From: Greg Kroah-Hartman Date: Fri, 15 Jan 2021 10:35:10 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.4.252~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5848020024faea082d2a1e68634744787d0dbe7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: arm-omap2-omap_device-fix-idling-of-devices-during-probe.patch block-rsxx-select-config_crc32.patch cpufreq-powernow-k8-pass-policy-rather-than-use-cpufreq_cpu_get.patch dmaengine-mediatek-mtk-hsdma-fix-a-resource-leak-in-the-error-handling-path-of-the-probe-function.patch dmaengine-xilinx_dma-check-dma_async_device_register-return-value.patch dmaengine-xilinx_dma-fix-incompatible-param-warning-in-_child_probe.patch dmaengine-xilinx_dma-fix-mixed_enum_type-coverity-warning.patch i2c-sprd-use-a-specific-timeout-to-avoid-system-hang-up-issue.patch iommu-intel-fix-memleak-in-intel_irq_remapping_alloc.patch kvm-arm64-don-t-access-pmcr_el0-when-no-pmu-is-available.patch lightnvm-select-config_crc32.patch net-mlx5e-fix-memleak-in-mlx5e_create_l2_table_groups.patch net-mlx5e-fix-two-double-free-cases.patch regmap-debugfs-fix-a-memory-leak-when-calling-regmap_attach_dev.patch spi-stm32-fifo-threshold-level-fix-align-packet-size.patch wan-ds26522-select-config_bitreverse.patch wil6210-select-config_crc32.patch --- diff --git a/queue-4.19/arm-omap2-omap_device-fix-idling-of-devices-during-probe.patch b/queue-4.19/arm-omap2-omap_device-fix-idling-of-devices-during-probe.patch new file mode 100644 index 00000000000..7f3d413c119 --- /dev/null +++ b/queue-4.19/arm-omap2-omap_device-fix-idling-of-devices-during-probe.patch @@ -0,0 +1,64 @@ +From ec76c2eea903947202098090bbe07a739b5246e9 Mon Sep 17 00:00:00 2001 +From: Andreas Kemnade +Date: Fri, 4 Dec 2020 10:55:39 +0100 +Subject: ARM: OMAP2+: omap_device: fix idling of devices during probe + +From: Andreas Kemnade + +commit ec76c2eea903947202098090bbe07a739b5246e9 upstream. + +On the GTA04A5 od->_driver_status was not set to BUS_NOTIFY_BIND_DRIVER +during probe of the second mmc used for wifi. Therefore +omap_device_late_idle idled the device during probing causing oopses when +accessing the registers. + +It was not set because od->_state was set to OMAP_DEVICE_STATE_IDLE +in the notifier callback. Therefore set od->_driver_status also in that +case. + +This came apparent after commit 21b2cec61c04 ("mmc: Set +PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") causing this +oops: + +omap_hsmmc 480b4000.mmc: omap_device_late_idle: enabled but no driver. Idling +8<--- cut here --- +Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0b402c +... +(omap_hsmmc_set_bus_width) from [] (omap_hsmmc_set_ios+0x11c/0x258) +(omap_hsmmc_set_ios) from [] (mmc_power_up.part.8+0x3c/0xd0) +(mmc_power_up.part.8) from [] (mmc_start_host+0x88/0x9c) +(mmc_start_host) from [] (mmc_add_host+0x58/0x84) +(mmc_add_host) from [] (omap_hsmmc_probe+0x5fc/0x8c0) +(omap_hsmmc_probe) from [] (platform_drv_probe+0x48/0x98) +(platform_drv_probe) from [] (really_probe+0x1dc/0x3b4) + +Fixes: 04abaf07f6d5 ("ARM: OMAP2+: omap_device: Sync omap_device and pm_runtime after probe defer") +Fixes: 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") +Acked-by: Ulf Hansson +Signed-off-by: Andreas Kemnade +[tony@atomide.com: left out extra parens, trimmed description stack trace] +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/omap_device.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/arm/mach-omap2/omap_device.c ++++ b/arch/arm/mach-omap2/omap_device.c +@@ -239,10 +239,12 @@ static int _omap_device_notifier_call(st + break; + case BUS_NOTIFY_BIND_DRIVER: + od = to_omap_device(pdev); +- if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) && +- pm_runtime_status_suspended(dev)) { ++ if (od) { + od->_driver_status = BUS_NOTIFY_BIND_DRIVER; +- pm_runtime_set_active(dev); ++ if (od->_state == OMAP_DEVICE_STATE_ENABLED && ++ pm_runtime_status_suspended(dev)) { ++ pm_runtime_set_active(dev); ++ } + } + break; + case BUS_NOTIFY_ADD_DEVICE: diff --git a/queue-4.19/block-rsxx-select-config_crc32.patch b/queue-4.19/block-rsxx-select-config_crc32.patch new file mode 100644 index 00000000000..dd54ff314b1 --- /dev/null +++ b/queue-4.19/block-rsxx-select-config_crc32.patch @@ -0,0 +1,33 @@ +From 36a106a4c1c100d55ba3d32a21ef748cfcd4fa99 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 3 Jan 2021 22:42:39 +0100 +Subject: block: rsxx: select CONFIG_CRC32 + +From: Arnd Bergmann + +commit 36a106a4c1c100d55ba3d32a21ef748cfcd4fa99 upstream. + +Without crc32, the driver fails to link: + +arm-linux-gnueabi-ld: drivers/block/rsxx/config.o: in function `rsxx_load_config': +config.c:(.text+0x124): undefined reference to `crc32_le' + +Fixes: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver") +Signed-off-by: Arnd Bergmann +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/block/Kconfig ++++ b/drivers/block/Kconfig +@@ -474,6 +474,7 @@ config BLK_DEV_RBD + config BLK_DEV_RSXX + tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver" + depends on PCI ++ select CRC32 + help + Device driver for IBM's high speed PCIe SSD + storage device: Flash Adapter 900GB Full Height. diff --git a/queue-4.19/cpufreq-powernow-k8-pass-policy-rather-than-use-cpufreq_cpu_get.patch b/queue-4.19/cpufreq-powernow-k8-pass-policy-rather-than-use-cpufreq_cpu_get.patch new file mode 100644 index 00000000000..05c1231ccde --- /dev/null +++ b/queue-4.19/cpufreq-powernow-k8-pass-policy-rather-than-use-cpufreq_cpu_get.patch @@ -0,0 +1,63 @@ +From 943bdd0cecad06da8392a33093230e30e501eccc Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Tue, 5 Jan 2021 10:19:57 +0000 +Subject: cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() + +From: Colin Ian King + +commit 943bdd0cecad06da8392a33093230e30e501eccc upstream. + +Currently there is an unlikely case where cpufreq_cpu_get() returns a +NULL policy and this will cause a NULL pointer dereference later on. + +Fix this by passing the policy to transition_frequency_fidvid() from +the caller and hence eliminating the need for the cpufreq_cpu_get() +and cpufreq_cpu_put(). + +Thanks to Viresh Kumar for suggesting the fix. + +Addresses-Coverity: ("Dereference null return") +Fixes: b43a7ffbf33b ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()") +Suggested-by: Viresh Kumar +Signed-off-by: Colin Ian King +Acked-by: Viresh Kumar +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpufreq/powernow-k8.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/cpufreq/powernow-k8.c ++++ b/drivers/cpufreq/powernow-k8.c +@@ -881,9 +881,9 @@ static int get_transition_latency(struct + + /* Take a frequency, and issue the fid/vid transition command */ + static int transition_frequency_fidvid(struct powernow_k8_data *data, +- unsigned int index) ++ unsigned int index, ++ struct cpufreq_policy *policy) + { +- struct cpufreq_policy *policy; + u32 fid = 0; + u32 vid = 0; + int res; +@@ -915,9 +915,6 @@ static int transition_frequency_fidvid(s + freqs.old = find_khz_freq_from_fid(data->currfid); + freqs.new = find_khz_freq_from_fid(fid); + +- policy = cpufreq_cpu_get(smp_processor_id()); +- cpufreq_cpu_put(policy); +- + cpufreq_freq_transition_begin(policy, &freqs); + res = transition_fid_vid(data, fid, vid); + cpufreq_freq_transition_end(policy, &freqs, res); +@@ -972,7 +969,7 @@ static long powernowk8_target_fn(void *a + + powernow_k8_acpi_pst_values(data, newstate); + +- ret = transition_frequency_fidvid(data, newstate); ++ ret = transition_frequency_fidvid(data, newstate, pol); + + if (ret) { + pr_err("transition frequency failed\n"); diff --git a/queue-4.19/dmaengine-mediatek-mtk-hsdma-fix-a-resource-leak-in-the-error-handling-path-of-the-probe-function.patch b/queue-4.19/dmaengine-mediatek-mtk-hsdma-fix-a-resource-leak-in-the-error-handling-path-of-the-probe-function.patch new file mode 100644 index 00000000000..7a7212eaad5 --- /dev/null +++ b/queue-4.19/dmaengine-mediatek-mtk-hsdma-fix-a-resource-leak-in-the-error-handling-path-of-the-probe-function.patch @@ -0,0 +1,33 @@ +From 33cbd54dc515cc04b5a603603414222b4bb1448d Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Sat, 19 Dec 2020 13:47:18 +0100 +Subject: dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function + +From: Christophe JAILLET + +commit 33cbd54dc515cc04b5a603603414222b4bb1448d upstream. + +'mtk_hsdma_hw_deinit()' should be called in the error handling path of the +probe function to undo a previous 'mtk_hsdma_hw_init()' call, as already +done in the remove function. + +Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/20201219124718.182664-1-christophe.jaillet@wanadoo.fr +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/mediatek/mtk-hsdma.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/dma/mediatek/mtk-hsdma.c ++++ b/drivers/dma/mediatek/mtk-hsdma.c +@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platfo + return 0; + + err_free: ++ mtk_hsdma_hw_deinit(hsdma); + of_dma_controller_free(pdev->dev.of_node); + err_unregister: + dma_async_device_unregister(dd); diff --git a/queue-4.19/dmaengine-xilinx_dma-check-dma_async_device_register-return-value.patch b/queue-4.19/dmaengine-xilinx_dma-check-dma_async_device_register-return-value.patch new file mode 100644 index 00000000000..aac052014de --- /dev/null +++ b/queue-4.19/dmaengine-xilinx_dma-check-dma_async_device_register-return-value.patch @@ -0,0 +1,40 @@ +From 99974aedbd73523969afb09f33c6e3047cd0ddae Mon Sep 17 00:00:00 2001 +From: Shravya Kumbham +Date: Wed, 23 Dec 2020 16:51:00 +0530 +Subject: dmaengine: xilinx_dma: check dma_async_device_register return value + +From: Shravya Kumbham + +commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream. + +dma_async_device_register() can return non-zero error code. Add +condition to check the return value of dma_async_device_register +function and handle the error path. + +Addresses-Coverity: Event check_return. +Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") +Signed-off-by: Shravya Kumbham +Signed-off-by: Radhey Shyam Pandey +Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/xilinx/xilinx_dma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/dma/xilinx/xilinx_dma.c ++++ b/drivers/dma/xilinx/xilinx_dma.c +@@ -2713,7 +2713,11 @@ static int xilinx_dma_probe(struct platf + } + + /* Register the DMA engine with the core */ +- dma_async_device_register(&xdev->common); ++ err = dma_async_device_register(&xdev->common); ++ if (err) { ++ dev_err(xdev->dev, "failed to register the dma device\n"); ++ goto error; ++ } + + err = of_dma_controller_register(node, of_dma_xilinx_xlate, + xdev); diff --git a/queue-4.19/dmaengine-xilinx_dma-fix-incompatible-param-warning-in-_child_probe.patch b/queue-4.19/dmaengine-xilinx_dma-fix-incompatible-param-warning-in-_child_probe.patch new file mode 100644 index 00000000000..f97571006a8 --- /dev/null +++ b/queue-4.19/dmaengine-xilinx_dma-fix-incompatible-param-warning-in-_child_probe.patch @@ -0,0 +1,38 @@ +From faeb0731be0a31e2246b21a85fa7dabbd750101d Mon Sep 17 00:00:00 2001 +From: Shravya Kumbham +Date: Wed, 23 Dec 2020 16:51:01 +0530 +Subject: dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() + +From: Shravya Kumbham + +commit faeb0731be0a31e2246b21a85fa7dabbd750101d upstream. + +In xilinx_dma_child_probe function, the nr_channels variable is +passed to of_property_read_u32() which expects an u32 return value +pointer. Modify the nr_channels variable type from int to u32 to +fix the incompatible parameter coverity warning. + +Addresses-Coverity: Event incompatible_param. +Fixes: 1a9e7a03c761 ("dmaengine: vdma: Add support for mulit-channel dma mode") +Signed-off-by: Shravya Kumbham +Signed-off-by: Radhey Shyam Pandey +Link: https://lore.kernel.org/r/1608722462-29519-3-git-send-email-radhey.shyam.pandey@xilinx.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/xilinx/xilinx_dma.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/dma/xilinx/xilinx_dma.c ++++ b/drivers/dma/xilinx/xilinx_dma.c +@@ -2529,7 +2529,8 @@ static int xilinx_dma_chan_probe(struct + static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev, + struct device_node *node) + { +- int ret, i, nr_channels = 1; ++ int ret, i; ++ u32 nr_channels = 1; + + ret = of_property_read_u32(node, "dma-channels", &nr_channels); + if ((ret < 0) && xdev->mcdma) diff --git a/queue-4.19/dmaengine-xilinx_dma-fix-mixed_enum_type-coverity-warning.patch b/queue-4.19/dmaengine-xilinx_dma-fix-mixed_enum_type-coverity-warning.patch new file mode 100644 index 00000000000..30edb1a84b7 --- /dev/null +++ b/queue-4.19/dmaengine-xilinx_dma-fix-mixed_enum_type-coverity-warning.patch @@ -0,0 +1,35 @@ +From 2d5efea64472469117dc1a9a39530069e95b21e9 Mon Sep 17 00:00:00 2001 +From: Shravya Kumbham +Date: Wed, 23 Dec 2020 16:51:02 +0530 +Subject: dmaengine: xilinx_dma: fix mixed_enum_type coverity warning + +From: Shravya Kumbham + +commit 2d5efea64472469117dc1a9a39530069e95b21e9 upstream. + +Typecast the fls(width -1) with (enum dmaengine_alignment) in +xilinx_dma_chan_probe function to fix the coverity warning. + +Addresses-Coverity: Event mixed_enum_type. +Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") +Signed-off-by: Shravya Kumbham +Signed-off-by: Radhey Shyam Pandey +Link: https://lore.kernel.org/r/1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/xilinx/xilinx_dma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/dma/xilinx/xilinx_dma.c ++++ b/drivers/dma/xilinx/xilinx_dma.c +@@ -2426,7 +2426,7 @@ static int xilinx_dma_chan_probe(struct + has_dre = false; + + if (!has_dre) +- xdev->common.copy_align = fls(width - 1); ++ xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1); + + if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") || + of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") || diff --git a/queue-4.19/i2c-sprd-use-a-specific-timeout-to-avoid-system-hang-up-issue.patch b/queue-4.19/i2c-sprd-use-a-specific-timeout-to-avoid-system-hang-up-issue.patch new file mode 100644 index 00000000000..2f8b80843b1 --- /dev/null +++ b/queue-4.19/i2c-sprd-use-a-specific-timeout-to-avoid-system-hang-up-issue.patch @@ -0,0 +1,57 @@ +From 0b884fe71f9ee6a5df35e677154256ea2099ebb8 Mon Sep 17 00:00:00 2001 +From: Chunyan Zhang +Date: Mon, 14 Dec 2020 12:58:50 +0800 +Subject: i2c: sprd: use a specific timeout to avoid system hang up issue + +From: Chunyan Zhang + +commit 0b884fe71f9ee6a5df35e677154256ea2099ebb8 upstream. + +If the i2c device SCL bus being pulled up due to some exception before +message transfer done, the system cannot receive the completing interrupt +signal any more, it would not exit waiting loop until MAX_SCHEDULE_TIMEOUT +jiffies eclipse, that would make the system seemed hang up. To avoid that +happen, this patch adds a specific timeout for message transfer. + +Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver") +Signed-off-by: Linhua Xu +Signed-off-by: Chunyan Zhang +[wsa: changed errno to ETIMEDOUT] +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-sprd.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-sprd.c ++++ b/drivers/i2c/busses/i2c-sprd.c +@@ -71,6 +71,8 @@ + + /* timeout (ms) for pm runtime autosuspend */ + #define SPRD_I2C_PM_TIMEOUT 1000 ++/* timeout (ms) for transfer message */ ++#define I2C_XFER_TIMEOUT 1000 + + /* SPRD i2c data structure */ + struct sprd_i2c { +@@ -244,6 +246,7 @@ static int sprd_i2c_handle_msg(struct i2 + struct i2c_msg *msg, bool is_last_msg) + { + struct sprd_i2c *i2c_dev = i2c_adap->algo_data; ++ unsigned long time_left; + + i2c_dev->msg = msg; + i2c_dev->buf = msg->buf; +@@ -273,7 +276,10 @@ static int sprd_i2c_handle_msg(struct i2 + + sprd_i2c_opt_start(i2c_dev); + +- wait_for_completion(&i2c_dev->complete); ++ time_left = wait_for_completion_timeout(&i2c_dev->complete, ++ msecs_to_jiffies(I2C_XFER_TIMEOUT)); ++ if (!time_left) ++ return -ETIMEDOUT; + + return i2c_dev->err; + } diff --git a/queue-4.19/iommu-intel-fix-memleak-in-intel_irq_remapping_alloc.patch b/queue-4.19/iommu-intel-fix-memleak-in-intel_irq_remapping_alloc.patch new file mode 100644 index 00000000000..77468c601ae --- /dev/null +++ b/queue-4.19/iommu-intel-fix-memleak-in-intel_irq_remapping_alloc.patch @@ -0,0 +1,35 @@ +From ff2b46d7cff80d27d82f7f3252711f4ca1666129 Mon Sep 17 00:00:00 2001 +From: Dinghao Liu +Date: Tue, 5 Jan 2021 13:18:37 +0800 +Subject: iommu/intel: Fix memleak in intel_irq_remapping_alloc + +From: Dinghao Liu + +commit ff2b46d7cff80d27d82f7f3252711f4ca1666129 upstream. + +When irq_domain_get_irq_data() or irqd_cfg() fails +at i == 0, data allocated by kzalloc() has not been +freed before returning, which leads to memleak. + +Fixes: b106ee63abcc ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains") +Signed-off-by: Dinghao Liu +Acked-by: Lu Baolu +Link: https://lore.kernel.org/r/20210105051837.32118-1-dinghao.liu@zju.edu.cn +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/intel_irq_remapping.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/iommu/intel_irq_remapping.c ++++ b/drivers/iommu/intel_irq_remapping.c +@@ -1373,6 +1373,8 @@ static int intel_irq_remapping_alloc(str + irq_data = irq_domain_get_irq_data(domain, virq + i); + irq_cfg = irqd_cfg(irq_data); + if (!irq_data || !irq_cfg) { ++ if (!i) ++ kfree(data); + ret = -EINVAL; + goto out_free_data; + } diff --git a/queue-4.19/kvm-arm64-don-t-access-pmcr_el0-when-no-pmu-is-available.patch b/queue-4.19/kvm-arm64-don-t-access-pmcr_el0-when-no-pmu-is-available.patch new file mode 100644 index 00000000000..4e5eca04589 --- /dev/null +++ b/queue-4.19/kvm-arm64-don-t-access-pmcr_el0-when-no-pmu-is-available.patch @@ -0,0 +1,46 @@ +From 2a5f1b67ec577fb1544b563086e0377f095f88e2 Mon Sep 17 00:00:00 2001 +From: Marc Zyngier +Date: Thu, 10 Dec 2020 08:30:59 +0000 +Subject: KVM: arm64: Don't access PMCR_EL0 when no PMU is available + +From: Marc Zyngier + +commit 2a5f1b67ec577fb1544b563086e0377f095f88e2 upstream. + +We reset the guest's view of PMCR_EL0 unconditionally, based on +the host's view of this register. It is however legal for an +implementation not to provide any PMU, resulting in an UNDEF. + +The obvious fix is to skip the reset of this shadow register +when no PMU is available, sidestepping the issue entirely. +If no PMU is available, the guest is not able to request +a virtual PMU anyway, so not doing nothing is the right thing +to do! + +It is unlikely that this bug can hit any HW implementation +though, as they all provide a PMU. It has been found using nested +virt with the host KVM not implementing the PMU itself. + +Fixes: ab9468340d2bc ("arm64: KVM: Add access handler for PMCR register") +Reviewed-by: Alexandru Elisei +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20201210083059.1277162-1-maz@kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/kvm/sys_regs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm64/kvm/sys_regs.c ++++ b/arch/arm64/kvm/sys_regs.c +@@ -619,6 +619,10 @@ static void reset_pmcr(struct kvm_vcpu * + { + u64 pmcr, val; + ++ /* No PMU available, PMCR_EL0 may UNDEF... */ ++ if (!kvm_arm_support_pmu_v3()) ++ return; ++ + pmcr = read_sysreg(pmcr_el0); + /* + * Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) are reset to UNKNOWN diff --git a/queue-4.19/lightnvm-select-config_crc32.patch b/queue-4.19/lightnvm-select-config_crc32.patch new file mode 100644 index 00000000000..1ff43badbdd --- /dev/null +++ b/queue-4.19/lightnvm-select-config_crc32.patch @@ -0,0 +1,35 @@ +From 19cd3403cb0d522dd5e10188eef85817de29e26e Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 3 Jan 2021 22:43:09 +0100 +Subject: lightnvm: select CONFIG_CRC32 + +From: Arnd Bergmann + +commit 19cd3403cb0d522dd5e10188eef85817de29e26e upstream. + +Without CRC32 support, this fails to link: + +arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_init': +pblk-init.c:(.text+0x2654): undefined reference to `crc32_le' +arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_exit': +pblk-init.c:(.text+0x2a7c): undefined reference to `crc32_le' + +Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") +Signed-off-by: Arnd Bergmann +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/lightnvm/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/lightnvm/Kconfig ++++ b/drivers/lightnvm/Kconfig +@@ -19,6 +19,7 @@ if NVM + + config NVM_PBLK + tristate "Physical Block Device Open-Channel SSD target" ++ select CRC32 + help + Allows an open-channel SSD to be exposed as a block device to the + host. The target assumes the device exposes raw flash and must be diff --git a/queue-4.19/net-mlx5e-fix-memleak-in-mlx5e_create_l2_table_groups.patch b/queue-4.19/net-mlx5e-fix-memleak-in-mlx5e_create_l2_table_groups.patch new file mode 100644 index 00000000000..76d01783dd0 --- /dev/null +++ b/queue-4.19/net-mlx5e-fix-memleak-in-mlx5e_create_l2_table_groups.patch @@ -0,0 +1,34 @@ +From 5b0bb12c58ac7d22e05b5bfdaa30a116c8c32e32 Mon Sep 17 00:00:00 2001 +From: Dinghao Liu +Date: Mon, 21 Dec 2020 19:27:31 +0800 +Subject: net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups + +From: Dinghao Liu + +commit 5b0bb12c58ac7d22e05b5bfdaa30a116c8c32e32 upstream. + +When mlx5_create_flow_group() fails, ft->g should be +freed just like when kvzalloc() fails. The caller of +mlx5e_create_l2_table_groups() does not catch this +issue on failure, which leads to memleak. + +Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table") +Signed-off-by: Dinghao Liu +Reviewed-by: Leon Romanovsky +Signed-off-by: Saeed Mahameed +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +@@ -1312,6 +1312,7 @@ err_destroy_groups: + ft->g[ft->num_groups] = NULL; + mlx5e_destroy_groups(ft); + kvfree(in); ++ kfree(ft->g); + + return err; + } diff --git a/queue-4.19/net-mlx5e-fix-two-double-free-cases.patch b/queue-4.19/net-mlx5e-fix-two-double-free-cases.patch new file mode 100644 index 00000000000..bfb1b2a28b6 --- /dev/null +++ b/queue-4.19/net-mlx5e-fix-two-double-free-cases.patch @@ -0,0 +1,45 @@ +From 7a6eb072a9548492ead086f3e820e9aac71c7138 Mon Sep 17 00:00:00 2001 +From: Dinghao Liu +Date: Mon, 28 Dec 2020 16:48:40 +0800 +Subject: net/mlx5e: Fix two double free cases + +From: Dinghao Liu + +commit 7a6eb072a9548492ead086f3e820e9aac71c7138 upstream. + +mlx5e_create_ttc_table_groups() frees ft->g on failure of +kvzalloc(), but such failure will be caught by its caller +in mlx5e_create_ttc_table() and ft->g will be freed again +in mlx5e_destroy_flow_table(). The same issue also occurs +in mlx5e_create_ttc_table_groups(). Set ft->g to NULL after +kfree() to avoid double free. + +Fixes: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets") +Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table") +Signed-off-by: Dinghao Liu +Reviewed-by: Leon Romanovsky +Signed-off-by: Saeed Mahameed +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +@@ -893,6 +893,7 @@ static int mlx5e_create_ttc_table_groups + in = kvzalloc(inlen, GFP_KERNEL); + if (!in) { + kfree(ft->g); ++ ft->g = NULL; + return -ENOMEM; + } + +@@ -1033,6 +1034,7 @@ static int mlx5e_create_inner_ttc_table_ + in = kvzalloc(inlen, GFP_KERNEL); + if (!in) { + kfree(ft->g); ++ ft->g = NULL; + return -ENOMEM; + } + diff --git a/queue-4.19/regmap-debugfs-fix-a-memory-leak-when-calling-regmap_attach_dev.patch b/queue-4.19/regmap-debugfs-fix-a-memory-leak-when-calling-regmap_attach_dev.patch new file mode 100644 index 00000000000..d3081bea1ed --- /dev/null +++ b/queue-4.19/regmap-debugfs-fix-a-memory-leak-when-calling-regmap_attach_dev.patch @@ -0,0 +1,75 @@ +From cffa4b2122f5f3e53cf3d529bbc74651f95856d5 Mon Sep 17 00:00:00 2001 +From: Xiaolei Wang +Date: Tue, 29 Dec 2020 18:50:46 +0800 +Subject: regmap: debugfs: Fix a memory leak when calling regmap_attach_dev + +From: Xiaolei Wang + +commit cffa4b2122f5f3e53cf3d529bbc74651f95856d5 upstream. + +After initializing the regmap through +syscon_regmap_lookup_by_compatible, then regmap_attach_dev to the +device, because the debugfs_name has been allocated, there is no +need to redistribute it again + +unreferenced object 0xd8399b80 (size 64): + comm "swapper/0", pid 1, jiffies 4294937641 (age 278.590s) + hex dump (first 32 bytes): + 64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72 +dummy-iomuxc-gpr + 40 32 30 65 34 30 30 30 00 7f 52 5b d8 7e 42 69 +@20e4000..R[.~Bi + backtrace: + [] kasprintf+0x2c/0x54 + [<6ad3bbc2>] regmap_debugfs_init+0xdc/0x2fc + [] __regmap_init+0xc38/0xd88 + [<1f7e0609>] of_syscon_register+0x168/0x294 + [<735e8766>] device_node_get_regmap+0x6c/0x98 + [] imx6ul_init_machine+0x20/0x88 + [<0456565b>] customize_machine+0x1c/0x30 + [] do_one_initcall+0x80/0x3ac + [<7e584867>] kernel_init_freeable+0x170/0x1f0 + [<80074741>] kernel_init+0x8/0x120 + [<285d6f28>] ret_from_fork+0x14/0x20 + [<00000000>] 0x0 + +Fixes: 9b947a13e7f6 ("regmap: use debugfs even when no device") +Signed-off-by: Xiaolei Wang +Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/regmap/regmap-debugfs.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/base/regmap/regmap-debugfs.c ++++ b/drivers/base/regmap/regmap-debugfs.c +@@ -579,18 +579,25 @@ void regmap_debugfs_init(struct regmap * + devname = dev_name(map->dev); + + if (name) { +- map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", ++ if (!map->debugfs_name) { ++ map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", + devname, name); ++ if (!map->debugfs_name) ++ return; ++ } + name = map->debugfs_name; + } else { + name = devname; + } + + if (!strcmp(name, "dummy")) { +- kfree(map->debugfs_name); ++ if (!map->debugfs_name) ++ kfree(map->debugfs_name); + + map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d", + dummy_index); ++ if (!map->debugfs_name) ++ return; + name = map->debugfs_name; + dummy_index++; + } diff --git a/queue-4.19/series b/queue-4.19/series index ad193131222..d6b0a1635fa 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -21,3 +21,20 @@ spi-pxa2xx-fix-use-after-free-on-unbind.patch iio-imu-st_lsm6dsx-flip-irq-return-logic.patch iio-imu-st_lsm6dsx-fix-edge-trigger-interrupts.patch hid-wacom-fix-memory-leakage-caused-by-kfifo_alloc.patch +arm-omap2-omap_device-fix-idling-of-devices-during-probe.patch +i2c-sprd-use-a-specific-timeout-to-avoid-system-hang-up-issue.patch +cpufreq-powernow-k8-pass-policy-rather-than-use-cpufreq_cpu_get.patch +spi-stm32-fifo-threshold-level-fix-align-packet-size.patch +dmaengine-mediatek-mtk-hsdma-fix-a-resource-leak-in-the-error-handling-path-of-the-probe-function.patch +dmaengine-xilinx_dma-check-dma_async_device_register-return-value.patch +dmaengine-xilinx_dma-fix-incompatible-param-warning-in-_child_probe.patch +dmaengine-xilinx_dma-fix-mixed_enum_type-coverity-warning.patch +wil6210-select-config_crc32.patch +block-rsxx-select-config_crc32.patch +lightnvm-select-config_crc32.patch +iommu-intel-fix-memleak-in-intel_irq_remapping_alloc.patch +net-mlx5e-fix-memleak-in-mlx5e_create_l2_table_groups.patch +net-mlx5e-fix-two-double-free-cases.patch +regmap-debugfs-fix-a-memory-leak-when-calling-regmap_attach_dev.patch +wan-ds26522-select-config_bitreverse.patch +kvm-arm64-don-t-access-pmcr_el0-when-no-pmu-is-available.patch diff --git a/queue-4.19/spi-stm32-fifo-threshold-level-fix-align-packet-size.patch b/queue-4.19/spi-stm32-fifo-threshold-level-fix-align-packet-size.patch new file mode 100644 index 00000000000..b3d147df756 --- /dev/null +++ b/queue-4.19/spi-stm32-fifo-threshold-level-fix-align-packet-size.patch @@ -0,0 +1,44 @@ +From a590370d918fc66c62df6620445791fbe840344a Mon Sep 17 00:00:00 2001 +From: Roman Guskov +Date: Mon, 21 Dec 2020 13:35:32 +0100 +Subject: spi: stm32: FIFO threshold level - fix align packet size + +From: Roman Guskov + +commit a590370d918fc66c62df6620445791fbe840344a upstream. + +if cur_bpw <= 8 and xfer_len < 4 then the value of fthlv will be 1 and +SPI registers content may have been lost. + +* If SPI data register is accessed as a 16-bit register and DSIZE <= 8bit, + better to select FTHLV = 2, 4, 6 etc + +* If SPI data register is accessed as a 32-bit register and DSIZE > 8bit, + better to select FTHLV = 2, 4, 6 etc, while if DSIZE <= 8bit, + better to select FTHLV = 4, 8, 12 etc + +Signed-off-by: Roman Guskov +Fixes: dcbe0d84dfa5 ("spi: add driver for STM32 SPI controller") +Reviewed-by: Marek Vasut +Link: https://lore.kernel.org/r/20201221123532.27272-1-rguskov@dh-electronics.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-stm32.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-stm32.c ++++ b/drivers/spi/spi-stm32.c +@@ -299,9 +299,9 @@ static u32 stm32_spi_prepare_fthlv(struc + + /* align packet size with data registers access */ + if (spi->cur_bpw > 8) +- fthlv -= (fthlv % 2); /* multiple of 2 */ ++ fthlv += (fthlv % 2) ? 1 : 0; + else +- fthlv -= (fthlv % 4); /* multiple of 4 */ ++ fthlv += (fthlv % 4) ? (4 - (fthlv % 4)) : 0; + + return fthlv; + } diff --git a/queue-4.19/wan-ds26522-select-config_bitreverse.patch b/queue-4.19/wan-ds26522-select-config_bitreverse.patch new file mode 100644 index 00000000000..c8e3bd5992b --- /dev/null +++ b/queue-4.19/wan-ds26522-select-config_bitreverse.patch @@ -0,0 +1,36 @@ +From 69931e11288520c250152180ecf9b6ac5e6e40ed Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 3 Jan 2021 22:36:23 +0100 +Subject: wan: ds26522: select CONFIG_BITREVERSE + +From: Arnd Bergmann + +commit 69931e11288520c250152180ecf9b6ac5e6e40ed upstream. + +Without this, the driver runs into a link failure + +arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_ds26522_probe': +slic_ds26522.c:(.text+0x100c): undefined reference to `byte_rev_table' +arm-linux-gnueabi-ld: slic_ds26522.c:(.text+0x1cdc): undefined reference to `byte_rev_table' +arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_write': +slic_ds26522.c:(.text+0x1e4c): undefined reference to `byte_rev_table' + +Fixes: c37d4a0085c5 ("Maxim/driver: Add driver for maxim ds26522") +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wan/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wan/Kconfig ++++ b/drivers/net/wan/Kconfig +@@ -295,6 +295,7 @@ config SLIC_DS26522 + tristate "Slic Maxim ds26522 card support" + depends on SPI + depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST ++ select BITREVERSE + help + This module initializes and configures the slic maxim card + in T1 or E1 mode. diff --git a/queue-4.19/wil6210-select-config_crc32.patch b/queue-4.19/wil6210-select-config_crc32.patch new file mode 100644 index 00000000000..f49fdf87c87 --- /dev/null +++ b/queue-4.19/wil6210-select-config_crc32.patch @@ -0,0 +1,34 @@ +From e186620d7bf11b274b985b839c38266d7918cc05 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 3 Jan 2021 22:36:20 +0100 +Subject: wil6210: select CONFIG_CRC32 + +From: Arnd Bergmann + +commit e186620d7bf11b274b985b839c38266d7918cc05 upstream. + +Without crc32, the driver fails to link: + +arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o: in function `wil_fw_verify': +fw.c:(.text+0x74c): undefined reference to `crc32_le' +arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o:fw.c:(.text+0x758): more undefined references to `crc32_le' follow + +Fixes: 151a9706503f ("wil6210: firmware download") +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/wil6210/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ath/wil6210/Kconfig ++++ b/drivers/net/wireless/ath/wil6210/Kconfig +@@ -1,6 +1,7 @@ + config WIL6210 + tristate "Wilocity 60g WiFi card wil6210 support" + select WANT_DEV_COREDUMP ++ select CRC32 + depends on CFG80211 + depends on PCI + default n