media: s5p-jpeg: Correct step and max values for V4L2_CID_JPEG_RESTART_INTERVAL
Subsystems (36)
Sasha Levin
maintainerPATCH 118/671 media: s5p-jpeg: Correct step and max values for V4L2_CID_JPEG_RESTART_INTERVAL
From: Pawe? Chmiel <[email protected]>
[ Upstream commit 19c624c6b29e244c418f8b44a711cbf5e82e3cd4 ]
This commit corrects max and step values for v4l2 control for V4L2_CID_JPEG_RESTART_INTERVAL. Max should be 0xffff and step should be 1. It was found by using v4l2-compliance tool and checking result of VIDIOC_QUERY_EXT_CTRL/QUERYMENU test.
Previously it was complaining that step was bigger than difference between max and min.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +1 -1
@@ -2005,7 +2005,7 @@ static int s5p_jpeg_controls_create(struct s5p_jpeg_ctx *ctx)v4l2_ctrl_new_std (&ctx->ctrl_handler, &s5p_jpeg_ctrl_ops,V4L2_CID_JPEG_RESTART_INTERVAL , -0 ,3 ,0xffff ,0 ); +0 ,0xffff ,1 ,0 );if (ctx->jpeg->variant->version ==SJPEG_S5P ) mask = ~0x06 ;/* 422, 420 */ }
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 119/671 kbuild: mark prepare0 as PHONY to fix external module build
From: Masahiro Yamada <[email protected]>
[ Upstream commit e00d8880481497474792d28c14479a9fb6752046 ]
Commit c3ff2a5193fa ("powerpc/32: add stack protector support") caused kernel panic on PowerPC when an external module is used with CONFIG_STACKPROTECTOR because the 'prepare' target was not executed for the external module build.
Commit e07db28eea38 ("kbuild: fix single target build for external module") turned it into a build error because the 'prepare' target is now executed but the 'prepare0' target is missing for the external module build.
External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is also broken in the same way.
Move 'PHONY += prepare0' to the common place. GNU Make is fine with missing rule for phony targets. I also removed the comment which is wrong irrespective of this commit.
I minimize the change so it can be easily backported to 4.20.x
To fix v4.20, please backport e07db28eea38 ("kbuild: fix single target build for external module"), and then this commit.
--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
@@ -964,6 +964,7 @@ ifdef CONFIG_STACK_VALIDATION endif endif +PHONY += prepare0 ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1072,8 +1073,7 @@ scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h) # archprepare is used in arch Makefiles and when processed asm symlink, # version.h and scripts_basic is processed / created. -# Listed in dependency order -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 +PHONY += prepare archprepare prepare1 prepare2 prepare3 # prepare3 is used to check if we are building in a separate output directory, # and if so do:
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 120/671 crypto: brcm - Fix some set-but-not-used warning
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 707d0cf8f7cff6dfee9197002859912310532c4f ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/crypto/bcm/cipher.c: In function 'handle_ahash_req':drivers/crypto/bcm/cipher.c:720:15: warning:
variable 'chunk_start' set but not used [-Wunused-but-set-variable]
drivers/crypto/bcm/cipher.c: In function 'spu_rx_callback':drivers/crypto/bcm/cipher.c:1679:31: warning:
variable 'areq' set but not used [-Wunused-but-set-variable]
drivers/crypto/bcm/cipher.c:1678:22: warning:
variable 'ctx' set but not used [-Wunused-but-set-variable]
--- drivers/crypto/bcm/cipher.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/crypto/bcm/cipher.c +1 -5
@@ -717,7 +717,7 @@ static int handle_ahash_req(struct iproc_reqctx_s *rctx)*/ unsigned int new_data_len; -unsigned int chunk_start =0 ; +unsigned int __maybe_unused chunk_start =0 ;u32 db_size;/* Length of data field, incl gcm and hash padding */ int pad_len =0 ;/* total pad len, including gcm, hash, stat padding */ u32 data_pad_len =0 ;/* length of GCM/CCM padding */
@@ -1675,8 +1675,6 @@ static void spu_rx_callback(struct mbox_client *cl, void *msg)struct spu_hw *spu = &iproc_priv.spu;struct brcm_message *mssg = msg;struct iproc_reqctx_s *rctx; -struct iproc_ctx_s *ctx; -struct crypto_async_request *areq;int err =0 ; rctx = mssg->ctx;
@@ -1686,8 +1684,6 @@ static void spu_rx_callback(struct mbox_client *cl, void *msg) err = -EFAULT ; goto cb_finish; } - areq = rctx->parent; - ctx = rctx->ctx;/* process the SPU status */ err = spu->spu_status_process (rctx->msg_buf.rx_stat);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 121/671 crypto: tgr192 - fix unaligned memory access
In reply to Sasha LevinFrom: Eric Biggers <[email protected]>
[ Upstream commit f990f7fb58ac8ac9a43316f09a48cff1a49dda42 ]
Fix an unaligned memory access in tgr192_transform() by using the unaligned access helpers.
--- crypto/tgr192.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
crypto/tgr192.c +3 -3
@@ -25,8 +25,9 @@#include <linux/init.h> #include <linux/module.h> #include <linux/mm.h> -#include <asm/byteorder.h> #include <linux/types.h> +#include <asm/byteorder.h> +#include <asm/unaligned.h> #define TGR192_DIGEST_SIZE 24#define TGR160_DIGEST_SIZE 20
@@ -468,10 +469,9 @@ static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data)u64 a, b, c, aa, bb, cc;u64 x[8 ];int i; -const __le64 *ptr = (const __le64 *)data;for (i =0 ; i <8 ; i++) - x[i] =le64_to_cpu (ptr[i]); + x[i] =get_unaligned_le64 (data + i *sizeof (__le64));/* save */ a = aa = tctx->a;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 122/671 ASoC: imx-sgtl5000: put of nodes if finding codec fails
In reply to Sasha LevinFrom: Stefan Agner <[email protected]>
[ Upstream commit d9866572486802bc598a3e8576a5231378d190de ]
Make sure to properly put the of node in case finding the codec fails.
--- sound/soc/fsl/imx-sgtl5000.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/fsl/imx-sgtl5000.c +2 -1
@@ -112,7 +112,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) codec_dev =of_find_i2c_device_by_node (codec_np);if (!codec_dev) {dev_err (&pdev->dev,"failed to find codec platform device\n" ); -return -EPROBE_DEFER ; + ret = -EPROBE_DEFER ; + goto fail; } data =devm_kzalloc (&pdev->dev,sizeof (*data),GFP_KERNEL );
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 123/671 IB/iser: Pass the correct number of entries for dma mapped SGL
In reply to Sasha LevinFrom: Israel Rukshin <[email protected]>
[ Upstream commit 57b26497fabe1b9379b59fbc7e35e608e114df16 ]
ib_dma_map_sg() augments the SGL into a 'dma mapped SGL'. This process may change the number of entries and the lengths of each entry.
Code that touches dma_address is iterating over the 'dma mapped SGL' and must use dma_nents which returned from ib_dma_map_sg().
ib_sg_to_pages() and ib_map_mr_sg() are using dma_address so they must use dma_nents.
--- drivers/infiniband/ulp/iser/iser_memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/ulp/iser/iser_memory.c +5 -5
@@ -240,8 +240,8 @@ int iser_fast_reg_fmr(struct iscsi_iser_task *iser_task, page_vec->npages =0 ; page_vec->fake_mr.page_size =SIZE_4K ; plen =ib_sg_to_pages (&page_vec->fake_mr, mem->sg, - mem->size,NULL , iser_set_page); -if (unlikely (plen < mem->size)) { + mem->dma_nents,NULL , iser_set_page); +if (unlikely (plen < mem->dma_nents)) {iser_err ("page vec too short to hold this SG\n" );iser_data_buf_dump (mem, device->ib_device);iser_dump_page_vec (page_vec);
@@ -451,10 +451,10 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,ib_update_fast_reg_key (mr,ib_inc_rkey (mr->rkey)); - n =ib_map_mr_sg (mr, mem->sg, mem->size,NULL ,SIZE_4K ); -if (unlikely (n != mem->size)) { + n =ib_map_mr_sg (mr, mem->sg, mem->dma_nents,NULL ,SIZE_4K ); +if (unlikely (n != mem->dma_nents)) {iser_err ("failed to map sg (%d/%d)\n" , - n, mem->size); + n, mem->dma_nents);return n <0 ? n : -EINVAL ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 124/671 net: hns3: fix wrong combined count returned by ethtool -l
In reply to Sasha LevinFrom: Huazhong Tan <[email protected]>
[ Upstream commit c3b9c50d1567aa12be4448fe85b09626eba2499c ]
The current code returns the number of all queues that can be used and the number of queues that have been allocated, which is incorrect. What should be returned is the number of queues allocated for each enabled TC and the number of queues that can be allocated.
This patch fixes it.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +3 -4
@@ -5922,18 +5922,17 @@ static u32 hclge_get_max_channels(struct hnae3_handle *handle)struct hclge_vport *vport =hclge_get_vport (handle);struct hclge_dev *hdev = vport->back; -return min_t (u32, hdev->rss_size_max * kinfo->num_tc, hdev->num_tqps); +return min_t (u32, hdev->rss_size_max, + vport->alloc_tqps / kinfo->num_tc); }static void hclge_get_channels (struct hnae3_handle *handle,struct ethtool_channels *ch) { -struct hclge_vport *vport =hclge_get_vport (handle); - ch->max_combined =hclge_get_max_channels (handle); ch->other_count =1 ; ch->max_other =1 ; - ch->combined_count = vport->alloc_tqps; + ch->combined_count = handle->kinfo.rss_size; } static void hclge_get_tqps_and_rss_info(struct hnae3_handle *handle,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 125/671 media: tw9910: Unregister subdevice with v4l2-async
In reply to Sasha LevinFrom: Jacopo Mondi <[email protected]>
[ Upstream commit 341fe1d301f587c930509f6b9153436b957f649c ]
As the tw9910 subdevice is registered through the v4l2-async framework, use the v4l2-async provided function to register it.
--- drivers/media/i2c/tw9910.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/tw9910.c +1 -1
@@ -1000,7 +1000,7 @@ static int tw9910_remove(struct i2c_client *client)if (priv->pdn_gpio)gpiod_put (priv->pdn_gpio);clk_put (priv->clk); -v4l2_device_unregister_subdev (&priv->subdev); +v4l2_async_unregister_subdev (&priv->subdev);return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 126/671 IB/mlx5: Don't override existing ip_protocol
In reply to Sasha LevinFrom: Maor Gottlieb <[email protected]>
[ Upstream commit 6113cc44015b41ca51c0a76fed82522b68108dac ]
Two flow specifications can set the ip protocol field in the flow table entry:
1) IB_FLOW_SPEC_TCP/UDP/GRE - set the ip protocol accordingly.
2) IB_FLOW_SPEC_IPV4/6 - has ip_protocol field for users who want to receive specific L4 packets.
We need to avoid overriding of the ip_protocol with zeros, in case that the user first put the L4 specification and only then the L3.
--- drivers/infiniband/hw/mlx5/main.c | 53 +++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 16 deletions(-)
drivers/infiniband/hw/mlx5/main.c +37 -16
@@ -2390,10 +2390,29 @@ static u8 get_match_criteria_enable(u32 *match_criteria)return match_criteria_enable; } -static void set_proto (void *outer_c,void *outer_v,u8 mask,u8 val) +static int set_proto (void *outer_c,void *outer_v,u8 mask,u8 val) { -MLX5_SET (fte_match_set_lyr_2_4, outer_c, ip_protocol, mask); -MLX5_SET (fte_match_set_lyr_2_4, outer_v, ip_protocol, val); +u8 entry_mask; +u8 entry_val; +int err =0 ; + +if (!mask) + goto out; + + entry_mask =MLX5_GET (fte_match_set_lyr_2_4, outer_c, + ip_protocol); + entry_val =MLX5_GET (fte_match_set_lyr_2_4, outer_v, + ip_protocol); +if (!entry_mask) { +MLX5_SET (fte_match_set_lyr_2_4, outer_c, ip_protocol, mask); +MLX5_SET (fte_match_set_lyr_2_4, outer_v, ip_protocol, val); + goto out; + } +/* Don't override existing ip protocol */ +if (mask != entry_mask || val != entry_val) + err = -EINVAL ; +out: +return err; } static void set_flow_label(void *misc_c, void *misc_v, u32 mask, u32 val,
@@ -2597,8 +2616,10 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c,set_tos (headers_c, headers_v, ib_spec->ipv4.mask.tos, ib_spec->ipv4.val.tos); -set_proto (headers_c, headers_v, - ib_spec->ipv4.mask.proto, ib_spec->ipv4.val.proto); +if (set_proto (headers_c, headers_v, + ib_spec->ipv4.mask.proto, + ib_spec->ipv4.val.proto)) +return -EINVAL ;break ;case IB_FLOW_SPEC_IPV6 :if (FIELDS_NOT_SUPPORTED (ib_spec->ipv6.mask,LAST_IPV6_FIELD ))
@@ -2637,9 +2658,10 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c, ib_spec->ipv6.mask.traffic_class, ib_spec->ipv6.val.traffic_class); -set_proto (headers_c, headers_v, - ib_spec->ipv6.mask.next_hdr, - ib_spec->ipv6.val.next_hdr); +if (set_proto (headers_c, headers_v, + ib_spec->ipv6.mask.next_hdr, + ib_spec->ipv6.val.next_hdr)) +return -EINVAL ; set_flow_label(misc_params_c, misc_params_v, ntohl(ib_spec->ipv6.mask.flow_label),
@@ -2660,10 +2682,8 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c, LAST_TCP_UDP_FIELD))return -EOPNOTSUPP ; -MLX5_SET (fte_match_set_lyr_2_4, headers_c, ip_protocol, -0xff ); -MLX5_SET (fte_match_set_lyr_2_4, headers_v, ip_protocol, -IPPROTO_TCP ); +if (set_proto (headers_c, headers_v,0xff ,IPPROTO_TCP )) +return -EINVAL ;MLX5_SET (fte_match_set_lyr_2_4, headers_c, tcp_sport,ntohs (ib_spec->tcp_udp.mask.src_port));
@@ -2680,10 +2700,8 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c, LAST_TCP_UDP_FIELD))return -EOPNOTSUPP ; -MLX5_SET (fte_match_set_lyr_2_4, headers_c, ip_protocol, -0xff ); -MLX5_SET (fte_match_set_lyr_2_4, headers_v, ip_protocol, -IPPROTO_UDP ); +if (set_proto (headers_c, headers_v,0xff ,IPPROTO_UDP )) +return -EINVAL ;MLX5_SET (fte_match_set_lyr_2_4, headers_c, udp_sport,ntohs (ib_spec->tcp_udp.mask.src_port));
@@ -2699,6 +2717,9 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c,if (ib_spec->gre.mask.c_ks_res0_ver)return -EOPNOTSUPP ; +if (set_proto (headers_c, headers_v,0xff ,IPPROTO_GRE )) +return -EINVAL ; +MLX5_SET (fte_match_set_lyr_2_4, headers_c, ip_protocol,0xff ); MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 127/671 rtc: cmos: ignore bogus century byte
In reply to Sasha LevinFrom: Eric Wong <[email protected]>
[ Upstream commit 2a4daadd4d3e507138f8937926e6a4df49c6bfdc ]
Older versions of Libreboot and Coreboot had an invalid value (`3' in my case) in the century byte affecting the GM45 in the Thinkpad X200. Not everybody's updated their firmwares, and Linux <= 4.2 was able to read the RTC without problems, so workaround this by ignoring invalid values.
--- drivers/rtc/rtc-mc146818-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-mc146818-lib.c +1 -1
@@ -82,7 +82,7 @@ unsigned int mc146818_get_time(struct rtc_time *time) time->tm_year += real_year -72 ;#endif -if (century) +if (century >20 ) time->tm_year += (century -19 ) *100 ;/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 128/671 spi/topcliff_pch: Fix potential NULL dereference on allocation error
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit e902cdcb5112b89ee445588147964723fd69ffb4 ]
In pch_spi_handle_dma, it doesn't check for NULL returns of kcalloc so it would result in an Oops.
--- drivers/spi/spi-topcliff-pch.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/spi/spi-topcliff-pch.c +6 -0
@@ -1008,6 +1008,9 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)/* RX */ dma->sg_rx_p =kcalloc (num,sizeof (*dma->sg_rx_p),GFP_ATOMIC ); +if (!dma->sg_rx_p) +return ; +sg_init_table (dma->sg_rx_p, num);/* Initialize SG table */ /* offset, length setting */ sg = dma->sg_rx_p;
@@ -1068,6 +1071,9 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) } dma->sg_tx_p =kcalloc (num,sizeof (*dma->sg_tx_p),GFP_ATOMIC ); +if (!dma->sg_tx_p) +return ; +sg_init_table (dma->sg_tx_p, num);/* Initialize SG table */ /* offset, length setting */ sg = dma->sg_tx_p;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 129/671 net: hns3: fix bug of ethtool_ops.get_channels for VF
In reply to Sasha LevinFrom: Huazhong Tan <[email protected]>
[ Upstream commit 8be7362186bd5ccb5f6f72be49751ad2778e2636 ]
The current code returns the number of all queues that can be used and the number of queues that have been allocated, which is incorrect. What should be returned is the number of queues allocated for each enabled TC and the number of queues that can be allocated.
This patch fixes it.
--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +3 -2
@@ -1957,7 +1957,8 @@ static u32 hclgevf_get_max_channels(struct hclgevf_dev *hdev)struct hnae3_handle *nic = &hdev->nic;struct hnae3_knic_private_info *kinfo = &nic->kinfo; -return min_t (u32, hdev->rss_size_max * kinfo->num_tc, hdev->num_tqps); +return min_t (u32, hdev->rss_size_max, + hdev->num_tqps / kinfo->num_tc); }/**
@@ -1978,7 +1979,7 @@ static void hclgevf_get_channels(struct hnae3_handle *handle, ch->max_combined =hclgevf_get_max_channels (hdev); ch->other_count =0 ; ch->max_other =0 ; - ch->combined_count = hdev->num_tqps; + ch->combined_count = handle->kinfo.rss_size; } static void hclgevf_get_tqps_and_rss_info(struct hnae3_handle *handle,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 130/671 ARM: dts: sun8i-a23-a33: Move NAND controller device node to sort by address
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit d027521497592773cd23d016d36975574d3452db ]
The NAND controller device node was inserted into the wrong position, probably due to a rebase or merge, as the file's structure does not provide enough context for git to accurately match the previous device node block.
--- arch/arm/boot/dts/sun8i-a23-a33.dtsi | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +13 -15
@@ -155,6 +155,19 @@ #dma-cells = <1>; }; + nfc: nand@1c03000 { + compatible = "allwinner,sun4i-a10-nand"; + reg = <0x01c03000 0x1000>; + interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_BUS_NAND>, <&ccu CLK_NAND>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_NAND>; + reset-names = "ahb"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + mmc0: mmc@1c0f000 { compatible = "allwinner,sun7i-a20-mmc"; reg = <0x01c0f000 0x1000>;
@@ -212,21 +225,6 @@ #size-cells = <0>; }; - nfc: nand@1c03000 { - compatible = "allwinner,sun4i-a10-nand"; - reg = <0x01c03000 0x1000>; - interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&ccu CLK_BUS_NAND>, <&ccu CLK_NAND>; - clock-names = "ahb", "mod"; - resets = <&ccu RST_BUS_NAND>; - reset-names = "ahb"; - pinctrl-names = "default"; - pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - usb_otg: usb@1c19000 { /* compatible gets set in SoC specific dtsi file */ reg = <0x01c19000 0x0400>;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 131/671 clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 108a459ef4cd17a28711d81092044e597b5c7618 ]
The PLL-MIPI clock is somewhat special as it has its own LDOs which need to be turned on for this PLL to actually work and output a clock signal.
Add the 2 LDO enable bits to the gate bits.
--- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +1 -1
@@ -144,7 +144,7 @@ static SUNXI_CCU_NKM_WITH_GATE_LOCK(pll_mipi_clk, "pll-mipi",8 ,4 ,/* N */ 4 ,2 ,/* K */ 0 ,4 ,/* M */ -BIT (31 ),/* gate */ +BIT (31 ) |BIT (23 ) |BIT (22 ),/* gate */ BIT (28 ),/* lock */ CLK_SET_RATE_UNGATE);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 132/671 iwlwifi: mvm: avoid possible access out of array.
In reply to Sasha LevinFrom: Mordechay Goodstein <[email protected]>
[ Upstream commit b0d795a9ae558209656b18930c2b4def5f8fdfb8 ]
The value in txq_id can be out of array scope,
validate it before accessing the array.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +13 -6
@@ -2462,7 +2462,7 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);struct iwl_mvm_tid_data *tid_data;u16 normalized_ssn; -int txq_id; +u16 txq_id;int ret;if (WARN_ON_ONCE (tid >=IWL_MAX_TID_COUNT ))
@@ -2506,17 +2506,24 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,*/ txq_id = mvmsta->tid_data[tid].txq_id;if (txq_id ==IWL_MVM_INVALID_QUEUE ) { - txq_id =iwl_mvm_find_free_queue (mvm, mvmsta->sta_id, -IWL_MVM_DQA_MIN_DATA_QUEUE , -IWL_MVM_DQA_MAX_DATA_QUEUE ); -if (txq_id <0 ) { - ret = txq_id; + ret =iwl_mvm_find_free_queue (mvm, mvmsta->sta_id, +IWL_MVM_DQA_MIN_DATA_QUEUE , +IWL_MVM_DQA_MAX_DATA_QUEUE ); +if (ret <0 ) {IWL_ERR (mvm,"Failed to allocate agg queue\n" ); goto release_locks; } + txq_id = ret; +/* TXQ hasn't yet been enabled, so mark it only as reserved */ mvm->queue_info[txq_id].status =IWL_MVM_QUEUE_RESERVED ; + }else if (WARN_ON (txq_id >=IWL_MAX_HW_QUEUES )) { + ret = -ENXIO ; +IWL_ERR (mvm,"tid_id %d out of range (0, %d)!\n" , + tid,IWL_MAX_HW_QUEUES -1 ); + goto out; + }else if (unlikely (mvm->queue_info[txq_id].status ==IWL_MVM_QUEUE_SHARED )) { ret = -ENXIO ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 133/671 net/mlx5: Take lock with IRQs disabled to avoid deadlock
In reply to Sasha LevinFrom: Moni Shoua <[email protected]>
[ Upstream commit 33814e5d127e21f53b52e17b0722c1b57d4f4d29 ]
The lock in qp_table might be taken from process context or from interrupt context. This may lead to a deadlock unless it is taken with IRQs disabled.
Discovered by lockdep
================================
WARNING: inconsistent lock state
4.20.0-rc6
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W}
python/12572 [HC1[1]:SC0[0]:HE0:SE1] takes:00000000052a4df4 (&(&table->lock)->rlock#2){?.+.}, /0x50 [mlx5_core] {HARDIRQ-ON-W} state was registered at:
_raw_spin_lock+0x33/0x70 mlx5_get_rsc+0x1a/0x50 [mlx5_core] mlx5_ib_eqe_pf_action+0x493/0x1be0 [mlx5_ib] process_one_work+0x90c/0x1820 worker_thread+0x87/0xbb0 kthread+0x320/0x3e0 ret_from_fork+0x24/0x30 irq event stamp: 103928 hardirqs last enabled at (103927): [] nk+0x1a/0x1c hardirqs last disabled at (103928): [] unk+0x1a/0x1c softirqs last enabled at (103924): [] tcp_sendmsg+0x31/0x40 softirqs last disabled at (103922): [] 80
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----lock(&(&table->lock)->rlock#2);
lock(&(&table->lock)->rlock#2);
*** DEADLOCK ***
--- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/qp.c +3 -2
@@ -44,14 +44,15 @@ static struct mlx5_core_rsc_common *mlx5_get_rsc(struct mlx5_core_dev *dev, {struct mlx5_qp_table *table = &dev->priv.qp_table;struct mlx5_core_rsc_common *common; +unsigned long flags; -spin_lock (&table->lock); +spin_lock_irqsave (&table->lock, flags); common =radix_tree_lookup (&table->tree, rsn);if (common)atomic_inc (&common->refcount); -spin_unlock (&table->lock); +spin_unlock_irqrestore (&table->lock, flags);if (!common) { mlx5_core_warn(dev, "Async event for bogus resource 0x%x\n",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 134/671 ip_tunnel: Fix route fl4 init in ip_md_tunnel_xmit
In reply to Sasha LevinFrom: wenxu <[email protected]>
[ Upstream commit 6e6b904ad4f9aed43ec320afbd5a52ed8461ab41 ]
Init the gre_key from tuninfo->key.tun_id and init the mark from the skb->mark, set the oif to zero in the collect metadata mode.
--- net/ipv4/ip_tunnel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/ip_tunnel.c +3 -2
@@ -574,8 +574,9 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, u8 proto)else if (skb->protocol ==htons (ETH_P_IPV6 )) tos =ipv6_get_dsfield ((const struct ipv6hdr *)inner_iph); } -ip_tunnel_init_flow (&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src,0 , -RT_TOS (tos), tunnel->parms.link, tunnel->fwmark); +ip_tunnel_init_flow (&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, +tunnel_id_to_key32 (key->tun_id),RT_TOS (tos), +0 , skb->mark);if (tunnel->encap.type !=TUNNEL_ENCAP_NONE ) goto tx_error; rt =ip_route_output_key (tunnel->net, &fl4);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 135/671 arm64: dts: allwinner: h6: Move GIC device node fix base address ordering
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 52d9bcb3d0de3fa1e07aff3800f857836d30410d ]
The GIC device node was placed out of order in the initial device tree submission. Move it so the nodes are correctly sorted by base address again.
--- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +11 -11
@@ -101,17 +101,6 @@ #reset-cells = <1>; }; - gic: interrupt-controller@3021000 { - compatible = "arm,gic-400"; - reg = <0x03021000 0x1000>, - <0x03022000 0x2000>, - <0x03024000 0x2000>, - <0x03026000 0x2000>; - interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; - interrupt-controller; - #interrupt-cells = <3>; - }; - pio: pinctrl@300b000 { compatible = "allwinner,sun50i-h6-pinctrl"; reg = <0x0300b000 0x400>;
@@ -149,6 +138,17 @@ }; }; + gic: interrupt-controller@3021000 { + compatible = "arm,gic-400"; + reg = <0x03021000 0x1000>, + <0x03022000 0x2000>, + <0x03024000 0x2000>, + <0x03026000 0x2000>; + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + interrupt-controller; + #interrupt-cells = <3>; + }; + mmc0: mmc@4020000 { compatible = "allwinner,sun50i-h6-mmc", "allwinner,sun50i-a64-mmc";
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 136/671 iwlwifi: mvm: fix A-MPDU reference assignment
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 1f7698abedeeb3fef3cbcf78e16f925df675a179 ]
The current code assigns the reference, and then goes to increment it if the toggle bit has changed. That way, we get
Toggle 0 0 0 0 1 1 1 1 ID 1 1 1 1 1 2 2 2
Fix that by assigning the post-toggle ID to get
Toggle 0 0 0 0 1 1 1 1 ID 1 1 1 1 2 2 2 2
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +1 -1
@@ -1077,7 +1077,6 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, he_phy_data =le64_to_cpu (desc->v1.he_phy_data); rx_status->flag |=RX_FLAG_AMPDU_DETAILS ; - rx_status->ampdu_reference = mvm->ampdu_ref;/* toggle is switched whenever new aggregation starts */ if (toggle_bit != mvm->ampdu_toggle) { mvm->ampdu_ref++;
@@ -1092,6 +1091,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,RX_FLAG_AMPDU_EOF_BIT ; } } + rx_status->ampdu_reference = mvm->ampdu_ref; }rcu_read_lock ();
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 137/671 bus: ti-sysc: Fix timer handling with drop pm_runtime_irq_safe()
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 9bd34c63f5536c490c152833c77fa47f59aeade3 ]
Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc") started producing a warning for pwm-omap-dmtimer:
WARNING: CPU: 0 PID: 77 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x2f8/0x388
44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 (Idle):
Data Access in Supervisor mode during Functional access
...__pm_runtime_idleomap_dm_timer_disablepwm_omap_dmtimer_startpwm_omap_dmtimer_enablepwm_apply_statepwm_vibrator_startpwm_vibrator_play_work
This is because the timer that pwm-omap-dmtimer is using is now being probed with ti-sysc interconnect target module instead of omap_device and the ti-sysc quirk for SYSC_QUIRK_LEGACY_IDLE is not fully compatible with what omap_device has been doing.
We could fix this by reverting the timer changes and have the timer probe again with omap_device. Or we could add more quirk handling to ti-sysc driver. But as these options don't work nicely as longer term solutions, let's just make timers probe with ti-sysc without any quirks.
To do this, all we need to do is remove quirks for timers for ti-sysc, and drop the bogus pm_runtime_irq_safe() flag for timer-ti-dm.
We should not use pm_runtime_irq_safe() anyways for drivers as it will take a permanent use count on the parent device blocking the parent devices from idling and has been forcing ti-sysc driver to use a quirk flag.
Note that we will move the timer data to DEBUG section later on in clean-up patches.
--- drivers/bus/ti-sysc.c | 4 ++-- drivers/clocksource/timer-ti-dm.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/bus/ti-sysc.c +2 -2
@@ -888,10 +888,10 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("smartreflex" ,0 ,-1 ,0x38 ,-1 ,0x00000000 ,0xffffffff ,SYSC_QUIRK_LEGACY_IDLE ),SYSC_QUIRK ("timer" ,0 ,0 ,0x10 ,0x14 ,0x00000015 ,0xffffffff , -SYSC_QUIRK_LEGACY_IDLE ), +0 ),/* Some timers on omap4 and later */ SYSC_QUIRK ("timer" ,0 ,0 ,0x10 ,-1 ,0x4fff1301 ,0xffffffff , -SYSC_QUIRK_LEGACY_IDLE ), +0 ),SYSC_QUIRK ("uart" ,0 ,0x50 ,0x54 ,0x58 ,0x00000052 ,0xffffffff , SYSC_QUIRK_LEGACY_IDLE),/* Uarts on omap4 and later */
drivers/clocksource/timer-ti-dm.c +0 -1
@@ -868,7 +868,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev) timer->pdev = pdev;pm_runtime_enable (dev); -pm_runtime_irq_safe (dev);if (!timer->reserved) { ret =pm_runtime_get_sync (dev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 138/671 tty: ipwireless: Fix potential NULL pointer dereference
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 7dd50e205b3348dc7784efbdf85723551de64a25 ]
There is a potential NULL pointer dereference in case alloc_ctrl_packet() fails and returns NULL.
--- drivers/tty/ipwireless/hardware.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/ipwireless/hardware.c +2 -0
@@ -1516,6 +1516,8 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw)sizeof (struct ipw_setup_get_version_query_packet ),ADDR_SETUP_PROT ,TL_PROTOCOLID_SETUP , TL_SETUP_SIGNO_GET_VERSION_QRY); +if (!ver_packet) +return ; ver_packet->header.length =sizeof (struct tl_setup_get_version_qry );/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 139/671 driver: uio: fix possible memory leak in __uio_register_device
In reply to Sasha LevinFrom: Liu Jian <[email protected]>
[ Upstream commit 1a392b3de7c5747506b38fc14b2e79977d3c7770 ]
'idev' is malloced in __uio_register_device() and leak free it before leaving from the uio_get_minor() error handing case, it will cause memory leak.
--- drivers/uio/uio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/uio/uio.c +3 -1
@@ -938,8 +938,10 @@ int __uio_register_device(struct module *owner,atomic_set (&idev->event,0 ); ret =uio_get_minor (idev); -if (ret) +if (ret) { +kfree (idev);return ret; + } idev->dev.devt =MKDEV (uio_major, idev->minor); idev->dev.class = &uio_class;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 140/671 driver: uio: fix possible use-after-free in __uio_register_device
In reply to Sasha LevinFrom: Liu Jian <[email protected]>
[ Upstream commit 221a1f4ac12d2ab46246c160b2e00d1b1160d5d9 ]
In uio_dev_add_attributes() error handing case, idev is used after device_unregister(), in which 'idev' has been released, touch idev cause use-after-free.
--- drivers/uio/uio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/uio/uio.c +4 -2
@@ -943,6 +943,7 @@ int __uio_register_device(struct module *owner,return ret; } +device_initialize (&idev->dev); idev->dev.devt =MKDEV (uio_major, idev->minor); idev->dev.class = &uio_class; idev->dev.parent = parent;
@@ -953,7 +954,7 @@ int __uio_register_device(struct module *owner,if (ret) goto err_device_create; - ret =device_register (&idev->dev); + ret =device_add (&idev->dev);if (ret) goto err_device_create;
@@ -985,9 +986,10 @@ int __uio_register_device(struct module *owner, err_request_irq:uio_dev_del_attributes (idev); err_uio_dev_add_attributes: -device_unregister (&idev->dev); +device_del (&idev->dev); err_device_create:uio_free_minor (idev); +put_device (&idev->dev);return ret; }EXPORT_SYMBOL_GPL (__uio_register_device);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 141/671 crypto: crypto4xx - Fix wrong ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments
In reply to Sasha LevinFrom: Corentin Labbe <[email protected]>
[ Upstream commit 6e88098ca43a3d80ae86908f7badba683c8a0d84 ]
When building without CONFIG_HW_RANDOM_PPC4XX, I hit the following build failure:drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_probe':drivers/crypto/amcc/crypto4xx_core.c:1407:20: error: passing argument 1 of 'ppc4xx_trng_probe' from incompatible pointer type [-Werror=incompatible-pointer-types] In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0:drivers/crypto/amcc/crypto4xx_trng.h:28:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_remove':drivers/crypto/amcc/crypto4xx_core.c:1434:21: error: passing argument 1 of 'ppc4xx_trng_remove' from incompatible pointer type [-Werror=incompatible-pointer-types] In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0:drivers/crypto/amcc/crypto4xx_trng.h:30:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *'
This patch fix the needed argument of ppc4xx_trng_probe()/ppc4xx_trng_remove() in that case.
--- drivers/crypto/amcc/crypto4xx_trng.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/amcc/crypto4xx_trng.h +2 -2
@@ -26,9 +26,9 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev);void ppc4xx_trng_remove (struct crypto4xx_core_device *core_dev);#else static inline void ppc4xx_trng_probe ( -struct crypto4xx_device *dev__maybe_unused ) { } +struct crypto4xx_core_device *dev__maybe_unused ) { }static inline void ppc4xx_trng_remove ( -struct crypto4xx_device *dev__maybe_unused ) { } +struct crypto4xx_core_device *dev__maybe_unused ) { }#endif #endif
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 142/671 driver core: Fix DL_FLAG_AUTOREMOVE_SUPPLIER device link flag handling
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit c8d50986da5d74ddfc233b13b91d0a13369fa164 ]
Change the list walk in device_links_driver_cleanup() to a safe one to avoid use-after-free when dropping a link from the list during the walk.
Also, while at it, fix device_link_add() to refuse to create stateless device links with DL_FLAG_AUTOREMOVE_SUPPLIER set, which is an invalid combination (setting that flag means that the driver core should manage the link, so it cannot be stateless), and extend the kerneldoc comment of device_link_add() to cover the DL_FLAG_AUTOREMOVE_SUPPLIER flag properly too.
--- drivers/base/core.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/base/core.c +12 -8
@@ -179,10 +179,14 @@ void device_pm_move_to_tail(struct device *dev)* of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be * ignored. * -* If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed -* automatically when the consumer device driver unbinds from it. -* The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS -* set is invalid and will cause NULL to be returned. +* If the DL_FLAG_AUTOREMOVE_CONSUMER flag is set, the link will be removed +* automatically when the consumer device driver unbinds from it. Analogously, +* if DL_FLAG_AUTOREMOVE_SUPPLIER is set in @flags, the link will be removed +* automatically when the supplier device driver unbinds from it. +* +* The combination of DL_FLAG_STATELESS and either DL_FLAG_AUTOREMOVE_CONSUMER +* or DL_FLAG_AUTOREMOVE_SUPPLIER set in @flags at the same time is invalid and +* will cause NULL to be returned upfront. * * A side effect of the link creation is re-ordering of dpm_list and the * devices_kset list by moving the consumer device and all devices depending
@@ -199,8 +203,8 @@ struct device_link *device_link_add(struct device *consumer,struct device_link *link;if (!consumer || !supplier || - ((flags &DL_FLAG_STATELESS ) && - (flags &DL_FLAG_AUTOREMOVE_CONSUMER ))) + (flags &DL_FLAG_STATELESS && + flags & (DL_FLAG_AUTOREMOVE_CONSUMER |DL_FLAG_AUTOREMOVE_SUPPLIER )))return NULL ;device_links_write_lock ();
@@ -539,11 +543,11 @@ void device_links_no_driver(struct device *dev)*/ void device_links_driver_cleanup (struct device *dev) { -struct device_link *link; +struct device_link *link, *ln;device_links_write_lock (); -list_for_each_entry (link, &dev->links.consumers, s_node) { +list_for_each_entry_safe (link, ln, &dev->links.consumers, s_node) {if (link->flags &DL_FLAG_STATELESS )continue ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 143/671 driver core: Avoid careless re-use of existing device links
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit f265df550a4350dce0a4d721a77c52e4b847ea40 ]
After commit ead18c23c263 ("driver core: Introduce device links reference counting"), if there is a link between the given supplier and the given consumer already, device_link_add() will refcount it and return it unconditionally. However, if the flags passed to it on the second (or any subsequent) attempt to create a device link between the same consumer-supplier pair are not compatible with the existing link's flags, that is incorrect.
First off, if the existing link is stateless and the next caller of device_link_add() for the same consumer-supplier pair wants a stateful one, or the other way around, the existing link cannot be returned, because it will not match the expected behavior, so make device_link_add() dump the stack and return NULL in that case.
Moreover, if the DL_FLAG_AUTOREMOVE_CONSUMER flag is passed to device_link_add(), its caller will expect its reference to the link to be dropped automatically on consumer driver removal, which will not happen if that flag is not set in the link's flags (and analogously for DL_FLAG_AUTOREMOVE_SUPPLIER). For this reason, make device_link_add() update the existing link's flags accordingly before returning it to the caller.
--- drivers/base/core.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/base/core.c +20 -3
@@ -221,12 +221,29 @@ struct device_link *device_link_add(struct device *consumer, goto out; } -list_for_each_entry (link, &supplier->links.consumers, s_node) -if (link->consumer == consumer) { -kref_get (&link->kref); +list_for_each_entry (link, &supplier->links.consumers, s_node) { +if (link->consumer != consumer) +continue ; + +/* +* Don't return a stateless link if the caller wants a stateful +* one and vice versa. +*/ +if (WARN_ON ((flags &DL_FLAG_STATELESS ) != (link->flags &DL_FLAG_STATELESS ))) { + link =NULL ; goto out; } +if (flags &DL_FLAG_AUTOREMOVE_CONSUMER ) + link->flags |=DL_FLAG_AUTOREMOVE_CONSUMER ; + +if (flags &DL_FLAG_AUTOREMOVE_SUPPLIER ) + link->flags |=DL_FLAG_AUTOREMOVE_SUPPLIER ; + +kref_get (&link->kref); + goto out; + } + link =kzalloc (sizeof (*link),GFP_KERNEL );if (!link) goto out;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 144/671 driver core: Do not resume suppliers under device_links_write_lock()
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 5db25c9eb893df8f6b93c1d97b8006d768e1b6f5 ]
It is incorrect to call pm_runtime_get_sync() under device_links_write_lock(), because it may end up trying to take device_links_read_lock() while resuming the target device and that will deadlock in the non-SRCU case, so avoid that by resuming the supplier device in device_link_add() before calling device_links_write_lock().
--- drivers/base/core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/base/core.c +14 -6
@@ -201,12 +201,21 @@ struct device_link *device_link_add(struct device *consumer, struct device *supplier, u32 flags) {struct device_link *link; +bool rpm_put_supplier = false;if (!consumer || !supplier || (flags &DL_FLAG_STATELESS && flags & (DL_FLAG_AUTOREMOVE_CONSUMER |DL_FLAG_AUTOREMOVE_SUPPLIER )))return NULL ; +if (flags &DL_FLAG_PM_RUNTIME && flags &DL_FLAG_RPM_ACTIVE ) { +if (pm_runtime_get_sync (supplier) <0 ) { +pm_runtime_put_noidle (supplier); +return NULL ; + } + rpm_put_supplier = true; + } +device_links_write_lock ();device_pm_lock ();
@@ -250,13 +259,8 @@ struct device_link *device_link_add(struct device *consumer,if (flags &DL_FLAG_PM_RUNTIME ) {if (flags &DL_FLAG_RPM_ACTIVE ) { -if (pm_runtime_get_sync (supplier) <0 ) { -pm_runtime_put_noidle (supplier); -kfree (link); - link =NULL ; - goto out; - } link->rpm_active = true; + rpm_put_supplier = false; }pm_runtime_new_link (consumer);/*
@@ -328,6 +332,10 @@ struct device_link *device_link_add(struct device *consumer, out:device_pm_unlock ();device_links_write_unlock (); + +if (rpm_put_supplier) +pm_runtime_put (supplier); +return link; }EXPORT_SYMBOL_GPL (device_link_add);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 145/671 driver core: Fix handling of runtime PM flags in device_link_add()
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit e2f3cd831a280fc226118d9369bf3f77aab58c56 ]
After commit ead18c23c263 ("driver core: Introduce device links reference counting"), if there is a link between the given supplier and the given consumer already, device_link_add() will refcount it and return it unconditionally without updating its flags. It is possible, however, that the second (or any subsequent) caller of device_link_add() for the same consumer-supplier pair will pass DL_FLAG_PM_RUNTIME, possibly along with DL_FLAG_RPM_ACTIVE, in flags to it and the existing link may not behave as expected then.
First, if DL_FLAG_PM_RUNTIME is not set in the existing link's flags at all, it needs to be set like during the original initialization of the link.
Second, if DL_FLAG_RPM_ACTIVE is passed to device_link_add() in flags (in addition to DL_FLAG_PM_RUNTIME), the existing link should to be updated to reflect the "active" runtime PM configuration of the consumer-supplier pair and extra care must be taken here to avoid possible destructive races with runtime PM of the consumer.
To that end, redefine the rpm_active field in struct device_link as a refcount, initialize it to 1 and make rpm_resume() (for the consumer) and device_link_add() increment it whenever they acquire a runtime PM reference on the supplier device. Accordingly, make rpm_suspend() (for the consumer) and pm_runtime_clean_up_links() decrement it and drop runtime PM references to the supplier device in a loop until rpm_active becones 1 again.
--- drivers/base/core.c | 45 ++++++++++++++++++++++++------------ drivers/base/power/runtime.c | 26 +++++++++------------ include/linux/device.h | 2 +- 3 files changed, 42 insertions(+), 31 deletions(-)
drivers/base/core.c +30 -15
@@ -165,6 +165,19 @@ void device_pm_move_to_tail(struct device *dev)device_links_read_unlock (idx); } +static void device_link_rpm_prepare (struct device *consumer, +struct device *supplier) +{ +pm_runtime_new_link (consumer); +/* +* If the link is being added by the consumer driver at probe time, +* balance the decrementation of the supplier's runtime PM usage counter +* after consumer probe in driver_probe_device(). +*/ +if (consumer->links.status ==DL_DEV_PROBING ) +pm_runtime_get_noresume (supplier); +} +/** * device_link_add - Create a link between two devices. * @consumer: Consumer end of the link.
@@ -201,7 +214,6 @@ struct device_link *device_link_add(struct device *consumer, struct device *supplier, u32 flags) {struct device_link *link; -bool rpm_put_supplier = false; if (!consumer || !supplier || (flags & DL_FLAG_STATELESS &&
@@ -213,7 +225,6 @@ struct device_link *device_link_add(struct device *consumer,pm_runtime_put_noidle (supplier);return NULL ; } - rpm_put_supplier = true; }device_links_write_lock ();
@@ -249,6 +260,15 @@ struct device_link *device_link_add(struct device *consumer,if (flags &DL_FLAG_AUTOREMOVE_SUPPLIER ) link->flags |=DL_FLAG_AUTOREMOVE_SUPPLIER ; +if (flags &DL_FLAG_PM_RUNTIME ) { +if (!(link->flags &DL_FLAG_PM_RUNTIME )) { +device_link_rpm_prepare (consumer, supplier); + link->flags |=DL_FLAG_PM_RUNTIME ; + } +if (flags &DL_FLAG_RPM_ACTIVE ) +refcount_inc (&link->rpm_active); + } +kref_get (&link->kref); goto out; }
@@ -257,20 +277,15 @@ struct device_link *device_link_add(struct device *consumer,if (!link) goto out; +refcount_set (&link->rpm_active,1 ); +if (flags &DL_FLAG_PM_RUNTIME ) { -if (flags &DL_FLAG_RPM_ACTIVE ) { - link->rpm_active = true; - rpm_put_supplier = false; - } -pm_runtime_new_link (consumer); -/* -* If the link is being added by the consumer driver at probe -* time, balance the decrementation of the supplier's runtime PM -* usage counter after consumer probe in driver_probe_device(). -*/ -if (consumer->links.status ==DL_DEV_PROBING ) -pm_runtime_get_noresume (supplier); +if (flags &DL_FLAG_RPM_ACTIVE ) +refcount_inc (&link->rpm_active); + +device_link_rpm_prepare (consumer, supplier); } +get_device (supplier); link->supplier = supplier;INIT_LIST_HEAD (&link->s_node);
@@ -333,7 +348,7 @@ struct device_link *device_link_add(struct device *consumer,device_pm_unlock ();device_links_write_unlock (); -if (rpm_put_supplier) +if ((flags &DL_FLAG_PM_RUNTIME && flags &DL_FLAG_RPM_ACTIVE ) && !link)pm_runtime_put (supplier);return link;
drivers/base/power/runtime.c +11 -15
@@ -268,11 +268,8 @@ static int rpm_get_suppliers(struct device *dev)list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) {int retval; -if (!(link->flags &DL_FLAG_PM_RUNTIME )) -continue ; - -if (READ_ONCE (link->status) ==DL_STATE_SUPPLIER_UNBIND || - link->rpm_active) +if (!(link->flags &DL_FLAG_PM_RUNTIME ) || +READ_ONCE (link->status) ==DL_STATE_SUPPLIER_UNBIND )continue ; retval =pm_runtime_get_sync (link->supplier);
@@ -281,7 +278,7 @@ static int rpm_get_suppliers(struct device *dev)pm_runtime_put_noidle (link->supplier);return retval; } - link->rpm_active = true; +refcount_inc (&link->rpm_active); }return 0 ; }
@@ -290,12 +287,13 @@ static void rpm_put_suppliers(struct device *dev) {struct device_link *link; -list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) -if (link->rpm_active && -READ_ONCE (link->status) !=DL_STATE_SUPPLIER_UNBIND ) { +list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) { +if (READ_ONCE (link->status) ==DL_STATE_SUPPLIER_UNBIND ) +continue ; + +while (refcount_dec_not_one (&link->rpm_active))pm_runtime_put (link->supplier); - link->rpm_active = false; - } + } }/**
@@ -1531,7 +1529,7 @@ void pm_runtime_remove(struct device *dev)* * Check links from this device to any consumers and if any of them have active * runtime PM references to the device, drop the usage counter of the device -* (once per link). +* (as many times as needed). * * Links with the DL_FLAG_STATELESS flag set are ignored. *
@@ -1553,10 +1551,8 @@ void pm_runtime_clean_up_links(struct device *dev)if (link->flags &DL_FLAG_STATELESS )continue ; -if (link->rpm_active) { +while (refcount_dec_not_one (&link->rpm_active))pm_runtime_put_noidle (dev); - link->rpm_active = false; - } }device_links_read_unlock (idx);
include/linux/device.h +1 -1
@@ -849,7 +849,7 @@ struct device_link {struct list_head c_node;enum device_link_state status;u32 flags; -bool rpm_active; +refcount_t rpm_active;struct kref kref;#ifdef CONFIG_SRCU struct rcu_head rcu_head;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 146/671 driver core: Do not call rpm_put_suppliers() in pm_runtime_drop_link()
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit a1fdbfbb1da2063ba98a12eb6f1bdd07451c7145 ]
Calling rpm_put_suppliers() from pm_runtime_drop_link() is excessive as it affects all suppliers of the consumer device and not just the one pointed to by the device link being dropped. Worst case it may cause the consumer device to stop working unexpectedly. Moreover, in principle it is racy with respect to runtime PM of the consumer device.
To avoid these problems drop runtime PM references on the particular supplier pointed to by the link in question only and do that after the link has been dropped from the consumer device's list of links to suppliers, which is in device_link_free().
--- drivers/base/core.c | 3 +++ drivers/base/power/runtime.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/base/core.c +3 -0
@@ -357,6 +357,9 @@ EXPORT_SYMBOL_GPL(device_link_add);static void device_link_free (struct device_link *link) { +while (refcount_dec_not_one (&link->rpm_active)) +pm_runtime_put (link->supplier); +put_device (link->consumer);put_device (link->supplier);kfree (link);
drivers/base/power/runtime.c +0 -2
@@ -1603,8 +1603,6 @@ void pm_runtime_new_link(struct device *dev)void pm_runtime_drop_link (struct device *dev) { -rpm_put_suppliers (dev); -spin_lock_irq (&dev->power.lock);WARN_ON (dev->power.links_count ==0 ); dev->power.links_count--;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 147/671 ARM: dts: lpc32xx: add required clocks property to keypad device node
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 3e88bc38b9f6fe4b69cecf81badd3c19fde97f97 ]
NXP LPC32xx keypad controller requires a clock property to be defined.
The change fixes the driver initialization problem:
lpc32xx_keys 40050000.key: failed to get clock
lpc32xx_keys: probe of 40050000.key failed with error -2
--- arch/arm/boot/dts/lpc32xx.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/lpc32xx.dtsi +1 -0
@@ -462,6 +462,7 @@ key: key@40050000 { compatible = "nxp,lpc3220-key"; reg = <0x40050000 0x1000>; + clocks = <&clk LPC32XX_CLK_KEY>; interrupts = <54 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 148/671 ARM: dts: lpc32xx: reparent keypad controller to SIC1
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 489261c45f0ebbc1c2813f337bbdf858267f5033 ]
After switching to a new interrupt controller scheme by separating SIC1 and SIC2 from MIC interrupt controller just one SoC keypad controller was not taken into account, fix it now:
WARNING: CPU: 0 PID: 1 at kernel/irq/irqdomain.c:524 irq_domain_associate+0x50/0x1b0 error: hwirq 0x36 is too large for interrupt-controller@40008000 ... lpc32xx_keys 40050000.key: failed to get platform irq lpc32xx_keys: probe of 40050000.key failed with error -22
--- arch/arm/boot/dts/lpc32xx.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/lpc32xx.dtsi +2 -1
@@ -463,7 +463,8 @@ compatible = "nxp,lpc3220-key"; reg = <0x40050000 0x1000>; clocks = <&clk LPC32XX_CLK_KEY>; - interrupts = <54 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&sic1>; + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; };
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 149/671 ARM: dts: lpc32xx: fix ARM PrimeCell LCD controller variant
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 7a0790a4121cbcd111cc537cdc801c46ccb789ee ]
ARM PrimeCell PL111 LCD controller is found on On NXP LPC3230 and LPC3250 SoCs variants, the original reference in compatible property to an older one ARM PrimeCell PL110 is invalid.
--- arch/arm/boot/dts/lpc32xx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/lpc32xx.dtsi +1 -1
@@ -139,7 +139,7 @@ }; clcd: clcd@31040000 { - compatible = "arm,pl110", "arm,primecell"; + compatible = "arm,pl111", "arm,primecell"; reg = <0x31040000 0x1000>; interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk LPC32XX_CLK_LCD>;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 150/671 ARM: dts: lpc32xx: fix ARM PrimeCell LCD controller clocks property
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 30fc01bae3cda747e7d9c352b1aa51ca113c8a9d ]
The originally added ARM PrimeCell PL111 clocks property misses the required "clcdclk" clock, which is the same as a clock to enable the LCD controller on NXP LPC3230 and NXP LPC3250 SoCs.
--- arch/arm/boot/dts/lpc32xx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/lpc32xx.dtsi +2 -2
@@ -142,8 +142,8 @@ compatible = "arm,pl111", "arm,primecell"; reg = <0x31040000 0x1000>; interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk LPC32XX_CLK_LCD>; - clock-names = "apb_pclk"; + clocks = <&clk LPC32XX_CLK_LCD>, <&clk LPC32XX_CLK_LCD>; + clock-names = "clcdclk", "apb_pclk"; status = "disabled"; };
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 151/671 ARM: dts: lpc32xx: phy3250: fix SD card regulator voltage
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit dc141b99fc36cf910a1d8d5ee30f43f2442fd1bd ]
The fixed voltage regulator on Phytec phyCORE-LPC3250 board, which supplies SD/MMC card's power, has a constant output voltage level of either 3.15V or 3.3V, the actual value depends on JP4 position, the power rail is referenced as VCC_SDIO in the board hardware manual.
--- arch/arm/boot/dts/lpc3250-phy3250.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/lpc3250-phy3250.dts +2 -2
@@ -49,8 +49,8 @@ sd_reg: regulator@2 { compatible = "regulator-fixed"; regulator-name = "sd_reg"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; gpio = <&gpio 5 5 0>; enable-active-high; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 152/671 drm/xen-front: Fix mmap attributes for display buffers
In reply to Sasha LevinFrom: Oleksandr Andrushchenko <[email protected]>
[ Upstream commit 24ded292a5c2ed476f01c77fee65f8320552cd27 ]
When GEM backing storage is allocated those are normal pages, so there is no point using pgprot_writecombine while mmaping. This fixes mismatch of buffer pages' memory attributes between the frontend and backend which may cause screen artifacts.
--- drivers/gpu/drm/xen/xen_drm_front_gem.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/xen/xen_drm_front_gem.c +10 -3
@@ -236,8 +236,14 @@ static int gem_mmap_obj(struct xen_gem_object *xen_obj, vma->vm_flags &= ~VM_PFNMAP ; vma->vm_flags |=VM_MIXEDMAP ; vma->vm_pgoff =0 ; - vma->vm_page_prot = -pgprot_writecombine (vm_get_page_prot (vma->vm_flags)); +/* +* According to Xen on ARM ABI (xen/include/public/arch-arm.h): +* all memory which is shared with other entities in the system +* (including the hypervisor and other guests) must reside in memory +* which is mapped as Normal Inner Write-Back Outer Write-Back +* Inner-Shareable. +*/ + vma->vm_page_prot =vm_get_page_prot (vma->vm_flags);/* * vm_operations_struct.fault handler will be called if CPU access
@@ -283,8 +289,9 @@ void *xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj)if (!xen_obj->pages)return NULL ; +/* Please see comment in gem_mmap_obj on mapping and attributes. */ return vmap (xen_obj->pages, xen_obj->num_pages, -VM_MAP ,pgprot_writecombine (PAGE_KERNEL )); +VM_MAP ,PAGE_KERNEL ); } void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 153/671 iwlwifi: mvm: fix RSS config command
In reply to Sasha LevinFrom: Sara Sharon <[email protected]>
[ Upstream commit 608dce95db10b8ee1a26dbce3f60204bb69812a5 ]
The hash mask is a bitmap, so we should use BIT() on the enum values.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +6 -6
@@ -110,12 +110,12 @@ static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)int i;struct iwl_rss_config_cmd cmd = { .flags =cpu_to_le32 (IWL_RSS_ENABLE ), - .hash_mask =IWL_RSS_HASH_TYPE_IPV4_TCP | -IWL_RSS_HASH_TYPE_IPV4_UDP | -IWL_RSS_HASH_TYPE_IPV4_PAYLOAD | -IWL_RSS_HASH_TYPE_IPV6_TCP | -IWL_RSS_HASH_TYPE_IPV6_UDP | -IWL_RSS_HASH_TYPE_IPV6_PAYLOAD , + .hash_mask =BIT (IWL_RSS_HASH_TYPE_IPV4_TCP ) | +BIT (IWL_RSS_HASH_TYPE_IPV4_UDP ) | +BIT (IWL_RSS_HASH_TYPE_IPV4_PAYLOAD ) | +BIT (IWL_RSS_HASH_TYPE_IPV6_TCP ) | +BIT (IWL_RSS_HASH_TYPE_IPV6_UDP ) | +BIT (IWL_RSS_HASH_TYPE_IPV6_PAYLOAD ), };if (mvm->trans->num_rx_queues ==1 )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 154/671 staging: most: cdev: add missing check for cdev_add failure
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit 5ae890780e1b4d08f2c0c5d4ea96fc3928fc0ee9 ]
Currently the call to cdev_add is missing a check for failure. Fix this by checking for failure and exiting via a new error path that ensures the allocated comp_channel struct is kfree'd.
Detected by CoverityScan, CID#1462359 ("Unchecked return value")
--- drivers/staging/most/cdev/cdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/most/cdev/cdev.c +4 -1
@@ -453,7 +453,9 @@ static int comp_probe(struct most_interface *iface, int channel_id, c->devno =MKDEV (comp.major, current_minor);cdev_init (&c->cdev, &channel_fops); c->cdev.owner =THIS_MODULE ; -cdev_add (&c->cdev, c->devno,1 ); + retval =cdev_add (&c->cdev, c->devno,1 ); +if (retval <0 ) + goto err_free_c; c->iface = iface; c->cfg = cfg; c->channel_id = channel_id;
@@ -485,6 +487,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,list_del (&c->list); error_alloc_kfifo:cdev_del (&c->cdev); +err_free_c:kfree (c); error_alloc_channel:ida_simple_remove (&comp.minor_id, current_minor);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 155/671 clk: ingenic: jz4740: Fix gating of UDC clock
In reply to Sasha LevinFrom: Paul Cercueil <[email protected]>
[ Upstream commit b7e29924a1a628aec60d18651b493fa1601bf944 ]
The UDC clock is gated when the bit is cleared, not when it is set.
--- drivers/clk/ingenic/jz4740-cgu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ingenic/jz4740-cgu.c +1 -1
@@ -165,7 +165,7 @@ static const struct ingenic_cgu_clk_info jz4740_cgu_clocks[] = { .parents = { JZ4740_CLK_EXT, JZ4740_CLK_PLL_HALF, -1, -1 }, .mux = { CGU_REG_CPCCR, 29, 1 }, .div = { CGU_REG_CPCCR, 23, 1, 6, -1, -1, -1 }, - .gate = { CGU_REG_SCR, 6 }, + .gate = { CGU_REG_SCR, 6, true }, }, /* Gate-only clocks */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 156/671 rtc: ds1672: fix unintended sign extension
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit f0c04c276739ed8acbb41b4868e942a55b128dca ]
Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result.
Fix this by casting the u8 value to an unsigned long before the shift.
Detected by CoverityScan, CID#138801 ("Unintended sign extension")
--- drivers/rtc/rtc-ds1672.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-ds1672.c +2 -1
@@ -58,7 +58,8 @@ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm)"%s: raw read data - counters=%02x,%02x,%02x,%02x\n" , __func__, buf[0], buf[1], buf[2], buf[3]); - time = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + time = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ];rtc_time_to_tm (time, tm);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 157/671 thermal: mediatek: fix register index error
In reply to Sasha LevinFrom: Michael Kao <[email protected]>
[ Upstream commit eb9aecd90d1a39601e91cd08b90d5fee51d321a6 ]
The index of msr and adcpnp should match the sensor which belongs to the selected bank in the for loop.
--- drivers/thermal/mtk_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/thermal/mtk_thermal.c +4 -2
@@ -431,7 +431,8 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)u32 raw;for (i =0 ; i < conf->bank_data[bank->id].num_sensors; i++) { - raw =readl (mt->thermal_base + conf->msr[i]); + raw =readl (mt->thermal_base + + conf->msr[conf->bank_data[bank->id].sensors[i]]); temp = raw_to_mcelsius(mt, conf->bank_data[bank->id].sensors[i],
@@ -568,7 +569,8 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,for (i =0 ; i < conf->bank_data[num].num_sensors; i++)writel (conf->sensor_mux_values[conf->bank_data[num].sensors[i]], - mt->thermal_base + conf->adcpnp[i]); + mt->thermal_base + + conf->adcpnp[conf->bank_data[num].sensors[i]]);writel ((1 << conf->bank_data[num].num_sensors) -1 , mt->thermal_base +TEMP_MONCTL0 );
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 158/671 arm64: dts: msm8916: remove bogus argument to the cpu clock
In reply to Sasha LevinFrom: Niklas Cassel <[email protected]>
[ Upstream commit e4f045ef38e61ba37aa4afc916fce4fc1b37aa19 ]
The apcs node has #clock-cells = <0>, which means that those who references it should specify 0 arguments.
The apcs reference in the cpu node incorrectly specifies an argument, remove this bogus argument.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +4 -4
@@ -114,7 +114,7 @@ next-level-cache = <&L2_0>; enable-method = "psci"; cpu-idle-states = <&CPU_SPC>; - clocks = <&apcs 0>; + clocks = <&apcs>; operating-points-v2 = <&cpu_opp_table>; #cooling-cells = <2>; };
@@ -126,7 +126,7 @@ next-level-cache = <&L2_0>; enable-method = "psci"; cpu-idle-states = <&CPU_SPC>; - clocks = <&apcs 0>; + clocks = <&apcs>; operating-points-v2 = <&cpu_opp_table>; #cooling-cells = <2>; };
@@ -138,7 +138,7 @@ next-level-cache = <&L2_0>; enable-method = "psci"; cpu-idle-states = <&CPU_SPC>; - clocks = <&apcs 0>; + clocks = <&apcs>; operating-points-v2 = <&cpu_opp_table>; #cooling-cells = <2>; };
@@ -150,7 +150,7 @@ next-level-cache = <&L2_0>; enable-method = "psci"; cpu-idle-states = <&CPU_SPC>; - clocks = <&apcs 0>; + clocks = <&apcs>; operating-points-v2 = <&cpu_opp_table>; #cooling-cells = <2>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 159/671 ath10k: fix dma unmap direction for management frames
In reply to Sasha LevinFrom: Rakesh Pillai <[email protected]>
[ Upstream commit 6e8a8991e2103dcb6a9cff28f460390e8e360848 ]
The management frames transmitted are dma mapped with direction TO_DEVICE, but incorrectly mapped with direction FROM_DEVICE during tx complete and error cases.
Fix the direction of dma during dma unmap of the
transmitted management frames.
Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/mac.c | 4 ++-- drivers/net/wireless/ath/ath10k/wmi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +2 -2
@@ -1,7 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -* Copyright (c) 2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -3853,7 +3853,7 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work)ath10k_warn (ar,"failed to transmit management frame by ref via WMI: %d\n" , ret);dma_unmap_single (ar->dev, paddr, skb->len, -DMA_FROM_DEVICE ); +DMA_TO_DEVICE );ieee80211_free_txskb (ar->hw, skb); } }else {
drivers/net/wireless/ath/ath10k/wmi.c +2 -2
@@ -1,7 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -* Copyright (c) 2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -2340,7 +2340,7 @@ static int wmi_process_mgmt_tx_comp(struct ath10k *ar, u32 desc_id, msdu = pkt_addr->vaddr;dma_unmap_single (ar->dev, pkt_addr->paddr, - msdu->len,DMA_FROM_DEVICE ); + msdu->len,DMA_TO_DEVICE ); info =IEEE80211_SKB_CB (msdu);if (status)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 160/671 net: phy: fixed_phy: Fix fixed_phy not checking GPIO
In reply to Sasha LevinFrom: Moritz Fischer <[email protected]>
[ Upstream commit 8f289805616e81f7c1690931aa8a586c76f4fa88 ]
Fix fixed_phy not checking GPIO if no link_update callback is registered.
In the original version all users registered a link_update callback so the issue was masked.
--- drivers/net/phy/fixed_phy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/fixed_phy.c +3 -3
@@ -67,11 +67,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)do { s =read_seqcount_begin (&fp->seqcount);/* Issue callback if user registered it. */ -if (fp->link_update) { +if (fp->link_update) fp->link_update (fp->phydev->attached_dev, &fp->status); -fixed_phy_update (fp); - } +/* Check the GPIO for change in status */ +fixed_phy_update (fp); state = fp->status; }while (read_seqcount_retry (&fp->seqcount, s));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 161/671 rtc: ds1307: rx8130: Fix alarm handling
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 3f929cad943380370b6db31fcb7a38d898d91089 ]
When the EXTENSION.WADA bit is set, register 0x19 contains a bitmap of week days, not a day of month. As Linux only handles a single alarm without repetition using day of month is more flexible, so clear this bit. (Otherwise a value depending on time.tm_wday would have to be written to register 0x19.)
Also optimize setting the AIE bit to use a single register write instead of a bulk write of three registers.
--- drivers/rtc/rtc-ds1307.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/rtc/rtc-ds1307.c +3 -4
@@ -749,8 +749,8 @@ static int rx8130_set_alarm(struct device *dev, struct rtc_wkalrm *t)if (ret <0 )return ret; - ctl[0 ] &= ~RX8130_REG_EXTENSION_WADA ; - ctl[1 ] |=RX8130_REG_FLAG_AF ; + ctl[0 ] &=RX8130_REG_EXTENSION_WADA ; + ctl[1 ] &= ~RX8130_REG_FLAG_AF ; ctl[2 ] &= ~RX8130_REG_CONTROL0_AIE ; ret = regmap_bulk_write(ds1307->regmap, RX8130_REG_EXTENSION, ctl,
@@ -773,8 +773,7 @@ static int rx8130_set_alarm(struct device *dev, struct rtc_wkalrm *t) ctl[2 ] |=RX8130_REG_CONTROL0_AIE ; -return regmap_bulk_write (ds1307->regmap,RX8130_REG_EXTENSION , ctl, -sizeof (ctl)); +return regmap_write (ds1307->regmap,RX8130_REG_CONTROL0 , ctl[2 ]); }static int rx8130_alarm_irq_enable (struct device *dev,unsigned int enabled)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 162/671 net/smc: original socket family in inet_sock_diag
In reply to Sasha LevinFrom: Karsten Graul <[email protected]>
[ Upstream commit 232dc8ef647658a5352da807d9e994e0e03b43cd ]
Commit ed75986f4aae ("net/smc: ipv6 support for smc_diag.c") changed the value of the diag_family field. The idea was to indicate the family of the IP address in the inet_diag_sockid field. But the change makes it impossible to distinguish an inet_sock_diag response message from SMC sock_diag response. This patch restores the original behaviour and sends AF_SMC as value of the diag_family field.
--- net/smc/smc_diag.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/smc/smc_diag.c +1 -2
@@ -38,6 +38,7 @@ static void smc_diag_msg_common_fill(struct smc_diag_msg *r, struct sock *sk) {struct smc_sock *smc =smc_sk (sk); + r->diag_family = sk->sk_family;if (!smc->clcsock)return ; r->id.idiag_sport =htons (smc->clcsock->sk->sk_num);
@@ -45,14 +46,12 @@ static void smc_diag_msg_common_fill(struct smc_diag_msg *r, struct sock *sk) r->id.idiag_if = smc->clcsock->sk->sk_bound_dev_if;sock_diag_save_cookie (sk, r->id.idiag_cookie);if (sk->sk_protocol ==SMCPROTO_SMC ) { - r->diag_family =PF_INET ;memset (&r->id.idiag_src,0 ,sizeof (r->id.idiag_src));memset (&r->id.idiag_dst,0 ,sizeof (r->id.idiag_dst)); r->id.idiag_src[0 ] = smc->clcsock->sk->sk_rcv_saddr; r->id.idiag_dst[0 ] = smc->clcsock->sk->sk_daddr;#if IS_ENABLED (CONFIG_IPV6 ) } else if (sk->sk_protocol == SMCPROTO_SMC6) { - r->diag_family =PF_INET6 ;memcpy (&r->id.idiag_src, &smc->clcsock->sk->sk_v6_rcv_saddr,sizeof (smc->clcsock->sk->sk_v6_rcv_saddr)); memcpy(&r->id.idiag_dst, &smc->clcsock->sk->sk_v6_daddr,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 163/671 rtc: 88pm860x: fix unintended sign extension
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit dc9e47160626cdb58d5c39a4f43dcfdb27a5c004 ]
Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result.
Fix this by casting the u8 value to an unsigned long before the shift.
Detected by CoverityScan, CID#144925-144928 ("Unintended sign extension")
--- drivers/rtc/rtc-88pm860x.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/rtc/rtc-88pm860x.c +14 -7
@@ -115,11 +115,13 @@ static int pm860x_rtc_read_time(struct device *dev, struct rtc_time *tm)pm860x_page_bulk_read (info->i2c,REG0_ADDR ,8 , buf);dev_dbg (info->dev,"%x-%x-%x-%x-%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ], buf[6 ], buf[7 ]); - base = (buf[1 ] <<24 ) | (buf[3 ] <<16 ) | (buf[5 ] <<8 ) | buf[7 ]; + base = ((unsigned long )buf[1 ] <<24 ) | (buf[3 ] <<16 ) | + (buf[5 ] <<8 ) | buf[7 ];/* load 32-bit read-only counter */ pm860x_bulk_read (info->i2c,PM8607_RTC_COUNTER1 ,4 , buf); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -145,7 +147,8 @@ static int pm860x_rtc_set_time(struct device *dev, struct rtc_time *tm)/* load 32-bit read-only counter */ pm860x_bulk_read (info->i2c,PM8607_RTC_COUNTER1 ,4 , buf); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; base = ticks - data;dev_dbg (info->dev,"set base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -170,10 +173,12 @@ static int pm860x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)pm860x_page_bulk_read (info->i2c,REG0_ADDR ,8 , buf);dev_dbg (info->dev,"%x-%x-%x-%x-%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ], buf[6 ], buf[7 ]); - base = (buf[1 ] <<24 ) | (buf[3 ] <<16 ) | (buf[5 ] <<8 ) | buf[7 ]; + base = ((unsigned long )buf[1 ] <<24 ) | (buf[3 ] <<16 ) | + (buf[5 ] <<8 ) | buf[7 ];pm860x_bulk_read (info->i2c,PM8607_RTC_EXPIRE1 ,4 , buf); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -198,11 +203,13 @@ static int pm860x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)pm860x_page_bulk_read (info->i2c,REG0_ADDR ,8 , buf);dev_dbg (info->dev,"%x-%x-%x-%x-%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ], buf[6 ], buf[7 ]); - base = (buf[1 ] <<24 ) | (buf[3 ] <<16 ) | (buf[5 ] <<8 ) | buf[7 ]; + base = ((unsigned long )buf[1 ] <<24 ) | (buf[3 ] <<16 ) | + (buf[5 ] <<8 ) | buf[7 ];/* load 32-bit read-only counter */ pm860x_bulk_read (info->i2c,PM8607_RTC_COUNTER1 ,4 , buf); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 164/671 rtc: 88pm80x: fix unintended sign extension
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit fb0b322537a831b5b0cb948c56f8f958ce493d3a ]
Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result.
Fix this by casting the u8 value to an unsigned long before the shift.
Detected by CoverityScan, CID#714646-714649 ("Unintended sign extension")
--- drivers/rtc/rtc-88pm80x.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/rtc/rtc-88pm80x.c +14 -7
@@ -114,12 +114,14 @@ static int pm80x_rtc_read_time(struct device *dev, struct rtc_time *tm)unsigned char buf[4 ];unsigned long ticks, base, data;regmap_raw_read (info->map,PM800_RTC_EXPIRE2_1 , buf,4 ); - base = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + base = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ];dev_dbg (info->dev,"%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ]);/* load 32-bit read-only counter */ regmap_raw_read (info->map,PM800_RTC_COUNTER1 , buf,4 ); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -137,7 +139,8 @@ static int pm80x_rtc_set_time(struct device *dev, struct rtc_time *tm)/* load 32-bit read-only counter */ regmap_raw_read (info->map,PM800_RTC_COUNTER1 , buf,4 ); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; base = ticks - data;dev_dbg (info->dev,"set base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -158,11 +161,13 @@ static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)int ret;regmap_raw_read (info->map,PM800_RTC_EXPIRE2_1 , buf,4 ); - base = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + base = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ];dev_dbg (info->dev,"%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ]);regmap_raw_read (info->map,PM800_RTC_EXPIRE1_1 , buf,4 ); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
@@ -185,12 +190,14 @@ static int pm80x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)regmap_update_bits (info->map,PM800_RTC_CONTROL ,PM800_ALARM1_EN ,0 );regmap_raw_read (info->map,PM800_RTC_EXPIRE2_1 , buf,4 ); - base = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + base = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ];dev_dbg (info->dev,"%x-%x-%x-%x\n" , buf[0 ], buf[1 ], buf[2 ], buf[3 ]);/* load 32-bit read-only counter */ regmap_raw_read (info->map,PM800_RTC_COUNTER1 , buf,4 ); - data = (buf[3 ] <<24 ) | (buf[2 ] <<16 ) | (buf[1 ] <<8 ) | buf[0 ]; + data = ((unsigned long )buf[3 ] <<24 ) | (buf[2 ] <<16 ) | + (buf[1 ] <<8 ) | buf[0 ]; ticks = base + data;dev_dbg (info->dev,"get base:0x%lx, RO count:0x%lx, ticks:0x%lx\n" , base, data, ticks);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 165/671 rtc: pm8xxx: fix unintended sign extension
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit e42280886018c6f77f0a90190f7cba344b0df3e0 ]
Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result.
Fix this by casting the u8 value to an unsigned long before the shift.
Detected by CoverityScan, CID#1309693 ("Unintended sign extension")
--- drivers/rtc/rtc-pm8xxx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/rtc/rtc-pm8xxx.c +4 -2
@@ -213,7 +213,8 @@ static int pm8xxx_rtc_read_time(struct device *dev, struct rtc_time *tm) } } - secs = value[0 ] | (value[1 ] <<8 ) | (value[2 ] <<16 ) | (value[3 ] <<24 ); + secs = value[0 ] | (value[1 ] <<8 ) | (value[2 ] <<16 ) | + ((unsigned long )value[3 ] <<24 );rtc_time_to_tm (secs, tm);
@@ -288,7 +289,8 @@ static int pm8xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)return rc; } - secs = value[0 ] | (value[1 ] <<8 ) | (value[2 ] <<16 ) | (value[3 ] <<24 ); + secs = value[0 ] | (value[1 ] <<8 ) | (value[2 ] <<16 ) | + ((unsigned long )value[3 ] <<24 );rtc_time_to_tm (secs, &alarm->time);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 166/671 fbdev: chipsfb: remove set but not used variable 'size'
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 8e71fa5e4d86bedfd26df85381d65d6b4c860020 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/video/fbdev/chipsfb.c: In function 'chipsfb_pci_init':drivers/video/fbdev/chipsfb.c:352:22: warning:
variable 'size' set but not used [-Wunused-but-set-variable]
--- drivers/video/fbdev/chipsfb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/chipsfb.c +1 -2
@@ -350,7 +350,7 @@ static void init_chips(struct fb_info *p, unsigned long addr)static int chipsfb_pci_init (struct pci_dev *dp,const struct pci_device_id *ent) {struct fb_info *p; -unsigned long addr, size; +unsigned long addr;unsigned short cmd;int rc = -ENODEV ;
@@ -362,7 +362,6 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)if ((dp->resource[0 ].flags &IORESOURCE_MEM ) =0 ) goto err_disable; addr =pci_resource_start (dp,0 ); - size =pci_resource_len (dp,0 );if (addr =0 ) goto err_disable;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 167/671 iw_cxgb4: use tos when importing the endpoint
In reply to Sasha LevinFrom: Steve Wise <[email protected]>
[ Upstream commit cb3ba0bde881f0cb7e3945d2a266901e2bd18c92 ]
import_ep() is passed the correct tos, but doesn't use it correctly.
--- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +1 -1
@@ -2076,7 +2076,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, }else { pdev =get_real_dev (n->dev); ep->l2t =cxgb4_l2t_get (cdev->rdev.lldi.l2t, - n, pdev,0 ); + n, pdev,rt_tos2priority (tos));if (!ep->l2t) goto out; ep->mtu =dst_mtu (dst);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 168/671 iw_cxgb4: use tos when finding ipv6 routes
In reply to Sasha LevinFrom: Steve Wise <[email protected]>
[ Upstream commit c8a7eb554a83214c3d8ee5cb322da8c72810d2dc ]
When IPv6 support was added, the correct tos was not passed to cxgb_find_route6(). This potentially results in the wrong route entry.
--- drivers/infiniband/hw/cxgb4/cm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +3 -2
@@ -2166,7 +2166,8 @@ static int c4iw_reconnect(struct c4iw_ep *ep) laddr6->sin6_addr.s6_addr, raddr6->sin6_addr.s6_addr, laddr6->sin6_port, - raddr6->sin6_port,0 , + raddr6->sin6_port, + ep->com.cm_id->tos, raddr6->sin6_scope_id); iptype =6 ; ra = (__u8 *)&raddr6->sin6_addr;
@@ -3326,7 +3327,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) laddr6->sin6_addr.s6_addr, raddr6->sin6_addr.s6_addr, laddr6->sin6_port, - raddr6->sin6_port,0 , + raddr6->sin6_port, cm_id->tos, raddr6->sin6_scope_id); }if (!ep->dst) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 169/671 ipmi: kcs_bmc: handle devm_kasprintf() failure case
In reply to Sasha LevinFrom: Nicholas Mc Guire <[email protected]>
[ Upstream commit 42c7c6ef1e6fa5fc0425120f06f045190b1dda2d ]
devm_kasprintf() may return NULL if internal allocation failed so this assignment is not safe. Moved the error exit path and added the !NULL which then allows the devres manager to take care of cleanup.
--- drivers/char/ipmi/kcs_bmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/ipmi/kcs_bmc.c +3 -2
@@ -440,12 +440,13 @@ struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, u32 channel) kcs_bmc->data_in =devm_kmalloc (dev,KCS_MSG_BUFSIZ ,GFP_KERNEL ); kcs_bmc->data_out =devm_kmalloc (dev,KCS_MSG_BUFSIZ ,GFP_KERNEL ); kcs_bmc->kbuffer =devm_kmalloc (dev,KCS_MSG_BUFSIZ ,GFP_KERNEL ); -if (!kcs_bmc->data_in || !kcs_bmc->data_out || !kcs_bmc->kbuffer) -return NULL ; kcs_bmc->miscdev.minor =MISC_DYNAMIC_MINOR ; kcs_bmc->miscdev.name =devm_kasprintf (dev,GFP_KERNEL ,"%s%u" ,DEVICE_NAME , channel); +if (!kcs_bmc->data_in || !kcs_bmc->data_out || !kcs_bmc->kbuffer || + !kcs_bmc->miscdev.name) +return NULL ; kcs_bmc->miscdev.fops = &kcs_bmc_fops;return kcs_bmc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 170/671 xsk: add missing smp_rmb() in xsk_mmap
In reply to Sasha LevinFrom: Magnus Karlsson <[email protected]>
[ Upstream commit e6762c8bcf982821935a2b1cb33cf8335d0eefae ]
All the setup code in AF_XDP is protected by a mutex with the exception of the mmap code that cannot use it. To make sure that a process banging on the mmap call at the same time as another process is setting up the socket, smp_wmb() calls were added in the umem registration code and the queue creation code, so that the published structures that xsk_mmap needs would be consistent. However, the corresponding smp_rmb() calls were not added to the xsk_mmap code. This patch adds these calls.
--- net/xdp/xsk.c | 4 ++++ 1 file changed, 4 insertions(+)
net/xdp/xsk.c +4 -0
@@ -661,6 +661,8 @@ static int xsk_mmap(struct file *file, struct socket *sock,if (!umem)return -EINVAL ; +/* Matches the smp_wmb() in XDP_UMEM_REG */ +smp_rmb ();if (offset ==XDP_UMEM_PGOFF_FILL_RING ) q =READ_ONCE (umem->fq);else if (offset ==XDP_UMEM_PGOFF_COMPLETION_RING )
@@ -670,6 +672,8 @@ static int xsk_mmap(struct file *file, struct socket *sock,if (!q)return -EINVAL ; +/* Matches the smp_wmb() in xsk_init_queue */ +smp_rmb (); qpg =virt_to_head_page (q->ring);if (size > (PAGE_SIZE <<compound_order (qpg)))return -EINVAL ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 171/671 drm/etnaviv: potential NULL dereference
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 9e05352340d3a3e68c144136db9810b26ebb88c3 ]
The etnaviv_gem_prime_get_sg_table() is supposed to return error pointers. Otherwise it can lead to a NULL dereference when it's called from drm_gem_map_dma_buf().
--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +1 -1
@@ -15,7 +15,7 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)int npages = obj->size >>PAGE_SHIFT ;if (WARN_ON (!etnaviv_obj->pages))/* should have already pinned! */ -return NULL ; +return ERR_PTR (-EINVAL );return drm_prime_pages_to_sg (etnaviv_obj->pages, npages); }
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 172/671 ntb_hw_switchtec: debug print 64bit aligned crosslink BAR Numbers
In reply to Sasha LevinFrom: Paul Selles <[email protected]>
[ Upstream commit cce8e04cf79e47809455215744685e8eb56f94bb ]
Switchtec NTB crosslink BARs are 64bit addressed but they are printed as 32bit addressed BARs. Fix debug log to increment the BAR numbers by 2 to reflect the 64bit address alignment.
--- drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ntb/hw/mscc/ntb_hw_switchtec.c +1 -1
@@ -1120,7 +1120,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,dev_dbg (&sndev->stdev->dev,"Crosslink BAR%d addr: %llx\n" , - i, bar_addr); + i*2 , bar_addr);if (bar_addr != bar_space * i)continue ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 173/671 ntb_hw_switchtec: NT req id mapping table register entry number should be 512
In reply to Sasha LevinFrom: Wesley Sheng <[email protected]>
[ Upstream commit d123fab71f63aae129aebe052664fda73131921a ]
The number of available NT req id mapping table entries per NTB control register is 512. The driver mistakenly limits the number to 256.
Fix the array size of NT req id mapping table.
--- include/linux/switchtec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/switchtec.h +2 -2
@@ -244,8 +244,8 @@ struct ntb_ctrl_regs {u64 xlate_addr; } bar_entry[6 ];u32 reserved2[216 ]; -u32 req_id_table[256 ]; -u32 reserved3[512 ]; +u32 req_id_table[512 ]; +u32 reserved3[256 ];u64 lut_entry[512 ]; } __packed;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 174/671 pinctrl: sh-pfc: emev2: Add missing pinmux functions
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 1ecd8c9cb899ae277e6986ae134635cb1a50f5de ]
The err_rst_reqb, ext_clki, lowpwr, and ref_clko pin groups are present, but no pinmux functions refer to them, hence they can not be selected.
--- drivers/pinctrl/sh-pfc/pfc-emev2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/pinctrl/sh-pfc/pfc-emev2.c +20 -0
@@ -1263,6 +1263,14 @@ static const char * const dtv_groups[] = { "dtv_b", }; +static const char *const err_rst_reqb_groups[] = { +"err_rst_reqb" , +}; + +static const char *const ext_clki_groups[] = { +"ext_clki" , +}; +static const char *const iic0_groups[] = {"iic0" , };
@@ -1285,6 +1293,10 @@ static const char * const lcd_groups[] = { "yuv3", }; +static const char *const lowpwr_groups[] = { +"lowpwr" , +}; +static const char *const ntsc_groups[] = {"ntsc_clk" ,"ntsc_data" ,
@@ -1298,6 +1310,10 @@ static const char * const pwm1_groups[] = { "pwm1", }; +static const char *const ref_clko_groups[] = { +"ref_clko" , +}; +static const char *const sd_groups[] = {"sd_cki" , };
@@ -1391,13 +1407,17 @@ static const struct sh_pfc_function pinmux_functions[] = {SH_PFC_FUNCTION (cam),SH_PFC_FUNCTION (cf),SH_PFC_FUNCTION (dtv), +SH_PFC_FUNCTION (err_rst_reqb), +SH_PFC_FUNCTION (ext_clki),SH_PFC_FUNCTION (iic0),SH_PFC_FUNCTION (iic1),SH_PFC_FUNCTION (jtag),SH_PFC_FUNCTION (lcd), +SH_PFC_FUNCTION (lowpwr),SH_PFC_FUNCTION (ntsc),SH_PFC_FUNCTION (pwm0),SH_PFC_FUNCTION (pwm1), +SH_PFC_FUNCTION (ref_clko),SH_PFC_FUNCTION (sd),SH_PFC_FUNCTION (sdi0), SH_PFC_FUNCTION(sdi1),
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 175/671 pinctrl: sh-pfc: r8a7791: Fix scifb2_data_c pin group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit a4b0350047f1b10207e25e72d7cd3f7826e93769 ]
The entry for "scifb2_data_c" in the SCIFB2 pin group array contains a typo, thus the group cannot be selected.
--- drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +1 -1
@@ -5239,7 +5239,7 @@ static const char * const scifb2_groups[] = {"scifb2_data_b" ,"scifb2_clk_b" ,"scifb2_ctrl_b" , -"scifb0_data_c" , +"scifb2_data_c" ,"scifb2_clk_c" , "scifb2_data_d", };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 176/671 pinctrl: sh-pfc: r8a7792: Fix vin1_data18_b pin group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit b9fd50488b4939ce5b3a026d29e752e17c2d1800 ]
The vin1_data18_b pin group itself is present, but it is not listed in the VIN1 pin group array, and thus cannot be selected.
--- drivers/pinctrl/sh-pfc/pfc-r8a7792.c | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/sh-pfc/pfc-r8a7792.c +1 -0
@@ -1916,6 +1916,7 @@ static const char * const vin1_groups[] = {"vin1_data8" ,"vin1_data24_b" ,"vin1_data20_b" , +"vin1_data18_b" ,"vin1_data16_b" ,"vin1_sync" , "vin1_field",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 177/671 pinctrl: sh-pfc: sh73a0: Fix fsic_spdif pin groups
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0e6e448bdcf896d001a289a6112a704542d51516 ]
There are two pin groups for the FSIC SPDIF signal, but the FSIC pin group array lists only one, and it refers to a nonexistent group.
--- drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-sh73a0.c +2 -1
@@ -3367,7 +3367,8 @@ static const char * const fsic_groups[] = {"fsic_sclk_out" ,"fsic_data_in" ,"fsic_data_out" , - "fsic_spdif", +"fsic_spdif_0" , + "fsic_spdif_1", }; static const char * const fsid_groups[] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 178/671 RDMA/mlx5: Fix memory leak in case we fail to add an IB device
In reply to Sasha LevinFrom: Mark Bloch <[email protected]>
[ Upstream commit fc9e4477f924e84d7798f7a1d41401d699de1219 ]
Make sure the IB device is freed on failure.
--- drivers/infiniband/hw/mlx5/ib_rep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/ib_rep.c +3 -1
@@ -69,8 +69,10 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) ibdev->mdev = dev; ibdev->num_ports =max (MLX5_CAP_GEN (dev, num_ports),MLX5_CAP_GEN (dev, num_vhca_ports)); -if (!__mlx5_ib_add (ibdev, &rep_profile)) +if (!__mlx5_ib_add (ibdev, &rep_profile)) { +ib_dealloc_device (&ibdev->ib_dev);return -EINVAL ; + } rep->rep_if[REP_IB ].priv = ibdev;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 179/671 driver core: Fix possible supplier PM-usage counter imbalance
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 4c06c4e6cf63d7f3d5dfe62593a073253d750a59 ]
If a stateless device link to a certain supplier with DL_FLAG_PM_RUNTIME set in the flags is added and then removed by the consumer driver's probe callback, the supplier's PM-runtime usage counter will be nonzero after that which effectively causes the supplier to remain "always on" going forward.
Namely, device_link_add() called to add the link invokes device_link_rpm_prepare() which notices that the consumer driver is probing, so it increments the supplier's PM-runtime usage counter with the assumption that the link will stay around until pm_runtime_put_suppliers() is called by driver_probe_device(), but if the link goes away before that point, the supplier's PM-runtime usage counter will remain nonzero.
To prevent that from happening, first rework pm_runtime_get_suppliers() and pm_runtime_put_suppliers() to use the rpm_active refounts of device links and make the latter only drop rpm_active and the supplier's PM-runtime usage counter for each link by one, unless rpm_active is one already for it. Next, modify device_link_add() to bump up the new link's rpm_active refcount and the suppliers PM-runtime usage counter by two, to prevent pm_runtime_put_suppliers(), if it is called subsequently, from suspending the supplier prematurely (in case its PM-runtime usage counter goes down to 0 in there).
Due to the way rpm_put_suppliers() works, this change does not affect runtime suspend of the consumer ends of new device links (or, generally, device links for which DL_FLAG_PM_RUNTIME has just been set).
--- drivers/base/core.c | 21 ++++----------------- drivers/base/power/runtime.c | 27 +++++++++++++++++++++++++-- include/linux/pm_runtime.h | 4 ++++ 3 files changed, 33 insertions(+), 19 deletions(-)
drivers/base/core.c +4 -17
@@ -165,19 +165,6 @@ void device_pm_move_to_tail(struct device *dev)device_links_read_unlock (idx); } -static void device_link_rpm_prepare (struct device *consumer, -struct device *supplier) -{ -pm_runtime_new_link (consumer); -/* -* If the link is being added by the consumer driver at probe time, -* balance the decrementation of the supplier's runtime PM usage counter -* after consumer probe in driver_probe_device(). -*/ -if (consumer->links.status ==DL_DEV_PROBING ) -pm_runtime_get_noresume (supplier); -} -/** * device_link_add - Create a link between two devices. * @consumer: Consumer end of the link.
@@ -262,11 +249,11 @@ struct device_link *device_link_add(struct device *consumer,if (flags &DL_FLAG_PM_RUNTIME ) {if (!(link->flags &DL_FLAG_PM_RUNTIME )) { -device_link_rpm_prepare (consumer, supplier); +pm_runtime_new_link (consumer); link->flags |=DL_FLAG_PM_RUNTIME ; }if (flags &DL_FLAG_RPM_ACTIVE ) -refcount_inc (&link->rpm_active); +pm_runtime_active_link (link, supplier); }kref_get (&link->kref);
@@ -281,9 +268,9 @@ struct device_link *device_link_add(struct device *consumer,if (flags &DL_FLAG_PM_RUNTIME ) {if (flags &DL_FLAG_RPM_ACTIVE ) -refcount_inc (&link->rpm_active); +pm_runtime_active_link (link, supplier); -device_link_rpm_prepare (consumer, supplier); +pm_runtime_new_link (consumer); }get_device (supplier);
drivers/base/power/runtime.c +25 -2
@@ -1570,8 +1570,10 @@ void pm_runtime_get_suppliers(struct device *dev) idx =device_links_read_lock ();list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) -if (link->flags &DL_FLAG_PM_RUNTIME ) +if (link->flags &DL_FLAG_PM_RUNTIME ) { +refcount_inc (&link->rpm_active);pm_runtime_get_sync (link->supplier); + }device_links_read_unlock (idx); }
@@ -1588,7 +1590,8 @@ void pm_runtime_put_suppliers(struct device *dev) idx =device_links_read_lock ();list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) -if (link->flags &DL_FLAG_PM_RUNTIME ) +if (link->flags &DL_FLAG_PM_RUNTIME && +refcount_dec_not_one (&link->rpm_active))pm_runtime_put (link->supplier);device_links_read_unlock (idx);
@@ -1601,6 +1604,26 @@ void pm_runtime_new_link(struct device *dev)spin_unlock_irq (&dev->power.lock); } +/** +* pm_runtime_active_link - Set up new device link as active for PM-runtime. +* @link: Device link to be set up as active. +* @supplier: Supplier end of the link. +* +* Add 2 to the rpm_active refcount of @link and increment the PM-runtime +* usage counter of @supplier once more in case the link is being added while +* the consumer driver is probing and pm_runtime_put_suppliers() will be called +* subsequently. +* +* Note that this doesn't prevent rpm_put_suppliers() from decreasing the link's +* rpm_active refcount down to one, so runtime suspend of the consumer end of +* @link is not affected. +*/ +void pm_runtime_active_link (struct device_link *link,struct device *supplier) +{ +refcount_add (2 , &link->rpm_active); +pm_runtime_get_noresume (supplier); +} +void pm_runtime_drop_link (struct device *dev) {spin_lock_irq (&dev->power.lock);
include/linux/pm_runtime.h +4 -0
@@ -59,6 +59,8 @@ extern void pm_runtime_clean_up_links(struct device *dev);extern void pm_runtime_get_suppliers (struct device *dev);extern void pm_runtime_put_suppliers (struct device *dev);extern void pm_runtime_new_link (struct device *dev); +extern void pm_runtime_active_link (struct device_link *link, +struct device *supplier);extern void pm_runtime_drop_link (struct device *dev);static inline void pm_suspend_ignore_children (struct device *dev,bool enable)
@@ -176,6 +178,8 @@ static inline void pm_runtime_clean_up_links(struct device *dev) {}static inline void pm_runtime_get_suppliers (struct device *dev) {}static inline void pm_runtime_put_suppliers (struct device *dev) {}static inline void pm_runtime_new_link (struct device *dev) {} +static inline void pm_runtime_active_link (struct device_link *link, +struct device *supplier) {}static inline void pm_runtime_drop_link (struct device *dev) {}#endif /* !CONFIG_PM */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 180/671 PCI: endpoint: functions: Use memcpy_fromio()/memcpy_toio()
In reply to Sasha LevinFrom: Wen Yang <[email protected]>
[ Upstream commit 726dabfde6aa35a4f1508e235ae37edbbf9fbc65 ]
Functions copying from/to IO addresses should use the memcpy_fromio()/memcpy_toio() API rather than plain memcpy().
Fix the issue detected through the sparse tool.
--- drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/endpoint/functions/pci-epf-test.c +2 -2
@@ -175,7 +175,7 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test) goto err_map_addr; } -memcpy (buf, src_addr, reg->size); +memcpy_fromio (buf, src_addr, reg->size); crc32 =crc32_le (~0 , buf, reg->size);if (crc32 != reg->checksum)
@@ -230,7 +230,7 @@ static int pci_epf_test_write(struct pci_epf_test *epf_test)get_random_bytes (buf, reg->size); reg->checksum =crc32_le (~0 , buf, reg->size); -memcpy (dst_addr, buf, reg->size); +memcpy_toio (dst_addr, buf, reg->size);/* * wait 1ms inorder for the write to complete. Without this delay L3
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 181/671 usb: phy: twl6030-usb: fix possible use-after-free on remove
In reply to Sasha LevinFrom: Sven Van Asbroeck <[email protected]>
[ Upstream commit 5895d311d28f2605e2f71c1a3e043ed38f3ac9d2 ]
In remove(), use cancel_delayed_work_sync() to cancel the delayed work. Otherwise there's a chance that this work will continue to run until after the device has been removed.
This issue was detected with the help of Coccinelle.
--- drivers/usb/phy/phy-twl6030-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-twl6030-usb.c +1 -1
@@ -400,7 +400,7 @@ static int twl6030_usb_remove(struct platform_device *pdev) {struct twl6030_usb *twl =platform_get_drvdata (pdev); -cancel_delayed_work (&twl->get_status_work); +cancel_delayed_work_sync (&twl->get_status_work);twl6030_interrupt_mask (TWL6030_USBOTG_INT_MASK ,REG_INT_MSK_LINE_C ); twl6030_interrupt_mask(TWL6030_USBOTG_INT_MASK,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 182/671 block: don't use bio->bi_vcnt to figure out segment number
In reply to Sasha LevinFrom: Ming Lei <[email protected]>
[ Upstream commit 1a67356e9a4829da2935dd338630a550c59c8489 ]
It is wrong to use bio->bi_vcnt to figure out how many segments there are in the bio even though CLONED flag isn't set on this bio, because this bio may be splitted or advanced.
So always use bio_segments() in blk_recount_segments(), and it shouldn't cause any performance loss now because the physical segment number is figured out in blk_queue_split() and BIO_SEG_VALID is set meantime since bdced438acd83ad83a6c ("block: setup bi_phys_segments after splitting").
--- block/blk-merge.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
block/blk-merge.c +1 -7
@@ -309,13 +309,7 @@ void blk_recalc_rq_segments(struct request *rq)void blk_recount_segments (struct request_queue *q,struct bio *bio) { -unsigned short seg_cnt; - -/* estimate segment number by bi_vcnt for non-cloned bio */ -if (bio_flagged (bio,BIO_CLONED )) - seg_cnt =bio_segments (bio); -else - seg_cnt = bio->bi_vcnt; +unsigned short seg_cnt =bio_segments (bio);if (test_bit (QUEUE_FLAG_NO_SG_MERGE , &q->queue_flags) && (seg_cnt <queue_max_segments (q)))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 183/671 keys: Timestamp new keys
In reply to Sasha LevinFrom: David Howells <[email protected]>
[ Upstream commit 7c1857bdbdf1e4c541e45eab477ee23ed4333ea4 ]
Set the timestamp on new keys rather than leaving it unset.
--- security/keys/key.c | 1 + 1 file changed, 1 insertion(+)
security/keys/key.c +1 -0
@@ -297,6 +297,7 @@ struct key *key_alloc(struct key_type *type, const char *desc, key->gid = gid; key->perm = perm; key->restrict_link = restrict_link; + key->last_used_at =ktime_get_real_seconds ();if (!(flags &KEY_ALLOC_NOT_IN_QUOTA )) key->flags |=1 <<KEY_FLAG_IN_QUOTA ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 184/671 net: dsa: b53: Fix default VLAN ID
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit fea83353177a55540c71c140887737c282137aa2 ]
We were not consistent in how the default VID of a given port was defined, b53_br_leave() would make sure the VLAN ID would be either 0/1 depending on the switch generation, but b53_configure_vlan(), which is the default configuration would unconditionally set it to 1. The correct value is 1 for 5325/5365 series and 0 otherwise. To avoid repeating that mistake ever again, introduce a helper function: b53_default_pvid() to factor that out.
--- drivers/net/dsa/b53/b53_common.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/net/dsa/b53/b53_common.c +16 -13
@@ -622,15 +622,25 @@ static void b53_enable_mib(struct b53_device *dev)b53_write8 (dev,B53_MGMT_PAGE ,B53_GLOBAL_CONFIG , gc); } +static u16 b53_default_pvid (struct b53_device *dev) +{ +if (is5325 (dev) ||is5365 (dev)) +return 1 ; +else +return 0 ; +} +int b53_configure_vlan (struct dsa_switch *ds) {struct b53_device *dev = ds->priv;struct b53_vlan vl = {0 }; -int i; +int i, def_vid; + + def_vid =b53_default_pvid (dev);/* clear all vlan entries */ if (is5325 (dev) ||is5365 (dev)) { -for (i =1 ; i < dev->num_vlans; i++) +for (i = def_vid; i < dev->num_vlans; i++)b53_set_vlan_entry (dev, i, &vl); }else {b53_do_vlan_op (dev,VTA_CMD_CLEAR );
@@ -640,7 +650,7 @@ int b53_configure_vlan(struct dsa_switch *ds)b53_for_each_port (dev, i)b53_write16 (dev,B53_VLAN_PAGE , -B53_VLAN_PORT_DEF_TAG (i),1 ); +B53_VLAN_PORT_DEF_TAG (i), def_vid);if (!is5325 (dev) && !is5365 (dev))b53_set_jumbo (dev, dev->enable_jumbo, false);
@@ -1142,12 +1152,8 @@ int b53_vlan_del(struct dsa_switch *ds, int port, vl->members &= ~BIT (port); -if (pvid == vid) { -if (is5325 (dev) ||is5365 (dev)) - pvid =1 ; -else - pvid =0 ; - } +if (pvid == vid) + pvid =b53_default_pvid (dev);if (untagged && !dsa_is_cpu_port (ds, port)) vl->untag &= ~(BIT (port));
@@ -1460,10 +1466,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br)b53_write16 (dev,B53_PVLAN_PAGE ,B53_PVLAN_PORT_MASK (port), pvlan); dev->ports[port].vlan_ctl_mask = pvlan; -if (is5325 (dev) ||is5365 (dev)) - pvid =1 ; -else - pvid =0 ; + pvid =b53_default_pvid (dev);/* Make this port join all VLANs without VLAN entries */ if (is58xx (dev)) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 185/671 net: dsa: b53: Properly account for VLAN filtering
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit dad8d7c6452b5b9f9828c9e2c7ca143205fd40c7 ]
VLAN filtering can be built into the kernel, and also dynamically turned on/off through the bridge master device. Allow re-configuring the switch appropriately to account for that by deciding whether VLAN table (v_table) misses should lead to a drop or forward.
--- drivers/net/dsa/b53/b53_common.c | 59 +++++++++++++++++++++++++++++--- drivers/net/dsa/b53/b53_priv.h | 3 ++ 2 files changed, 57 insertions(+), 5 deletions(-)
drivers/net/dsa/b53/b53_common.c +54 -5
@@ -343,7 +343,8 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)b53_write8 (dev,B53_CTRL_PAGE ,B53_SWITCH_CTRL , mgmt); } -static void b53_enable_vlan (struct b53_device *dev,bool enable) +static void b53_enable_vlan (struct b53_device *dev,bool enable, +bool enable_filtering) {u8 mgmt, vc0, vc1, vc4 =0 , vc5;
@@ -368,8 +369,13 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable) vc0 |=VC0_VLAN_EN |VC0_VID_CHK_EN |VC0_VID_HASH_VID ; vc1 |=VC1_RX_MCST_UNTAG_EN |VC1_RX_MCST_FWD_EN ; vc4 &= ~VC4_ING_VID_CHECK_MASK ; - vc4 |=VC4_ING_VID_VIO_DROP <<VC4_ING_VID_CHECK_S ; - vc5 |=VC5_DROP_VTABLE_MISS ; +if (enable_filtering) { + vc4 |=VC4_ING_VID_VIO_DROP <<VC4_ING_VID_CHECK_S ; + vc5 |=VC5_DROP_VTABLE_MISS ; + }else { + vc4 |=VC4_ING_VID_VIO_FWD <<VC4_ING_VID_CHECK_S ; + vc5 &= ~VC5_DROP_VTABLE_MISS ; + }if (is5325 (dev)) vc0 &= ~VC0_RESERVED_1 ;
@@ -419,6 +425,9 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable) }b53_write8 (dev,B53_CTRL_PAGE ,B53_SWITCH_MODE , mgmt); + + dev->vlan_enabled = enable; + dev->vlan_filtering_enabled = enable_filtering; }static int b53_set_jumbo (struct b53_device *dev,bool enable,bool allow_10_100)
@@ -646,7 +655,7 @@ int b53_configure_vlan(struct dsa_switch *ds)b53_do_vlan_op (dev,VTA_CMD_CLEAR ); } -b53_enable_vlan (dev, false); +b53_enable_vlan (dev, false, dev->vlan_filtering_enabled);b53_for_each_port (dev, i) b53_write16(dev, B53_VLAN_PAGE,
@@ -1081,6 +1090,46 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,int b53_vlan_filtering (struct dsa_switch *ds,int port,bool vlan_filtering) { +struct b53_device *dev = ds->priv; +struct net_device *bridge_dev; +unsigned int i; +u16 pvid, new_pvid; + +/* Handle the case were multiple bridges span the same switch device +* and one of them has a different setting than what is being requested +* which would be breaking filtering semantics for any of the other +* bridge devices. +*/ +b53_for_each_port (dev, i) { + bridge_dev =dsa_to_port (ds, i)->bridge_dev; +if (bridge_dev && + bridge_dev !=dsa_to_port (ds, port)->bridge_dev && +br_vlan_enabled (bridge_dev) != vlan_filtering) { +netdev_err (bridge_dev, +"VLAN filtering is global to the switch!\n" ); +return -EINVAL ; + } + } + +b53_read16 (dev,B53_VLAN_PAGE ,B53_VLAN_PORT_DEF_TAG (port), &pvid); + new_pvid = pvid; +if (dev->vlan_filtering_enabled && !vlan_filtering) { +/* Filtering is currently enabled, use the default PVID since +* the bridge does not expect tagging anymore +*/ + dev->ports[port].pvid = pvid; + new_pvid =b53_default_pvid (dev); + }else if (!dev->vlan_filtering_enabled && vlan_filtering) { +/* Filtering is currently disabled, restore the previous PVID */ + new_pvid = dev->ports[port].pvid; + } + +if (pvid != new_pvid) +b53_write16 (dev,B53_VLAN_PAGE ,B53_VLAN_PORT_DEF_TAG (port), + new_pvid); + +b53_enable_vlan (dev, dev->vlan_enabled, vlan_filtering); +return 0 ; }EXPORT_SYMBOL (b53_vlan_filtering);
@@ -1096,7 +1145,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,if (vlan->vid_end > dev->num_vlans)return -ERANGE ; -b53_enable_vlan (dev, true); +b53_enable_vlan (dev, true, dev->vlan_filtering_enabled);return 0 ; }
drivers/net/dsa/b53/b53_priv.h +3 -0
@@ -73,6 +73,7 @@ enum {struct b53_port {u16 vlan_ctl_mask;struct ethtool_eee eee; +u16 pvid; };struct b53_vlan {
@@ -118,6 +119,8 @@ struct b53_device {unsigned int num_vlans;struct b53_vlan *vlans; +bool vlan_enabled; +bool vlan_filtering_enabled;unsigned int num_ports;struct b53_port *ports; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 186/671 net: dsa: b53: Do not program CPU port's PVID
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit 10163aaee9671b01b2f4737922e1a4f43581047a ]
The CPU port is special and does not need to obey VLAN restrictions as far as untagged traffic goes, also, having the CPU port be part of a particular PVID is against the idea of keeping it tagged in all VLANs.
--- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +1 -1
@@ -1175,7 +1175,7 @@ void b53_vlan_add(struct dsa_switch *ds, int port,b53_fast_age_vlan (dev, vid); } -if (pvid) { +if (pvid && !dsa_is_cpu_port (ds, port)) {b53_write16 (dev,B53_VLAN_PAGE ,B53_VLAN_PORT_DEF_TAG (port), vlan->vid_end);b53_fast_age_vlan (dev, vid);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 187/671 mt76: usb: fix possible memory leak in mt76u_buf_free
In reply to Sasha LevinFrom: Lorenzo Bianconi <[email protected]>
[ Upstream commit cb83585e1121bd6d6c039cf09fa32380bf8b6258 ]
Move q->ndesc initialization before the for loop in mt76u_alloc_rx since otherwise allocated urbs will not be freed in mt76u_buf_free Double-check scatterlist pointer in mt76u_buf_free
--- drivers/net/wireless/mediatek/mt76/usb.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +10 -4
@@ -273,10 +273,16 @@ EXPORT_SYMBOL_GPL(mt76u_buf_alloc);void mt76u_buf_free (struct mt76u_buf *buf) {struct urb *urb = buf->urb; +struct scatterlist *sg;int i; -for (i =0 ; i < urb->num_sgs; i++) -skb_free_frag (sg_virt (&urb->sg[i])); +for (i =0 ; i < urb->num_sgs; i++) { + sg = &urb->sg[i]; +if (!sg) +continue ; + +skb_free_frag (sg_virt (sg)); + }usb_free_urb (buf->urb); }EXPORT_SYMBOL_GPL (mt76u_buf_free);
@@ -478,7 +484,8 @@ static int mt76u_alloc_rx(struct mt76_dev *dev) nsgs =1 ; } -for (i =0 ; i <MT_NUM_RX_ENTRIES ; i++) { + q->ndesc =MT_NUM_RX_ENTRIES ; +for (i =0 ; i < q->ndesc; i++) { err = mt76u_buf_alloc(dev, &q->entry[i].ubuf, nsgs, q->buf_size, SKB_WITH_OVERHEAD(q->buf_size),
@@ -486,7 +493,6 @@ static int mt76u_alloc_rx(struct mt76_dev *dev)if (err <0 )return err; } - q->ndesc =MT_NUM_RX_ENTRIES ;return mt76u_submit_rx_buffers (dev); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 188/671 media: sh: migor: Include missing dma-mapping header
In reply to Sasha LevinFrom: Jacopo Mondi <[email protected]>
[ Upstream commit 5c88ee02932a964096cbbcc7c9f38b78d230bacb ]
Since the removal of the stale soc_camera headers, Migo-R board fails to build due to missing dma-mapping include directive.
Include missing dma-mapping.h header in Migo-R board file to fix the build error.
--- arch/sh/boards/mach-migor/setup.c | 1 + 1 file changed, 1 insertion(+)
arch/sh/boards/mach-migor/setup.c +1 -0
@@ -5,6 +5,7 @@* Copyright (C) 2008 Magnus Damm */ #include <linux/clkdev.h> +#include <linux/dma-mapping.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/interrupt.h>
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 189/671 vfio_pci: Enable memory accesses before calling pci_map_rom
In reply to Sasha LevinFrom: Eric Auger <[email protected]>
[ Upstream commit 0cfd027be1d6def4a462cdc180c055143af24069 ]
pci_map_rom/pci_get_rom_size() performs memory access in the ROM. In case the Memory Space accesses were disabled, readw() is likely to trigger a synchronous external abort on some platforms.
In case memory accesses were disabled, re-enable them before the call and disable them back again just after.
--- drivers/vfio/pci/vfio_pci.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/vfio/pci/vfio_pci.c +14 -5
@@ -696,6 +696,7 @@ static long vfio_pci_ioctl(void *device_data, {void __iomem *io;size_t size; +u16 orig_cmd; info.offset =VFIO_PCI_INDEX_TO_OFFSET (info.index); info.flags =0 ;
@@ -711,15 +712,23 @@ static long vfio_pci_ioctl(void *device_data,break ; } -/* Is it really there? */ +/* +* Is it really there? Enable memory decode for +* implicit access in pci_map_rom(). +*/ +pci_read_config_word (pdev,PCI_COMMAND , &orig_cmd); +pci_write_config_word (pdev,PCI_COMMAND , + orig_cmd |PCI_COMMAND_MEMORY ); + io =pci_map_rom (pdev, &size); -if (!io || !size) { +if (io) { + info.flags =VFIO_REGION_INFO_FLAG_READ ; +pci_unmap_rom (pdev, io); + }else { info.size =0 ; -break ; } -pci_unmap_rom (pdev, io); - info.flags =VFIO_REGION_INFO_FLAG_READ ; +pci_write_config_word (pdev,PCI_COMMAND , orig_cmd);break ; }case VFIO_PCI_VGA_REGION_INDEX :
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 190/671 hwmon: (pmbus/tps53679) Fix driver info initialization in probe routine
In reply to Sasha LevinFrom: Vadim Pasternak <[email protected]>
[ Upstream commit ff066653aeed8ee2d4dadb1e35774dd91ecbb19f ]
Fix tps53679_probe() by using dynamically allocated "pmbus_driver_info" structure instead of static. Usage of static structures causes overwritten of the field "vrm_version", in case the system is equipped with several tps53679 devices with the different "vrm_version". In such case the last probed device overwrites this field for all others.
--- drivers/hwmon/pmbus/tps53679.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/tps53679.c +8 -1
@@ -80,7 +80,14 @@ static struct pmbus_driver_info tps53679_info = {static int tps53679_probe (struct i2c_client *client,const struct i2c_device_id *id) { -return pmbus_do_probe (client, id, &tps53679_info); +struct pmbus_driver_info *info; + + info =devm_kmemdup (&client->dev, &tps53679_info,sizeof (*info), +GFP_KERNEL ); +if (!info) +return -ENOMEM ; + +return pmbus_do_probe (client, id, info); }static const struct i2c_device_id tps53679_id[] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 191/671 mdio_bus: Fix PTR_ERR() usage after initialization to constant
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 780feae7eb69388c8d8b661cda6706b0dc0f642b ]
Fix coccinelle warning:
./drivers/net/phy/mdio_bus.c:51:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44 ./drivers/net/phy/mdio_bus.c:52:5-12: ERROR: PTR_ERR applied after initialization to constant on line 44
fix this by using IS_ERR before PTR_ERR
--- drivers/net/phy/mdio_bus.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/phy/mdio_bus.c +6 -5
@@ -56,11 +56,12 @@ static int mdiobus_register_gpiod(struct mdio_device *mdiodev) gpiod =fwnode_get_named_gpiod (&mdiodev->dev.of_node->fwnode,"reset-gpios" ,0 ,GPIOD_OUT_LOW ,"PHY reset" ); -if (PTR_ERR (gpiod) == -ENOENT || -PTR_ERR (gpiod) == -ENOSYS ) - gpiod =NULL ; -else if (IS_ERR (gpiod)) -return PTR_ERR (gpiod); +if (IS_ERR (gpiod)) { +if (PTR_ERR (gpiod) == -ENOENT ||PTR_ERR (gpiod) == -ENOSYS ) + gpiod =NULL ; +else +return PTR_ERR (gpiod); + } mdiodev->reset = gpiod;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 192/671 KVM: PPC: Release all hardware TCE tables attached to a group
In reply to Sasha LevinFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit a67614cc05a5052b265ea48196dab2fce11f5f2e ]
The SPAPR TCE KVM device references all hardware IOMMU tables assigned to some IOMMU group to ensure that in-kernel KVM acceleration of H_PUT_TCE can work. The tables are references when an IOMMU group gets registered with the VFIO KVM device by the KVM_DEV_VFIO_GROUP_ADD ioctl; KVM_DEV_VFIO_GROUP_DEL calls into the dereferencing code
in kvm_spapr_tce_release_iommu_group() which walks through the list of LIOBNs, finds a matching IOMMU table and calls kref_put() when found.
However that code stops after the very first successful derefencing leaving other tables referenced till the SPAPR TCE KVM device is destroyed which normally happens on guest reboot or termination so if we do hotplug and unplug in a loop, we are leaking IOMMU tables here.
This removes a premature return to let kvm_spapr_tce_release_iommu_group() find and dereference all attached tables.
--- arch/powerpc/kvm/book3s_64_vio.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/kvm/book3s_64_vio.c +0 -1
@@ -133,7 +133,6 @@ extern void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,continue ;kref_put (&stit->kref, kvm_spapr_tce_liobn_put); -return ; } } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 193/671 staging: r8822be: check kzalloc return or bail
In reply to Sasha LevinFrom: Nicholas Mc Guire <[email protected]>
[ Upstream commit e4b08e16b7d9d030b6475ef48f94d734a39f3c81 ]
The kzalloc() in halmac_parse_psd_data_88xx() can fail and return NULL so check the psd_set->data after allocation and if allocation failed return HALMAC_CMD_PROCESS_ERROR.
--- .../staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c +4 -1
@@ -2466,8 +2466,11 @@ halmac_parse_psd_data_88xx(struct halmac_adapter *halmac_adapter, u8 *c2h_buf, segment_size = (u8 )PSD_DATA_GET_SEGMENT_SIZE (c2h_buf); psd_set->data_size = total_size; -if (!psd_set->data) +if (!psd_set->data) { psd_set->data =kzalloc (psd_set->data_size,GFP_KERNEL ); +if (!psd_set->data) +return HALMAC_CMD_PROCESS_ERROR ; + }if (segment_id ==0 ) psd_set->segment_size = segment_size;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 194/671 dmaengine: mv_xor: Use correct device for DMA API
In reply to Sasha LevinFrom: Robin Murphy <[email protected]>
[ Upstream commit 3e5daee5ecf314da33a890fabaa2404244cd2a36 ]
Using dma_dev->dev for mappings before it's assigned with the correct device is unlikely to work as expected, and with future dma-direct changes, passing a NULL device may end up crashing entirely. I don't know enough about this hardware or the mv_xor_prep_dma_interrupt() operation to implement the appropriate error-handling logic that would have revealed those dma_map_single() calls failing on arm64 for as long as the driver has been enabled there, but moving the assignment earlier will at least make the current code operate as intended.
--- drivers/dma/mv_xor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/mv_xor.c +1 -1
@@ -1059,6 +1059,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev, mv_chan->op_in_desc =XOR_MODE_IN_DESC ; dma_dev = &mv_chan->dmadev; + dma_dev->dev = &pdev->dev; mv_chan->xordev = xordev;/*
@@ -1091,7 +1092,6 @@ mv_xor_channel_add(struct mv_xor_device *xordev, dma_dev->device_free_chan_resources = mv_xor_free_chan_resources; dma_dev->device_tx_status = mv_xor_status; dma_dev->device_issue_pending = mv_xor_issue_pending; - dma_dev->dev = &pdev->dev;/* set prep routines based on capability */ if (dma_has_cap (DMA_INTERRUPT , dma_dev->cap_mask))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 195/671 cdc-wdm: pass return value of recover_from_urb_loss
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 0742a338f5b3446a26de551ad8273fb41b2787f2 ]
'rv' is the correct return value, pass it upstream instead of 0
--- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-wdm.c +1 -1
@@ -1107,7 +1107,7 @@ static int wdm_post_reset(struct usb_interface *intf) rv =recover_from_urb_loss (desc);mutex_unlock (&desc->wlock);mutex_unlock (&desc->rlock); -return 0 ; +return rv; }static struct usb_driver wdm_driver = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 196/671 brcmfmac: create debugfs files for bus-specific layer
In reply to Sasha LevinFrom: Arend van Spriel <[email protected]>
[ Upstream commit aaf6a5e86e36766abbeedf220462bde8031f9a72 ]
Since we moved the drivers debugfs directory under ieee80211 debugfs the debugfs entries need to be added after wiphy_register() has been called. For most part that has been done accordingly, but for the debugfs entries added by SDIO it was not and failed silently. This patch fixes that by adding a bus-layer callback for it.
--- .../net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 10 ++++++++++ .../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 + .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 12 +++++++----- 3 files changed, 18 insertions(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +10 -0
@@ -90,6 +90,7 @@ struct brcmf_bus_ops {int (*get_memdump)(struct device *dev,void *data,size_t len);int (*get_fwname)(struct device *dev,const char *ext,unsigned char *fw_name); +void (*debugfs_create)(struct device *dev); };
@@ -235,6 +236,15 @@ int brcmf_bus_get_fwname(struct brcmf_bus *bus, const char *ext,return bus->ops->get_fwname (bus->dev, ext, fw_name); } +static inline +void brcmf_bus_debugfs_create (struct brcmf_bus *bus) +{ +if (!bus->ops->debugfs_create) +return ; + +return bus->ops->debugfs_create (bus->dev); +} +/* * interface functions from common layer */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +1 -0
@@ -1105,6 +1105,7 @@ static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)brcmf_debugfs_add_entry (drvr,"revinfo" , brcmf_revinfo_read);brcmf_feat_debugfs_create (drvr);brcmf_proto_debugfs_create (drvr); +brcmf_bus_debugfs_create (bus_if);return 0 ;
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +7 -5
@@ -3131,9 +3131,12 @@ static int brcmf_debugfs_sdio_count_read(struct seq_file *seq, void *data)return 0 ; } -static void brcmf_sdio_debugfs_create (struct brcmf_sdio *bus) +static void brcmf_sdio_debugfs_create (struct device *dev) { -struct brcmf_pub *drvr = bus->sdiodev->bus_if->drvr; +struct brcmf_bus *bus_if =dev_get_drvdata (dev); +struct brcmf_pub *drvr = bus_if->drvr; +struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; +struct brcmf_sdio *bus = sdiodev->bus;struct dentry *dentry =brcmf_debugfs_get_devdir (drvr);if (IS_ERR_OR_NULL (dentry))
@@ -3153,7 +3156,7 @@ static int brcmf_sdio_checkdied(struct brcmf_sdio *bus) return 0; } -static void brcmf_sdio_debugfs_create (struct brcmf_sdio *bus) +static void brcmf_sdio_debugfs_create (struct device *dev) { }#endif /* DEBUG */
@@ -3438,8 +3441,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)if (bus->rxbuf) bus->rxblen = value; -brcmf_sdio_debugfs_create (bus); -/* the commands below use the terms tx and rx from * a device perspective, ie. bus:txglom affects the * bus transfers from device to host.
@@ -4050,6 +4051,7 @@ static const struct brcmf_bus_ops brcmf_sdio_bus_ops = { .get_ramsize = brcmf_sdio_bus_get_ramsize, .get_memdump = brcmf_sdio_bus_get_memdump, .get_fwname = brcmf_sdio_get_fwname, + .debugfs_create = brcmf_sdio_debugfs_create };#define BRCMF_SDIO_FW_CODE 0
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 197/671 regulator: pv88060: Fix array out-of-bounds access
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit 7cd415f875591bc66c5ecb49bf84ef97e80d7b0e ]
Fix off-by-one while iterating current_limits array. The valid index should be 0 ~ n_current_limits -1.
--- drivers/regulator/pv88060-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/pv88060-regulator.c +1 -1
@@ -135,7 +135,7 @@ static int pv88060_set_current_limit(struct regulator_dev *rdev, int min,int i;/* search for closest to maximum */ -for (i = info->n_current_limits; i >=0 ; i--) { +for (i = info->n_current_limits -1 ; i >=0 ; i--) {if (min <= info->current_limits[i] && max >= info->current_limits[i]) { return regmap_update_bits(rdev->regmap,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 198/671 regulator: pv88080: Fix array out-of-bounds access
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit 3c413f594c4f9df40061445667ca11a12bc8ee34 ]
Fix off-by-one while iterating current_limits array. The valid index should be 0 ~ n_current_limits -1.
--- drivers/regulator/pv88080-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/pv88080-regulator.c +1 -1
@@ -279,7 +279,7 @@ static int pv88080_set_current_limit(struct regulator_dev *rdev, int min,int i;/* search for closest to maximum */ -for (i = info->n_current_limits; i >=0 ; i--) { +for (i = info->n_current_limits -1 ; i >=0 ; i--) {if (min <= info->current_limits[i] && max >= info->current_limits[i]) { return regmap_update_bits(rdev->regmap,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 199/671 regulator: pv88090: Fix array out-of-bounds access
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit a5455c9159414748bed4678184bf69989a4f7ba3 ]
Fix off-by-one while iterating current_limits array. The valid index should be 0 ~ n_current_limits -1.
--- drivers/regulator/pv88090-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/pv88090-regulator.c +1 -1
@@ -157,7 +157,7 @@ static int pv88090_set_current_limit(struct regulator_dev *rdev, int min,int i;/* search for closest to maximum */ -for (i = info->n_current_limits; i >=0 ; i--) { +for (i = info->n_current_limits -1 ; i >=0 ; i--) {if (min <= info->current_limits[i] && max >= info->current_limits[i]) { return regmap_update_bits(rdev->regmap,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 200/671 net: dsa: qca8k: Enable delay for RGMII_ID mode
In reply to Sasha LevinFrom: Vinod Koul <[email protected]>
[ Upstream commit a968b5e9d5879f9535d6099505f9e14abcafb623 ]
RGMII_ID specifies that we should have internal delay, so resurrect the delay addition routine but under the RGMII_ID mode.
--- drivers/net/dsa/qca8k.c | 12 ++++++++++++ drivers/net/dsa/qca8k.h | 1 + 2 files changed, 13 insertions(+)
drivers/net/dsa/qca8k.c +12 -0
@@ -451,6 +451,18 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode)qca8k_write (priv,QCA8K_REG_PORT5_PAD_CTRL ,QCA8K_PORT_PAD_RGMII_RX_DELAY_EN );break ; +case PHY_INTERFACE_MODE_RGMII_ID : +/* RGMII_ID needs internal delay. This is enabled through +* PORT5_PAD_CTRL for all ports, rather than individual port +* registers +*/ +qca8k_write (priv, reg, +QCA8K_PORT_PAD_RGMII_EN | +QCA8K_PORT_PAD_RGMII_TX_DELAY (QCA8K_MAX_DELAY ) | +QCA8K_PORT_PAD_RGMII_RX_DELAY (QCA8K_MAX_DELAY )); +qca8k_write (priv,QCA8K_REG_PORT5_PAD_CTRL , +QCA8K_PORT_PAD_RGMII_RX_DELAY_EN ); +break ;case PHY_INTERFACE_MODE_SGMII :qca8k_write (priv, reg,QCA8K_PORT_PAD_SGMII_EN );break ;
drivers/net/dsa/qca8k.h +1 -0
@@ -40,6 +40,7 @@ ((0x8 + (x & 0x3)) << 22)#define QCA8K_PORT_PAD_RGMII_RX_DELAY (x) \ ((0x10 + (x & 0x3)) << 20) +#define QCA8K_MAX_DELAY 3#define QCA8K_PORT_PAD_RGMII_RX_DELAY_EN BIT(24)#define QCA8K_PORT_PAD_SGMII_EN BIT(7)#define QCA8K_REG_MODULE_EN 0x030
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 201/671 net/mlx5: Delete unused FPGA QPN variable
In reply to Sasha LevinFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 566428375a53619196e31803130dd1a7010c4d7f ]
fpga_qpn was assigned but never used and compilation with W=1 produced the following warning:
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c: In function _mlx5_fpga_event_:drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c:320:6: warning:
variable _fpga_qpn_ set but not used [-Wunused-but-set-variable]
u32 fpga_qpn;
^~~~~~~~--- drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +0 -2
@@ -289,7 +289,6 @@ void mlx5_fpga_event(struct mlx5_core_dev *mdev, u8 event, void *data)const char *event_name;bool teardown = false;unsigned long flags; -u32 fpga_qpn;u8 syndrome;switch (event) {
@@ -300,7 +299,6 @@ void mlx5_fpga_event(struct mlx5_core_dev *mdev, u8 event, void *data)case MLX5_EVENT_TYPE_FPGA_QP_ERROR : syndrome =MLX5_GET (fpga_qp_error_event, data, syndrome); event_name =mlx5_fpga_qp_syndrome_to_string (syndrome); - fpga_qpn =MLX5_GET (fpga_qp_error_event, data, fpga_qpn);break ;default : mlx5_fpga_warn_ratelimited(fdev, "Unexpected event %u\n",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 202/671 drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit 13649101a25c53c87f4ab98a076dfe61f3636ab1 ]
Currently, the expression for calculating RON is always going to result in zero no matter the value of ram->mr[1] because the ! operator has higher precedence than the shift >> operator. I believe the missing parentheses around the expression before appying the ! operator will result in the desired result.
[ Note, not tested ]
Detected by CoveritScan, CID#1324005 ("Operands don't affect result")
--- drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c +1 -1
@@ -87,7 +87,7 @@ nvkm_gddr3_calc(struct nvkm_ram *ram)WR = (ram->next->bios.timing[2 ] &0x007f0000 ) >>16 ;/* XXX: Get these values from the VBIOS instead */ DLL = !(ram->mr[1 ] &0x1 ); -RON = !(ram->mr[1 ] &0x300 ) >>8 ; +RON = !((ram->mr[1 ] &0x300 ) >>8 );break ;default :return -ENOSYS ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 203/671 drm/nouveau/pmu: don't print reply values if exec is false
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit b1d03fc36ec9834465a08c275c8d563e07f6f6bf ]
Currently the uninitialized values in the array reply are printed out when exec is false and nvkm_pmu_send has not updated the array. Avoid confusion by only dumping out these values if they have been actually updated.
Detected by CoverityScan, CID#1271291 ("Uninitialized scaler variable")
--- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c +2 -2
@@ -88,10 +88,10 @@ nvkm_memx_fini(struct nvkm_memx **pmemx, bool exec)if (exec) {nvkm_pmu_send (pmu, reply,PROC_MEMX ,MEMX_MSG_EXEC , memx->base, finish); +nvkm_debug (subdev,"Exec took %uns, PMU_IN %08x\n" , + reply[0 ], reply[1 ]); } -nvkm_debug (subdev,"Exec took %uns, PMU_IN %08x\n" , - reply[0 ], reply[1 ]);kfree (memx);return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 204/671 drm/nouveau: fix missing break in switch statement
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit 785cf1eeafa23ec63f426d322401054d13abe2a3 ]
The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up re-assigning the getparam->value to an undesired value. Fix this by adding in the missing break.
Detected by CoverityScan, CID#1460507 ("Missing break in switch")
--- drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +1 -0
@@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)WARN_ON (1 );break ; } +break ;case NOUVEAU_GETPARAM_FB_SIZE : getparam->value = drm->gem.vram_available;break ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 205/671 driver core: Fix PM-runtime for links added during consumer probe
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 36003d4cf57ca431fb3f94d317bcca426a2394d6 ]
Commit 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter imbalance") introduced a regression that causes suppliers to be suspended prematurely for device links added during consumer driver probe if the initial PM-runtime status of the consumer is "suspended" and the consumer is resumed after adding the link and before pm_runtime_put_suppliers() is called. In that case, pm_runtime_put_suppliers() will drop the rpm_active refcount for the link by one and (since rpm_active is equal to two after the preceding consumer resume) the supplier's PM-runtime usage counter will be decremented, which may cause the supplier to suspend even though the consumer's PM-runtime status is "active".
For this reason, partially revert commit 4c06c4e6cf63 as the problem it tried to fix needs to be addressed somewhat differently, and change pm_runtime_get_suppliers() and pm_runtime_put_suppliers() so that the latter only drops rpm_active references acquired by the former. [This requires adding a new field to struct device_link, but I coulnd't find a cleaner way to address the issue that would work in all cases.]
This causes pm_runtime_put_suppliers() to effectively ignore device links added during consumer probe, so device_link_add() doesn't need to worry about ensuring that suppliers will remain active after pm_runtime_put_suppliers() for links created with DL_FLAG_RPM_ACTIVE set and it only needs to bump up rpm_active by one for those links, so pm_runtime_active_link() is not necessary any more.
--- drivers/base/core.c | 4 ++-- drivers/base/power/runtime.c | 29 ++++++----------------------- include/linux/device.h | 1 + include/linux/pm_runtime.h | 4 ---- 4 files changed, 9 insertions(+), 29 deletions(-)
drivers/base/core.c +2 -2
@@ -253,7 +253,7 @@ struct device_link *device_link_add(struct device *consumer, link->flags |=DL_FLAG_PM_RUNTIME ; }if (flags &DL_FLAG_RPM_ACTIVE ) -pm_runtime_active_link (link, supplier); +refcount_inc (&link->rpm_active); }kref_get (&link->kref);
@@ -268,7 +268,7 @@ struct device_link *device_link_add(struct device *consumer,if (flags &DL_FLAG_PM_RUNTIME ) {if (flags &DL_FLAG_RPM_ACTIVE ) -pm_runtime_active_link (link, supplier); +refcount_inc (&link->rpm_active);pm_runtime_new_link (consumer); }
drivers/base/power/runtime.c +6 -23
@@ -1571,6 +1571,7 @@ void pm_runtime_get_suppliers(struct device *dev)list_for_each_entry_rcu (link, &dev->links.suppliers, c_node)if (link->flags &DL_FLAG_PM_RUNTIME ) { + link->supplier_preactivated = true;refcount_inc (&link->rpm_active);pm_runtime_get_sync (link->supplier); }
@@ -1590,9 +1591,11 @@ void pm_runtime_put_suppliers(struct device *dev) idx =device_links_read_lock ();list_for_each_entry_rcu (link, &dev->links.suppliers, c_node) -if (link->flags &DL_FLAG_PM_RUNTIME && -refcount_dec_not_one (&link->rpm_active)) -pm_runtime_put (link->supplier); +if (link->supplier_preactivated) { + link->supplier_preactivated = false; +if (refcount_dec_not_one (&link->rpm_active)) +pm_runtime_put (link->supplier); + }device_links_read_unlock (idx); }
@@ -1604,26 +1607,6 @@ void pm_runtime_new_link(struct device *dev)spin_unlock_irq (&dev->power.lock); } -/** -* pm_runtime_active_link - Set up new device link as active for PM-runtime. -* @link: Device link to be set up as active. -* @supplier: Supplier end of the link. -* -* Add 2 to the rpm_active refcount of @link and increment the PM-runtime -* usage counter of @supplier once more in case the link is being added while -* the consumer driver is probing and pm_runtime_put_suppliers() will be called -* subsequently. -* -* Note that this doesn't prevent rpm_put_suppliers() from decreasing the link's -* rpm_active refcount down to one, so runtime suspend of the consumer end of -* @link is not affected. -*/ -void pm_runtime_active_link (struct device_link *link,struct device *supplier) -{ -refcount_add (2 , &link->rpm_active); -pm_runtime_get_noresume (supplier); -} -void pm_runtime_drop_link (struct device *dev) {spin_lock_irq (&dev->power.lock);
include/linux/device.h +1 -0
@@ -854,6 +854,7 @@ struct device_link {#ifdef CONFIG_SRCU struct rcu_head rcu_head;#endif +bool supplier_preactivated;/* Owned by consumer probe. */ };/**
include/linux/pm_runtime.h +0 -4
@@ -59,8 +59,6 @@ extern void pm_runtime_clean_up_links(struct device *dev);extern void pm_runtime_get_suppliers (struct device *dev);extern void pm_runtime_put_suppliers (struct device *dev);extern void pm_runtime_new_link (struct device *dev); -extern void pm_runtime_active_link (struct device_link *link, -struct device *supplier);extern void pm_runtime_drop_link (struct device *dev);static inline void pm_suspend_ignore_children (struct device *dev,bool enable)
@@ -178,8 +176,6 @@ static inline void pm_runtime_clean_up_links(struct device *dev) {}static inline void pm_runtime_get_suppliers (struct device *dev) {}static inline void pm_runtime_put_suppliers (struct device *dev) {}static inline void pm_runtime_new_link (struct device *dev) {} -static inline void pm_runtime_active_link (struct device_link *link, -struct device *supplier) {}static inline void pm_runtime_drop_link (struct device *dev) {}#endif /* !CONFIG_PM */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 206/671 ASoC: qcom: Fix of-node refcount unbalance in apq8016_sbc_parse_of()
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 8d1667200850f8753c0265fa4bd25c9a6e5f94ce ]
The apq8016 driver leaves the of-node refcount at aborting from the loop of for_each_child_of_node() in the error path. Not only the iterator node of for_each_child_of_node(), the children nodes referred from it for codec and cpu have to be properly unreferenced.
--- sound/soc/qcom/apq8016_sbc.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
sound/soc/qcom/apq8016_sbc.c +16 -5
@@ -164,41 +164,52 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)if (!cpu || !codec) {dev_err (dev,"Can't find cpu/codec DT node\n" ); -return ERR_PTR (-EINVAL ); + ret = -EINVAL ; + goto error; } link->cpu_of_node =of_parse_phandle (cpu,"sound-dai" ,0 );if (!link->cpu_of_node) {dev_err (card->dev,"error getting cpu phandle\n" ); -return ERR_PTR (-EINVAL ); + ret = -EINVAL ; + goto error; } ret =snd_soc_of_get_dai_name (cpu, &link->cpu_dai_name);if (ret) {dev_err (card->dev,"error getting cpu dai name\n" ); -return ERR_PTR (ret); + goto error; } ret =snd_soc_of_get_dai_link_codecs (dev, codec, link);if (ret <0 ) {dev_err (card->dev,"error getting codec dai name\n" ); -return ERR_PTR (ret); + goto error; } link->platform_of_node = link->cpu_of_node; ret =of_property_read_string (np,"link-name" , &link->name);if (ret) {dev_err (card->dev,"error getting codec dai_link name\n" ); -return ERR_PTR (ret); + goto error; } link->stream_name = link->name; link->init = apq8016_sbc_dai_init; link++; + +of_node_put (cpu); +of_node_put (codec); }return data; + + error: +of_node_put (np); +of_node_put (cpu); +of_node_put (codec); +return ERR_PTR (ret); }static const struct snd_soc_dapm_widget apq8016_sbc_dapm_widgets[] = {
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 207/671 net: dsa: fix unintended change of bridge interface STP state
In reply to Sasha LevinFrom: Russell King <[email protected]>
[ Upstream commit 9c2054a5cf415a9dc32c91ffde78399955deb571 ]
When a DSA port is added to a bridge and brought up, the resulting STP state programmed into the hardware depends on the order that these operations are performed. However, the Linux bridge code believes that the port is in disabled mode.
If the DSA port is first added to a bridge and then brought up, it will be in blocking mode. If it is brought up and then added to the bridge, it will be in disabled mode.
This difference is caused by DSA always setting the STP mode in dsa_port_enable() whether or not this port is part of a bridge. Since bridge always sets the STP state when the port is added, brought up or taken down, it is unnecessary for us to manipulate the STP state.
Apparently, this code was copied from Rocker, and the very next day a similar fix for Rocker was merged but was not propagated to DSA. See e47172ab7e41 ("rocker: put port in FORWADING state after leaving bridge")
--- net/dsa/port.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/dsa/port.c +4 -3
@@ -69,7 +69,6 @@ static void dsa_port_set_state_now(struct dsa_port *dp, u8 state)int dsa_port_enable (struct dsa_port *dp,struct phy_device *phy) { -u8 stp_state = dp->bridge_dev ?BR_STATE_BLOCKING :BR_STATE_FORWARDING ;struct dsa_switch *ds = dp->ds;int port = dp->index;int err;
@@ -80,7 +79,8 @@ int dsa_port_enable(struct dsa_port *dp, struct phy_device *phy)return err; } -dsa_port_set_state_now (dp, stp_state); +if (!dp->bridge_dev) +dsa_port_set_state_now (dp,BR_STATE_FORWARDING );return 0 ; }
@@ -90,7 +90,8 @@ void dsa_port_disable(struct dsa_port *dp, struct phy_device *phy)struct dsa_switch *ds = dp->ds;int port = dp->index; -dsa_port_set_state_now (dp,BR_STATE_DISABLED ); +if (!dp->bridge_dev) +dsa_port_set_state_now (dp,BR_STATE_DISABLED );if (ds->ops->port_disable) ds->ops->port_disable (ds, port, phy);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 208/671 fs/nfs: Fix nfs_parse_devname to not modify it's argument
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit 40cc394be1aa18848b8757e03bd8ed23281f572e ]
In the rare and unsupported case of a hostname list nfs_parse_devname will modify dev_name. There is no need to modify dev_name as the all that is being computed is the length of the hostname, so the computed length can just be shorted.
--- fs/nfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/super.c +1 -1
@@ -1930,7 +1930,7 @@ static int nfs_parse_devname(const char *dev_name,/* kill possible hostname list: not supported */ comma =strchr (dev_name,',' );if (comma !=NULL && comma < end) - *comma =0 ; + len = comma - dev_name; }if (len > maxnamlen)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 209/671 staging: rtlwifi: Use proper enum for return in halmac_parse_psd_data_88xx
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit e8edc32d70a4e09160835792eb5d1af71a0eec14 ]
Clang warns:
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c:2472:11:
warning: implicit conversion from enumeration type 'enum halmac_cmd_process_status' to different enumeration type 'enum halmac_ret_status' [-Wenum-conversion]
return HALMAC_CMD_PROCESS_ERROR;
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~1 warning generated.
Fix this by using the proper enum for allocation failures, HALMAC_RET_MALLOC_FAIL, which is used in the rest of this file.
--- drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c +1 -1
@@ -2469,7 +2469,7 @@ halmac_parse_psd_data_88xx(struct halmac_adapter *halmac_adapter, u8 *c2h_buf,if (!psd_set->data) { psd_set->data =kzalloc (psd_set->data_size,GFP_KERNEL );if (!psd_set->data) -return HALMAC_CMD_PROCESS_ERROR ; +return HALMAC_RET_MALLOC_FAIL ; }if (segment_id ==0 )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 210/671 powerpc/64s: Fix logic when handling unknown CPU features
In reply to Sasha LevinFrom: Michael Ellerman <[email protected]>
[ Upstream commit 8cfaf106918a8c13abb24c641556172afbb9545c ]
In cpufeatures_process_feature(), if a provided CPU feature is unknown and enable_unknown is false, we erroneously print that the feature is being enabled and return true, even though no feature has been enabled, and may also set feature bits based on the last entry in the match table.
Fix this so that we only set feature bits from the match table if we have actually enabled a feature from that table, and when failing to enable an unknown feature, always print the "not enabling" message and return false.
Coincidentally, some older gccs (<GCC 7), when invoked with -fsanitize-coverage=trace-pc, cause a spurious uninitialised variable warning in this function:
arch/powerpc/kernel/dt_cpu_ftrs.c: In function ‘cpufeatures_process_feature’:
arch/powerpc/kernel/dt_cpu_ftrs.c:686:7: warning: ‘m’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (m->cpu_ftr_bit_mask)
An upcoming patch will enable support for kcov, which requires this option. This patch avoids the warning.
--- arch/powerpc/kernel/dt_cpu_ftrs.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
arch/powerpc/kernel/dt_cpu_ftrs.c +7 -10
@@ -666,8 +666,10 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f) m = &dt_cpu_feature_match_table[i];if (!strcmp (f->name, m->name)) { known = true; -if (m->enable (f)) +if (m->enable (f)) { + cur_cpu_spec->cpu_features |= m->cpu_ftr_bit_mask;break ; + }pr_info ("not enabling: %s (disabled or unsupported by kernel)\n" , f->name);
@@ -675,17 +677,12 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f) } } -if (!known && enable_unknown) { -if (!feat_try_enable_unknown (f)) { -pr_info ("not enabling: %s (unknown and unsupported by kernel)\n" , - f->name); -return false; - } +if (!known && (!enable_unknown || !feat_try_enable_unknown (f))) { +pr_info ("not enabling: %s (unknown and unsupported by kernel)\n" , + f->name); +return false; } -if (m->cpu_ftr_bit_mask) - cur_cpu_spec->cpu_features |= m->cpu_ftr_bit_mask; -if (known)pr_debug ("enabling: %s\n" , f->name);else
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 211/671 NFS: Fix a soft lockup in the delegation recovery code
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 6f9449be53f3ce383caed797708b332ede8d952c ]
Fix a soft lockup when NFS client delegation recovery is attempted but the inode is in the process of being freed. When the igrab(inode) call fails, and we have to restart the recovery process, we need to ensure that we won't attempt to recover the same delegation again.
--- fs/nfs/delegation.c | 20 ++++++++++++-------- fs/nfs/delegation.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-)
fs/nfs/delegation.c +12 -8
@@ -240,6 +240,8 @@ static struct inode *nfs_delegation_grab_inode(struct nfs_delegation *delegationspin_lock (&delegation->lock);if (delegation->inode !=NULL ) inode =igrab (delegation->inode); +if (!inode) +set_bit (NFS_DELEGATION_INODE_FREEING , &delegation->flags);spin_unlock (&delegation->lock);return inode; }
@@ -955,10 +957,11 @@ void nfs_delegation_reap_unclaimed(struct nfs_client *clp)list_for_each_entry_rcu (server, &clp->cl_superblocks, client_link) {list_for_each_entry_rcu (delegation, &server->delegations, super_list) { -if (test_bit (NFS_DELEGATION_RETURNING , - &delegation->flags)) -continue ; -if (test_bit (NFS_DELEGATION_NEED_RECLAIM , +if (test_bit (NFS_DELEGATION_INODE_FREEING , + &delegation->flags) || +test_bit (NFS_DELEGATION_RETURNING , + &delegation->flags) || +test_bit (NFS_DELEGATION_NEED_RECLAIM , &delegation->flags) ==0 )continue ;if (!nfs_sb_active (server->super))
@@ -1064,10 +1067,11 @@ void nfs_reap_expired_delegations(struct nfs_client *clp)list_for_each_entry_rcu (server, &clp->cl_superblocks, client_link) {list_for_each_entry_rcu (delegation, &server->delegations, super_list) { -if (test_bit (NFS_DELEGATION_RETURNING , - &delegation->flags)) -continue ; -if (test_bit (NFS_DELEGATION_TEST_EXPIRED , +if (test_bit (NFS_DELEGATION_INODE_FREEING , + &delegation->flags) || +test_bit (NFS_DELEGATION_RETURNING , + &delegation->flags) || +test_bit (NFS_DELEGATION_TEST_EXPIRED , &delegation->flags) ==0 )continue ;if (!nfs_sb_active (server->super))
fs/nfs/delegation.h +1 -0
@@ -34,6 +34,7 @@ enum {NFS_DELEGATION_RETURNING ,NFS_DELEGATION_REVOKED ,NFS_DELEGATION_TEST_EXPIRED , + NFS_DELEGATION_INODE_FREEING, }; int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 212/671 perf: Copy parent's address filter offsets on clone
In reply to Sasha LevinFrom: Alexander Shishkin <[email protected]>
[ Upstream commit 18736eef12137c59f60cc9f56dc5bea05c92e0eb ]
When a child event is allocated in the inherit_event() path, the VMA based filter offsets are not copied from the parent, even though the address space mapping of the new task remains the same, which leads to no trace for the new task until exec.
--- kernel/events/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
kernel/events/core.c +15 -0
@@ -1254,6 +1254,7 @@ static void put_ctx(struct perf_event_context *ctx)* perf_event_context::lock * perf_event::mmap_mutex * mmap_sem +* perf_addr_filters_head::lock * * cpu_hotplug_lock * pmus_lock
@@ -10136,6 +10137,20 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, goto err_per_task; } +/* +* Clone the parent's vma offsets: they are valid until exec() +* even if the mm is not shared with the parent. +*/ +if (event->parent) { +struct perf_addr_filters_head *ifh =perf_event_addr_filters (event); + +raw_spin_lock_irq (&ifh->lock); +memcpy (event->addr_filters_offs, + event->parent->addr_filters_offs, + pmu->nr_addr_filters *sizeof (unsigned long )); +raw_spin_unlock_irq (&ifh->lock); + } +/* force hw sync on the address filters */ event->addr_filters_gen =1 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 213/671 perf, pt, coresight: Fix address filters for vmas with non-zero offset
In reply to Sasha LevinFrom: Alexander Shishkin <[email protected]>
[ Upstream commit c60f83b813e5b25ccd5de7e8c8925c31b3aebcc1 ]
Currently, the address range calculation for file-based filters works as long as the vma that maps the matching part of the object file starts from offset zero into the file (vm_pgoff==0). Otherwise, the resulting filter range would be off by vm_pgoff pages. Another related problem is that in case of a partially matching vma, that is, a vma that matches part of a filter region, the filter range size wouldn't be adjusted.
Fix the arithmetics around address filter range calculations, taking into account vma offset, so that the entire calculation is done before the filter configuration is passed to the PMU drivers instead of having those drivers do the final bit of arithmetics.
Based on the patch by Adrian Hunter <adrian.hunter.intel.com>.
--- arch/x86/events/intel/pt.c | 9 ++- .../hwtracing/coresight/coresight-etm-perf.c | 7 +- include/linux/perf_event.h | 7 +- kernel/events/core.c | 81 +++++++++++-------- 4 files changed, 62 insertions(+), 42 deletions(-)
arch/x86/events/intel/pt.c +5 -4
@@ -1213,7 +1213,8 @@ static int pt_event_addr_filters_validate(struct list_head *filters)static void pt_event_addr_filters_sync (struct perf_event *event) {struct perf_addr_filters_head *head =perf_event_addr_filters (event); -unsigned long msr_a, msr_b, *offs = event->addr_filters_offs; +unsigned long msr_a, msr_b; +struct perf_addr_filter_range *fr = event->addr_filter_ranges;struct pt_filters *filters = event->hw.addr_filters;struct perf_addr_filter *filter;int range =0 ;
@@ -1222,12 +1223,12 @@ static void pt_event_addr_filters_sync(struct perf_event *event)return ;list_for_each_entry (filter, &head->list, entry) { -if (filter->path.dentry && !offs[range]) { +if (filter->path.dentry && !fr[range].start) { msr_a = msr_b =0 ; }else {/* apply the offset */ - msr_a = filter->offset + offs[range]; - msr_b = filter->size + msr_a -1 ; + msr_a = fr[range].start; + msr_b = msr_a + fr[range].size -1 ; } filters->filter[range].msr_a = msr_a;
drivers/hwtracing/coresight/coresight-etm-perf.c +4 -3
@@ -437,15 +437,16 @@ static int etm_addr_filters_validate(struct list_head *filters)static void etm_addr_filters_sync (struct perf_event *event) {struct perf_addr_filters_head *head =perf_event_addr_filters (event); -unsigned long start, stop, *offs = event->addr_filters_offs; +unsigned long start, stop; +struct perf_addr_filter_range *fr = event->addr_filter_ranges;struct etm_filters *filters = event->hw.addr_filters;struct etm_filter *etm_filter;struct perf_addr_filter *filter;int i =0 ;list_for_each_entry (filter, &head->list, entry) { - start = filter->offset + offs[i]; - stop = start + filter->size; + start = fr[i].start; + stop = start + fr[i].size; etm_filter = &filters->etm_filter[i];switch (filter->action) {
include/linux/perf_event.h +6 -1
@@ -494,6 +494,11 @@ struct perf_addr_filters_head {unsigned int nr_file_filters; }; +struct perf_addr_filter_range { +unsigned long start; +unsigned long size; +}; +/** * enum perf_event_state - the states of an event: */
@@ -670,7 +675,7 @@ struct perf_event {/* address range filters */ struct perf_addr_filters_head addr_filters;/* vma address array for file-based filders */ -unsigned long *addr_filters_offs; +struct perf_addr_filter_range *addr_filter_ranges;unsigned long addr_filters_gen;void (*destroy)(struct perf_event *);
kernel/events/core.c +47 -34
163 lines not on this page · raw message
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 214/671 clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit e7e7e0d7beafebd11b0c065cd5fbc1e5759c5aab ]
If the clock tree is not fully populated when the timer-sun5i init code is called, attempts to get the clock rate for the timer would fail and return 0.
Make the init code for both clock events and clocksource check the returned clock rate and fail gracefully if the result is 0, instead of causing a divide by 0 exception later on.
--- drivers/clocksource/timer-sun5i.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/clocksource/timer-sun5i.c +10 -0
@@ -202,6 +202,11 @@ static int __init sun5i_setup_clocksource(struct device_node *node, } rate =clk_get_rate (clk); +if (!rate) { +pr_err ("Couldn't get parent clock rate\n" ); + ret = -EINVAL ; + goto err_disable_clk; + } cs->timer.base = base; cs->timer.clk = clk;
@@ -275,6 +280,11 @@ static int __init sun5i_setup_clockevent(struct device_node *node, void __iomem } rate =clk_get_rate (clk); +if (!rate) { +pr_err ("Couldn't get parent clock rate\n" ); + ret = -EINVAL ; + goto err_disable_clk; + } ce->timer.base = base; ce->timer.ticks_per_jiffy =DIV_ROUND_UP (rate,HZ );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 215/671 clocksource/drivers/exynos_mct: Fix error path in timer resources initialization
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit b9307420196009cdf18bad55e762ac49fb9a80f4 ]
While freeing interrupt handlers in error path, don't assume that all requested interrupts are per-processor interrupts and properly release standard interrupts too.
--- drivers/clocksource/exynos_mct.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/clocksource/exynos_mct.c +13 -1
@@ -563,7 +563,19 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem *return 0 ; out_irq: -free_percpu_irq (mct_irqs[MCT_L0_IRQ ], &percpu_mct_tick); +if (mct_int_type ==MCT_INT_PPI ) { +free_percpu_irq (mct_irqs[MCT_L0_IRQ ], &percpu_mct_tick); + }else { +for_each_possible_cpu (cpu) { +struct mct_clock_event_device *pcpu_mevt = +per_cpu_ptr (&percpu_mct_tick, cpu); + +if (pcpu_mevt->evt.irq !=-1 ) { +free_irq (pcpu_mevt->evt.irq, pcpu_mevt); + pcpu_mevt->evt.irq =-1 ; + } + } + }return err; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 216/671 platform/x86: wmi: fix potential null pointer dereference
In reply to Sasha LevinFrom: Mattias Jacobsson <[email protected]>
[ Upstream commit c355ec651a8941864549f2586f969d0eb7bf499a ]
In the function wmi_dev_match() the variable id is dereferenced without first performing a NULL check. The variable can for example be NULL if a WMI driver is registered without specifying the id_table field in struct wmi_driver.
Add a NULL check and return that the driver can't handle the device if the variable is NULL.
--- drivers/platform/x86/wmi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/x86/wmi.c +3 -0
@@ -768,6 +768,9 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver)struct wmi_block *wblock =dev_to_wblock (dev);const struct wmi_device_id *id = wmi_driver->id_table; +if (id ==NULL ) +return 0 ; +while (id->guid_string) {uuid_le driver_guid;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 217/671 NFS/pnfs: Bulk destroy of layouts needs to be safe w.r.t. umount
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 5085607d209102b37b169bc94d0aa39566a9842a ]
If a bulk layout recall or a metadata server reboot coincides with a umount, then holding a reference to an inode is unsafe unless we also hold a reference to the super block.
--- fs/nfs/pnfs.c | 33 +++++++++++++++++++++++---------- fs/nfs/pnfs.h | 1 + 2 files changed, 24 insertions(+), 10 deletions(-)
fs/nfs/pnfs.c +23 -10
@@ -758,22 +758,35 @@ static int pnfs_layout_bulk_destroy_byserver_locked(struct nfs_client *clp, struct nfs_server *server, struct list_head *layout_list) + __must_hold(&clp->cl_lock) + __must_hold(RCU) { struct pnfs_layout_hdr *lo, *next;struct inode *inode;list_for_each_entry_safe (lo, next, &server->layouts, plh_layouts) { -if (test_bit (NFS_LAYOUT_INVALID_STID , &lo->plh_flags)) +if (test_bit (NFS_LAYOUT_INVALID_STID , &lo->plh_flags) || +test_bit (NFS_LAYOUT_INODE_FREEING , &lo->plh_flags) || + !list_empty (&lo->plh_bulk_destroy))continue ; +/* If the sb is being destroyed, just bail */ +if (!nfs_sb_active (server->super)) +break ; inode =igrab (lo->plh_inode); -if (inode ==NULL ) -continue ; -list_del_init (&lo->plh_layouts); -if (pnfs_layout_add_bulk_destroy_list (inode, layout_list)) -continue ; -rcu_read_unlock (); -spin_unlock (&clp->cl_lock); -iput (inode); +if (inode !=NULL ) { +list_del_init (&lo->plh_layouts); +if (pnfs_layout_add_bulk_destroy_list (inode, + layout_list)) +continue ; +rcu_read_unlock (); +spin_unlock (&clp->cl_lock); +iput (inode); + }else { +rcu_read_unlock (); +spin_unlock (&clp->cl_lock); +set_bit (NFS_LAYOUT_INODE_FREEING , &lo->plh_flags); + } +nfs_sb_deactive (server->super);spin_lock (&clp->cl_lock);rcu_read_lock ();return -EAGAIN ;
@@ -811,7 +824,7 @@ pnfs_layout_free_bulk_destroy_list(struct list_head *layout_list,/* Free all lsegs that are attached to commit buckets */ nfs_commit_inode (inode,0 );pnfs_put_layout_hdr (lo); -iput (inode); +nfs_iput_and_deactive (inode); }return ret; }
fs/nfs/pnfs.h +1 -0
@@ -104,6 +104,7 @@ enum {NFS_LAYOUT_RETURN_REQUESTED ,/* Return this layout ASAP */ NFS_LAYOUT_INVALID_STID ,/* layout stateid id is invalid */ NFS_LAYOUT_FIRST_LAYOUTGET ,/* Serialize first layoutget */ + NFS_LAYOUT_INODE_FREEING, /* The inode is being freed */ }; enum layoutdriver_policy_flags {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 218/671 mmc: sdhci-brcmstb: handle mmc_of_parse() errors during probe
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit 1e20186e706da8446f9435f2924cd65ab1397e73 ]
We need to handle mmc_of_parse() errors during probe otherwise the MMC driver could start without proper initialization (e.g. power sequence).
--- drivers/mmc/host/sdhci-brcmstb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-brcmstb.c +3 -1
@@ -55,7 +55,9 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev) }sdhci_get_of_property (pdev); -mmc_of_parse (host->mmc); + res =mmc_of_parse (host->mmc); +if (res) + goto err;/* * Supply the existing CAPS, but clear the UHS modes. This
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 219/671 iommu: Fix IOMMU debugfs fallout
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 18b3af4492a0aa6046b86d712f6ba4cbb66100fb ]
A change made in the final version of IOMMU debugfs support replaced the public function iommu_debugfs_new_driver_dir() by the public dentry iommu_debugfs_dir in <linux/iommu.h>, but forgot to update both the implementation in iommu-debugfs.c, and the patch description.
Fix this by exporting iommu_debugfs_dir, and removing the reference to and implementation of iommu_debugfs_new_driver_dir().
--- drivers/iommu/iommu-debugfs.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-)
drivers/iommu/iommu-debugfs.c +4 -19
@@ -12,6 +12,7 @@#include <linux/debugfs.h> struct dentry *iommu_debugfs_dir; +EXPORT_SYMBOL_GPL (iommu_debugfs_dir);/** * iommu_debugfs_setup - create the top-level iommu directory in debugfs
@@ -23,9 +24,9 @@ struct dentry *iommu_debugfs_dir;* Emit a strong warning at boot time to indicate that this feature is * enabled. * -* This function is called from iommu_init; drivers may then call -* iommu_debugfs_new_driver_dir() to instantiate a vendor-specific -* directory to be used to expose internal data. +* This function is called from iommu_init; drivers may then use +* iommu_debugfs_dir to instantiate a vendor-specific directory to be used +* to expose internal data. */ void iommu_debugfs_setup (void ) {
@@ -48,19 +49,3 @@ void iommu_debugfs_setup(void)pr_warn ("*************************************************************\n" ); } } - -/** -* iommu_debugfs_new_driver_dir - create a vendor directory under debugfs/iommu -* @vendor: name of the vendor-specific subdirectory to create -* -* This function is called by an IOMMU driver to create the top-level debugfs -* directory for that driver. -* -* Return: upon success, a pointer to the dentry for the new directory. -* NULL in case of failure. -*/ -struct dentry *iommu_debugfs_new_driver_dir (const char *vendor) -{ -return debugfs_create_dir (vendor, iommu_debugfs_dir); -} -EXPORT_SYMBOL_GPL (iommu_debugfs_new_driver_dir);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 220/671 ARM: 8847/1: pm: fix HYP/SVC mode mismatch when MCPM is used
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit ca70ea43f80c98582f5ffbbd1e6f4da2742da0c4 ]
MCPM does a soft reset of the CPUs and uses common cpu_resume() routine to perform low-level platform initialization. This results in a try to install HYP stubs for the second time for each CPU and results in false HYP/SVC mode mismatch detection. The HYP stubs are already installed at the beginning of the kernel initialization on the boot CPU (head.S) or in the secondary_startup() for other CPUs. To fix this issue MCPM code should use a cpu_resume() routine without HYP stubs installation.
This change fixes HYP/SVC mode mismatch on Samsung Exynos5422-based Odroid XU3/XU4/HC1 boards.
--- arch/arm/common/mcpm_entry.c | 2 +- arch/arm/include/asm/suspend.h | 1 + arch/arm/kernel/sleep.S | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/common/mcpm_entry.c +1 -1
@@ -381,7 +381,7 @@ static int __init nocache_trampoline(unsigned long _arg)unsigned int cluster =MPIDR_AFFINITY_LEVEL (mpidr,1 );phys_reset_t phys_reset; -mcpm_set_entry_vector (cpu, cluster, cpu_resume); +mcpm_set_entry_vector (cpu, cluster, cpu_resume_no_hyp);setup_mm_for_reboot ();__mcpm_cpu_going_down (cpu, cluster);
arch/arm/include/asm/suspend.h +1 -0
@@ -10,6 +10,7 @@ struct sleep_save_sp { };extern void cpu_resume (void ); +extern void cpu_resume_no_hyp (void );extern void cpu_resume_arm (void );extern int cpu_suspend (unsigned long ,int (*)(unsigned long ));
arch/arm/kernel/sleep.S +12 -0
@@ -120,6 +120,14 @@ ENDPROC(cpu_resume_after_mmu) .text .align +#ifdef CONFIG_MCPM + .arm +THUMB( .thumb ) +ENTRY(cpu_resume_no_hyp) +ARM_BE8(setend be) @ ensure we are in BE mode + b no_hyp +#endif + #ifdef CONFIG_MMU .arm ENTRY(cpu_resume_arm)
@@ -135,6 +143,7 @@ ARM_BE8(setend be) @ ensure we are in BE mode bl __hyp_stub_install_secondary #endif safe_svcmode_maskall r1 +no_hyp: mov r1, #0 ALT_SMP(mrc p15, 0, r0, c0, c0, 5) ALT_UP_B(1f)
@@ -163,6 +172,9 @@ ENDPROC(cpu_resume) #ifdef CONFIG_MMU ENDPROC(cpu_resume_arm) +#endif +#ifdef CONFIG_MCPM +ENDPROC(cpu_resume_no_hyp) #endif .align 2
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 221/671 ARM: 8848/1: virt: Align GIC version check with arm64 counterpart
In reply to Sasha LevinFrom: Vladimir Murzin <[email protected]>
[ Upstream commit 9db043d36bd379f4cc99054c079de0dabfc38d03 ]
arm64 has got relaxation on GIC version check at early boot stage due to update of the GIC architecture let's align ARM with that.
To help backports (even though the code was correct at the time of writing)
--- arch/arm/kernel/hyp-stub.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/hyp-stub.S +2 -2
@@ -180,8 +180,8 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE @ Check whether GICv3 system registers are available mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 ubfx r7, r7, #28, #4 - cmp r7, #1 - bne 2f + teq r7, #0 + beq 2f @ Enable system register accesses mrc p15, 4, r7, c12, c9, 5 @ ICC_HSRE
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 222/671 ARM: 8849/1: NOMMU: Fix encodings for PMSAv8's PRBAR4/PRLAR4
In reply to Sasha LevinFrom: Vladimir Murzin <[email protected]>
[ Upstream commit d410a8a49e3e00e07d43037e90f776d522b25a6a ]
To access PRBARn, where n is referenced as a binary number:
MRC p15, 0, <Rt>, c6, c8+n[3:1], 4*n[0] ; Read PRBARn into Rt MCR p15, 0, <Rt>, c6, c8+n[3:1], 4*n[0] ; Write Rt into PRBARn
To access PRLARn, where n is referenced as a binary number:
MRC p15, 0, <Rt>, c6, c8+n[3:1], 4*n[0]+1 ; Read PRLARn into Rt MCR p15, 0, <Rt>, c6, c8+n[3:1], 4*n[0]+1 ; Write Rt into PRLARn
For PR{B,L}AR4, n is 4, n[0] is 0, n[3:1] is 2, while current encoding done with n[0] set to 1 which is wrong. Use proper encoding instead.
--- arch/arm/kernel/head-nommu.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/head-nommu.S +2 -2
@@ -441,8 +441,8 @@ M_CLASS(str r6, [r12, #PMSAv8_RLAR_A(3)]) str r5, [r12, #PMSAv8_RBAR_A(0)] str r6, [r12, #PMSAv8_RLAR_A(0)] #else - mcr p15, 0, r5, c6, c10, 1 @ PRBAR4 - mcr p15, 0, r6, c6, c10, 2 @ PRLAR4 + mcr p15, 0, r5, c6, c10, 0 @ PRBAR4 + mcr p15, 0, r6, c6, c10, 1 @ PRLAR4 #endif #endif ret lr
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 223/671 regulator: wm831x-dcdc: Fix list of wm831x_dcdc_ilim from mA to uA
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit c25d47888f0fb3d836d68322d4aea2caf31a75a6 ]
The wm831x_dcdc_ilim entries needs to be uA because it is used to compare with min_uA and max_uA.
While at it also make the array const and change to use unsigned int.
--- drivers/regulator/wm831x-dcdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/wm831x-dcdc.c +2 -2
@@ -327,8 +327,8 @@ static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev) }/* Current limit options */ -static u16 wm831x_dcdc_ilim[] = { -125 ,250 ,375 ,500 ,625 ,750 ,875 ,1000 +static const unsigned int wm831x_dcdc_ilim[] = { +125000 ,250000 ,375000 ,500000 ,625000 ,750000 ,875000 ,1000000 }; static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 224/671 ath10k: Fix length of wmi tlv command for protected mgmt frames
In reply to Sasha LevinFrom: Surabhi Vishnoi <[email protected]>
[ Upstream commit 761156ff573d1002983416e4fd1fe8d3489c4bd8 ]
The length of wmi tlv command for management tx send is calculated incorrectly in case of protected management frames as there is addition of IEEE80211_CCMP_MIC_LEN twice. This leads to improper behaviour of firmware as the wmi tlv mgmt tx send command for protected mgmt frames is formed wrongly.
Fix the length calculation of wmi tlv command for mgmt tx send in case of protected management frames by adding the IEEE80211_CCMP_MIC_LEN only once.
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/wmi-tlv.c +1 -3
@@ -2692,10 +2692,8 @@ ath10k_wmi_tlv_op_gen_mgmt_tx_send(struct ath10k *ar, struct sk_buff *msdu,if ((ieee80211_is_action (hdr->frame_control) ||ieee80211_is_deauth (hdr->frame_control) ||ieee80211_is_disassoc (hdr->frame_control)) && -ieee80211_has_protected (hdr->frame_control)) { - len +=IEEE80211_CCMP_MIC_LEN ; +ieee80211_has_protected (hdr->frame_control)) buf_len +=IEEE80211_CCMP_MIC_LEN ; - } buf_len =min_t (u32, buf_len,WMI_TLV_MGMT_TX_FRAME_MAX_LEN ); buf_len =round_up (buf_len,4 );
Signature · 7 lines
2.20.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Sasha Levin
maintainerPATCH 225/671 netfilter: nft_set_hash: fix lookups with fixed size hash on big endian
In reply to Sasha LevinFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 3b02b0adc242a72b5e46019b6a9e4f84823592f6 ]
Call jhash_1word() for the 4-bytes key case from the insertion and deactivation path, otherwise big endian arch set lookups fail.
--- net/netfilter/nft_set_hash.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
net/netfilter/nft_set_hash.c +19 -4
@@ -488,6 +488,23 @@ static bool nft_hash_lookup_fast(const struct net *net,return false; } +static u32 nft_jhash (const struct nft_set *set,const struct nft_hash *priv, +const struct nft_set_ext *ext) +{ +const struct nft_data *key =nft_set_ext_key (ext); +u32 hash, k1; + +if (set->klen ==4 ) { + k1 = *(u32 *)key; + hash =jhash_1word (k1, priv->seed); + }else { + hash =jhash (key, set->klen, priv->seed); + } + hash =reciprocal_scale (hash, priv->buckets); + +return hash; +} +static int nft_hash_insert (const struct net *net,const struct nft_set *set,const struct nft_set_elem *elem,struct nft_set_ext **ext)
@@ -497,8 +514,7 @@ static int nft_hash_insert(const struct net *net, const struct nft_set *set,u8 genmask =nft_genmask_next (net);u32 hash; - hash =jhash (nft_set_ext_key (&this->ext), set->klen, priv->seed); - hash =reciprocal_scale (hash, priv->buckets); + hash =nft_jhash (set, priv, &this->ext);hlist_for_each_entry (he, &priv->table[hash], node) { if (!memcmp(nft_set_ext_key(&this->ext), nft_set_ext_key(&he->ext), set->klen) &&
@@ -537,8 +553,7 @@ static void *nft_hash_deactivate(const struct net *net,u8 genmask =nft_genmask_next (net);u32 hash; - hash =jhash (nft_set_ext_key (&this->ext), set->klen, priv->seed); - hash =reciprocal_scale (hash, priv->buckets); + hash =nft_jhash (set, priv, &this->ext);hlist_for_each_entry (he, &priv->table[hash], node) { if (!memcmp(nft_set_ext_key(&this->ext), &elem->key.val, set->klen) &&
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 226/671 netfilter: nft_set_hash: bogus element self comparison from deactivation path
In reply to Sasha LevinFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit a01cbae57ec29b161d42ee1caa4ffffda5d519c2 ]
Use the element from the loop iteration, not the same element we want to deactivate otherwise this branch always evaluates true.
--- net/netfilter/nft_set_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_set_hash.c +1 -1
@@ -555,7 +555,7 @@ static void *nft_hash_deactivate(const struct net *net, hash =nft_jhash (set, priv, &this->ext);hlist_for_each_entry (he, &priv->table[hash], node) { -if (!memcmp (nft_set_ext_key (&this->ext), &elem->key.val, +if (!memcmp (nft_set_ext_key (&he->ext), &elem->key.val, set->klen) &&nft_set_elem_active (&he->ext, genmask)) {nft_set_elem_change_active (net, set, &he->ext);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 227/671 net: sched: act_csum: Fix csum calc for tagged packets
In reply to Sasha LevinFrom: Eli Britstein <[email protected]>
[ Upstream commit 2ecba2d1e45b24620a7c3df9531895cf68d5dec6 ]
The csum calculation is different for IPv4/6. For VLAN packets, tc_skb_protocol returns the VLAN protocol rather than the packet's one (e.g. IPv4/6), so csum is not calculated. Furthermore, VLAN may not be stripped so csum is not calculated in this case too. Calculate the csum for those cases.
--- net/sched/act_csum.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
net/sched/act_csum.c +29 -2
@@ -560,8 +560,11 @@ static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) {struct tcf_csum *p =to_tcf_csum (a); +bool orig_vlan_tag_present = false; +unsigned int vlan_hdr_count =0 ;struct tcf_csum_params *params;u32 update_flags; +__be16 protocol;int action; params =rcu_dereference_bh (p->params);
@@ -574,7 +577,9 @@ static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a, goto drop; update_flags = params->update_flags; -switch (tc_skb_protocol (skb)) { + protocol =tc_skb_protocol (skb); +again: +switch (protocol) {case cpu_to_be16 (ETH_P_IP ):if (!tcf_csum_ipv4 (skb, update_flags)) goto drop;
@@ -583,13 +588,35 @@ static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a,if (!tcf_csum_ipv6 (skb, update_flags)) goto drop;break ; +case cpu_to_be16 (ETH_P_8021AD ):/* fall through */ +case cpu_to_be16 (ETH_P_8021Q ): +if (skb_vlan_tag_present (skb) && !orig_vlan_tag_present) { + protocol = skb->protocol; + orig_vlan_tag_present = true; + }else { +struct vlan_hdr *vlan = (struct vlan_hdr *)skb->data; + + protocol = vlan->h_vlan_encapsulated_proto; +skb_pull (skb,VLAN_HLEN ); +skb_reset_network_header (skb); + vlan_hdr_count++; + } + goto again; + } + +out: +/* Restore the skb for the pulled VLAN tags */ +while (vlan_hdr_count--) { +skb_push (skb,VLAN_HLEN ); +skb_reset_network_header (skb); }return action; drop:qstats_drop_inc (this_cpu_ptr (p->common.cpu_qstats)); -return TC_ACT_SHOT ; + action =TC_ACT_SHOT ; + goto out; } static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 228/671 hwrng: bcm2835 - fix probe as platform device
In reply to Sasha LevinFrom: Jonas Gorski <[email protected]>
[ Upstream commit 984798de671a927ac73da31096a150df42e6aaf3 ]
BCM63XX (MIPS) does not use device tree, so there cannot be any of_device_id, causing the driver to fail on probe:
[ 0.904564] bcm2835-rng: probe of bcm63xx-rng failed with error -22
Fix this by checking for match data only if we are probing from device tree.
--- drivers/char/hw_random/bcm2835-rng.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/char/hw_random/bcm2835-rng.c +10 -8
@@ -171,14 +171,16 @@ static int bcm2835_rng_probe(struct platform_device *pdev) priv->rng.read = bcm2835_rng_read; priv->rng.cleanup = bcm2835_rng_cleanup; - rng_id =of_match_node (bcm2835_rng_of_match, np); -if (!rng_id) -return -EINVAL ; - -/* Check for rng init function, execute it */ - of_data = rng_id->data; -if (of_data) - priv->mask_interrupts = of_data->mask_interrupts; +if (dev_of_node (dev)) { + rng_id =of_match_node (bcm2835_rng_of_match, np); +if (!rng_id) +return -EINVAL ; + +/* Check for rng init function, execute it */ + of_data = rng_id->data; +if (of_data) + priv->mask_interrupts = of_data->mask_interrupts; + }/* register driver */ err =devm_hwrng_register (dev, &priv->rng);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 229/671 iommu/vt-d: Fix NULL pointer reference in intel_svm_bind_mm()
In reply to Sasha LevinFrom: Lu Baolu <[email protected]>
[ Upstream commit c56cba5daf45d2d091ef1cfe2f1d6a930446687b ]
Intel IOMMU could be turned off with intel_iommu=off. If Intel IOMMU is off, the intel_iommu struct will not be initialized. When device drivers call intel_svm_bind_mm(), the NULL pointer reference will happen there.
Add dmar_disabled check to avoid NULL pointer reference.
--- drivers/iommu/intel-svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel-svm.c +1 -1
@@ -293,7 +293,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_int pasid_max;int ret; -if (!iommu) +if (!iommu || dmar_disabled)return -EINVAL ;if (dev_is_pci (dev)) {
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 230/671 NFS: Add missing encode / decode sequence_maxsz to v4.2 operations
In reply to Sasha LevinFrom: Anna Schumaker <[email protected]>
[ Upstream commit 1a3466aed3a17eed41cd9411f89eb637f58349b0 ]
These really should have been there from the beginning, but we never noticed because there was enough slack in the RPC request for the extra bytes. Chuck's recent patch to use au_cslack and au_rslack to compute buffer size shrunk the buffer enough that this was now a problem for SEEK operations on my test client.
--- fs/nfs/nfs42xdr.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/nfs/nfs42xdr.c +10 -0
@@ -59,43 +59,53 @@#define decode_clone_maxsz (op_decode_hdr_maxsz)#define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_allocate_maxsz + \ encode_getattr_maxsz)#define NFS4_dec_allocate_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_allocate_maxsz + \ decode_getattr_maxsz)#define NFS4_enc_copy_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_savefh_maxsz + \ encode_putfh_maxsz + \ encode_copy_maxsz + \ encode_commit_maxsz)#define NFS4_dec_copy_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_savefh_maxsz + \ decode_putfh_maxsz + \ decode_copy_maxsz + \ decode_commit_maxsz)#define NFS4_enc_offload_cancel_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_offload_cancel_maxsz)#define NFS4_dec_offload_cancel_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_offload_cancel_maxsz)#define NFS4_enc_deallocate_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_deallocate_maxsz + \ encode_getattr_maxsz)#define NFS4_dec_deallocate_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_deallocate_maxsz + \ decode_getattr_maxsz)#define NFS4_enc_seek_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ encode_putfh_maxsz + \ encode_seek_maxsz)#define NFS4_dec_seek_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ decode_putfh_maxsz + \ decode_seek_maxsz)#define NFS4_enc_layoutstats_sz (compound_encode_hdr_maxsz + \
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 231/671 NFSv4/flexfiles: Fix invalid deref in FF_LAYOUT_DEVID_NODE()
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 108bb4afd351d65826648a47f11fa3104e250d9b ]
If the attempt to instantiate the mirror's layout DS pointer failed, then that pointer may hold a value of type ERR_PTR(), so we need to check that before we dereference it.
--- fs/nfs/flexfilelayout/flexfilelayout.h | 32 +++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-)
fs/nfs/flexfilelayout/flexfilelayout.h +19 -13
@@ -132,16 +132,6 @@ FF_LAYOUT_LSEG(struct pnfs_layout_segment *lseg) generic_hdr); } -static inline struct nfs4_deviceid_node * -FF_LAYOUT_DEVID_NODE (struct pnfs_layout_segment *lseg,u32 idx) -{ -if (idx >=FF_LAYOUT_LSEG (lseg)->mirror_array_cnt || -FF_LAYOUT_LSEG (lseg)->mirror_array[idx] ==NULL || -FF_LAYOUT_LSEG (lseg)->mirror_array[idx]->mirror_ds ==NULL ) -return NULL ; -return &FF_LAYOUT_LSEG (lseg)->mirror_array[idx]->mirror_ds->id_node; -} -static inline struct nfs4_ff_layout_ds *FF_LAYOUT_MIRROR_DS (struct nfs4_deviceid_node *node) {
@@ -151,9 +141,25 @@ FF_LAYOUT_MIRROR_DS(struct nfs4_deviceid_node *node)static inline struct nfs4_ff_layout_mirror *FF_LAYOUT_COMP (struct pnfs_layout_segment *lseg,u32 idx) { -if (idx >=FF_LAYOUT_LSEG (lseg)->mirror_array_cnt) -return NULL ; -return FF_LAYOUT_LSEG (lseg)->mirror_array[idx]; +struct nfs4_ff_layout_segment *fls =FF_LAYOUT_LSEG (lseg); + +if (idx < fls->mirror_array_cnt) +return fls->mirror_array[idx]; +return NULL ; +} + +static inline struct nfs4_deviceid_node * +FF_LAYOUT_DEVID_NODE (struct pnfs_layout_segment *lseg,u32 idx) +{ +struct nfs4_ff_layout_mirror *mirror =FF_LAYOUT_COMP (lseg, idx); + +if (mirror !=NULL ) { +struct nfs4_ff_layout_ds *mirror_ds = mirror->mirror_ds; + +if (!IS_ERR_OR_NULL (mirror_ds)) +return &mirror_ds->id_node; + } +return NULL ; } static inline u32
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 232/671 net: aquantia: fixed instack structure overflow
In reply to Sasha LevinFrom: Igor Russkikh <[email protected]>
[ Upstream commit 8006e3730b6e900319411e35cee85b4513d298df ]
This is a real stack undercorruption found by kasan build.
The issue did no harm normally because it only overflowed 2 bytes after bitary array which on most architectures were mapped into err local.
--- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 4 ++-- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +2 -2
@@ -207,8 +207,8 @@ static int hw_atl_a0_hw_rss_set(struct aq_hw_s *self,u32 i =0U ;u32 num_rss_queues =max (1U , self->aq_nic_cfg->num_rss_queues);int err =0 ; -u16 bitary[(HW_ATL_A0_RSS_REDIRECTION_MAX * -HW_ATL_A0_RSS_REDIRECTION_BITS /16U )]; +u16 bitary[1 + (HW_ATL_A0_RSS_REDIRECTION_MAX * +HW_ATL_A0_RSS_REDIRECTION_BITS /16U )];memset (bitary,0 ,sizeof (bitary));
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +2 -2
@@ -192,8 +192,8 @@ static int hw_atl_b0_hw_rss_set(struct aq_hw_s *self,u32 i =0U ;u32 num_rss_queues =max (1U , self->aq_nic_cfg->num_rss_queues);int err =0 ; -u16 bitary[(HW_ATL_B0_RSS_REDIRECTION_MAX * -HW_ATL_B0_RSS_REDIRECTION_BITS /16U )]; +u16 bitary[1 + (HW_ATL_B0_RSS_REDIRECTION_MAX * +HW_ATL_B0_RSS_REDIRECTION_BITS /16U )];memset (bitary,0 ,sizeof (bitary));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 233/671 powerpc/mm: Check secondary hash page table
In reply to Sasha LevinFrom: Rashmica Gupta <[email protected]>
[ Upstream commit 790845e2f12709d273d08ea7a2af7c2593689519 ]
We were always calling base_hpte_find() with primary = true, even when we wanted to check the secondary table.
mpe: I broke this when refactoring Rashmica's original patch.
--- arch/powerpc/mm/dump_hashpagetable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/dump_hashpagetable.c +1 -1
@@ -342,7 +342,7 @@ static unsigned long hpte_find(struct pg_state *st, unsigned long ea, int psize)/* Look in secondary table */ if (slot ==-1 ) - slot =base_hpte_find (ea, psize, true, &v, &r); + slot =base_hpte_find (ea, psize, false, &v, &r);/* No entry found */ if (slot ==-1 )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 234/671 media: dvb/earth-pt1: fix wrong initialization for demod blocks
In reply to Sasha LevinFrom: Akihiro Tsukada <[email protected]>
[ Upstream commit 15d90a6ae98e6d2c68497b44a491cb9efbb98ab1 ]
earth-pt1 driver was decomposed/restructured by the commit b732539efdba ("media: dvb: earth-pt1: decompose pt1 driver into sub drivers"), but it introduced a problem regarding concurrent streaming:
Opening a new terrestial stream stops the reception of an existing, already-opened satellite stream.
The demod IC in earth-pt1 boards contains 2 pairs of terr. and sat. blocks, supporting 4 concurrent demodulations, and the above problem was because the config of a terr. block contained whole reset/init of the pair blocks, thus each open() of a terrestrial frontend wrongly cleared the config of its peer satellite block of the demod.
This whole/pair reset should be executed earlier and not on each open().
--- drivers/media/pci/pt1/pt1.c | 54 ++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-)
drivers/media/pci/pt1/pt1.c +48 -6
@@ -200,16 +200,10 @@ static const u8 va1j5jf8007t_25mhz_configs[][2] = {static int config_demod (struct i2c_client *cl,enum pt1_fe_clk clk) {int ret; -u8 buf[2 ] = {0x01 ,0x80 };bool is_sat;const u8 (*cfg_data)[2 ];int i, len; - ret =i2c_master_send (cl, buf,2 ); -if (ret <0 ) -return ret; -usleep_range (30000 ,50000 ); - is_sat = !strncmp (cl->name,TC90522_I2C_DEV_SAT ,strlen (TC90522_I2C_DEV_SAT ));if (is_sat) {
@@ -260,6 +254,46 @@ static int config_demod(struct i2c_client *cl, enum pt1_fe_clk clk)return 0 ; } +/* +* Init registers for (each pair of) terrestrial/satellite block in demod. +* Note that resetting terr. block also resets its peer sat. block as well. +* This function must be called before configuring any demod block +* (before pt1_wakeup(), fe->ops.init()). +*/ +static int pt1_demod_block_init (struct pt1 *pt1) +{ +struct i2c_client *cl; +u8 buf[2 ] = {0x01 ,0x80 }; +int ret; +int i; + +/* reset all terr. & sat. pairs first */ +for (i =0 ; i <PT1_NR_ADAPS ; i++) { + cl = pt1->adaps[i]->demod_i2c_client; +if (strncmp (cl->name,TC90522_I2C_DEV_TER , +strlen (TC90522_I2C_DEV_TER ))) +continue ; + + ret =i2c_master_send (cl, buf,2 ); +if (ret <0 ) +return ret; +usleep_range (30000 ,50000 ); + } + +for (i =0 ; i <PT1_NR_ADAPS ; i++) { + cl = pt1->adaps[i]->demod_i2c_client; +if (strncmp (cl->name,TC90522_I2C_DEV_SAT , +strlen (TC90522_I2C_DEV_SAT ))) +continue ; + + ret =i2c_master_send (cl, buf,2 ); +if (ret <0 ) +return ret; +usleep_range (30000 ,50000 ); + } +return 0 ; +} +static void pt1_write_reg (struct pt1 *pt1,int reg,u32 data) {writel (data, pt1->regs + reg *4 );
@@ -987,6 +1021,10 @@ static int pt1_init_frontends(struct pt1 *pt1) goto tuner_release; } + ret =pt1_demod_block_init (pt1); +if (ret <0 ) + goto fe_unregister; +return 0 ; tuner_release:
@@ -1245,6 +1283,10 @@ static int pt1_resume(struct device *dev)pt1_update_power (pt1);usleep_range (1000 ,2000 ); + ret =pt1_demod_block_init (pt1); +if (ret <0 ) + goto resume_err; +for (i =0 ; i <PT1_NR_ADAPS ; i++)dvb_frontend_reinitialise (pt1->adaps[i]->fe);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 235/671 rbd: clear ->xferred on error from rbd_obj_issue_copyup()
In reply to Sasha LevinFrom: Ilya Dryomov <[email protected]>
[ Upstream commit 356889c49d84f11f446ec235bd52ca1a7d581aa0 ]
Otherwise the assert in rbd_obj_end_request() is triggered.
--- drivers/block/rbd.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/rbd.c +1 -0
@@ -2506,6 +2506,7 @@ static bool rbd_obj_handle_write(struct rbd_obj_request *obj_req) ret =rbd_obj_issue_copyup (obj_req, obj_req->xferred);if (ret) { obj_req->result = ret; + obj_req->xferred =0 ;return true; }return false;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 236/671 PCI: Fix "try" semantics of bus and slot reset
In reply to Sasha LevinFrom: Alex Williamson <[email protected]>
[ Upstream commit ddefc033eecf23f1e8b81d0663c5db965adf5516 ]
The commit referenced below introduced device locking around save and restore of state for each device during a PCI bus "try" reset, making it decidely non-"try" and prone to deadlock in the event that a device is already locked. Restore __pci_reset_bus() and __pci_reset_slot() to their advertised locking semantics by pushing the save and restore functions into the branch where the entire tree is already locked. Extend the helper function names with "_locked" and update the comment to reflect this calling requirement.
--- drivers/pci/pci.c | 54 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 28 deletions(-)
drivers/pci/pci.c +26 -28
@@ -5039,39 +5039,42 @@ static int pci_slot_trylock(struct pci_slot *slot)return 0 ; } -/* Save and disable devices from the top of the tree down */ -static void pci_bus_save_and_disable (struct pci_bus *bus) +/* +* Save and disable devices from the top of the tree down while holding +* the @dev mutex lock for the entire tree. +*/ +static void pci_bus_save_and_disable_locked (struct pci_bus *bus) {struct pci_dev *dev;list_for_each_entry (dev, &bus->devices, bus_list) { -pci_dev_lock (dev);pci_dev_save_and_disable (dev); -pci_dev_unlock (dev);if (dev->subordinate) -pci_bus_save_and_disable (dev->subordinate); +pci_bus_save_and_disable_locked (dev->subordinate); } }/* -* Restore devices from top of the tree down - parent bridges need to be -* restored before we can get to subordinate devices. +* Restore devices from top of the tree down while holding @dev mutex lock +* for the entire tree. Parent bridges need to be restored before we can +* get to subordinate devices. */ -static void pci_bus_restore (struct pci_bus *bus) +static void pci_bus_restore_locked (struct pci_bus *bus) {struct pci_dev *dev;list_for_each_entry (dev, &bus->devices, bus_list) { -pci_dev_lock (dev);pci_dev_restore (dev); -pci_dev_unlock (dev);if (dev->subordinate) -pci_bus_restore (dev->subordinate); +pci_bus_restore_locked (dev->subordinate); } } -/* Save and disable devices from the top of the tree down */ -static void pci_slot_save_and_disable (struct pci_slot *slot) +/* +* Save and disable devices from the top of the tree down while holding +* the @dev mutex lock for the entire tree. +*/ +static void pci_slot_save_and_disable_locked (struct pci_slot *slot) {struct pci_dev *dev;
@@ -5080,26 +5083,25 @@ static void pci_slot_save_and_disable(struct pci_slot *slot)continue ;pci_dev_save_and_disable (dev);if (dev->subordinate) -pci_bus_save_and_disable (dev->subordinate); +pci_bus_save_and_disable_locked (dev->subordinate); } }/* -* Restore devices from top of the tree down - parent bridges need to be -* restored before we can get to subordinate devices. +* Restore devices from top of the tree down while holding @dev mutex lock +* for the entire tree. Parent bridges need to be restored before we can +* get to subordinate devices. */ -static void pci_slot_restore (struct pci_slot *slot) +static void pci_slot_restore_locked (struct pci_slot *slot) {struct pci_dev *dev;list_for_each_entry (dev, &slot->bus->devices, bus_list) {if (!dev->slot || dev->slot != slot)continue ; -pci_dev_lock (dev);pci_dev_restore (dev); -pci_dev_unlock (dev);if (dev->subordinate) -pci_bus_restore (dev->subordinate); +pci_bus_restore_locked (dev->subordinate); } }
@@ -5158,17 +5160,15 @@ static int __pci_reset_slot(struct pci_slot *slot)if (rc)return rc; -pci_slot_save_and_disable (slot); -if (pci_slot_trylock (slot)) { +pci_slot_save_and_disable_locked (slot);might_sleep (); rc =pci_reset_hotplug_slot (slot->hotplug,0 ); +pci_slot_restore_locked (slot);pci_slot_unlock (slot); }else rc = -EAGAIN ; -pci_slot_restore (slot); -return rc; }
@@ -5254,17 +5254,15 @@ static int __pci_reset_bus(struct pci_bus *bus)if (rc)return rc; -pci_bus_save_and_disable (bus); -if (pci_bus_trylock (bus)) { +pci_bus_save_and_disable_locked (bus);might_sleep (); rc =pci_bridge_secondary_bus_reset (bus->self); +pci_bus_restore_locked (bus);pci_bus_unlock (bus); }else rc = -EAGAIN ; -pci_bus_restore (bus); -return rc; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 237/671 nios2: ksyms: Add missing symbol exports
In reply to Sasha LevinFrom: Guenter Roeck <[email protected]>
[ Upstream commit 0f8ed994575429d6042cf5d7ef70081c94091587 ]
Building nios2:allmodconfig fails as follows (each symbol is only listed once).
ERROR: "__ashldi3" [drivers/md/dm-writecache.ko] undefined!
ERROR: "__ashrdi3" [fs/xfs/xfs.ko] undefined!
ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined!
ERROR: "__lshrdi3" [drivers/md/dm-zoned.ko] undefined!
ERROR: "flush_icache_range" [drivers/misc/lkdtm/lkdtm.ko] undefined!
ERROR: "empty_zero_page" [drivers/md/dm-mod.ko] undefined!
The problem is seen with gcc 7.3.0.
Export the missing symbols.
--- arch/nios2/kernel/nios2_ksyms.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/nios2/kernel/nios2_ksyms.c +12 -0
@@ -9,12 +9,20 @@#include <linux/export.h> #include <linux/string.h> +#include <asm/cacheflush.h> +#include <asm/pgtable.h> +/* string functions */ EXPORT_SYMBOL (memcpy);EXPORT_SYMBOL (memset);EXPORT_SYMBOL (memmove); +/* memory management */ + +EXPORT_SYMBOL (empty_zero_page); +EXPORT_SYMBOL (flush_icache_range); +/* * libgcc functions - functions that are used internally by the * compiler... (prototypes are not correct though, but that
@@ -31,3 +39,7 @@ DECLARE_EXPORT(__udivsi3);DECLARE_EXPORT (__umoddi3);DECLARE_EXPORT (__umodsi3);DECLARE_EXPORT (__muldi3); +DECLARE_EXPORT (__ucmpdi2); +DECLARE_EXPORT (__lshrdi3); +DECLARE_EXPORT (__ashldi3); +DECLARE_EXPORT (__ashrdi3);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 238/671 x86/mm: Remove unused variable 'cpu'
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit 3609e31bc8dc03b701390f79c74fc7fe92b95039 ]
The commit a2055abe9c67 ("x86/mm: Pass flush_tlb_info to flush_tlb_others() etc") removed the unnecessary cpu parameter from uv_flush_tlb_others() but left an unused variable.
arch/x86/mm/tlb.c: In function 'native_flush_tlb_others':arch/x86/mm/tlb.c:688:16: warning: variable 'cpu' set but not used [-Wunused-but-set-variable]
unsigned int cpu;
^~~--- arch/x86/mm/tlb.c | 3 --- 1 file changed, 3 deletions(-)
arch/x86/mm/tlb.c +0 -3
@@ -664,9 +664,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask,* that UV should be updated so that smp_call_function_many(), * etc, are optimal on UV. */ -unsigned int cpu; - - cpu =smp_processor_id (); cpumask =uv_flush_tlb_others (cpumask, info);if (cpumask) smp_call_function_many(cpumask, flush_tlb_func_remote,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 239/671 scsi: megaraid_sas: reduce module load time
In reply to Sasha LevinFrom: Steve Sistare <[email protected]>
[ Upstream commit 31b6a05f86e690e1818116fd23c3be915cc9d9ed ]
megaraid_sas takes 1+ seconds to load while waiting for firmware:
[2.822603] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state [3.871003] megaraid_sas 0000:03:00.0: FW now in Ready state
This is due to the following loop in megasas_transition_to_ready(), which waits a minimum of 1 second, even though the FW becomes ready in tens of millisecs:
/*
* The cur_state should not last for more than max_wait secs
*/
for (i = 0; i < max_wait; i++) {
...
msleep(1000);
...
dev_info(&instance->pdev->dev, "FW now in Ready state\n");This is a regression, caused by a change of the msleep granularity from 1 to 1000 due to concern about waiting too long on systems with coarse jiffies.
To fix, increase iterations and use msleep(20), which results in:
[2.670627] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state [2.739386] megaraid_sas 0000:03:00.0: FW now in Ready state
--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +2 -2
@@ -3894,12 +3894,12 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)/* * The cur_state should not last for more than max_wait secs */ -for (i =0 ; i < max_wait; i++) { +for (i =0 ; i < max_wait *50 ; i++) { curr_abs_state = instance->instancet->read_fw_status_reg (instance->reg_set);if (abs_state == curr_abs_state) { -msleep (1000 ); +msleep (20 ); }else break ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 240/671 nfp: fix simple vNIC mailbox length
In reply to Sasha LevinFrom: Dirk van der Merwe <[email protected]>
[ Upstream commit eaab2d2d0fe4393b040dbf3922e18cd2ab7d6b85 ]
The simple vNIC mailbox length should be 12 decimal and not 0x12. Using a decimal also makes it clear this is a length value and not another field within the simple mailbox defines.
Found by code inspection, there are no known firmware configurations where this would cause issues.
--- drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h +1 -1
@@ -423,7 +423,7 @@#define NFP_NET_CFG_MBOX_SIMPLE_CMD 0x0#define NFP_NET_CFG_MBOX_SIMPLE_RET 0x4#define NFP_NET_CFG_MBOX_SIMPLE_VAL 0x8 -#define NFP_NET_CFG_MBOX_SIMPLE_LEN 0x12 +#define NFP_NET_CFG_MBOX_SIMPLE_LEN 12#define NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_ADD 1#define NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_KILL 2
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 241/671 drivers/rapidio/rio_cm.c: fix potential oops in riocm_ch_listen()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 5ac188b12e7cbdd92dee60877d1fac913fc1d074 ]
If riocm_get_channel() fails, then we should just return -EINVAL. Calling riocm_put_channel() will trigger a NULL dereference and generally we should call put() if the get() didn't succeed.
--- drivers/rapidio/rio_cm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rapidio/rio_cm.c +3 -1
@@ -1215,7 +1215,9 @@ static int riocm_ch_listen(u16 ch_id)riocm_debug (CHOP ,"(ch_%d)" , ch_id); ch =riocm_get_channel (ch_id); -if (!ch || !riocm_cmp_exch (ch,RIO_CM_CHAN_BOUND ,RIO_CM_LISTEN )) +if (!ch) +return -EINVAL ; +if (!riocm_cmp_exch (ch,RIO_CM_CHAN_BOUND ,RIO_CM_LISTEN )) ret = -EINVAL ;riocm_put_channel (ch);return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 242/671 xen, cpu_hotplug: Prevent an out of bounds access
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 201676095dda7e5b31a5e1d116d10fc22985075e ]
The "cpu" variable comes from the sscanf() so Smatch marks it as untrusted data. We can't pass a higher value than "nr_cpu_ids" to cpu_possible() or it results in an out of bounds access.
--- drivers/xen/cpu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/cpu_hotplug.c +1 -1
@@ -54,7 +54,7 @@ static int vcpu_online(unsigned int cpu) }static void vcpu_hotplug (unsigned int cpu) { -if (!cpu_possible (cpu)) +if (cpu >= nr_cpu_ids || !cpu_possible (cpu))return ;switch (vcpu_online (cpu)) {
Signature · 7 lines
2.20.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Sasha Levin
maintainerPATCH 243/671 net/mlx5: Fix multiple updates of steering rules in parallel
In reply to Sasha LevinFrom: Eli Britstein <[email protected]>
[ Upstream commit 6237634d8fcc65c9e3348382910e7cdb15084c68 ]
There might be a condition where the fte found is not active yet. In this case we should not use it, but continue to search for another, or allocate a new one.
--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +6 -0
@@ -469,6 +469,7 @@ static void del_hw_fte(struct fs_node *node)mlx5_core_warn (dev,"flow steering can't delete fte in index %d of flow group id %d\n" , fte->index, fg->id); + node->active =0 ; } }
@@ -1597,6 +1598,11 @@ lookup_fte_locked(struct mlx5_flow_group *g, fte_tmp =NULL ; goto out; } +if (!fte_tmp->node.active) { +tree_put_node (&fte_tmp->node); + fte_tmp =NULL ; + goto out; + }nested_down_write_ref_node (&fte_tmp->node,FS_LOCK_CHILD ); out:
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 244/671 net/mlx5e: IPoIB, Fix RX checksum statistics update
In reply to Sasha LevinFrom: Feras Daoud <[email protected]>
[ Upstream commit 3d6f3cdf9bfe92c430674308db0f1c8655f2c11d ]
Update the RX checksum only if the feature is enabled.
--- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +8 -3
@@ -1364,8 +1364,14 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, skb->protocol = *((__be16 *)(skb->data)); - skb->ip_summed =CHECKSUM_COMPLETE ; - skb->csum =csum_unfold ((__force __sum16 )cqe->check_sum); +if (netdev->features &NETIF_F_RXCSUM ) { + skb->ip_summed =CHECKSUM_COMPLETE ; + skb->csum =csum_unfold ((__force __sum16 )cqe->check_sum); + stats->csum_complete++; + }else { + skb->ip_summed =CHECKSUM_NONE ; + stats->csum_none++; + }if (unlikely (mlx5e_rx_hw_stamp (tstamp))) skb_hwtstamps(skb)->hwtstamp =
@@ -1384,7 +1390,6 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq, skb->dev = netdev; - stats->csum_complete++; stats->packets++; stats->bytes += cqe_bcnt; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 245/671 net: sh_eth: fix a missing check of of_get_phy_mode
In reply to Sasha LevinFrom: Kangjie Lu <[email protected]>
[ Upstream commit 035a14e71f27eefa50087963b94cbdb3580d08bf ]
of_get_phy_mode may fail and return a negative error code; the fix checks the return value of of_get_phy_mode and returns NULL of it fails.
--- drivers/net/ethernet/renesas/sh_eth.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/renesas/sh_eth.c +5 -1
@@ -3129,12 +3129,16 @@ static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)struct device_node *np = dev->of_node;struct sh_eth_plat_data *pdata;const char *mac_addr; +int ret; pdata =devm_kzalloc (dev,sizeof (*pdata),GFP_KERNEL );if (!pdata)return NULL ; - pdata->phy_interface =of_get_phy_mode (np); + ret =of_get_phy_mode (np); +if (ret <0 ) +return NULL ; + pdata->phy_interface = ret; mac_addr =of_get_mac_address (np);if (mac_addr)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 246/671 regulator: lp87565: Fix missing register for LP87565_BUCK_0
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit d1a6cbdf1e597917cb642c655512d91b71a35d22 ]
LP87565_BUCK_0 is missed, fix it.
--- drivers/regulator/lp87565-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/lp87565-regulator.c +1 -1
@@ -193,7 +193,7 @@ static int lp87565_regulator_probe(struct platform_device *pdev)struct lp87565 *lp87565 =dev_get_drvdata (pdev->dev.parent);struct regulator_config config = { };struct regulator_dev *rdev; -int i, min_idx =LP87565_BUCK_1 , max_idx =LP87565_BUCK_3 ; +int i, min_idx =LP87565_BUCK_0 , max_idx =LP87565_BUCK_3 ;platform_set_drvdata (pdev, lp87565);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 247/671 soc: amlogic: gx-socinfo: Add mask for each SoC packages
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit dce47aed20c7de3ee2011b7a63e67f08e9dcfb5e ]
When updated IDs on f842c41adc04 ("amlogic: meson-gx-socinfo: Update soc ids") we introduced packages ids using the full 8bit value, but in the function socinfo_to_package_id() the id was filtered with the 0xf0 mask.
While the 0xf0 mask is valid for most board, it filters out the lower 4 bits which encodes some characteristics of the chip.
This patch moves the mask into the meson_gx_package_id table to be applied on each package name independently and add the correct mask for some specific entries.
An example is the S905, in the vendor code the S905 is package_id different from 0x20, and S905M is exactly 0x20.
Another example are the The Wetek Hub & Play2 boards using a S905-H variant, which is the S905 SoC with some licence bits enabled. These licence bits are encoded in the lower 4bits, so to detect the -H variant, we must detect the id == 0x3 with the 0xf mask.
--- drivers/soc/amlogic/meson-gx-socinfo.c | 32 ++++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-)
drivers/soc/amlogic/meson-gx-socinfo.c +17 -15
@@ -43,20 +43,21 @@ static const struct meson_gx_package_id {const char *name;unsigned int major_id;unsigned int pack_id; +unsigned int pack_mask; } soc_packages[] = { - { "S905", 0x1f, 0 }, - { "S905H", 0x1f, 0x13 }, - { "S905M", 0x1f, 0x20 }, - { "S905D", 0x21, 0 }, - { "S905X", 0x21, 0x80 }, - { "S905W", 0x21, 0xa0 }, - { "S905L", 0x21, 0xc0 }, - { "S905M2", 0x21, 0xe0 }, - { "S912", 0x22, 0 }, - { "962X", 0x24, 0x10 }, - { "962E", 0x24, 0x20 }, - { "A113X", 0x25, 0x37 }, - { "A113D", 0x25, 0x22 }, + { "S905", 0x1f, 0, 0x20 }, /* pack_id != 0x20 */ + { "S905H", 0x1f, 0x3, 0xf }, /* pack_id & 0xf == 0x3 */ + { "S905M", 0x1f, 0x20, 0xf0 }, /* pack_id == 0x20 */ + { "S905D", 0x21, 0, 0xf0 }, + { "S905X", 0x21, 0x80, 0xf0 }, + { "S905W", 0x21, 0xa0, 0xf0 }, + { "S905L", 0x21, 0xc0, 0xf0 }, + { "S905M2", 0x21, 0xe0, 0xf0 }, + { "S912", 0x22, 0, 0x0 }, /* Only S912 is known for GXM */ + { "962X", 0x24, 0x10, 0xf0 }, + { "962E", 0x24, 0x20, 0xf0 }, + { "A113X", 0x25, 0x37, 0xff }, + { "A113D", 0x25, 0x22, 0xff }, }; static inline unsigned int socinfo_to_major(u32 socinfo)
@@ -81,13 +82,14 @@ static inline unsigned int socinfo_to_misc(u32 socinfo)static const char *socinfo_to_package_id (u32 socinfo) { -unsigned int pack =socinfo_to_pack (socinfo) &0xf0 ; +unsigned int pack =socinfo_to_pack (socinfo);unsigned int major =socinfo_to_major (socinfo);int i;for (i =0 ; i <ARRAY_SIZE (soc_packages) ; ++i) {if (soc_packages[i].major_id == major && - soc_packages[i].pack_id == pack) + soc_packages[i].pack_id == + (pack & soc_packages[i].pack_mask))return soc_packages[i].name; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 248/671 media: ivtv: update *pos correctly in ivtv_read_pos()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit f8e579f3ca0973daef263f513da5edff520a6c0d ]
We had intended to update *pos, but the current code is a no-op.
--- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/ivtv/ivtv-fileops.c +1 -1
@@ -420,7 +420,7 @@ static ssize_t ivtv_read_pos(struct ivtv_stream *s, char __user *ubuf, size_t coIVTV_DEBUG_HI_FILE ("read %zd from %s, got %zd\n" , count, s->name, rc);if (rc >0 ) - pos += rc; + *pos += rc;return rc; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 249/671 media: cx18: update *pos correctly in cx18_read_pos()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 7afb0df554292dca7568446f619965fb8153085d ]
We should be updating *pos. The current code is a no-op.
--- drivers/media/pci/cx18/cx18-fileops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/cx18/cx18-fileops.c +1 -1
@@ -484,7 +484,7 @@ static ssize_t cx18_read_pos(struct cx18_stream *s, char __user *ubuf,CX18_DEBUG_HI_FILE ("read %zd from %s, got %zd\n" , count, s->name, rc);if (rc >0 ) - pos += rc; + *pos += rc;return rc; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 250/671 media: wl128x: Fix an error code in fm_download_firmware()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit ef4bb63dc1f7213c08e13f6943c69cd27f69e4a3 ]
We forgot to set "ret" on this error path.
--- drivers/media/radio/wl128x/fmdrv_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/radio/wl128x/fmdrv_common.c +3 -2
@@ -1271,8 +1271,9 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name)switch (action->type) {case ACTION_SEND_COMMAND :/* Send */ -if (fmc_send_cmd (fmdev,0 ,0 , action->data, - action->size,NULL ,NULL )) + ret =fmc_send_cmd (fmdev,0 ,0 , action->data, + action->size,NULL ,NULL ); +if (ret) goto rel_fw; cmd_cnt++;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 251/671 media: cx23885: check allocation return
In reply to Sasha LevinFrom: Nicholas Mc Guire <[email protected]>
[ Upstream commit a3d7f22ef34ec4206b50ee121384d5c8bebd5591 ]
Checking of kmalloc() seems to have been committed - as cx23885_dvb_register() is checking for != 0 return, returning -ENOMEM should be fine here. While at it address the coccicheck suggestion to move to kmemdup rather than using kmalloc+memcpy.
--- drivers/media/pci/cx23885/cx23885-dvb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/pci/cx23885/cx23885-dvb.c +3 -2
@@ -1474,8 +1474,9 @@ static int dvb_register(struct cx23885_tsport *port)if (fe0->dvb.frontend !=NULL ) {struct i2c_adapter *tun_i2c; - fe0->dvb.frontend->sec_priv =kmalloc (sizeof (dib7000p_ops),GFP_KERNEL ); -memcpy (fe0->dvb.frontend->sec_priv, &dib7000p_ops,sizeof (dib7000p_ops)); + fe0->dvb.frontend->sec_priv =kmemdup (&dib7000p_ops,sizeof (dib7000p_ops),GFP_KERNEL ); +if (!fe0->dvb.frontend->sec_priv) +return -ENOMEM ; tun_i2c = dib7000p_ops.get_i2c_master (fe0->dvb.frontend,DIBX000_I2C_INTERFACE_TUNER ,1 );if (!dvb_attach (dib0070_attach, fe0->dvb.frontend, tun_i2c, &dib7070p_dib0070_config))return -ENODEV ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 252/671 regulator: tps65086: Fix tps65086_ldoa1_ranges for selector 0xB
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit e69b394703e032e56a140172440ec4f9890b536d ]
selector 0xB (1011) should be 2.6V rather than 2.7V, fit ix.
Table 5-4. LDOA1 Output Voltage Options
VID Bits VOUT VID Bits VOUT VID Bits VOUT VID Bits VOUT
0000 1.35 0100 1.8 1000 2.3 1100 2.85 0001 1.5 0101 1.9 1001 2.4 1101 3.0 0010 1.6 0110 2.0 1010 2.5 1110 3.3 0011 1.7 0111 2.1 1011 2.6 1111 Not Used
--- drivers/regulator/tps65086-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/tps65086-regulator.c +2 -2
@@ -90,8 +90,8 @@ static const struct regulator_linear_range tps65086_buck345_25mv_ranges[] = {static const struct regulator_linear_range tps65086_ldoa1_ranges[] = {REGULATOR_LINEAR_RANGE (1350000 ,0x0 ,0x0 ,0 ),REGULATOR_LINEAR_RANGE (1500000 ,0x1 ,0x7 ,100000 ), -REGULATOR_LINEAR_RANGE (2300000 ,0x8 ,0xA ,100000 ), -REGULATOR_LINEAR_RANGE (2700000 ,0xB ,0xD ,150000 ), +REGULATOR_LINEAR_RANGE (2300000 ,0x8 ,0xB ,100000 ), +REGULATOR_LINEAR_RANGE (2850000 ,0xC ,0xD ,150000 ),REGULATOR_LINEAR_RANGE (3300000 ,0xE ,0xE ,0 ), };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 253/671 crypto: ccree - reduce kernel stack usage with clang
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 5db46ac29a6797541943d3c4081821747e342732 ]
Building with clang for a 32-bit architecture runs over the stack frame limit in the setkey function:
drivers/crypto/ccree/cc_cipher.c:318:12: error: stack frame size of 1152 bytes in function 'cc_cipher_setkey' [-Werror,-Wframe-larger-than=]
The problem is that there are two large variables: the temporary 'tmp' array and the SHASH_DESC_ON_STACK() declaration. Moving the first into the block in which it is used reduces the total frame size to 768 bytes, which seems more reasonable and is under the warning limit.
--- drivers/crypto/ccree/cc_cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccree/cc_cipher.c +1 -1
@@ -306,7 +306,6 @@ static int cc_cipher_setkey(struct crypto_skcipher *sktfm, const u8 *key,struct crypto_tfm *tfm =crypto_skcipher_tfm (sktfm);struct cc_cipher_ctx *ctx_p =crypto_tfm_ctx (tfm);struct device *dev =drvdata_to_dev (ctx_p->drvdata); -u32 tmp[DES3_EDE_EXPKEY_WORDS ];struct cc_crypto_alg *cc_alg = container_of(tfm->__crt_alg, struct cc_crypto_alg, skcipher_alg.base);
@@ -332,6 +331,7 @@ static int cc_cipher_setkey(struct crypto_skcipher *sktfm, const u8 *key,* HW does the expansion on its own. */ if (ctx_p->flow_mode == S_DIN_to_DES) { +u32 tmp[DES3_EDE_EXPKEY_WORDS ];if (keylen ==DES3_EDE_KEY_SIZE &&__des3_ede_setkey (tmp, &tfm->crt_flags, key,DES3_EDE_KEY_SIZE )) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 254/671 jfs: fix bogus variable self-initialization
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit a5fdd713d256887b5f012608701149fa939e5645 ]
A statement was originally added in 2006 to shut up a gcc warning, now but now clang warns about it:
fs/jfs/jfs_txnmgr.c:1932:15: error: variable 'pxd' is uninitialized when used within its own initialization
[-Werror,-Wuninitialized]
pxd_t pxd = pxd; /* truncated extent of xad */
~~~ ^~~
Modern versions of gcc are fine without the silly assignment, so just drop it. Tested with gcc-4.6 (released 2011), 4.7, 4.8, and 4.9.
--- fs/jfs/jfs_txnmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/jfs/jfs_txnmgr.c +1 -2
@@ -1928,8 +1928,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,* header ? */ if (tlck->type & tlckTRUNCATE) { -/* This odd declaration suppresses a bogus gcc warning */ -pxd_t pxd = pxd;/* truncated extent of xad */ +pxd_t pxd;/* truncated extent of xad */ int twm;/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 255/671 tipc: tipc clang warning
In reply to Sasha LevinFrom: Jon Maloy <[email protected]>
[ Upstream commit 737889efe9713a0f20a75fd0de952841d9275e6b ]
When checking the code with clang -Wsometimes-uninitialized we get the following warning:
if (!tipc_link_is_establishing(l)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/tipc/node.c:847:46: note: uninitialized use occurs here
tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr);net/tipc/node.c:831:2: note: remove the 'if' if its condition is always true
if (!tipc_link_is_establishing(l)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~net/tipc/node.c:821:31: note: initialize the variable 'maddr' to silence this warning
struct tipc_media_addr *maddr;
We fix this by initializing 'maddr' to NULL. For the matter of clarity, we also test if 'xmitq' is non-empty before we use it and 'maddr' further down in the function. It will never happen that 'xmitq' is non- empty at the same time as 'maddr' is NULL, so this is a sufficient test.
--- net/tipc/node.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/tipc/node.c +4 -3
@@ -810,10 +810,10 @@ static void __tipc_node_link_down(struct tipc_node *n, int *bearer_id,static void tipc_node_link_down (struct tipc_node *n,int bearer_id,bool delete) {struct tipc_link_entry *le = &n->links[bearer_id]; +struct tipc_media_addr *maddr =NULL ;struct tipc_link *l = le->link; -struct tipc_media_addr *maddr; -struct sk_buff_head xmitq;int old_bearer_id = bearer_id; +struct sk_buff_head xmitq;if (!l)return ;
@@ -835,7 +835,8 @@ static void tipc_node_link_down(struct tipc_node *n, int bearer_id, bool delete)tipc_node_write_unlock (n);if (delete)tipc_mon_remove_peer (n->net, n->addr, old_bearer_id); -tipc_bearer_xmit (n->net, bearer_id, &xmitq, maddr); +if (!skb_queue_empty (&xmitq)) +tipc_bearer_xmit (n->net, bearer_id, &xmitq, maddr);tipc_sk_rcv (n->net, &le->inputq); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 256/671 m68k: mac: Fix VIA timer counter accesses
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 0ca7ce7db771580433bf24454f7a1542bd326078 ]
This resolves some bugs that affect VIA timer counter accesses. Avoid lost interrupts caused by reading the counter low byte register. Make allowance for the fact that the counter will be decremented to 0xFFFF before being reloaded.
--- arch/m68k/mac/via.c | 102 +++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 49 deletions(-)
arch/m68k/mac/via.c +53 -49
@@ -54,16 +54,6 @@ static __u8 rbv_clear;static int gIER,gIFR,gBufA,gBufB; -/* -* Timer defs. -*/ - -#define TICK_SIZE 10000 -#define MAC_CLOCK_TICK (783300/HZ)/* ticks per HZ */ -#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) -#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) - -/* * On Macs with a genuine VIA chip there is no way to mask an individual slot * interrupt. This limitation also seems to apply to VIA clone logic cores in
@@ -267,22 +257,6 @@ void __init via_init(void) } } -/* -* Start the 100 Hz clock -*/ - -void __init via_init_clock (irq_handler_t func) -{ - via1[vACR] |=0x40 ; - via1[vT1LL] =MAC_CLOCK_LOW ; - via1[vT1LH] =MAC_CLOCK_HIGH ; - via1[vT1CL] =MAC_CLOCK_LOW ; - via1[vT1CH] =MAC_CLOCK_HIGH ; - -if (request_irq (IRQ_MAC_TIMER_1 , func,0 ,"timer" , func)) -pr_err ("Couldn't register %s interrupt\n" ,"timer" ); -} -/* * Debugging dump, used in various places to see what's going on. */
@@ -310,29 +284,6 @@ void via_debug_dump(void) } } -/* -* This is always executed with interrupts disabled. -* -* TBI: get time offset between scheduling timer ticks -*/ - -u32 mac_gettimeoffset (void ) -{ -unsigned long ticks, offset =0 ; - -/* read VIA1 timer 2 current value */ - ticks = via1[vT1CL] | (via1[vT1CH] <<8 ); -/* The probability of underflow is less than 2% */ -if (ticks >MAC_CLOCK_TICK -MAC_CLOCK_TICK /50 ) -/* Check for pending timer interrupt in VIA1 IFR */ -if (via1[vIFR] &0x40 ) offset =TICK_SIZE ; - - ticks =MAC_CLOCK_TICK - ticks; - ticks = ticks *10000L /MAC_CLOCK_TICK ; - -return (ticks + offset) *1000 ; -} -/* * Flush the L2 cache on Macs that have it by flipping * the system into 24-bit mode for an instant.
@@ -601,3 +552,56 @@ int via2_scsi_drq_pending(void)return via2[gIFR] & (1 <<IRQ_IDX (IRQ_MAC_SCSIDRQ )); }EXPORT_SYMBOL (via2_scsi_drq_pending); + +/* timer and clock source */ + +#define VIA_CLOCK_FREQ 783360/* VIA "phase 2" clock in Hz */ +#define VIA_TIMER_INTERVAL (1000000 / HZ)/* microseconds per jiffy */ +#define VIA_TIMER_CYCLES (VIA_CLOCK_FREQ / HZ)/* clock cycles per jiffy */ + +#define VIA_TC (VIA_TIMER_CYCLES - 2)/* including 0 and -1 */ +#define VIA_TC_LOW (VIA_TC & 0xFF) +#define VIA_TC_HIGH (VIA_TC >> 8) + +void __init via_init_clock (irq_handler_t timer_routine) +{ +if (request_irq (IRQ_MAC_TIMER_1 , timer_routine,0 ,"timer" ,NULL )) { +pr_err ("Couldn't register %s interrupt\n" ,"timer" ); +return ; + } + + via1[vT1LL] =VIA_TC_LOW ; + via1[vT1LH] =VIA_TC_HIGH ; + via1[vT1CL] =VIA_TC_LOW ; + via1[vT1CH] =VIA_TC_HIGH ; + via1[vACR] |=0x40 ; +} + +u32 mac_gettimeoffset (void ) +{ +unsigned long flags; +u8 count_high; +u16 count, offset =0 ; + +/* +* Timer counter wrap-around is detected with the timer interrupt flag +* but reading the counter low byte (vT1CL) would reset the flag. +* Also, accessing both counter registers is essentially a data race. +* These problems are avoided by ignoring the low byte. Clock accuracy +* is 256 times worse (error can reach 0.327 ms) but CPU overhead is +* reduced by avoiding slow VIA register accesses. +*/ + +local_irq_save (flags); + count_high = via1[vT1CH]; +if (count_high ==0xFF ) + count_high =0 ; +if (count_high >0 && (via1[vIFR] &VIA_TIMER_1_INT )) + offset =VIA_TIMER_CYCLES ; +local_irq_restore (flags); + + count = count_high <<8 ; + count =VIA_TIMER_CYCLES - count + offset; + +return ((count *VIA_TIMER_INTERVAL ) /VIA_TIMER_CYCLES ) *1000 ; +}
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 257/671 ARM: dts: sun8i: a33: Reintroduce default pinctrl muxing
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit fa44328f4eb0b762a1fcb148809068e9646e7156 ]
Commit d02752149759 ("ARM: dts: sun8i-a23-a33: Move NAND controller device node to sort by address") moved the NAND controller node around, but dropped the default muxing in the process.
Reintroduce it.
--- arch/arm/boot/dts/sun8i-a23-a33.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/sun8i-a23-a33.dtsi +2 -0
@@ -163,6 +163,8 @@ clock-names = "ahb", "mod"; resets = <&ccu RST_BUS_NAND>; reset-names = "ahb"; + pinctrl-names = "default"; + pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>; status = "disabled"; #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 258/671 arm64: dts: allwinner: a64: Add missing PIO clocks
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit 562bf19611c000cb7219431c3cc78aa60c2b371e ]
The pinctrl binding mandates that we have the three clocks fed into the PIO described.
Even though the old case is still supported for backward compatibility, we should update our DTs to fix this.
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -1
@@ -366,7 +366,8 @@ interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&ccu 58>; + clocks = <&ccu 58>, <&osc24M>, <&rtc 0>; + clock-names = "apb", "hosc", "losc"; gpio-controller; #gpio-cells = <3>; interrupt-controller;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 259/671 ARM: dts: sun9i: optimus: Fix fixed-regulators
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit c2a5b554751545023056559121a8ecf86aebe541 ]
Commit 1848f3f44444 ("ARM: dts: sun9i: Remove GPIO pinctrl nodes to avoid warnings") was wrong on the optimus, and instead of droping the pinctrl-names property, it dropped the regulator-name one.
Obviously, that wasn't what was intended. Reinstate regulator-name and drop pinctrl-names.
--- arch/arm/boot/dts/sun9i-a80-optimus.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun9i-a80-optimus.dts +2 -2
@@ -82,7 +82,7 @@ reg_usb1_vbus: usb1-vbus { compatible = "regulator-fixed"; - pinctrl-names = "default"; + regulator-name = "usb1-vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high;
@@ -91,7 +91,7 @@ reg_usb3_vbus: usb3-vbus { compatible = "regulator-fixed"; - pinctrl-names = "default"; + regulator-name = "usb3-vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 260/671 net: phy: don't clear BMCR in genphy_soft_reset
In reply to Sasha LevinFrom: Heiner Kallweit <[email protected]>
[ Upstream commit d29f5aa0bc0c321e1b9e4658a2a7e08e885da52a ]
So far we effectively clear the BMCR register. Some PHY's can deal with this (e.g. because they reset BMCR to a default as part of a soft-reset) whilst on others this causes issues because e.g. the autoneg bit is cleared. Marvell is an example, see also thread [0]. So let's be a little bit more gentle and leave all bits we're not interested in as-is. This change is needed for PHY drivers to properly deal with the original patch.
[0] https://marc.info/?t=155264050700001&r=1&w=2
--- drivers/net/phy/phy_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy_device.c +1 -1
@@ -1657,7 +1657,7 @@ int genphy_soft_reset(struct phy_device *phydev) {int ret; - ret =phy_write (phydev,MII_BMCR ,BMCR_RESET ); + ret =phy_set_bits (phydev,MII_BMCR ,BMCR_RESET );if (ret <0 )return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 261/671 ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset()
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 7f0d078667a494466991aa7133f49594f32ff6a2 ]
Commit 747834ab8347 ("ARM: OMAP2+: hwmod: revise hardreset behavior") made the call to _enable() conditional based on no oh->rst_lines_cnt. This caused the return value to be potentially uninitialized. Curiously we see no compiler warnings for this, probably as this gets inlined.
We call _setup_reset() from _setup() and only _setup_postsetup() if the return value is zero. Currently the return value can be uninitialized for cases where oh->rst_lines_cnt is set and HWMOD_INIT_NO_RESET is not set.
--- arch/arm/mach-omap2/omap_hwmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod.c +1 -1
@@ -2430,7 +2430,7 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh)*/ static int _setup_reset (struct omap_hwmod *oh) { -int r; +int r =0 ;if (oh->_state != _HWMOD_STATE_INITIALIZED)return -EINVAL ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 262/671 net: dsa: Avoid null pointer when failing to connect to PHY
In reply to Sasha LevinFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 6146dd453e235c487d85ae4dc6cc08978a1c890f ]
When phylink_of_phy_connect fails, dsa_slave_phy_setup tries to save the day by connecting to an alternative PHY, none other than a PHY on the switch's internal MDIO bus, at an address equal to the port's index.
However this does not take into consideration the scenario when the switch that failed to probe an external PHY does not have an internal MDIO bus at all.
--- net/dsa/slave.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/dsa/slave.c +4 -4
@@ -1219,9 +1219,9 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) phy_flags = ds->ops->get_phy_flags (ds, dp->index); ret =phylink_of_phy_connect (dp->pl, port_dn, phy_flags); -if (ret == -ENODEV ) { -/* We could not connect to a designated PHY or SFP, so use the -* switch internal MDIO bus instead +if (ret == -ENODEV && ds->slave_mii_bus) { +/* We could not connect to a designated PHY or SFP, so try to +* use the switch internal MDIO bus instead */ ret =dsa_slave_phy_connect (slave_dev, dp->index);if (ret) {
@@ -1233,7 +1233,7 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) } } -return 0 ; +return ret; }static struct lock_class_key dsa_slave_netdev_xmit_lock_key;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 263/671 soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 93b260528020792032e50725383f27a27897bb0f ]
The memremap() function doesn't return error pointers, it returns NULL. This code is returning "ret = PTR_ERR(NULL);" which is success, but it should return -ENOMEM.
--- drivers/soc/qcom/cmd-db.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/cmd-db.c +2 -2
@@ -283,8 +283,8 @@ static int cmd_db_dev_probe(struct platform_device *pdev) } cmd_db_header =memremap (rmem->base, rmem->size,MEMREMAP_WB ); -if (IS_ERR_OR_NULL (cmd_db_header)) { - ret =PTR_ERR (cmd_db_header); +if (!cmd_db_header) { + ret = -ENOMEM ; cmd_db_header =NULL ;return ret; }
Signature · 1 line
2.20.1