From: Greg Kroah-Hartman Date: Sat, 5 Mar 2022 20:25:58 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.9.305~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d62d7228eff2dbe615130ca1fc87f51b0198ff10;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: arm-9182-1-mmu-fix-returns-from-early_param-and-__setup-functions.patch arm-fix-kgdb-breakpoint-for-thumb2.patch arm64-dts-rockchip-switch-rk3399-gru-dp-to-spdif-output.patch asoc-cs4265-fix-the-duplicated-control-name.patch can-gs_usb-change-active_channels-s-type-from-atomic_t-to-u8.patch efivars-respect-block-flag-in-efivar_entry_set_safe.patch firmware-arm_scmi-remove-space-in-module_alias-name.patch iavf-fix-missing-check-for-running-netdev.patch ibmvnic-free-reset-work-item-when-flushing.patch igc-igc_read_phy_reg_gpy-drop-premature-return.patch igc-igc_write_phy_reg_gpy-drop-premature-return.patch ixgbe-xsk-change-netif_carrier_ok-handling-in-ixgbe_xmit_zc.patch mac80211-fix-forwarded-mesh-frames-ac-queue-selection.patch net-arcnet-com20020-fix-null-ptr-deref-in-com20020pci_probe.patch net-stmmac-fix-return-value-of-__setup-handler.patch net-sxgbe-fix-return-value-of-__setup-handler.patch --- diff --git a/queue-5.4/arm-9182-1-mmu-fix-returns-from-early_param-and-__setup-functions.patch b/queue-5.4/arm-9182-1-mmu-fix-returns-from-early_param-and-__setup-functions.patch new file mode 100644 index 00000000000..bb00801e3a6 --- /dev/null +++ b/queue-5.4/arm-9182-1-mmu-fix-returns-from-early_param-and-__setup-functions.patch @@ -0,0 +1,51 @@ +From 7b83299e5b9385943a857d59e15cba270df20d7e Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Wed, 23 Feb 2022 20:46:35 +0100 +Subject: ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Randy Dunlap + +commit 7b83299e5b9385943a857d59e15cba270df20d7e upstream. + +early_param() handlers should return 0 on success. +__setup() handlers should return 1 on success, i.e., the parameter +has been handled. A return of 0 would cause the "option=value" string +to be added to init's environment strings, polluting it. + +../arch/arm/mm/mmu.c: In function 'test_early_cachepolicy': +../arch/arm/mm/mmu.c:215:1: error: no return statement in function returning non-void [-Werror=return-type] +../arch/arm/mm/mmu.c: In function 'test_noalign_setup': +../arch/arm/mm/mmu.c:221:1: error: no return statement in function returning non-void [-Werror=return-type] + +Fixes: b849a60e0903 ("ARM: make cr_alignment read-only #ifndef CONFIG_CPU_CP15") +Signed-off-by: Randy Dunlap +Reported-by: Igor Zhbanov +Cc: Uwe Kleine-König +Cc: linux-arm-kernel@lists.infradead.org +Cc: patches@armlinux.org.uk +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mm/mmu.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/mm/mmu.c ++++ b/arch/arm/mm/mmu.c +@@ -229,12 +229,14 @@ early_param("ecc", early_ecc); + static int __init early_cachepolicy(char *p) + { + pr_warn("cachepolicy kernel parameter not supported without cp15\n"); ++ return 0; + } + early_param("cachepolicy", early_cachepolicy); + + static int __init noalign_setup(char *__unused) + { + pr_warn("noalign kernel parameter not supported without cp15\n"); ++ return 1; + } + __setup("noalign", noalign_setup); + diff --git a/queue-5.4/arm-fix-kgdb-breakpoint-for-thumb2.patch b/queue-5.4/arm-fix-kgdb-breakpoint-for-thumb2.patch new file mode 100644 index 00000000000..00bd8e09bec --- /dev/null +++ b/queue-5.4/arm-fix-kgdb-breakpoint-for-thumb2.patch @@ -0,0 +1,93 @@ +From d920eaa4c4559f59be7b4c2d26fa0a2e1aaa3da9 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Wed, 16 Feb 2022 15:37:38 +0000 +Subject: ARM: Fix kgdb breakpoint for Thumb2 + +From: Russell King (Oracle) + +commit d920eaa4c4559f59be7b4c2d26fa0a2e1aaa3da9 upstream. + +The kgdb code needs to register an undef hook for the Thumb UDF +instruction that will fault in order to be functional on Thumb2 +platforms. + +Reported-by: Johannes Stezenbach +Tested-by: Johannes Stezenbach +Fixes: 5cbad0ebf45c ("kgdb: support for ARCH=arm") +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/kernel/kgdb.c | 36 ++++++++++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 8 deletions(-) + +--- a/arch/arm/kernel/kgdb.c ++++ b/arch/arm/kernel/kgdb.c +@@ -154,22 +154,38 @@ static int kgdb_compiled_brk_fn(struct p + return 0; + } + +-static struct undef_hook kgdb_brkpt_hook = { ++static struct undef_hook kgdb_brkpt_arm_hook = { + .instr_mask = 0xffffffff, + .instr_val = KGDB_BREAKINST, +- .cpsr_mask = MODE_MASK, ++ .cpsr_mask = PSR_T_BIT | MODE_MASK, + .cpsr_val = SVC_MODE, + .fn = kgdb_brk_fn + }; + +-static struct undef_hook kgdb_compiled_brkpt_hook = { ++static struct undef_hook kgdb_brkpt_thumb_hook = { ++ .instr_mask = 0xffff, ++ .instr_val = KGDB_BREAKINST & 0xffff, ++ .cpsr_mask = PSR_T_BIT | MODE_MASK, ++ .cpsr_val = PSR_T_BIT | SVC_MODE, ++ .fn = kgdb_brk_fn ++}; ++ ++static struct undef_hook kgdb_compiled_brkpt_arm_hook = { + .instr_mask = 0xffffffff, + .instr_val = KGDB_COMPILED_BREAK, +- .cpsr_mask = MODE_MASK, ++ .cpsr_mask = PSR_T_BIT | MODE_MASK, + .cpsr_val = SVC_MODE, + .fn = kgdb_compiled_brk_fn + }; + ++static struct undef_hook kgdb_compiled_brkpt_thumb_hook = { ++ .instr_mask = 0xffff, ++ .instr_val = KGDB_COMPILED_BREAK & 0xffff, ++ .cpsr_mask = PSR_T_BIT | MODE_MASK, ++ .cpsr_val = PSR_T_BIT | SVC_MODE, ++ .fn = kgdb_compiled_brk_fn ++}; ++ + static int __kgdb_notify(struct die_args *args, unsigned long cmd) + { + struct pt_regs *regs = args->regs; +@@ -210,8 +226,10 @@ int kgdb_arch_init(void) + if (ret != 0) + return ret; + +- register_undef_hook(&kgdb_brkpt_hook); +- register_undef_hook(&kgdb_compiled_brkpt_hook); ++ register_undef_hook(&kgdb_brkpt_arm_hook); ++ register_undef_hook(&kgdb_brkpt_thumb_hook); ++ register_undef_hook(&kgdb_compiled_brkpt_arm_hook); ++ register_undef_hook(&kgdb_compiled_brkpt_thumb_hook); + + return 0; + } +@@ -224,8 +242,10 @@ int kgdb_arch_init(void) + */ + void kgdb_arch_exit(void) + { +- unregister_undef_hook(&kgdb_brkpt_hook); +- unregister_undef_hook(&kgdb_compiled_brkpt_hook); ++ unregister_undef_hook(&kgdb_brkpt_arm_hook); ++ unregister_undef_hook(&kgdb_brkpt_thumb_hook); ++ unregister_undef_hook(&kgdb_compiled_brkpt_arm_hook); ++ unregister_undef_hook(&kgdb_compiled_brkpt_thumb_hook); + unregister_die_notifier(&kgdb_notifier); + } + diff --git a/queue-5.4/arm64-dts-rockchip-switch-rk3399-gru-dp-to-spdif-output.patch b/queue-5.4/arm64-dts-rockchip-switch-rk3399-gru-dp-to-spdif-output.patch new file mode 100644 index 00000000000..d155a57dba9 --- /dev/null +++ b/queue-5.4/arm64-dts-rockchip-switch-rk3399-gru-dp-to-spdif-output.patch @@ -0,0 +1,67 @@ +From b5fbaf7d779f5f02b7f75b080e7707222573be2a Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Fri, 14 Jan 2022 15:02:07 -0800 +Subject: arm64: dts: rockchip: Switch RK3399-Gru DP to SPDIF output + +From: Brian Norris + +commit b5fbaf7d779f5f02b7f75b080e7707222573be2a upstream. + +Commit b18c6c3c7768 ("ASoC: rockchip: cdn-dp sound output use spdif") +switched the platform to SPDIF, but we didn't fix up the device tree. + +Drop the pinctrl settings, because the 'spdif_bus' pins are either: + * unused (on kevin, bob), so the settings is ~harmless + * used by a different function (on scarlet), which causes probe + failures (!!) + +Fixes: b18c6c3c7768 ("ASoC: rockchip: cdn-dp sound output use spdif") +Signed-off-by: Brian Norris +Reviewed-by: Chen-Yu Tsai +Link: https://lore.kernel.org/r/20220114150129.v2.1.I46f64b00508d9dff34abe1c3e8d2defdab4ea1e5@changeid +Signed-off-by: Heiko Stuebner +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +@@ -281,7 +281,7 @@ + + sound: sound { + compatible = "rockchip,rk3399-gru-sound"; +- rockchip,cpu = <&i2s0 &i2s2>; ++ rockchip,cpu = <&i2s0 &spdif>; + }; + }; + +@@ -432,10 +432,6 @@ ap_i2c_audio: &i2c8 { + status = "okay"; + }; + +-&i2s2 { +- status = "okay"; +-}; +- + &io_domains { + status = "okay"; + +@@ -532,6 +528,17 @@ ap_i2c_audio: &i2c8 { + vqmmc-supply = <&ppvar_sd_card_io>; + }; + ++&spdif { ++ status = "okay"; ++ ++ /* ++ * SPDIF is routed internally to DP; we either don't use these pins, or ++ * mux them to something else. ++ */ ++ /delete-property/ pinctrl-0; ++ /delete-property/ pinctrl-names; ++}; ++ + &spi1 { + status = "okay"; + diff --git a/queue-5.4/asoc-cs4265-fix-the-duplicated-control-name.patch b/queue-5.4/asoc-cs4265-fix-the-duplicated-control-name.patch new file mode 100644 index 00000000000..500fa9a17cd --- /dev/null +++ b/queue-5.4/asoc-cs4265-fix-the-duplicated-control-name.patch @@ -0,0 +1,54 @@ +From c5487b9cdea5c1ede38a7ec94db0fc59963c8e86 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Tue, 15 Feb 2022 09:05:14 -0300 +Subject: ASoC: cs4265: Fix the duplicated control name + +From: Fabio Estevam + +commit c5487b9cdea5c1ede38a7ec94db0fc59963c8e86 upstream. + +Currently, the following error messages are seen during boot: + +asoc-simple-card sound: control 2:0:0:SPDIF Switch:0 is already present +cs4265 1-004f: ASoC: failed to add widget SPDIF dapm kcontrol SPDIF Switch: -16 + +Quoting Mark Brown: + +"The driver is just plain buggy, it defines both a regular SPIDF Switch +control and a SND_SOC_DAPM_SWITCH() called SPDIF both of which will +create an identically named control, it can never have loaded without +error. One or both of those has to be renamed or they need to be +merged into one thing." + +Fix the duplicated control name by combining the two SPDIF controls here +and move the register bits onto the DAPM widget and have DAPM control them. + +Fixes: f853d6b3ba34 ("ASoC: cs4265: Add a S/PDIF enable switch") +Signed-off-by: Fabio Estevam +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20220215120514.1760628-1-festevam@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/cs4265.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/sound/soc/codecs/cs4265.c ++++ b/sound/soc/codecs/cs4265.c +@@ -150,7 +150,6 @@ static const struct snd_kcontrol_new cs4 + SOC_SINGLE("E to F Buffer Disable Switch", CS4265_SPDIF_CTL1, + 6, 1, 0), + SOC_ENUM("C Data Access", cam_mode_enum), +- SOC_SINGLE("SPDIF Switch", CS4265_SPDIF_CTL2, 5, 1, 1), + SOC_SINGLE("Validity Bit Control Switch", CS4265_SPDIF_CTL2, + 3, 1, 0), + SOC_ENUM("SPDIF Mono/Stereo", spdif_mono_stereo_enum), +@@ -186,7 +185,7 @@ static const struct snd_soc_dapm_widget + + SND_SOC_DAPM_SWITCH("Loopback", SND_SOC_NOPM, 0, 0, + &loopback_ctl), +- SND_SOC_DAPM_SWITCH("SPDIF", SND_SOC_NOPM, 0, 0, ++ SND_SOC_DAPM_SWITCH("SPDIF", CS4265_SPDIF_CTL2, 5, 1, + &spdif_switch), + SND_SOC_DAPM_SWITCH("DAC", CS4265_PWRCTL, 1, 1, + &dac_switch), diff --git a/queue-5.4/can-gs_usb-change-active_channels-s-type-from-atomic_t-to-u8.patch b/queue-5.4/can-gs_usb-change-active_channels-s-type-from-atomic_t-to-u8.patch new file mode 100644 index 00000000000..863d6ef8c4e --- /dev/null +++ b/queue-5.4/can-gs_usb-change-active_channels-s-type-from-atomic_t-to-u8.patch @@ -0,0 +1,79 @@ +From 035b0fcf02707d3c9c2890dc1484b11aa5335eb1 Mon Sep 17 00:00:00 2001 +From: Vincent Mailhol +Date: Tue, 15 Feb 2022 08:48:14 +0900 +Subject: can: gs_usb: change active_channels's type from atomic_t to u8 + +From: Vincent Mailhol + +commit 035b0fcf02707d3c9c2890dc1484b11aa5335eb1 upstream. + +The driver uses an atomic_t variable: gs_usb:active_channels to keep +track of the number of opened channels in order to only allocate +memory for the URBs when this count changes from zero to one. + +However, the driver does not decrement the counter when an error +occurs in gs_can_open(). This issue is fixed by changing the type from +atomic_t to u8 and by simplifying the logic accordingly. + +It is safe to use an u8 here because the network stack big kernel lock +(a.k.a. rtnl_mutex) is being hold. For details, please refer to [1]. + +[1] https://lore.kernel.org/linux-can/CAMZ6Rq+sHpiw34ijPsmp7vbUpDtJwvVtdV7CvRZJsLixjAFfrg@mail.gmail.com/T/#t + +Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") +Link: https://lore.kernel.org/all/20220214234814.1321599-1-mailhol.vincent@wanadoo.fr +Signed-off-by: Vincent Mailhol +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/can/usb/gs_usb.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/net/can/usb/gs_usb.c ++++ b/drivers/net/can/usb/gs_usb.c +@@ -190,8 +190,8 @@ struct gs_can { + struct gs_usb { + struct gs_can *canch[GS_MAX_INTF]; + struct usb_anchor rx_submitted; +- atomic_t active_channels; + struct usb_device *udev; ++ u8 active_channels; + }; + + /* 'allocate' a tx context. +@@ -588,7 +588,7 @@ static int gs_can_open(struct net_device + if (rc) + return rc; + +- if (atomic_add_return(1, &parent->active_channels) == 1) { ++ if (!parent->active_channels) { + for (i = 0; i < GS_MAX_RX_URBS; i++) { + struct urb *urb; + u8 *buf; +@@ -689,6 +689,7 @@ static int gs_can_open(struct net_device + + dev->can.state = CAN_STATE_ERROR_ACTIVE; + ++ parent->active_channels++; + if (!(dev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)) + netif_start_queue(netdev); + +@@ -704,7 +705,8 @@ static int gs_can_close(struct net_devic + netif_stop_queue(netdev); + + /* Stop polling */ +- if (atomic_dec_and_test(&parent->active_channels)) ++ parent->active_channels--; ++ if (!parent->active_channels) + usb_kill_anchored_urbs(&parent->rx_submitted); + + /* Stop sending URBs */ +@@ -983,8 +985,6 @@ static int gs_usb_probe(struct usb_inter + + init_usb_anchor(&dev->rx_submitted); + +- atomic_set(&dev->active_channels, 0); +- + usb_set_intfdata(intf, dev); + dev->udev = interface_to_usbdev(intf); + diff --git a/queue-5.4/efivars-respect-block-flag-in-efivar_entry_set_safe.patch b/queue-5.4/efivars-respect-block-flag-in-efivar_entry_set_safe.patch new file mode 100644 index 00000000000..b052a0f6c9e --- /dev/null +++ b/queue-5.4/efivars-respect-block-flag-in-efivar_entry_set_safe.patch @@ -0,0 +1,56 @@ +From 258dd902022cb10c83671176688074879517fd21 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Fri, 18 Feb 2022 19:05:59 +0100 +Subject: efivars: Respect "block" flag in efivar_entry_set_safe() + +From: Jann Horn + +commit 258dd902022cb10c83671176688074879517fd21 upstream. + +When the "block" flag is false, the old code would sometimes still call +check_var_size(), which wrongly tells ->query_variable_store() that it can +block. + +As far as I can tell, this can't really materialize as a bug at the moment, +because ->query_variable_store only does something on X86 with generic EFI, +and in that configuration we always take the efivar_entry_set_nonblocking() +path. + +Fixes: ca0e30dcaa53 ("efi: Add nonblocking option to efi_query_variable_store()") +Signed-off-by: Jann Horn +Signed-off-by: Ard Biesheuvel +Link: https://lore.kernel.org/r/20220218180559.1432559-1-jannh@google.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/efi/vars.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/firmware/efi/vars.c ++++ b/drivers/firmware/efi/vars.c +@@ -750,6 +750,7 @@ int efivar_entry_set_safe(efi_char16_t * + { + const struct efivar_operations *ops; + efi_status_t status; ++ unsigned long varsize; + + if (!__efivars) + return -EINVAL; +@@ -772,15 +773,17 @@ int efivar_entry_set_safe(efi_char16_t * + return efivar_entry_set_nonblocking(name, vendor, attributes, + size, data); + ++ varsize = size + ucs2_strsize(name, 1024); + if (!block) { + if (down_trylock(&efivars_lock)) + return -EBUSY; ++ status = check_var_size_nonblocking(attributes, varsize); + } else { + if (down_interruptible(&efivars_lock)) + return -EINTR; ++ status = check_var_size(attributes, varsize); + } + +- status = check_var_size(attributes, size + ucs2_strsize(name, 1024)); + if (status != EFI_SUCCESS) { + up(&efivars_lock); + return -ENOSPC; diff --git a/queue-5.4/firmware-arm_scmi-remove-space-in-module_alias-name.patch b/queue-5.4/firmware-arm_scmi-remove-space-in-module_alias-name.patch new file mode 100644 index 00000000000..c9510b6fcab --- /dev/null +++ b/queue-5.4/firmware-arm_scmi-remove-space-in-module_alias-name.patch @@ -0,0 +1,32 @@ +From 1ba603f56568c3b4c2542dfba07afa25f21dcff3 Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Fri, 11 Feb 2022 10:27:04 +0000 +Subject: firmware: arm_scmi: Remove space in MODULE_ALIAS name + +From: Alyssa Ross + +commit 1ba603f56568c3b4c2542dfba07afa25f21dcff3 upstream. + +modprobe can't handle spaces in aliases. Get rid of it to fix the issue. + +Link: https://lore.kernel.org/r/20220211102704.128354-1-sudeep.holla@arm.com +Fixes: aa4f886f3893 ("firmware: arm_scmi: add basic driver infrastructure for SCMI") +Reviewed-by: Cristian Marussi +Signed-off-by: Alyssa Ross +Signed-off-by: Sudeep Holla +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/arm_scmi/driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/firmware/arm_scmi/driver.c ++++ b/drivers/firmware/arm_scmi/driver.c +@@ -983,7 +983,7 @@ static struct platform_driver scmi_drive + + module_platform_driver(scmi_driver); + +-MODULE_ALIAS("platform: arm-scmi"); ++MODULE_ALIAS("platform:arm-scmi"); + MODULE_AUTHOR("Sudeep Holla "); + MODULE_DESCRIPTION("ARM SCMI protocol driver"); + MODULE_LICENSE("GPL v2"); diff --git a/queue-5.4/iavf-fix-missing-check-for-running-netdev.patch b/queue-5.4/iavf-fix-missing-check-for-running-netdev.patch new file mode 100644 index 00000000000..c595b69929f --- /dev/null +++ b/queue-5.4/iavf-fix-missing-check-for-running-netdev.patch @@ -0,0 +1,43 @@ +From d2c0f45fcceb0995f208c441d9c9a453623f9ccf Mon Sep 17 00:00:00 2001 +From: Slawomir Laba +Date: Wed, 23 Feb 2022 13:38:43 +0100 +Subject: iavf: Fix missing check for running netdev + +From: Slawomir Laba + +commit d2c0f45fcceb0995f208c441d9c9a453623f9ccf upstream. + +The driver was queueing reset_task regardless of the netdev +state. + +Do not queue the reset task in iavf_change_mtu if netdev +is not running. + +Fixes: fdd4044ffdc8 ("iavf: Remove timer for work triggering, use delaying work instead") +Signed-off-by: Slawomir Laba +Signed-off-by: Phani Burra +Signed-off-by: Jacob Keller +Signed-off-by: Mateusz Palczewski +Tested-by: Konrad Jankowski +Signed-off-by: Tony Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/iavf/iavf_main.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/iavf/iavf_main.c ++++ b/drivers/net/ethernet/intel/iavf/iavf_main.c +@@ -3323,8 +3323,11 @@ static int iavf_change_mtu(struct net_de + iavf_notify_client_l2_params(&adapter->vsi); + adapter->flags |= IAVF_FLAG_SERVICE_CLIENT_REQUESTED; + } +- adapter->flags |= IAVF_FLAG_RESET_NEEDED; +- queue_work(iavf_wq, &adapter->reset_task); ++ ++ if (netif_running(netdev)) { ++ adapter->flags |= IAVF_FLAG_RESET_NEEDED; ++ queue_work(iavf_wq, &adapter->reset_task); ++ } + + return 0; + } diff --git a/queue-5.4/ibmvnic-free-reset-work-item-when-flushing.patch b/queue-5.4/ibmvnic-free-reset-work-item-when-flushing.patch new file mode 100644 index 00000000000..51ecdaa00b2 --- /dev/null +++ b/queue-5.4/ibmvnic-free-reset-work-item-when-flushing.patch @@ -0,0 +1,33 @@ +From 8d0657f39f487d904fca713e0bc39c2707382553 Mon Sep 17 00:00:00 2001 +From: Sukadev Bhattiprolu +Date: Thu, 24 Feb 2022 22:23:51 -0800 +Subject: ibmvnic: free reset-work-item when flushing + +From: Sukadev Bhattiprolu + +commit 8d0657f39f487d904fca713e0bc39c2707382553 upstream. + +Fix a tiny memory leak when flushing the reset work queue. + +Fixes: 2770a7984db5 ("ibmvnic: Introduce hard reset recovery") +Signed-off-by: Sukadev Bhattiprolu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/ibm/ibmvnic.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2248,8 +2248,10 @@ static int ibmvnic_reset(struct ibmvnic_ + * flush reset queue and process this reset + */ + if (adapter->force_reset_recovery && !list_empty(&adapter->rwi_list)) { +- list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) ++ list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) { + list_del(entry); ++ kfree(list_entry(entry, struct ibmvnic_rwi, list)); ++ } + } + rwi->reset_reason = reason; + list_add_tail(&rwi->list, &adapter->rwi_list); diff --git a/queue-5.4/igc-igc_read_phy_reg_gpy-drop-premature-return.patch b/queue-5.4/igc-igc_read_phy_reg_gpy-drop-premature-return.patch new file mode 100644 index 00000000000..0fa34aa257e --- /dev/null +++ b/queue-5.4/igc-igc_read_phy_reg_gpy-drop-premature-return.patch @@ -0,0 +1,37 @@ +From fda2635466cd26ad237e1bc5d3f6a60f97ad09b6 Mon Sep 17 00:00:00 2001 +From: Corinna Vinschen +Date: Wed, 16 Feb 2022 14:31:35 +0100 +Subject: igc: igc_read_phy_reg_gpy: drop premature return + +From: Corinna Vinschen + +commit fda2635466cd26ad237e1bc5d3f6a60f97ad09b6 upstream. + +igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic +and if it's not 0, returns immediately. By doing this, it leaves the HW +semaphore in the acquired state. + +Drop this premature return statement, the function returns after +releasing the semaphore immediately anyway. + +Fixes: 5586838fe9ce ("igc: Add code for PHY support") +Signed-off-by: Corinna Vinschen +Acked-by: Sasha Neftin +Tested-by: Naama Meir +Signed-off-by: Tony Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igc/igc_phy.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/net/ethernet/intel/igc/igc_phy.c ++++ b/drivers/net/ethernet/intel/igc/igc_phy.c +@@ -767,8 +767,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw * + if (ret_val) + return ret_val; + ret_val = igc_read_phy_reg_mdic(hw, offset, data); +- if (ret_val) +- return ret_val; + hw->phy.ops.release(hw); + } else { + ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr, diff --git a/queue-5.4/igc-igc_write_phy_reg_gpy-drop-premature-return.patch b/queue-5.4/igc-igc_write_phy_reg_gpy-drop-premature-return.patch new file mode 100644 index 00000000000..0cf8acecb5a --- /dev/null +++ b/queue-5.4/igc-igc_write_phy_reg_gpy-drop-premature-return.patch @@ -0,0 +1,39 @@ +From c4208653a327a09da1e9e7b10299709b6d9b17bf Mon Sep 17 00:00:00 2001 +From: Sasha Neftin +Date: Sun, 20 Feb 2022 09:29:15 +0200 +Subject: igc: igc_write_phy_reg_gpy: drop premature return + +From: Sasha Neftin + +commit c4208653a327a09da1e9e7b10299709b6d9b17bf upstream. + +Similar to "igc_read_phy_reg_gpy: drop premature return" patch. +igc_write_phy_reg_gpy checks the return value from igc_write_phy_reg_mdic +and if it's not 0, returns immediately. By doing this, it leaves the HW +semaphore in the acquired state. + +Drop this premature return statement, the function returns after +releasing the semaphore immediately anyway. + +Fixes: 5586838fe9ce ("igc: Add code for PHY support") +Suggested-by: Dima Ruinskiy +Reported-by: Corinna Vinschen +Signed-off-by: Sasha Neftin +Tested-by: Naama Meir +Signed-off-by: Tony Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igc/igc_phy.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/net/ethernet/intel/igc/igc_phy.c ++++ b/drivers/net/ethernet/intel/igc/igc_phy.c +@@ -734,8 +734,6 @@ s32 igc_write_phy_reg_gpy(struct igc_hw + if (ret_val) + return ret_val; + ret_val = igc_write_phy_reg_mdic(hw, offset, data); +- if (ret_val) +- return ret_val; + hw->phy.ops.release(hw); + } else { + ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr, diff --git a/queue-5.4/ixgbe-xsk-change-netif_carrier_ok-handling-in-ixgbe_xmit_zc.patch b/queue-5.4/ixgbe-xsk-change-netif_carrier_ok-handling-in-ixgbe_xmit_zc.patch new file mode 100644 index 00000000000..45e9fb994e2 --- /dev/null +++ b/queue-5.4/ixgbe-xsk-change-netif_carrier_ok-handling-in-ixgbe_xmit_zc.patch @@ -0,0 +1,50 @@ +From 6c7273a266759d9d36f7c862149f248bcdeddc0f Mon Sep 17 00:00:00 2001 +From: Maciej Fijalkowski +Date: Wed, 2 Mar 2022 09:59:27 -0800 +Subject: ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() + +From: Maciej Fijalkowski + +commit 6c7273a266759d9d36f7c862149f248bcdeddc0f upstream. + +Commit c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if +netif is not OK") addressed the ring transient state when +MEM_TYPE_XSK_BUFF_POOL was being configured which in turn caused the +interface to through down/up. Maurice reported that when carrier is not +ok and xsk_pool is present on ring pair, ksoftirqd will consume 100% CPU +cycles due to the constant NAPI rescheduling as ixgbe_poll() states that +there is still some work to be done. + +To fix this, do not set work_done to false for a !netif_carrier_ok(). + +Fixes: c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") +Reported-by: Maurice Baijens +Tested-by: Maurice Baijens +Signed-off-by: Maciej Fijalkowski +Tested-by: Sandeep Penigalapati +Signed-off-by: Tony Nguyen +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +@@ -583,12 +583,14 @@ static bool ixgbe_xmit_zc(struct ixgbe_r + u32 cmd_type; + + while (budget-- > 0) { +- if (unlikely(!ixgbe_desc_unused(xdp_ring)) || +- !netif_carrier_ok(xdp_ring->netdev)) { ++ if (unlikely(!ixgbe_desc_unused(xdp_ring))) { + work_done = false; + break; + } + ++ if (!netif_carrier_ok(xdp_ring->netdev)) ++ break; ++ + if (!xsk_umem_consume_tx(xdp_ring->xsk_umem, &desc)) + break; + diff --git a/queue-5.4/mac80211-fix-forwarded-mesh-frames-ac-queue-selection.patch b/queue-5.4/mac80211-fix-forwarded-mesh-frames-ac-queue-selection.patch new file mode 100644 index 00000000000..c5770dca87f --- /dev/null +++ b/queue-5.4/mac80211-fix-forwarded-mesh-frames-ac-queue-selection.patch @@ -0,0 +1,60 @@ +From 859ae7018316daa4adbc496012dcbbb458d7e510 Mon Sep 17 00:00:00 2001 +From: Nicolas Escande +Date: Mon, 14 Feb 2022 18:32:14 +0100 +Subject: mac80211: fix forwarded mesh frames AC & queue selection + +From: Nicolas Escande + +commit 859ae7018316daa4adbc496012dcbbb458d7e510 upstream. + +There are two problems with the current code that have been highlighted +with the AQL feature that is now enbaled by default. + +First problem is in ieee80211_rx_h_mesh_fwding(), +ieee80211_select_queue_80211() is used on received packets to choose +the sending AC queue of the forwarding packet although this function +should only be called on TX packet (it uses ieee80211_tx_info). +This ends with forwarded mesh packets been sent on unrelated random AC +queue. To fix that, AC queue can directly be infered from skb->priority +which has been extracted from QOS info (see ieee80211_parse_qos()). + +Second problem is the value of queue_mapping set on forwarded mesh +frames via skb_set_queue_mapping() is not the AC of the packet but a +hardware queue index. This may or may not work depending on AC to HW +queue mapping which is driver specific. + +Both of these issues lead to improper AC selection while forwarding +mesh packets but more importantly due to improper airtime accounting +(which is done on a per STA, per AC basis) caused traffic stall with +the introduction of AQL. + +Fixes: cf44012810cc ("mac80211: fix unnecessary frame drops in mesh fwding") +Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping") +Co-developed-by: Remi Pommarel +Signed-off-by: Remi Pommarel +Signed-off-by: Nicolas Escande +Link: https://lore.kernel.org/r/20220214173214.368862-1-nico.escande@gmail.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/rx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2852,13 +2852,13 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + ether_addr_equal(sdata->vif.addr, hdr->addr3)) + return RX_CONTINUE; + +- ac = ieee80211_select_queue_80211(sdata, skb, hdr); ++ ac = ieee802_1d_to_ac[skb->priority]; + q = sdata->vif.hw_queue[ac]; + if (ieee80211_queue_stopped(&local->hw, q)) { + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); + return RX_DROP_MONITOR; + } +- skb_set_queue_mapping(skb, q); ++ skb_set_queue_mapping(skb, ac); + + if (!--mesh_hdr->ttl) { + if (!is_multicast_ether_addr(hdr->addr1)) diff --git a/queue-5.4/net-arcnet-com20020-fix-null-ptr-deref-in-com20020pci_probe.patch b/queue-5.4/net-arcnet-com20020-fix-null-ptr-deref-in-com20020pci_probe.patch new file mode 100644 index 00000000000..63bfc4bcfde --- /dev/null +++ b/queue-5.4/net-arcnet-com20020-fix-null-ptr-deref-in-com20020pci_probe.patch @@ -0,0 +1,49 @@ +From bd6f1fd5d33dfe5d1b4f2502d3694a7cc13f166d Mon Sep 17 00:00:00 2001 +From: Zheyu Ma +Date: Wed, 2 Mar 2022 20:24:23 +0800 +Subject: net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() + +From: Zheyu Ma + +commit bd6f1fd5d33dfe5d1b4f2502d3694a7cc13f166d upstream. + +During driver initialization, the pointer of card info, i.e. the +variable 'ci' is required. However, the definition of +'com20020pci_id_table' reveals that this field is empty for some +devices, which will cause null pointer dereference when initializing +these devices. + +The following log reveals it: + +[ 3.973806] KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] +[ 3.973819] RIP: 0010:com20020pci_probe+0x18d/0x13e0 [com20020_pci] +[ 3.975181] Call Trace: +[ 3.976208] local_pci_probe+0x13f/0x210 +[ 3.977248] pci_device_probe+0x34c/0x6d0 +[ 3.977255] ? pci_uevent+0x470/0x470 +[ 3.978265] really_probe+0x24c/0x8d0 +[ 3.978273] __driver_probe_device+0x1b3/0x280 +[ 3.979288] driver_probe_device+0x50/0x370 + +Fix this by checking whether the 'ci' is a null pointer first. + +Fixes: 8c14f9c70327 ("ARCNET: add com20020 PCI IDs with metadata") +Signed-off-by: Zheyu Ma +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/arcnet/com20020-pci.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/arcnet/com20020-pci.c ++++ b/drivers/net/arcnet/com20020-pci.c +@@ -136,6 +136,9 @@ static int com20020pci_probe(struct pci_ + return -ENOMEM; + + ci = (struct com20020_pci_card_info *)id->driver_data; ++ if (!ci) ++ return -EINVAL; ++ + priv->ci = ci; + mm = &ci->misc_map; + diff --git a/queue-5.4/net-stmmac-fix-return-value-of-__setup-handler.patch b/queue-5.4/net-stmmac-fix-return-value-of-__setup-handler.patch new file mode 100644 index 00000000000..52b7361a264 --- /dev/null +++ b/queue-5.4/net-stmmac-fix-return-value-of-__setup-handler.patch @@ -0,0 +1,53 @@ +From e01b042e580f1fbf4fd8da467442451da00c7a90 Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Wed, 23 Feb 2022 19:35:36 -0800 +Subject: net: stmmac: fix return value of __setup handler + +From: Randy Dunlap + +commit e01b042e580f1fbf4fd8da467442451da00c7a90 upstream. + +__setup() handlers should return 1 on success, i.e., the parameter +has been handled. A return of 0 causes the "option=value" string to be +added to init's environment strings, polluting it. + +Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") +Fixes: f3240e2811f0 ("stmmac: remove warning when compile as built-in (V2)") +Signed-off-by: Randy Dunlap +Reported-by: Igor Zhbanov +Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru +Cc: Giuseppe Cavallaro +Cc: Alexandre Torgue +Cc: Jose Abreu +Link: https://lore.kernel.org/r/20220224033536.25056-1-rdunlap@infradead.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -4890,7 +4890,7 @@ static int __init stmmac_cmdline_opt(cha + char *opt; + + if (!str || !*str) +- return -EINVAL; ++ return 1; + while ((opt = strsep(&str, ",")) != NULL) { + if (!strncmp(opt, "debug:", 6)) { + if (kstrtoint(opt + 6, 0, &debug)) +@@ -4921,11 +4921,11 @@ static int __init stmmac_cmdline_opt(cha + goto err; + } + } +- return 0; ++ return 1; + + err: + pr_err("%s: ERROR broken module parameter conversion", __func__); +- return -EINVAL; ++ return 1; + } + + __setup("stmmaceth=", stmmac_cmdline_opt); diff --git a/queue-5.4/net-sxgbe-fix-return-value-of-__setup-handler.patch b/queue-5.4/net-sxgbe-fix-return-value-of-__setup-handler.patch new file mode 100644 index 00000000000..f44bbc3c7ea --- /dev/null +++ b/queue-5.4/net-sxgbe-fix-return-value-of-__setup-handler.patch @@ -0,0 +1,52 @@ +From 50e06ddceeea263f57fe92baa677c638ecd65bb6 Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Wed, 23 Feb 2022 19:35:28 -0800 +Subject: net: sxgbe: fix return value of __setup handler + +From: Randy Dunlap + +commit 50e06ddceeea263f57fe92baa677c638ecd65bb6 upstream. + +__setup() handlers should return 1 on success, i.e., the parameter +has been handled. A return of 0 causes the "option=value" string to be +added to init's environment strings, polluting it. + +Fixes: acc18c147b22 ("net: sxgbe: add EEE(Energy Efficient Ethernet) for Samsung sxgbe") +Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver") +Signed-off-by: Randy Dunlap +Reported-by: Igor Zhbanov +Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru +Cc: Siva Reddy +Cc: Girish K S +Cc: Byungho An +Link: https://lore.kernel.org/r/20220224033528.24640-1-rdunlap@infradead.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c ++++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +@@ -2277,18 +2277,18 @@ static int __init sxgbe_cmdline_opt(char + char *opt; + + if (!str || !*str) +- return -EINVAL; ++ return 1; + while ((opt = strsep(&str, ",")) != NULL) { + if (!strncmp(opt, "eee_timer:", 10)) { + if (kstrtoint(opt + 10, 0, &eee_timer)) + goto err; + } + } +- return 0; ++ return 1; + + err: + pr_err("%s: ERROR broken module parameter conversion\n", __func__); +- return -EINVAL; ++ return 1; + } + + __setup("sxgbeeth=", sxgbe_cmdline_opt); diff --git a/queue-5.4/series b/queue-5.4/series index 725cff67f73..67131ca2a4c 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -31,3 +31,19 @@ xen-netfront-destroy-queues-before-real_num_tx_queues-is-zeroed.patch sched-topology-make-sched_init_numa-use-a-set-for-the-deduplicating-sort.patch sched-topology-fix-sched_domain_topology_level-alloc-in-sched_init_numa.patch ia64-ensure-proper-numa-distance-and-possible-map-initialization.patch +mac80211-fix-forwarded-mesh-frames-ac-queue-selection.patch +net-stmmac-fix-return-value-of-__setup-handler.patch +iavf-fix-missing-check-for-running-netdev.patch +net-sxgbe-fix-return-value-of-__setup-handler.patch +net-arcnet-com20020-fix-null-ptr-deref-in-com20020pci_probe.patch +ixgbe-xsk-change-netif_carrier_ok-handling-in-ixgbe_xmit_zc.patch +efivars-respect-block-flag-in-efivar_entry_set_safe.patch +firmware-arm_scmi-remove-space-in-module_alias-name.patch +asoc-cs4265-fix-the-duplicated-control-name.patch +can-gs_usb-change-active_channels-s-type-from-atomic_t-to-u8.patch +arm64-dts-rockchip-switch-rk3399-gru-dp-to-spdif-output.patch +igc-igc_read_phy_reg_gpy-drop-premature-return.patch +arm-fix-kgdb-breakpoint-for-thumb2.patch +arm-9182-1-mmu-fix-returns-from-early_param-and-__setup-functions.patch +igc-igc_write_phy_reg_gpy-drop-premature-return.patch +ibmvnic-free-reset-work-item-when-flushing.patch