From: Greg Kroah-Hartman Date: Sat, 20 Mar 2021 10:53:29 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.263~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85d1565b84ccdc597e09ec137ddaf831d82e2614;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: alsa-dice-fix-null-pointer-dereference-when-node-is-disconnected.patch alsa-hda-generic-fix-the-micmute-led-init-state.patch alsa-hda-realtek-apply-headset-mic-quirks-for-xiaomi-redmibook-air.patch alsa-hda-realtek-apply-pin-quirk-for-xiaominotebook-pro.patch asoc-ak4458-add-module_device_table.patch asoc-ak5558-add-module_device_table.patch revert-pm-runtime-update-device-status-before-letting-suppliers-suspend.patch s390-vtime-fix-increased-steal-time-accounting.patch --- diff --git a/queue-5.4/alsa-dice-fix-null-pointer-dereference-when-node-is-disconnected.patch b/queue-5.4/alsa-dice-fix-null-pointer-dereference-when-node-is-disconnected.patch new file mode 100644 index 00000000000..06783270770 --- /dev/null +++ b/queue-5.4/alsa-dice-fix-null-pointer-dereference-when-node-is-disconnected.patch @@ -0,0 +1,42 @@ +From dd7b836d6bc935df95c826f69ff4d051f5561604 Mon Sep 17 00:00:00 2001 +From: Takashi Sakamoto +Date: Fri, 12 Mar 2021 18:34:07 +0900 +Subject: ALSA: dice: fix null pointer dereference when node is disconnected + +From: Takashi Sakamoto + +commit dd7b836d6bc935df95c826f69ff4d051f5561604 upstream. + +When node is removed from IEEE 1394 bus, any transaction fails to the node. +In the case, ALSA dice driver doesn't stop isochronous contexts even if +they are running. As a result, null pointer dereference occurs in callback +from the running context. + +This commit fixes the bug to release isochronous contexts always. + +Cc: # v5.4 or later +Fixes: e9f21129b8d8 ("ALSA: dice: support AMDTP domain") +Signed-off-by: Takashi Sakamoto +Link: https://lore.kernel.org/r/20210312093407.23437-1-o-takashi@sakamocchi.jp +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/firewire/dice/dice-stream.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/sound/firewire/dice/dice-stream.c ++++ b/sound/firewire/dice/dice-stream.c +@@ -489,11 +489,10 @@ void snd_dice_stream_stop_duplex(struct + struct reg_params tx_params, rx_params; + + if (dice->substreams_counter == 0) { +- if (get_register_params(dice, &tx_params, &rx_params) >= 0) { +- amdtp_domain_stop(&dice->domain); ++ if (get_register_params(dice, &tx_params, &rx_params) >= 0) + finish_session(dice, &tx_params, &rx_params); +- } + ++ amdtp_domain_stop(&dice->domain); + release_resources(dice); + } + } diff --git a/queue-5.4/alsa-hda-generic-fix-the-micmute-led-init-state.patch b/queue-5.4/alsa-hda-generic-fix-the-micmute-led-init-state.patch new file mode 100644 index 00000000000..e46441d0f52 --- /dev/null +++ b/queue-5.4/alsa-hda-generic-fix-the-micmute-led-init-state.patch @@ -0,0 +1,48 @@ +From 2bf44e0ee95f39cc54ea1b942f0a027e0181ca4e Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Fri, 12 Mar 2021 12:14:08 +0800 +Subject: ALSA: hda: generic: Fix the micmute led init state + +From: Hui Wang + +commit 2bf44e0ee95f39cc54ea1b942f0a027e0181ca4e upstream. + +Recently we found the micmute led init state is not correct after +freshly installing the ubuntu linux on a Lenovo AIO machine. The +internal mic is not muted, but the micmute led is on and led mode is +'follow mute'. If we mute internal mic, the led is keeping on, then +unmute the internal mic, the led is off. And from then on, the +micmute led will work correctly. + +So the micmute led init state is not correct. The led is controlled +by codec gpio (ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), in the +patch_realtek, the gpio data is set to 0x4 initially and the led is +on with this data. In the hda_generic, the led_value is set to +0 initially, suppose users set the 'capture switch' to on from +user space and the micmute led should change to be off with this +operation, but the check "if (val == spec->micmute_led.led_value)" in +the call_micmute_led_update() will skip the led setting. + +To guarantee the led state will be set by the 1st time of changing +"Capture Switch", set -1 to the init led_value. + +Cc: +Signed-off-by: Hui Wang +Link: https://lore.kernel.org/r/20210312041408.3776-1-hui.wang@canonical.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/hda_generic.c ++++ b/sound/pci/hda/hda_generic.c +@@ -4017,7 +4017,7 @@ int snd_hda_gen_add_micmute_led(struct h + + spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE; + spec->micmute_led.capture = 0; +- spec->micmute_led.led_value = 0; ++ spec->micmute_led.led_value = -1; + spec->micmute_led.old_hook = spec->cap_sync_hook; + spec->micmute_led.update = hook; + spec->cap_sync_hook = update_micmute_led; diff --git a/queue-5.4/alsa-hda-realtek-apply-headset-mic-quirks-for-xiaomi-redmibook-air.patch b/queue-5.4/alsa-hda-realtek-apply-headset-mic-quirks-for-xiaomi-redmibook-air.patch new file mode 100644 index 00000000000..69f52301fe1 --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-apply-headset-mic-quirks-for-xiaomi-redmibook-air.patch @@ -0,0 +1,31 @@ +From e1c86210fe27428399643861b81b080eccd79f87 Mon Sep 17 00:00:00 2001 +From: Xiaoliang Yu +Date: Sat, 13 Mar 2021 07:54:53 +0800 +Subject: ALSA: hda/realtek: Apply headset-mic quirks for Xiaomi Redmibook Air + +From: Xiaoliang Yu + +commit e1c86210fe27428399643861b81b080eccd79f87 upstream. + +There is another fix for headset-mic problem on Redmibook (1d72:1602), +it also works on Redmibook Air (1d72:1947), which has the same issue. + +Signed-off-by: Xiaoliang Yu +Cc: +Link: https://lore.kernel.org/r/TYBP286MB02856DC016849DEA0F9B6A37EE6F9@TYBP286MB0285.JPNP286.PROD.OUTLOOK.COM +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -8104,6 +8104,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), + SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), ++ SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), + SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), + SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), + SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), diff --git a/queue-5.4/alsa-hda-realtek-apply-pin-quirk-for-xiaominotebook-pro.patch b/queue-5.4/alsa-hda-realtek-apply-pin-quirk-for-xiaominotebook-pro.patch new file mode 100644 index 00000000000..9db325c656a --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-apply-pin-quirk-for-xiaominotebook-pro.patch @@ -0,0 +1,31 @@ +From b95bc12e0412d14d5fc764f0b82631c7bcaf1959 Mon Sep 17 00:00:00 2001 +From: Xiaoliang Yu +Date: Tue, 16 Mar 2021 00:49:00 +0800 +Subject: ALSA: hda/realtek: apply pin quirk for XiaomiNotebook Pro + +From: Xiaoliang Yu + +commit b95bc12e0412d14d5fc764f0b82631c7bcaf1959 upstream. + +Built-in microphone and combojack on Xiaomi Notebook Pro (1d72:1701) needs +to be fixed, the existing quirk for Dell works well on that machine. + +Signed-off-by: Xiaoliang Yu +Cc: +Link: https://lore.kernel.org/r/OS0P286MB02749B9E13920E6899902CD8EE6C9@OS0P286MB0274.JPNP286.PROD.OUTLOOK.COM +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -8102,6 +8102,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), + SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ + SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), ++ SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), + SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), diff --git a/queue-5.4/asoc-ak4458-add-module_device_table.patch b/queue-5.4/asoc-ak4458-add-module_device_table.patch new file mode 100644 index 00000000000..78b5bcd987c --- /dev/null +++ b/queue-5.4/asoc-ak4458-add-module_device_table.patch @@ -0,0 +1,32 @@ +From 4ec5b96775a88dd9b1c3ba1d23c43c478cab95a2 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Wed, 24 Feb 2021 14:57:51 +0800 +Subject: ASoC: ak4458: Add MODULE_DEVICE_TABLE + +From: Shengjiu Wang + +commit 4ec5b96775a88dd9b1c3ba1d23c43c478cab95a2 upstream. + +Add missed MODULE_DEVICE_TABLE for the driver can be loaded +automatically at boot. + +Fixes: 08660086eff9 ("ASoC: ak4458: Add support for AK4458 DAC driver") +Cc: +Signed-off-by: Shengjiu Wang +Link: https://lore.kernel.org/r/1614149872-25510-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/ak4458.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/codecs/ak4458.c ++++ b/sound/soc/codecs/ak4458.c +@@ -707,6 +707,7 @@ static const struct of_device_id ak4458_ + { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata}, + { }, + }; ++MODULE_DEVICE_TABLE(of, ak4458_of_match); + + static struct i2c_driver ak4458_i2c_driver = { + .driver = { diff --git a/queue-5.4/asoc-ak5558-add-module_device_table.patch b/queue-5.4/asoc-ak5558-add-module_device_table.patch new file mode 100644 index 00000000000..2c9a649944d --- /dev/null +++ b/queue-5.4/asoc-ak5558-add-module_device_table.patch @@ -0,0 +1,32 @@ +From 80cffd2468ddb850e678f17841fc356930b2304a Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Wed, 24 Feb 2021 14:57:52 +0800 +Subject: ASoC: ak5558: Add MODULE_DEVICE_TABLE + +From: Shengjiu Wang + +commit 80cffd2468ddb850e678f17841fc356930b2304a upstream. + +Add missed MODULE_DEVICE_TABLE for the driver can be loaded +automatically at boot. + +Fixes: 920884777480 ("ASoC: ak5558: Add support for AK5558 ADC driver") +Cc: +Signed-off-by: Shengjiu Wang +Link: https://lore.kernel.org/r/1614149872-25510-2-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/ak5558.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/codecs/ak5558.c ++++ b/sound/soc/codecs/ak5558.c +@@ -389,6 +389,7 @@ static const struct of_device_id ak5558_ + { .compatible = "asahi-kasei,ak5558"}, + { } + }; ++MODULE_DEVICE_TABLE(of, ak5558_i2c_dt_ids); + + static struct i2c_driver ak5558_i2c_driver = { + .driver = { diff --git a/queue-5.4/revert-pm-runtime-update-device-status-before-letting-suppliers-suspend.patch b/queue-5.4/revert-pm-runtime-update-device-status-before-letting-suppliers-suspend.patch new file mode 100644 index 00000000000..5085072ce2f --- /dev/null +++ b/queue-5.4/revert-pm-runtime-update-device-status-before-letting-suppliers-suspend.patch @@ -0,0 +1,113 @@ +From 0cab893f409c53634d0d818fa414641cbcdb0dab Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Fri, 19 Mar 2021 15:47:25 +0100 +Subject: Revert "PM: runtime: Update device status before letting suppliers suspend" + +From: Rafael J. Wysocki + +commit 0cab893f409c53634d0d818fa414641cbcdb0dab upstream. + +Revert commit 44cc89f76464 ("PM: runtime: Update device status +before letting suppliers suspend") that introduced a race condition +into __rpm_callback() which allowed a concurrent rpm_resume() to +run and resume the device prematurely after its status had been +changed to RPM_SUSPENDED by __rpm_callback(). + +Fixes: 44cc89f76464 ("PM: runtime: Update device status before letting suppliers suspend") +Link: https://lore.kernel.org/linux-pm/24dfb6fc-5d54-6ee2-9195-26428b7ecf8a@intel.com/ +Reported-by: Adrian Hunter +Cc: 4.10+ # 4.10+ +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/base/power/runtime.c | 62 +++++++++++++++++-------------------------- + 1 file changed, 25 insertions(+), 37 deletions(-) + +--- a/drivers/base/power/runtime.c ++++ b/drivers/base/power/runtime.c +@@ -325,22 +325,22 @@ static void rpm_put_suppliers(struct dev + static int __rpm_callback(int (*cb)(struct device *), struct device *dev) + __releases(&dev->power.lock) __acquires(&dev->power.lock) + { +- bool use_links = dev->power.links_count > 0; +- bool get = false; + int retval, idx; +- bool put; ++ bool use_links = dev->power.links_count > 0; + + if (dev->power.irq_safe) { + spin_unlock(&dev->power.lock); +- } else if (!use_links) { +- spin_unlock_irq(&dev->power.lock); + } else { +- get = dev->power.runtime_status == RPM_RESUMING; +- + spin_unlock_irq(&dev->power.lock); + +- /* Resume suppliers if necessary. */ +- if (get) { ++ /* ++ * Resume suppliers if necessary. ++ * ++ * The device's runtime PM status cannot change until this ++ * routine returns, so it is safe to read the status outside of ++ * the lock. ++ */ ++ if (use_links && dev->power.runtime_status == RPM_RESUMING) { + idx = device_links_read_lock(); + + retval = rpm_get_suppliers(dev); +@@ -355,36 +355,24 @@ static int __rpm_callback(int (*cb)(stru + + if (dev->power.irq_safe) { + spin_lock(&dev->power.lock); +- return retval; +- } +- +- spin_lock_irq(&dev->power.lock); +- +- if (!use_links) +- return retval; +- +- /* +- * If the device is suspending and the callback has returned success, +- * drop the usage counters of the suppliers that have been reference +- * counted on its resume. +- * +- * Do that if the resume fails too. +- */ +- put = dev->power.runtime_status == RPM_SUSPENDING && !retval; +- if (put) +- __update_runtime_status(dev, RPM_SUSPENDED); +- else +- put = get && retval; +- +- if (put) { +- spin_unlock_irq(&dev->power.lock); +- +- idx = device_links_read_lock(); ++ } else { ++ /* ++ * If the device is suspending and the callback has returned ++ * success, drop the usage counters of the suppliers that have ++ * been reference counted on its resume. ++ * ++ * Do that if resume fails too. ++ */ ++ if (use_links ++ && ((dev->power.runtime_status == RPM_SUSPENDING && !retval) ++ || (dev->power.runtime_status == RPM_RESUMING && retval))) { ++ idx = device_links_read_lock(); + +-fail: +- rpm_put_suppliers(dev); ++ fail: ++ rpm_put_suppliers(dev); + +- device_links_read_unlock(idx); ++ device_links_read_unlock(idx); ++ } + + spin_lock_irq(&dev->power.lock); + } diff --git a/queue-5.4/s390-vtime-fix-increased-steal-time-accounting.patch b/queue-5.4/s390-vtime-fix-increased-steal-time-accounting.patch new file mode 100644 index 00000000000..01cd7a3b967 --- /dev/null +++ b/queue-5.4/s390-vtime-fix-increased-steal-time-accounting.patch @@ -0,0 +1,38 @@ +From d54cb7d54877d529bc1e0e1f47a3dd082f73add3 Mon Sep 17 00:00:00 2001 +From: Gerald Schaefer +Date: Wed, 10 Mar 2021 14:23:37 +0100 +Subject: s390/vtime: fix increased steal time accounting + +From: Gerald Schaefer + +commit d54cb7d54877d529bc1e0e1f47a3dd082f73add3 upstream. + +Commit 152e9b8676c6e ("s390/vtime: steal time exponential moving average") +inadvertently changed the input value for account_steal_time() from +"cputime_to_nsecs(steal)" to just "steal", resulting in broken increased +steal time accounting. + +Fix this by changing it back to "cputime_to_nsecs(steal)". + +Fixes: 152e9b8676c6e ("s390/vtime: steal time exponential moving average") +Cc: # 5.1 +Reported-by: Sabine Forkel +Reviewed-by: Heiko Carstens +Signed-off-by: Gerald Schaefer +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/kernel/vtime.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/kernel/vtime.c ++++ b/arch/s390/kernel/vtime.c +@@ -217,7 +217,7 @@ void vtime_flush(struct task_struct *tsk + avg_steal = S390_lowcore.avg_steal_timer / 2; + if ((s64) steal > 0) { + S390_lowcore.steal_timer = 0; +- account_steal_time(steal); ++ account_steal_time(cputime_to_nsecs(steal)); + avg_steal += steal; + } + S390_lowcore.avg_steal_timer = avg_steal; diff --git a/queue-5.4/series b/queue-5.4/series index e69de29bb2d..2213cf98c4d 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -0,0 +1,8 @@ +asoc-ak4458-add-module_device_table.patch +asoc-ak5558-add-module_device_table.patch +alsa-dice-fix-null-pointer-dereference-when-node-is-disconnected.patch +alsa-hda-realtek-apply-pin-quirk-for-xiaominotebook-pro.patch +alsa-hda-generic-fix-the-micmute-led-init-state.patch +alsa-hda-realtek-apply-headset-mic-quirks-for-xiaomi-redmibook-air.patch +revert-pm-runtime-update-device-status-before-letting-suppliers-suspend.patch +s390-vtime-fix-increased-steal-time-accounting.patch