From: Sasha Levin Date: Sun, 24 Oct 2021 21:48:52 +0000 (-0400) Subject: Fixes for 4.4 X-Git-Tag: v4.4.290~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c77acbfa9489f69a794f88f6568fac54f21be923;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/alsa-hda-avoid-write-to-statests-if-controller-is-in.patch b/queue-4.4/alsa-hda-avoid-write-to-statests-if-controller-is-in.patch new file mode 100644 index 00000000000..671fda0a9d5 --- /dev/null +++ b/queue-4.4/alsa-hda-avoid-write-to-statests-if-controller-is-in.patch @@ -0,0 +1,66 @@ +From d73587b90058289c39bce137cdfb48544e0d4f5a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Oct 2021 17:29:35 +0300 +Subject: ALSA: hda: avoid write to STATESTS if controller is in reset + +From: Kai Vehmanen + +[ Upstream commit b37a15188eae9d4c49c5bb035e0c8d4058e4d9b3 ] + +The snd_hdac_bus_reset_link() contains logic to clear STATESTS register +before performing controller reset. This code dates back to an old +bugfix in commit e8a7f136f5ed ("[ALSA] hda-intel - Improve HD-audio +codec probing robustness"). Originally the code was added to +azx_reset(). + +The code was moved around in commit a41d122449be ("ALSA: hda - Embed bus +into controller object") and ended up to snd_hdac_bus_reset_link() and +called primarily via snd_hdac_bus_init_chip(). + +The logic to clear STATESTS is correct when snd_hdac_bus_init_chip() is +called when controller is not in reset. In this case, STATESTS can be +cleared. This can be useful e.g. when forcing a controller reset to retry +codec probe. A normal non-power-on reset will not clear the bits. + +However, this old logic is problematic when controller is already in +reset. The HDA specification states that controller must be taken out of +reset before writing to registers other than GCTL.CRST (1.0a spec, +3.3.7). The write to STATESTS in snd_hdac_bus_reset_link() will be lost +if the controller is already in reset per the HDA specification mentioned. + +This has been harmless on older hardware. On newer generation of Intel +PCIe based HDA controllers, if configured to report issues, this write +will emit an unsupported request error. If ACPI Platform Error Interface +(APEI) is enabled in kernel, this will end up to kernel log. + +Fix the code in snd_hdac_bus_reset_link() to only clear the STATESTS if +the function is called when controller is not in reset. Otherwise +clearing the bits is not possible and should be skipped. + +Signed-off-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20211012142935.3731820-1-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/hda/hdac_controller.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c +index 4727f5b80e76..4ee3458ad810 100644 +--- a/sound/hda/hdac_controller.c ++++ b/sound/hda/hdac_controller.c +@@ -288,8 +288,9 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset) + if (!full_reset) + goto skip_reset; + +- /* clear STATESTS */ +- snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK); ++ /* clear STATESTS if not in reset */ ++ if (snd_hdac_chip_readb(bus, GCTL) & AZX_GCTL_RESET) ++ snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK); + + /* reset controller */ + snd_hdac_bus_enter_link_reset(bus); +-- +2.33.0 + diff --git a/queue-4.4/arm-dts-spear3xx-fix-gmac-node.patch b/queue-4.4/arm-dts-spear3xx-fix-gmac-node.patch new file mode 100644 index 00000000000..b8d4ed468a6 --- /dev/null +++ b/queue-4.4/arm-dts-spear3xx-fix-gmac-node.patch @@ -0,0 +1,41 @@ +From 4aacf0b49925b07f3bb7226231bdd48cdb4b1200 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Oct 2021 12:34:40 +0200 +Subject: ARM: dts: spear3xx: Fix gmac node + +From: Herve Codina + +[ Upstream commit 6636fec29cdf6665bd219564609e8651f6ddc142 ] + +On SPEAr3xx, ethernet driver is not compatible with the SPEAr600 +one. +Indeed, SPEAr3xx uses an earlier version of this IP (v3.40) and +needs some driver tuning compare to SPEAr600. + +The v3.40 IP support was added to stmmac driver and this patch +fixes this issue and use the correct compatible string for +SPEAr3xx + +Signed-off-by: Herve Codina +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/spear3xx.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/spear3xx.dtsi b/arch/arm/boot/dts/spear3xx.dtsi +index 118135d75899..4e4166d96b26 100644 +--- a/arch/arm/boot/dts/spear3xx.dtsi ++++ b/arch/arm/boot/dts/spear3xx.dtsi +@@ -53,7 +53,7 @@ + }; + + gmac: eth@e0800000 { +- compatible = "st,spear600-gmac"; ++ compatible = "snps,dwmac-3.40a"; + reg = <0xe0800000 0x8000>; + interrupts = <23 22>; + interrupt-names = "macirq", "eth_wake_irq"; +-- +2.33.0 + diff --git a/queue-4.4/isdn-misdn-fix-sleeping-function-called-from-invalid.patch b/queue-4.4/isdn-misdn-fix-sleeping-function-called-from-invalid.patch new file mode 100644 index 00000000000..1bc4aca1f04 --- /dev/null +++ b/queue-4.4/isdn-misdn-fix-sleeping-function-called-from-invalid.patch @@ -0,0 +1,80 @@ +From 50dff89932d773e90298927fed9f3762f8100163 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 9 Oct 2021 11:33:49 +0000 +Subject: isdn: mISDN: Fix sleeping function called from invalid context + +From: Zheyu Ma + +[ Upstream commit 6510e80a0b81b5d814e3aea6297ba42f5e76f73c ] + +The driver can call card->isac.release() function from an atomic +context. + +Fix this by calling this function after releasing the lock. + +The following log reveals it: + +[ 44.168226 ] BUG: sleeping function called from invalid context at kernel/workqueue.c:3018 +[ 44.168941 ] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 5475, name: modprobe +[ 44.169574 ] INFO: lockdep is turned off. +[ 44.169899 ] irq event stamp: 0 +[ 44.170160 ] hardirqs last enabled at (0): [<0000000000000000>] 0x0 +[ 44.170627 ] hardirqs last disabled at (0): [] copy_process+0x132d/0x3e00 +[ 44.171240 ] softirqs last enabled at (0): [] copy_process+0x135a/0x3e00 +[ 44.171852 ] softirqs last disabled at (0): [<0000000000000000>] 0x0 +[ 44.172318 ] Preemption disabled at: +[ 44.172320 ] [] nj_release+0x69/0x500 [netjet] +[ 44.174441 ] Call Trace: +[ 44.174630 ] dump_stack_lvl+0xa8/0xd1 +[ 44.174912 ] dump_stack+0x15/0x17 +[ 44.175166 ] ___might_sleep+0x3a2/0x510 +[ 44.175459 ] ? nj_release+0x69/0x500 [netjet] +[ 44.175791 ] __might_sleep+0x82/0xe0 +[ 44.176063 ] ? start_flush_work+0x20/0x7b0 +[ 44.176375 ] start_flush_work+0x33/0x7b0 +[ 44.176672 ] ? trace_irq_enable_rcuidle+0x85/0x170 +[ 44.177034 ] ? kasan_quarantine_put+0xaa/0x1f0 +[ 44.177372 ] ? kasan_quarantine_put+0xaa/0x1f0 +[ 44.177711 ] __flush_work+0x11a/0x1a0 +[ 44.177991 ] ? flush_work+0x20/0x20 +[ 44.178257 ] ? lock_release+0x13c/0x8f0 +[ 44.178550 ] ? __kasan_check_write+0x14/0x20 +[ 44.178872 ] ? do_raw_spin_lock+0x148/0x360 +[ 44.179187 ] ? read_lock_is_recursive+0x20/0x20 +[ 44.179530 ] ? __kasan_check_read+0x11/0x20 +[ 44.179846 ] ? do_raw_spin_unlock+0x55/0x900 +[ 44.180168 ] ? ____kasan_slab_free+0x116/0x140 +[ 44.180505 ] ? _raw_spin_unlock_irqrestore+0x41/0x60 +[ 44.180878 ] ? skb_queue_purge+0x1a3/0x1c0 +[ 44.181189 ] ? kfree+0x13e/0x290 +[ 44.181438 ] flush_work+0x17/0x20 +[ 44.181695 ] mISDN_freedchannel+0xe8/0x100 +[ 44.182006 ] isac_release+0x210/0x260 [mISDNipac] +[ 44.182366 ] nj_release+0xf6/0x500 [netjet] +[ 44.182685 ] nj_remove+0x48/0x70 [netjet] +[ 44.182989 ] pci_device_remove+0xa9/0x250 + +Signed-off-by: Zheyu Ma +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/isdn/hardware/mISDN/netjet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c +index 59eec2014b82..a74741d28ca8 100644 +--- a/drivers/isdn/hardware/mISDN/netjet.c ++++ b/drivers/isdn/hardware/mISDN/netjet.c +@@ -963,8 +963,8 @@ nj_release(struct tiger_hw *card) + nj_disable_hwirq(card); + mode_tiger(&card->bc[0], ISDN_P_NONE); + mode_tiger(&card->bc[1], ISDN_P_NONE); +- card->isac.release(&card->isac); + spin_unlock_irqrestore(&card->lock, flags); ++ card->isac.release(&card->isac); + release_region(card->base, card->base_s); + card->base_s = 0; + } +-- +2.33.0 + diff --git a/queue-4.4/platform-x86-intel_scu_ipc-update-timeout-value-in-c.patch b/queue-4.4/platform-x86-intel_scu_ipc-update-timeout-value-in-c.patch new file mode 100644 index 00000000000..efacb37c958 --- /dev/null +++ b/queue-4.4/platform-x86-intel_scu_ipc-update-timeout-value-in-c.patch @@ -0,0 +1,43 @@ +From f7f76dee5050e28a1818fbf194984ea52bd5ec85 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Sep 2021 03:19:34 -0700 +Subject: platform/x86: intel_scu_ipc: Update timeout value in comment + +From: Prashant Malani + +[ Upstream commit a0c5814b9933f25ecb6de169483c5b88cf632bca ] + +The comment decribing the IPC timeout hadn't been updated when the +actual timeout was changed from 3 to 5 seconds in +commit a7d53dbbc70a ("platform/x86: intel_scu_ipc: Increase virtual +timeout from 3 to 5 seconds") . + +Since the value is anyway updated to 10s now, take this opportunity to +update the value in the comment too. + +Signed-off-by: Prashant Malani +Cc: Benson Leung +Reviewed-by: Mika Westerberg +Link: https://lore.kernel.org/r/20210928101932.2543937-4-pmalani@chromium.org +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel_scu_ipc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c +index f94b730540e2..04cabcbd8aaa 100644 +--- a/drivers/platform/x86/intel_scu_ipc.c ++++ b/drivers/platform/x86/intel_scu_ipc.c +@@ -188,7 +188,7 @@ static inline int busy_loop(struct intel_scu_ipc_dev *scu) + return 0; + } + +-/* Wait till ipc ioc interrupt is received or timeout in 3 HZ */ ++/* Wait till ipc ioc interrupt is received or timeout in 10 HZ */ + static inline int ipc_wait_for_interrupt(struct intel_scu_ipc_dev *scu) + { + int status; +-- +2.33.0 + diff --git a/queue-4.4/series b/queue-4.4/series index af9b2064fc6..e806cb6dfb9 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -34,3 +34,7 @@ ovl-fix-missing-negative-dentry-check-in-ovl_rename.patch nfc-nci-fix-the-uaf-of-rf_conn_info-object.patch isdn-cpai-check-ctr-cnr-to-avoid-array-index-out-of-bound.patch netfilter-kconfig-use-default-y-instead-of-m-for-bool-config-option.patch +arm-dts-spear3xx-fix-gmac-node.patch +isdn-misdn-fix-sleeping-function-called-from-invalid.patch +platform-x86-intel_scu_ipc-update-timeout-value-in-c.patch +alsa-hda-avoid-write-to-statests-if-controller-is-in.patch