From: Greg Kroah-Hartman Date: Sat, 18 Apr 2020 10:26:09 +0000 (+0200) Subject: 5.6-stable patches X-Git-Tag: v4.19.117~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=860920d8823975f2c75b04e6eb4d0e685e3f7886;p=thirdparty%2Fkernel%2Fstable-queue.git 5.6-stable patches added patches: acpi-nfit-improve-bounds-checking-for-func.patch arm-dts-imx7-colibri-fix-muxing-of-usbc_det-pin.patch arm64-dts-librem5-devkit-add-a-vbus-supply-to-usb0.patch asoc-intel-mrfld-fix-incorrect-check-on-p-sink.patch asoc-intel-mrfld-return-error-codes-when-an-error-occurs.patch clk-at91-sam9x60-fix-usb-clock-parents.patch clk-at91-usb-use-proper-usbs_mask.patch ext4-fix-incorrect-group-count-in-ext4_fill_super-error-message.patch ext4-fix-incorrect-inodes-per-group-in-error-message.patch hid-lg-g15-do-not-fail-the-probe-when-we-fail-to-disable-f-emulation.patch jbd2-improve-comments-about-freeing-data-buffers-whose-page-mapping-is-null.patch net-bpfilter-remove-superfluous-testing-message.patch net-stmmac-xgmac-fix-vlan-register-handling.patch ovl-fix-value-of-i_ino-for-lower-hardlink-corner-case.patch perf-report-fix-no-branch-type-statistics-report-issue.patch platform-chrome-cros_ec_rpmsg-fix-race-with-host-event.patch pwm-pca9685-fix-pwm-gpio-inter-operation.patch revert-acpi-ec-do-not-clear-boot_ec_is_ecdt-in-acpi_ec_add.patch scsi-ufs-fix-ufshcd_hold-caused-scheduling-while-atomic.patch usb-dwc3-gadget-don-t-clear-flags-before-transfer-ended.patch --- diff --git a/queue-5.6/acpi-nfit-improve-bounds-checking-for-func.patch b/queue-5.6/acpi-nfit-improve-bounds-checking-for-func.patch new file mode 100644 index 00000000000..7eeb5ee2438 --- /dev/null +++ b/queue-5.6/acpi-nfit-improve-bounds-checking-for-func.patch @@ -0,0 +1,80 @@ +From 01091c496f920e634ea84b689f480c39016752a8 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 25 Feb 2020 19:20:06 +0300 +Subject: acpi/nfit: improve bounds checking for 'func' + +From: Dan Carpenter + +commit 01091c496f920e634ea84b689f480c39016752a8 upstream. + +The 'func' variable can come from the user in the __nd_ioctl(). If it's +too high then the (1 << func) shift in acpi_nfit_clear_to_send() is +undefined. In acpi_nfit_ctl() we pass 'func' to test_bit(func, &dsm_mask) +which could result in an out of bounds access. + +To fix these issues, I introduced the NVDIMM_CMD_MAX (31) define and +updated nfit_dsm_revid() to use that define as well instead of magic +numbers. + +Fixes: 11189c1089da ("acpi/nfit: Fix command-supported detection") +Signed-off-by: Dan Carpenter +Reviewed-by: Dan Williams +Link: https://lore.kernel.org/r/20200225161927.hvftuq7kjn547fyj@kili.mountain +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/nfit/core.c | 10 ++++++---- + drivers/acpi/nfit/nfit.h | 1 + + 2 files changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/acpi/nfit/core.c ++++ b/drivers/acpi/nfit/core.c +@@ -360,7 +360,7 @@ static union acpi_object *acpi_label_inf + + static u8 nfit_dsm_revid(unsigned family, unsigned func) + { +- static const u8 revid_table[NVDIMM_FAMILY_MAX+1][32] = { ++ static const u8 revid_table[NVDIMM_FAMILY_MAX+1][NVDIMM_CMD_MAX+1] = { + [NVDIMM_FAMILY_INTEL] = { + [NVDIMM_INTEL_GET_MODES] = 2, + [NVDIMM_INTEL_GET_FWINFO] = 2, +@@ -386,7 +386,7 @@ static u8 nfit_dsm_revid(unsigned family + + if (family > NVDIMM_FAMILY_MAX) + return 0; +- if (func > 31) ++ if (func > NVDIMM_CMD_MAX) + return 0; + id = revid_table[family][func]; + if (id == 0) +@@ -492,7 +492,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_desc + * Check for a valid command. For ND_CMD_CALL, we also have to + * make sure that the DSM function is supported. + */ +- if (cmd == ND_CMD_CALL && !test_bit(func, &dsm_mask)) ++ if (cmd == ND_CMD_CALL && ++ (func > NVDIMM_CMD_MAX || !test_bit(func, &dsm_mask))) + return -ENOTTY; + else if (!test_bit(cmd, &cmd_mask)) + return -ENOTTY; +@@ -3492,7 +3493,8 @@ static int acpi_nfit_clear_to_send(struc + if (nvdimm && cmd == ND_CMD_CALL && + call_pkg->nd_family == NVDIMM_FAMILY_INTEL) { + func = call_pkg->nd_command; +- if ((1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK) ++ if (func > NVDIMM_CMD_MAX || ++ (1 << func) & NVDIMM_INTEL_SECURITY_CMDMASK) + return -EOPNOTSUPP; + } + +--- a/drivers/acpi/nfit/nfit.h ++++ b/drivers/acpi/nfit/nfit.h +@@ -34,6 +34,7 @@ + | ACPI_NFIT_MEM_NOT_ARMED | ACPI_NFIT_MEM_MAP_FAILED) + + #define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_HYPERV ++#define NVDIMM_CMD_MAX 31 + + #define NVDIMM_STANDARD_CMDMASK \ + (1 << ND_CMD_SMART | 1 << ND_CMD_SMART_THRESHOLD | 1 << ND_CMD_DIMM_FLAGS \ diff --git a/queue-5.6/arm-dts-imx7-colibri-fix-muxing-of-usbc_det-pin.patch b/queue-5.6/arm-dts-imx7-colibri-fix-muxing-of-usbc_det-pin.patch new file mode 100644 index 00000000000..6b061d25b1c --- /dev/null +++ b/queue-5.6/arm-dts-imx7-colibri-fix-muxing-of-usbc_det-pin.patch @@ -0,0 +1,55 @@ +From 7007f2eca0f258710899ca486da00546d03db0ed Mon Sep 17 00:00:00 2001 +From: Oleksandr Suvorov +Date: Tue, 4 Feb 2020 13:11:47 +0200 +Subject: ARM: dts: imx7-colibri: fix muxing of usbc_det pin + +From: Oleksandr Suvorov + +commit 7007f2eca0f258710899ca486da00546d03db0ed upstream. + +USB_C_DET pin shouldn't be in ethernet group. + +Creating a separate group allows one to use this pin +as an USB ID pin. + +Fixes: b326629f25b7 ("ARM: dts: imx7: add Toradex Colibri iMX7S/iMX7D suppor") +Signed-off-by: Oleksandr Suvorov +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/imx7-colibri.dtsi | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/imx7-colibri.dtsi ++++ b/arch/arm/boot/dts/imx7-colibri.dtsi +@@ -345,7 +345,7 @@ + &iomuxc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4 +- &pinctrl_gpio7>; ++ &pinctrl_gpio7 &pinctrl_usbc_det>; + + pinctrl_gpio1: gpio1-grp { + fsl,pins = < +@@ -450,7 +450,6 @@ + + pinctrl_enet1: enet1grp { + fsl,pins = < +- MX7D_PAD_ENET1_CRS__GPIO7_IO14 0x14 + MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x73 + MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x73 + MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x73 +@@ -648,6 +647,12 @@ + >; + }; + ++ pinctrl_usbc_det: gpio-usbc-det { ++ fsl,pins = < ++ MX7D_PAD_ENET1_CRS__GPIO7_IO14 0x14 ++ >; ++ }; ++ + pinctrl_usbh_reg: gpio-usbh-vbus { + fsl,pins = < + MX7D_PAD_UART3_CTS_B__GPIO4_IO7 0x14 /* SODIMM 129 USBH PEN */ diff --git a/queue-5.6/arm64-dts-librem5-devkit-add-a-vbus-supply-to-usb0.patch b/queue-5.6/arm64-dts-librem5-devkit-add-a-vbus-supply-to-usb0.patch new file mode 100644 index 00000000000..ef9ad996e44 --- /dev/null +++ b/queue-5.6/arm64-dts-librem5-devkit-add-a-vbus-supply-to-usb0.patch @@ -0,0 +1,31 @@ +From dde061b865598ad91f50140760e1d224e5045db9 Mon Sep 17 00:00:00 2001 +From: "Angus Ainslie (Purism)" +Date: Thu, 27 Feb 2020 14:17:26 +0100 +Subject: arm64: dts: librem5-devkit: add a vbus supply to usb0 + +From: Angus Ainslie (Purism) + +commit dde061b865598ad91f50140760e1d224e5045db9 upstream. + +Without a VBUS supply the dwc3 driver won't go into otg mode. + +Fixes: eb4ea0857c83 ("arm64: dts: fsl: librem5: Add a device tree for the Librem5 devkit") +Signed-off-by: Angus Ainslie (Purism) +Signed-off-by: Martin Kepplinger +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +@@ -750,6 +750,7 @@ + }; + + &usb3_phy0 { ++ vbus-supply = <®_5v_p>; + status = "okay"; + }; + diff --git a/queue-5.6/asoc-intel-mrfld-fix-incorrect-check-on-p-sink.patch b/queue-5.6/asoc-intel-mrfld-fix-incorrect-check-on-p-sink.patch new file mode 100644 index 00000000000..42a3d16f39a --- /dev/null +++ b/queue-5.6/asoc-intel-mrfld-fix-incorrect-check-on-p-sink.patch @@ -0,0 +1,35 @@ +From f5e056e1e46fcbb5f74ce560792aeb7d57ce79e6 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Tue, 19 Nov 2019 11:36:40 +0000 +Subject: ASoC: Intel: mrfld: fix incorrect check on p->sink + +From: Colin Ian King + +commit f5e056e1e46fcbb5f74ce560792aeb7d57ce79e6 upstream. + +The check on p->sink looks bogus, I believe it should be p->source +since the following code blocks are related to p->source. Fix +this by replacing p->sink with p->source. + +Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls") +Signed-off-by: Colin Ian King +Addresses-Coverity: ("Copy-paste error") +Link: https://lore.kernel.org/r/20191119113640.166940-1-colin.king@canonical.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/intel/atom/sst-atom-controls.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/intel/atom/sst-atom-controls.c ++++ b/sound/soc/intel/atom/sst-atom-controls.c +@@ -1333,7 +1333,7 @@ int sst_send_pipe_gains(struct snd_soc_d + dai->capture_widget->name); + w = dai->capture_widget; + snd_soc_dapm_widget_for_each_source_path(w, p) { +- if (p->connected && !p->connected(w, p->sink)) ++ if (p->connected && !p->connected(w, p->source)) + continue; + + if (p->connect && p->source->power && diff --git a/queue-5.6/asoc-intel-mrfld-return-error-codes-when-an-error-occurs.patch b/queue-5.6/asoc-intel-mrfld-return-error-codes-when-an-error-occurs.patch new file mode 100644 index 00000000000..7311f90c144 --- /dev/null +++ b/queue-5.6/asoc-intel-mrfld-return-error-codes-when-an-error-occurs.patch @@ -0,0 +1,38 @@ +From 3025571edd9df653e1ad649f0638368a39d1bbb5 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Sat, 8 Feb 2020 22:07:20 +0000 +Subject: ASoC: Intel: mrfld: return error codes when an error occurs + +From: Colin Ian King + +commit 3025571edd9df653e1ad649f0638368a39d1bbb5 upstream. + +Currently function sst_platform_get_resources always returns zero and +error return codes set by the function are never returned. Fix this +by returning the error return code in variable ret rather than the +hard coded zero. + +Addresses-Coverity: ("Unused value") +Fixes: f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part") +Signed-off-by: Colin Ian King +Acked-by: Cezary Rojewski +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200208220720.36657-1-colin.king@canonical.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/intel/atom/sst/sst_pci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/intel/atom/sst/sst_pci.c ++++ b/sound/soc/intel/atom/sst/sst_pci.c +@@ -99,7 +99,7 @@ static int sst_platform_get_resources(st + dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram); + do_release_regions: + pci_release_regions(pci); +- return 0; ++ return ret; + } + + /* diff --git a/queue-5.6/clk-at91-sam9x60-fix-usb-clock-parents.patch b/queue-5.6/clk-at91-sam9x60-fix-usb-clock-parents.patch new file mode 100644 index 00000000000..4a24beb9ec5 --- /dev/null +++ b/queue-5.6/clk-at91-sam9x60-fix-usb-clock-parents.patch @@ -0,0 +1,36 @@ +From 43b203d32b77d1b1b2209e22837f49767020553e Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Fri, 17 Jan 2020 13:36:47 +0200 +Subject: clk: at91: sam9x60: fix usb clock parents + +From: Claudiu Beznea + +commit 43b203d32b77d1b1b2209e22837f49767020553e upstream. + +SAM9X60's USB clock has 3 parents: plla, upll and main_osc. + +Fixes: 01e2113de9a5 ("clk: at91: add sam9x60 pmc driver") +Signed-off-by: Claudiu Beznea +Link: https://lkml.kernel.org/r/1579261009-4573-3-git-send-email-claudiu.beznea@microchip.com +Acked-by: Alexandre Belloni +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/at91/sam9x60.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/clk/at91/sam9x60.c ++++ b/drivers/clk/at91/sam9x60.c +@@ -237,9 +237,8 @@ static void __init sam9x60_pmc_setup(str + + parent_names[0] = "pllack"; + parent_names[1] = "upllck"; +- parent_names[2] = "mainck"; +- parent_names[3] = "mainck"; +- hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 4); ++ parent_names[2] = "main_osc"; ++ hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 3); + if (IS_ERR(hw)) + goto err_free; + diff --git a/queue-5.6/clk-at91-usb-use-proper-usbs_mask.patch b/queue-5.6/clk-at91-usb-use-proper-usbs_mask.patch new file mode 100644 index 00000000000..a47c940a969 --- /dev/null +++ b/queue-5.6/clk-at91-usb-use-proper-usbs_mask.patch @@ -0,0 +1,34 @@ +From d7a83d67a1694c42cc95fc0755d823f7ca3bfcfb Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Fri, 17 Jan 2020 13:36:48 +0200 +Subject: clk: at91: usb: use proper usbs_mask + +From: Claudiu Beznea + +commit d7a83d67a1694c42cc95fc0755d823f7ca3bfcfb upstream. + +Use usbs_mask passed as argument. The usbs_mask is different for +SAM9X60. + +Fixes: 2423eeaead6f8 ("clk: at91: usb: Add sam9x60 support") +Signed-off-by: Claudiu Beznea +Link: https://lkml.kernel.org/r/1579261009-4573-4-git-send-email-claudiu.beznea@microchip.com +Acked-by: Alexandre Belloni +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/at91/clk-usb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/at91/clk-usb.c ++++ b/drivers/clk/at91/clk-usb.c +@@ -211,7 +211,7 @@ _at91sam9x5_clk_register_usb(struct regm + + usb->hw.init = &init; + usb->regmap = regmap; +- usb->usbs_mask = SAM9X5_USBS_MASK; ++ usb->usbs_mask = usbs_mask; + + hw = &usb->hw; + ret = clk_hw_register(NULL, &usb->hw); diff --git a/queue-5.6/ext4-fix-incorrect-group-count-in-ext4_fill_super-error-message.patch b/queue-5.6/ext4-fix-incorrect-group-count-in-ext4_fill_super-error-message.patch new file mode 100644 index 00000000000..1cc7a90f23d --- /dev/null +++ b/queue-5.6/ext4-fix-incorrect-group-count-in-ext4_fill_super-error-message.patch @@ -0,0 +1,39 @@ +From df41460a21b06a76437af040d90ccee03888e8e5 Mon Sep 17 00:00:00 2001 +From: Josh Triplett +Date: Sat, 28 Mar 2020 14:54:01 -0700 +Subject: ext4: fix incorrect group count in ext4_fill_super error message + +From: Josh Triplett + +commit df41460a21b06a76437af040d90ccee03888e8e5 upstream. + +ext4_fill_super doublechecks the number of groups before mounting; if +that check fails, the resulting error message prints the group count +from the ext4_sb_info sbi, which hasn't been set yet. Print the freshly +computed group count instead (which at that point has just been computed +in "blocks_count"). + +Signed-off-by: Josh Triplett +Fixes: 4ec1102813798 ("ext4: Add sanity checks for the superblock before mounting the filesystem") +Link: https://lore.kernel.org/r/8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -4286,9 +4286,9 @@ static int ext4_fill_super(struct super_ + EXT4_BLOCKS_PER_GROUP(sb) - 1); + do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb)); + if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) { +- ext4_msg(sb, KERN_WARNING, "groups count too large: %u " ++ ext4_msg(sb, KERN_WARNING, "groups count too large: %llu " + "(block count %llu, first data block %u, " +- "blocks per group %lu)", sbi->s_groups_count, ++ "blocks per group %lu)", blocks_count, + ext4_blocks_count(es), + le32_to_cpu(es->s_first_data_block), + EXT4_BLOCKS_PER_GROUP(sb)); diff --git a/queue-5.6/ext4-fix-incorrect-inodes-per-group-in-error-message.patch b/queue-5.6/ext4-fix-incorrect-inodes-per-group-in-error-message.patch new file mode 100644 index 00000000000..65aeffc8d5d --- /dev/null +++ b/queue-5.6/ext4-fix-incorrect-inodes-per-group-in-error-message.patch @@ -0,0 +1,35 @@ +From b9c538da4e52a7b79dfcf4cfa487c46125066dfb Mon Sep 17 00:00:00 2001 +From: Josh Triplett +Date: Sat, 28 Mar 2020 15:34:15 -0700 +Subject: ext4: fix incorrect inodes per group in error message + +From: Josh Triplett + +commit b9c538da4e52a7b79dfcf4cfa487c46125066dfb upstream. + +If ext4_fill_super detects an invalid number of inodes per group, the +resulting error message printed the number of blocks per group, rather +than the number of inodes per group. Fix it to print the correct value. + +Fixes: cd6bb35bf7f6d ("ext4: use more strict checks for inodes_per_block on mount") +Link: https://lore.kernel.org/r/8be03355983a08e5d4eed480944613454d7e2550.1585434649.git.josh@joshtriplett.org +Reviewed-by: Andreas Dilger +Signed-off-by: Josh Triplett +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -4157,7 +4157,7 @@ static int ext4_fill_super(struct super_ + if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || + sbi->s_inodes_per_group > blocksize * 8) { + ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n", +- sbi->s_blocks_per_group); ++ sbi->s_inodes_per_group); + goto failed_mount; + } + sbi->s_itb_per_group = sbi->s_inodes_per_group / diff --git a/queue-5.6/hid-lg-g15-do-not-fail-the-probe-when-we-fail-to-disable-f-emulation.patch b/queue-5.6/hid-lg-g15-do-not-fail-the-probe-when-we-fail-to-disable-f-emulation.patch new file mode 100644 index 00000000000..7f6ab440091 --- /dev/null +++ b/queue-5.6/hid-lg-g15-do-not-fail-the-probe-when-we-fail-to-disable-f-emulation.patch @@ -0,0 +1,60 @@ +From b8a75eaddae9410767c7d95a1c5f3a547aae7b81 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 15 Mar 2020 18:34:49 +0100 +Subject: HID: lg-g15: Do not fail the probe when we fail to disable F# emulation + +From: Hans de Goede + +commit b8a75eaddae9410767c7d95a1c5f3a547aae7b81 upstream. + +By default the G1-G12 keys on the Logitech gaming keyboards send +F1 - F12 when in "generic HID" mode. + +The first thing the hid-lg-g15 driver does is disable this behavior. + +We have received a bugreport that this does not work when the keyboard +is connected through an Aten KVM switch. Using a gaming keyboard with +a KVM is a bit weird setup, but still we can try to fail a bit more +gracefully here. + +On the G510 keyboards the same USB-interface which is used for the gaming +keys is also used for the media-keys. Before this commit we would call +hid_hw_stop() on failure to disable the F# emulation and then exit the +probe method with an error code. + +This not only causes us to not handle the gaming-keys, but this also +breaks the media keys which is a regression compared to the situation +when these keyboards where handled by the generic hidinput driver. + +This commit changes the error handling to clear the hiddev drvdata +(to disable our .raw_event handler) and then returning from the probe +method with success. + +The net result of this is that, when connected through a KVM, things +work as well as they did before the hid-lg-g15 driver was introduced. + +Fixes: ad4203f5a243 ("HID: lg-g15: Add support for the G510 keyboards' gaming keys") +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1806321 +Signed-off-by: Hans de Goede +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-lg-g15.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/hid/hid-lg-g15.c ++++ b/drivers/hid/hid-lg-g15.c +@@ -803,8 +803,10 @@ static int lg_g15_probe(struct hid_devic + } + + if (ret < 0) { +- hid_err(hdev, "Error disabling keyboard emulation for the G-keys\n"); +- goto error_hw_stop; ++ hid_err(hdev, "Error %d disabling keyboard emulation for the G-keys, falling back to generic hid-input driver\n", ++ ret); ++ hid_set_drvdata(hdev, NULL); ++ return 0; + } + + /* Get initial brightness levels */ diff --git a/queue-5.6/jbd2-improve-comments-about-freeing-data-buffers-whose-page-mapping-is-null.patch b/queue-5.6/jbd2-improve-comments-about-freeing-data-buffers-whose-page-mapping-is-null.patch new file mode 100644 index 00000000000..81515519b40 --- /dev/null +++ b/queue-5.6/jbd2-improve-comments-about-freeing-data-buffers-whose-page-mapping-is-null.patch @@ -0,0 +1,41 @@ +From 780f66e59231fcf882f36c63f287252ee47cc75a Mon Sep 17 00:00:00 2001 +From: "zhangyi (F)" +Date: Mon, 17 Feb 2020 19:27:06 +0800 +Subject: jbd2: improve comments about freeing data buffers whose page mapping is NULL + +From: zhangyi (F) + +commit 780f66e59231fcf882f36c63f287252ee47cc75a upstream. + +Improve comments in jbd2_journal_commit_transaction() to describe why +we don't need to clear the buffer_mapped bit for freeing file mapping +buffers whose page mapping is NULL. + +Link: https://lore.kernel.org/r/20200217112706.20085-1-yi.zhang@huawei.com +Fixes: c96dceeabf76 ("jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer") +Suggested-by: Jan Kara +Reviewed-by: Jan Kara +Signed-off-by: zhangyi (F) +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/jbd2/commit.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/fs/jbd2/commit.c ++++ b/fs/jbd2/commit.c +@@ -997,9 +997,10 @@ restart_loop: + * journalled data) we need to unmap buffer and clear + * more bits. We also need to be careful about the check + * because the data page mapping can get cleared under +- * out hands, which alse need not to clear more bits +- * because the page and buffers will be freed and can +- * never be reused once we are done with them. ++ * our hands. Note that if mapping == NULL, we don't ++ * need to make buffer unmapped because the page is ++ * already detached from the mapping and buffers cannot ++ * get reused. + */ + mapping = READ_ONCE(bh->b_page->mapping); + if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) { diff --git a/queue-5.6/net-bpfilter-remove-superfluous-testing-message.patch b/queue-5.6/net-bpfilter-remove-superfluous-testing-message.patch new file mode 100644 index 00000000000..e33264fb66d --- /dev/null +++ b/queue-5.6/net-bpfilter-remove-superfluous-testing-message.patch @@ -0,0 +1,34 @@ +From 41c55ea6c2a7ca4c663eeec05bdf54f4e2419699 Mon Sep 17 00:00:00 2001 +From: Bruno Meneguele +Date: Tue, 31 Mar 2020 10:06:30 -0300 +Subject: net/bpfilter: remove superfluous testing message + +From: Bruno Meneguele + +commit 41c55ea6c2a7ca4c663eeec05bdf54f4e2419699 upstream. + +A testing message was brought by 13d0f7b814d9 ("net/bpfilter: fix dprintf +usage for /dev/kmsg") but should've been deleted before patch submission. +Although it doesn't cause any harm to the code or functionality itself, it's +totally unpleasant to have it displayed on every loop iteration with no real +use case. Thus remove it unconditionally. + +Fixes: 13d0f7b814d9 ("net/bpfilter: fix dprintf usage for /dev/kmsg") +Signed-off-by: Bruno Meneguele +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/bpfilter/main.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/net/bpfilter/main.c ++++ b/net/bpfilter/main.c +@@ -35,7 +35,6 @@ static void loop(void) + struct mbox_reply reply; + int n; + +- fprintf(debug_f, "testing the buffer\n"); + n = read(0, &req, sizeof(req)); + if (n != sizeof(req)) { + fprintf(debug_f, "invalid request %d\n", n); diff --git a/queue-5.6/net-stmmac-xgmac-fix-vlan-register-handling.patch b/queue-5.6/net-stmmac-xgmac-fix-vlan-register-handling.patch new file mode 100644 index 00000000000..922c2eeb3a8 --- /dev/null +++ b/queue-5.6/net-stmmac-xgmac-fix-vlan-register-handling.patch @@ -0,0 +1,60 @@ +From 21f64e72e7073199a6f8d7d8efe52cd814d7d665 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Thu, 2 Apr 2020 15:57:07 +0200 +Subject: net: stmmac: xgmac: Fix VLAN register handling + +From: Jose Abreu + +commit 21f64e72e7073199a6f8d7d8efe52cd814d7d665 upstream. + +Commit 907a076881f1, forgot that we need to clear old values of +XGMAC_VLAN_TAG register when we switch from VLAN perfect matching to +HASH matching. + +Fix it. + +Fixes: 907a076881f1 ("net: stmmac: xgmac: fix incorrect XGMAC_VLAN_TAG register writting") +Signed-off-by: Jose Abreu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +@@ -576,8 +576,13 @@ static void dwxgmac2_update_vlan_hash(st + value |= XGMAC_VLAN_EDVLP; + value |= XGMAC_VLAN_ESVL; + value |= XGMAC_VLAN_DOVLTC; ++ } else { ++ value &= ~XGMAC_VLAN_EDVLP; ++ value &= ~XGMAC_VLAN_ESVL; ++ value &= ~XGMAC_VLAN_DOVLTC; + } + ++ value &= ~XGMAC_VLAN_VID; + writel(value, ioaddr + XGMAC_VLAN_TAG); + } else if (perfect_match) { + u32 value = readl(ioaddr + XGMAC_PACKET_FILTER); +@@ -588,13 +593,19 @@ static void dwxgmac2_update_vlan_hash(st + + value = readl(ioaddr + XGMAC_VLAN_TAG); + ++ value &= ~XGMAC_VLAN_VTHM; + value |= XGMAC_VLAN_ETV; + if (is_double) { + value |= XGMAC_VLAN_EDVLP; + value |= XGMAC_VLAN_ESVL; + value |= XGMAC_VLAN_DOVLTC; ++ } else { ++ value &= ~XGMAC_VLAN_EDVLP; ++ value &= ~XGMAC_VLAN_ESVL; ++ value &= ~XGMAC_VLAN_DOVLTC; + } + ++ value &= ~XGMAC_VLAN_VID; + writel(value | perfect_match, ioaddr + XGMAC_VLAN_TAG); + } else { + u32 value = readl(ioaddr + XGMAC_PACKET_FILTER); diff --git a/queue-5.6/ovl-fix-value-of-i_ino-for-lower-hardlink-corner-case.patch b/queue-5.6/ovl-fix-value-of-i_ino-for-lower-hardlink-corner-case.patch new file mode 100644 index 00000000000..bb96c075784 --- /dev/null +++ b/queue-5.6/ovl-fix-value-of-i_ino-for-lower-hardlink-corner-case.patch @@ -0,0 +1,51 @@ +From 300b124fcf6ad2cd99a7b721e0f096785e0a3134 Mon Sep 17 00:00:00 2001 +From: Amir Goldstein +Date: Tue, 19 Nov 2019 15:36:14 +0200 +Subject: ovl: fix value of i_ino for lower hardlink corner case + +From: Amir Goldstein + +commit 300b124fcf6ad2cd99a7b721e0f096785e0a3134 upstream. + +Commit 6dde1e42f497 ("ovl: make i_ino consistent with st_ino in more +cases"), relaxed the condition nfs_export=on in order to set the value of +i_ino to xino map of real ino. + +Specifically, it also relaxed the pre-condition that index=on for +consistent i_ino. This opened the corner case of lower hardlink in +ovl_get_inode(), which calls ovl_fill_inode() with ino=0 and then +ovl_init_inode() is called to set i_ino to lower real ino without the xino +mapping. + +Pass the correct values of ino;fsid in this case to ovl_fill_inode(), so it +can initialize i_ino correctly. + +Fixes: 6dde1e42f497 ("ovl: make i_ino consistent with st_ino in more ...") +Signed-off-by: Amir Goldstein +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman + +--- + fs/overlayfs/inode.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/fs/overlayfs/inode.c ++++ b/fs/overlayfs/inode.c +@@ -891,7 +891,7 @@ struct inode *ovl_get_inode(struct super + struct dentry *lowerdentry = lowerpath ? lowerpath->dentry : NULL; + bool bylower = ovl_hash_bylower(sb, upperdentry, lowerdentry, + oip->index); +- int fsid = bylower ? oip->lowerpath->layer->fsid : 0; ++ int fsid = bylower ? lowerpath->layer->fsid : 0; + bool is_dir, metacopy = false; + unsigned long ino = 0; + int err = oip->newinode ? -EEXIST : -ENOMEM; +@@ -941,6 +941,8 @@ struct inode *ovl_get_inode(struct super + err = -ENOMEM; + goto out_err; + } ++ ino = realinode->i_ino; ++ fsid = lowerpath->layer->fsid; + } + ovl_fill_inode(inode, realinode->i_mode, realinode->i_rdev, ino, fsid); + ovl_inode_init(inode, upperdentry, lowerdentry, oip->lowerdata); diff --git a/queue-5.6/perf-report-fix-no-branch-type-statistics-report-issue.patch b/queue-5.6/perf-report-fix-no-branch-type-statistics-report-issue.patch new file mode 100644 index 00000000000..25e15dc74f1 --- /dev/null +++ b/queue-5.6/perf-report-fix-no-branch-type-statistics-report-issue.patch @@ -0,0 +1,84 @@ +From c3b10649a80e9da2892c1fd3038c53abd57588f6 Mon Sep 17 00:00:00 2001 +From: Jin Yao +Date: Fri, 13 Mar 2020 21:46:07 +0800 +Subject: perf report: Fix no branch type statistics report issue + +From: Jin Yao + +commit c3b10649a80e9da2892c1fd3038c53abd57588f6 upstream. + +Previously we could get the report of branch type statistics. + +For example: + + # perf record -j any,save_type ... + # t perf report --stdio + + # + # Branch Statistics: + # + COND_FWD: 40.6% + COND_BWD: 4.1% + CROSS_4K: 24.7% + CROSS_2M: 12.3% + COND: 44.7% + UNCOND: 0.0% + IND: 6.1% + CALL: 24.5% + RET: 24.7% + +But now for the recent perf, it can't report the branch type statistics. + +It's a regression issue caused by commit 40c39e304641 ("perf report: Fix +a no annotate browser displayed issue"), which only counts the branch +type statistics for browser mode. + +This patch moves the branch_type_count() outside of ui__has_annotation() +checking, then branch type statistics can work for stdio mode. + +Fixes: 40c39e304641 ("perf report: Fix a no annotate browser displayed issue") +Signed-off-by: Jin Yao +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Peter Zijlstra +Link: http://lore.kernel.org/lkml/20200313134607.12873-1-yao.jin@linux.intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/builtin-report.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/tools/perf/builtin-report.c ++++ b/tools/perf/builtin-report.c +@@ -185,24 +185,23 @@ static int hist_iter__branch_callback(st + { + struct hist_entry *he = iter->he; + struct report *rep = arg; +- struct branch_info *bi; ++ struct branch_info *bi = he->branch_info; + struct perf_sample *sample = iter->sample; + struct evsel *evsel = iter->evsel; + int err; + ++ branch_type_count(&rep->brtype_stat, &bi->flags, ++ bi->from.addr, bi->to.addr); ++ + if (!ui__has_annotation() && !rep->symbol_ipc) + return 0; + +- bi = he->branch_info; + err = addr_map_symbol__inc_samples(&bi->from, sample, evsel); + if (err) + goto out; + + err = addr_map_symbol__inc_samples(&bi->to, sample, evsel); + +- branch_type_count(&rep->brtype_stat, &bi->flags, +- bi->from.addr, bi->to.addr); +- + out: + return err; + } diff --git a/queue-5.6/platform-chrome-cros_ec_rpmsg-fix-race-with-host-event.patch b/queue-5.6/platform-chrome-cros_ec_rpmsg-fix-race-with-host-event.patch new file mode 100644 index 00000000000..93581c646aa --- /dev/null +++ b/queue-5.6/platform-chrome-cros_ec_rpmsg-fix-race-with-host-event.patch @@ -0,0 +1,66 @@ +From f775ac78fcfc6bdc96bdda07029d11f2a5e84869 Mon Sep 17 00:00:00 2001 +From: Pi-Hsun Shih +Date: Fri, 14 Feb 2020 16:26:38 +0800 +Subject: platform/chrome: cros_ec_rpmsg: Fix race with host event + +From: Pi-Hsun Shih + +commit f775ac78fcfc6bdc96bdda07029d11f2a5e84869 upstream. + +Host event can be sent by remoteproc by any time, and +cros_ec_rpmsg_callback would be called after cros_ec_rpmsg_create_ept. +But the cros_ec_device is initialized after that, which cause host event +handler to use cros_ec_device that are not initialized properly yet. + +Fix this by don't schedule host event handler before cros_ec_register +returns. Instead, remember that we have a pending host event, and +schedule host event handler after cros_ec_register. + +Fixes: 71cddb7097e2 ("platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed.") +Signed-off-by: Pi-Hsun Shih +Signed-off-by: Enric Balletbo i Serra +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/chrome/cros_ec_rpmsg.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +--- a/drivers/platform/chrome/cros_ec_rpmsg.c ++++ b/drivers/platform/chrome/cros_ec_rpmsg.c +@@ -44,6 +44,8 @@ struct cros_ec_rpmsg { + struct completion xfer_ack; + struct work_struct host_event_work; + struct rpmsg_endpoint *ept; ++ bool has_pending_host_event; ++ bool probe_done; + }; + + /** +@@ -177,7 +179,14 @@ static int cros_ec_rpmsg_callback(struct + memcpy(ec_dev->din, resp->data, len); + complete(&ec_rpmsg->xfer_ack); + } else if (resp->type == HOST_EVENT_MARK) { +- schedule_work(&ec_rpmsg->host_event_work); ++ /* ++ * If the host event is sent before cros_ec_register is ++ * finished, queue the host event. ++ */ ++ if (ec_rpmsg->probe_done) ++ schedule_work(&ec_rpmsg->host_event_work); ++ else ++ ec_rpmsg->has_pending_host_event = true; + } else { + dev_warn(ec_dev->dev, "rpmsg received invalid type = %d", + resp->type); +@@ -240,6 +249,11 @@ static int cros_ec_rpmsg_probe(struct rp + return ret; + } + ++ ec_rpmsg->probe_done = true; ++ ++ if (ec_rpmsg->has_pending_host_event) ++ schedule_work(&ec_rpmsg->host_event_work); ++ + return 0; + } + diff --git a/queue-5.6/pwm-pca9685-fix-pwm-gpio-inter-operation.patch b/queue-5.6/pwm-pca9685-fix-pwm-gpio-inter-operation.patch new file mode 100644 index 00000000000..74e70992d23 --- /dev/null +++ b/queue-5.6/pwm-pca9685-fix-pwm-gpio-inter-operation.patch @@ -0,0 +1,204 @@ +From 9cc5f232a4b6a0ef6e9b57876d61b88f61bdd7c2 Mon Sep 17 00:00:00 2001 +From: Sven Van Asbroeck +Date: Wed, 1 Apr 2020 19:01:06 +0200 +Subject: pwm: pca9685: Fix PWM/GPIO inter-operation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sven Van Asbroeck + +commit 9cc5f232a4b6a0ef6e9b57876d61b88f61bdd7c2 upstream. + +This driver allows pwms to be requested as gpios via gpiolib. Obviously, +it should not be allowed to request a GPIO when its corresponding PWM is +already requested (and vice versa). So it requires some exclusion code. + +Given that the PWMm and GPIO cores are not synchronized with respect to +each other, this exclusion code will also require proper +synchronization. + +Such a mechanism was in place, but was inadvertently removed by Uwe's +clean-up in commit e926b12c611c ("pwm: Clear chip_data in pwm_put()"). + +Upon revisiting the synchronization mechanism, we found that +theoretically, it could allow two threads to successfully request +conflicting PWMs/GPIOs. + +Replace with a bitmap which tracks PWMs in-use, plus a mutex. As long as +PWM and GPIO's respective request/free functions modify the in-use +bitmap while holding the mutex, proper synchronization will be +guaranteed. + +Reported-by: YueHaibing +Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()") +Cc: Mika Westerberg +Cc: Uwe Kleine-König +Cc: YueHaibing +Link: https://lkml.org/lkml/2019/5/31/963 +Signed-off-by: Sven Van Asbroeck +Reviewed-by: Mika Westerberg +[cg: Tested on an i.MX6Q board with two NXP PCA9685 chips] +Tested-by: Clemens Gruber +Reviewed-by: Sven Van Asbroeck # cg's rebase +Link: https://lore.kernel.org/lkml/20200330160238.GD2817345@ulmo/ +Signed-off-by: Thierry Reding +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pwm/pwm-pca9685.c | 85 +++++++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 37 deletions(-) + +--- a/drivers/pwm/pwm-pca9685.c ++++ b/drivers/pwm/pwm-pca9685.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + /* + * Because the PCA9685 has only one prescaler per chip, changing the period of +@@ -74,6 +75,7 @@ struct pca9685 { + #if IS_ENABLED(CONFIG_GPIOLIB) + struct mutex lock; + struct gpio_chip gpio; ++ DECLARE_BITMAP(pwms_inuse, PCA9685_MAXCHAN + 1); + #endif + }; + +@@ -83,51 +85,51 @@ static inline struct pca9685 *to_pca(str + } + + #if IS_ENABLED(CONFIG_GPIOLIB) +-static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset) ++static bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca, int pwm_idx) + { +- struct pca9685 *pca = gpiochip_get_data(gpio); +- struct pwm_device *pwm; ++ bool is_inuse; + + mutex_lock(&pca->lock); +- +- pwm = &pca->chip.pwms[offset]; +- +- if (pwm->flags & (PWMF_REQUESTED | PWMF_EXPORTED)) { +- mutex_unlock(&pca->lock); +- return -EBUSY; ++ if (pwm_idx >= PCA9685_MAXCHAN) { ++ /* ++ * "all LEDs" channel: ++ * pretend already in use if any of the PWMs are requested ++ */ ++ if (!bitmap_empty(pca->pwms_inuse, PCA9685_MAXCHAN)) { ++ is_inuse = true; ++ goto out; ++ } ++ } else { ++ /* ++ * regular channel: ++ * pretend already in use if the "all LEDs" channel is requested ++ */ ++ if (test_bit(PCA9685_MAXCHAN, pca->pwms_inuse)) { ++ is_inuse = true; ++ goto out; ++ } + } +- +- pwm_set_chip_data(pwm, (void *)1); +- ++ is_inuse = test_and_set_bit(pwm_idx, pca->pwms_inuse); ++out: + mutex_unlock(&pca->lock); +- pm_runtime_get_sync(pca->chip.dev); +- return 0; ++ return is_inuse; + } + +-static bool pca9685_pwm_is_gpio(struct pca9685 *pca, struct pwm_device *pwm) ++static void pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx) + { +- bool is_gpio = false; +- + mutex_lock(&pca->lock); ++ clear_bit(pwm_idx, pca->pwms_inuse); ++ mutex_unlock(&pca->lock); ++} + +- if (pwm->hwpwm >= PCA9685_MAXCHAN) { +- unsigned int i; +- +- /* +- * Check if any of the GPIOs are requested and in that case +- * prevent using the "all LEDs" channel. +- */ +- for (i = 0; i < pca->gpio.ngpio; i++) +- if (gpiochip_is_requested(&pca->gpio, i)) { +- is_gpio = true; +- break; +- } +- } else if (pwm_get_chip_data(pwm)) { +- is_gpio = true; +- } ++static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset) ++{ ++ struct pca9685 *pca = gpiochip_get_data(gpio); + +- mutex_unlock(&pca->lock); +- return is_gpio; ++ if (pca9685_pwm_test_and_set_inuse(pca, offset)) ++ return -EBUSY; ++ pm_runtime_get_sync(pca->chip.dev); ++ return 0; + } + + static int pca9685_pwm_gpio_get(struct gpio_chip *gpio, unsigned int offset) +@@ -162,6 +164,7 @@ static void pca9685_pwm_gpio_free(struct + + pca9685_pwm_gpio_set(gpio, offset, 0); + pm_runtime_put(pca->chip.dev); ++ pca9685_pwm_clear_inuse(pca, offset); + } + + static int pca9685_pwm_gpio_get_direction(struct gpio_chip *chip, +@@ -213,12 +216,17 @@ static int pca9685_pwm_gpio_probe(struct + return devm_gpiochip_add_data(dev, &pca->gpio, pca); + } + #else +-static inline bool pca9685_pwm_is_gpio(struct pca9685 *pca, +- struct pwm_device *pwm) ++static inline bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca, ++ int pwm_idx) + { + return false; + } + ++static inline void ++pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx) ++{ ++} ++ + static inline int pca9685_pwm_gpio_probe(struct pca9685 *pca) + { + return 0; +@@ -402,7 +410,7 @@ static int pca9685_pwm_request(struct pw + { + struct pca9685 *pca = to_pca(chip); + +- if (pca9685_pwm_is_gpio(pca, pwm)) ++ if (pca9685_pwm_test_and_set_inuse(pca, pwm->hwpwm)) + return -EBUSY; + pm_runtime_get_sync(chip->dev); + +@@ -411,8 +419,11 @@ static int pca9685_pwm_request(struct pw + + static void pca9685_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) + { ++ struct pca9685 *pca = to_pca(chip); ++ + pca9685_pwm_disable(chip, pwm); + pm_runtime_put(chip->dev); ++ pca9685_pwm_clear_inuse(pca, pwm->hwpwm); + } + + static const struct pwm_ops pca9685_pwm_ops = { diff --git a/queue-5.6/revert-acpi-ec-do-not-clear-boot_ec_is_ecdt-in-acpi_ec_add.patch b/queue-5.6/revert-acpi-ec-do-not-clear-boot_ec_is_ecdt-in-acpi_ec_add.patch new file mode 100644 index 00000000000..f757ea58a30 --- /dev/null +++ b/queue-5.6/revert-acpi-ec-do-not-clear-boot_ec_is_ecdt-in-acpi_ec_add.patch @@ -0,0 +1,50 @@ +From df541c011f5d731447d5c99fd77d77c2191d0c6d Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Sat, 18 Apr 2020 11:29:04 +0200 +Subject: Revert "ACPI: EC: Do not clear boot_ec_is_ecdt in acpi_ec_add()" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Greg Kroah-Hartman + +This reverts commit 281e612b4b9587c0c72e30c49ec279587b20da0f which is +commit 65a691f5f8f0bb63d6a82eec7b0ffd193d8d8a5f upstream. + +Rafael writes: + It has not been marked for -stable or otherwise requested to be + included AFAICS. Also it depends on other mainline commits that + have not been included into 5.6.5. + +Reported-by: Toralf Förster +Reported-by: Rafael J. Wysocki +Cc: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/ec.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -1646,6 +1646,7 @@ static int acpi_ec_add(struct acpi_devic + + if (boot_ec && ec->command_addr == boot_ec->command_addr && + ec->data_addr == boot_ec->data_addr) { ++ boot_ec_is_ecdt = false; + /* + * Trust PNP0C09 namespace location rather than + * ECDT ID. But trust ECDT GPE rather than _GPE +@@ -1665,12 +1666,9 @@ static int acpi_ec_add(struct acpi_devic + + if (ec == boot_ec) + acpi_handle_info(boot_ec->handle, +- "Boot %s EC initialization complete\n", ++ "Boot %s EC used to handle transactions and events\n", + boot_ec_is_ecdt ? "ECDT" : "DSDT"); + +- acpi_handle_info(ec->handle, +- "EC: Used to handle transactions and events\n"); +- + device->driver_data = ec; + + ret = !!request_region(ec->data_addr, 1, "EC data"); diff --git a/queue-5.6/scsi-ufs-fix-ufshcd_hold-caused-scheduling-while-atomic.patch b/queue-5.6/scsi-ufs-fix-ufshcd_hold-caused-scheduling-while-atomic.patch new file mode 100644 index 00000000000..3628984b7f1 --- /dev/null +++ b/queue-5.6/scsi-ufs-fix-ufshcd_hold-caused-scheduling-while-atomic.patch @@ -0,0 +1,43 @@ +From c63d6099a7959ecc919b2549dc6b71f53521f819 Mon Sep 17 00:00:00 2001 +From: Can Guo +Date: Mon, 10 Feb 2020 19:40:48 -0800 +Subject: scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic + +From: Can Guo + +commit c63d6099a7959ecc919b2549dc6b71f53521f819 upstream. + +The async version of ufshcd_hold(async == true), which is only called in +queuecommand path as for now, is expected to work in atomic context, thus +it should not sleep or schedule out. When it runs into the condition that +clocks are ON but link is still in hibern8 state, it should bail out +without flushing the clock ungate work. + +Fixes: f2a785ac2312 ("scsi: ufshcd: Fix race between clk scaling and ungate work") +Link: https://lore.kernel.org/r/1581392451-28743-6-git-send-email-cang@codeaurora.org +Reviewed-by: Hongwu Su +Reviewed-by: Asutosh Das +Reviewed-by: Bean Huo +Reviewed-by: Stanley Chu +Signed-off-by: Can Guo +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/ufs/ufshcd.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -1518,6 +1518,11 @@ start: + */ + if (ufshcd_can_hibern8_during_gating(hba) && + ufshcd_is_link_hibern8(hba)) { ++ if (async) { ++ rc = -EAGAIN; ++ hba->clk_gating.active_reqs--; ++ break; ++ } + spin_unlock_irqrestore(hba->host->host_lock, flags); + flush_work(&hba->clk_gating.ungate_work); + spin_lock_irqsave(hba->host->host_lock, flags); diff --git a/queue-5.6/series b/queue-5.6/series index e687274ea1f..f898de700d0 100644 --- a/queue-5.6/series +++ b/queue-5.6/series @@ -19,3 +19,23 @@ net-icmp6-do-not-select-saddr-from-iif-when-route-has-prefsrc-set.patch net-mscc-ocelot-fix-untagged-packet-drops-when-enslaving-to-vlan-aware-bridge.patch net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch net-phy-marvell-fix-pause-frame-negotiation.patch +revert-acpi-ec-do-not-clear-boot_ec_is_ecdt-in-acpi_ec_add.patch +ovl-fix-value-of-i_ino-for-lower-hardlink-corner-case.patch +scsi-ufs-fix-ufshcd_hold-caused-scheduling-while-atomic.patch +platform-chrome-cros_ec_rpmsg-fix-race-with-host-event.patch +jbd2-improve-comments-about-freeing-data-buffers-whose-page-mapping-is-null.patch +acpi-nfit-improve-bounds-checking-for-func.patch +perf-report-fix-no-branch-type-statistics-report-issue.patch +pwm-pca9685-fix-pwm-gpio-inter-operation.patch +net-stmmac-xgmac-fix-vlan-register-handling.patch +net-bpfilter-remove-superfluous-testing-message.patch +ext4-fix-incorrect-group-count-in-ext4_fill_super-error-message.patch +ext4-fix-incorrect-inodes-per-group-in-error-message.patch +hid-lg-g15-do-not-fail-the-probe-when-we-fail-to-disable-f-emulation.patch +clk-at91-sam9x60-fix-usb-clock-parents.patch +clk-at91-usb-use-proper-usbs_mask.patch +arm-dts-imx7-colibri-fix-muxing-of-usbc_det-pin.patch +arm64-dts-librem5-devkit-add-a-vbus-supply-to-usb0.patch +usb-dwc3-gadget-don-t-clear-flags-before-transfer-ended.patch +asoc-intel-mrfld-fix-incorrect-check-on-p-sink.patch +asoc-intel-mrfld-return-error-codes-when-an-error-occurs.patch diff --git a/queue-5.6/usb-dwc3-gadget-don-t-clear-flags-before-transfer-ended.patch b/queue-5.6/usb-dwc3-gadget-don-t-clear-flags-before-transfer-ended.patch new file mode 100644 index 00000000000..d2c702ef87e --- /dev/null +++ b/queue-5.6/usb-dwc3-gadget-don-t-clear-flags-before-transfer-ended.patch @@ -0,0 +1,36 @@ +From a114c4ca64bd522aec1790c7e5c60c882f699d8f Mon Sep 17 00:00:00 2001 +From: Thinh Nguyen +Date: Thu, 5 Mar 2020 13:23:49 -0800 +Subject: usb: dwc3: gadget: Don't clear flags before transfer ended + +From: Thinh Nguyen + +commit a114c4ca64bd522aec1790c7e5c60c882f699d8f upstream. + +We track END_TRANSFER command completion. Don't clear transfer +started/ended flag prematurely. Otherwise, we'd run into the problem +with restarting transfer before END_TRANSFER command finishes. + +Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status") +Signed-off-by: Thinh Nguyen +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -2570,10 +2570,8 @@ static void dwc3_gadget_endpoint_transfe + + dwc3_gadget_ep_cleanup_completed_requests(dep, event, status); + +- if (stop) { ++ if (stop) + dwc3_stop_active_transfer(dep, true, true); +- dep->flags = DWC3_EP_ENABLED; +- } + + /* + * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.