From: Greg Kroah-Hartman Date: Wed, 4 Oct 2023 14:51:21 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.5.6~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=091637844c831f3f52dd2260f5b8486eca09a11b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch i2c-i801-unregister-tco_pdev-in-i801_probe-error-path.patch kernel-sched-modify-initial-boot-task-idle-setup.patch sched-rt-fix-live-lock-between-select_fallback_rq-and-rt-push.patch --- diff --git a/queue-5.15/alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch b/queue-5.15/alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch new file mode 100644 index 00000000000..082772a6907 --- /dev/null +++ b/queue-5.15/alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch @@ -0,0 +1,31 @@ +From 057a28ef93bdbe84326d34cdb5543afdaab49fe1 Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Thu, 7 Sep 2023 15:24:34 +0800 +Subject: ALSA: hda: Disable power save for solving pop issue on Lenovo ThinkCentre M70q + +From: Kailang Yang + +commit 057a28ef93bdbe84326d34cdb5543afdaab49fe1 upstream. + +Lenovo ThinkCentre M70q had boot up pop noise. +Disable power save will solve pop issue. + +Signed-off-by: Kailang Yang +Cc: +Link: https://lore.kernel.org/r/315900e2efef42fd9855eacfeb443abd@realtek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2203,6 +2203,7 @@ static const struct snd_pci_quirk power_ + SND_PCI_QUIRK(0x8086, 0x2068, "Intel NUC7i3BNB", 0), + /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */ + SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0), ++ SND_PCI_QUIRK(0x17aa, 0x316e, "Lenovo ThinkCentre M70q", 0), + /* https://bugzilla.redhat.com/show_bug.cgi?id=1689623 */ + SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0), + /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */ diff --git a/queue-5.15/ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch b/queue-5.15/ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch new file mode 100644 index 00000000000..0c58310b517 --- /dev/null +++ b/queue-5.15/ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch @@ -0,0 +1,40 @@ +From 3ef600923521616ebe192c893468ad0424de2afb Mon Sep 17 00:00:00 2001 +From: Niklas Cassel +Date: Mon, 18 Sep 2023 22:24:50 +0200 +Subject: ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES + +From: Niklas Cassel + +commit 3ef600923521616ebe192c893468ad0424de2afb upstream. + +For REPORT SUPPORTED OPERATION CODES command, the service action field is +defined as bits 0-4 in the second byte in the CDB. Bits 5-7 in the second +byte are reserved. + +Only look at the service action field in the second byte when determining +if the MAINTENANCE IN opcode is a REPORT SUPPORTED OPERATION CODES command. + +This matches how we only look at the service action field in the second +byte when determining if the SERVICE ACTION IN(16) opcode is a READ +CAPACITY(16) command (reserved bits 5-7 in the second byte are ignored). + +Fixes: 7b2030942859 ("libata: Add support for SCT Write Same") +Cc: stable@vger.kernel.org +Signed-off-by: Niklas Cassel +Signed-off-by: Damien Le Moal +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/libata-scsi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/ata/libata-scsi.c ++++ b/drivers/ata/libata-scsi.c +@@ -4214,7 +4214,7 @@ void ata_scsi_simulate(struct ata_device + break; + + case MAINTENANCE_IN: +- if (scsicmd[1] == MI_REPORT_SUPPORTED_OPERATION_CODES) ++ if ((scsicmd[1] & 0x1f) == MI_REPORT_SUPPORTED_OPERATION_CODES) + ata_scsi_rbuf_fill(&args, ata_scsiop_maint_in); + else + ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); diff --git a/queue-5.15/i2c-i801-unregister-tco_pdev-in-i801_probe-error-path.patch b/queue-5.15/i2c-i801-unregister-tco_pdev-in-i801_probe-error-path.patch new file mode 100644 index 00000000000..1508d54c853 --- /dev/null +++ b/queue-5.15/i2c-i801-unregister-tco_pdev-in-i801_probe-error-path.patch @@ -0,0 +1,32 @@ +From 3914784553f68c931fc666dbe7e86fe881aada38 Mon Sep 17 00:00:00 2001 +From: Heiner Kallweit +Date: Thu, 14 Sep 2023 23:08:44 +0200 +Subject: i2c: i801: unregister tco_pdev in i801_probe() error path + +From: Heiner Kallweit + +commit 3914784553f68c931fc666dbe7e86fe881aada38 upstream. + +We have to unregister tco_pdev also if i2c_add_adapter() fails. + +Fixes: 9424693035a5 ("i2c: i801: Create iTCO device on newer Intel PCHs") +Cc: stable@vger.kernel.org +Signed-off-by: Heiner Kallweit +Reviewed-by: Mika Westerberg +Reviewed-by: Jean Delvare +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-i801.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/i2c/busses/i2c-i801.c ++++ b/drivers/i2c/busses/i2c-i801.c +@@ -1861,6 +1861,7 @@ static int i801_probe(struct pci_dev *de + "SMBus I801 adapter at %04lx", priv->smba); + err = i2c_add_adapter(&priv->adapter); + if (err) { ++ platform_device_unregister(priv->tco_pdev); + i801_acpi_remove(priv); + return err; + } diff --git a/queue-5.15/kernel-sched-modify-initial-boot-task-idle-setup.patch b/queue-5.15/kernel-sched-modify-initial-boot-task-idle-setup.patch new file mode 100644 index 00000000000..28a4ce7206e --- /dev/null +++ b/queue-5.15/kernel-sched-modify-initial-boot-task-idle-setup.patch @@ -0,0 +1,58 @@ +From cff9b2332ab762b7e0586c793c431a8f2ea4db04 Mon Sep 17 00:00:00 2001 +From: "Liam R. Howlett" +Date: Fri, 15 Sep 2023 13:44:44 -0400 +Subject: kernel/sched: Modify initial boot task idle setup + +From: Liam R. Howlett + +commit cff9b2332ab762b7e0586c793c431a8f2ea4db04 upstream. + +Initial booting is setting the task flag to idle (PF_IDLE) by the call +path sched_init() -> init_idle(). Having the task idle and calling +call_rcu() in kernel/rcu/tiny.c means that TIF_NEED_RESCHED will be +set. Subsequent calls to any cond_resched() will enable IRQs, +potentially earlier than the IRQ setup has completed. Recent changes +have caused just this scenario and IRQs have been enabled early. + +This causes a warning later in start_kernel() as interrupts are enabled +before they are fully set up. + +Fix this issue by setting the PF_IDLE flag later in the boot sequence. + +Although the boot task was marked as idle since (at least) d80e4fda576d, +I am not sure that it is wrong to do so. The forced context-switch on +idle task was introduced in the tiny_rcu update, so I'm going to claim +this fixes 5f6130fa52ee. + +Fixes: 5f6130fa52ee ("tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task") +Signed-off-by: Liam R. Howlett +Signed-off-by: Peter Zijlstra (Intel) +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/linux-mm/CAMuHMdWpvpWoDa=Ox-do92czYRvkok6_x6pYUH+ZouMcJbXy+Q@mail.gmail.com/ +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/core.c | 2 +- + kernel/sched/idle.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -8725,7 +8725,7 @@ void __init init_idle(struct task_struct + * PF_KTHREAD should already be set at this point; regardless, make it + * look like a proper per-CPU kthread. + */ +- idle->flags |= PF_IDLE | PF_KTHREAD | PF_NO_SETAFFINITY; ++ idle->flags |= PF_KTHREAD | PF_NO_SETAFFINITY; + kthread_set_per_cpu(idle, cpu); + + #ifdef CONFIG_SMP +--- a/kernel/sched/idle.c ++++ b/kernel/sched/idle.c +@@ -397,6 +397,7 @@ EXPORT_SYMBOL_GPL(play_idle_precise); + + void cpu_startup_entry(enum cpuhp_state state) + { ++ current->flags |= PF_IDLE; + arch_cpu_idle_prepare(); + cpuhp_online_idle(state); + while (1) diff --git a/queue-5.15/sched-rt-fix-live-lock-between-select_fallback_rq-and-rt-push.patch b/queue-5.15/sched-rt-fix-live-lock-between-select_fallback_rq-and-rt-push.patch new file mode 100644 index 00000000000..2508a563789 --- /dev/null +++ b/queue-5.15/sched-rt-fix-live-lock-between-select_fallback_rq-and-rt-push.patch @@ -0,0 +1,52 @@ +From fc09027786c900368de98d03d40af058bcb01ad9 Mon Sep 17 00:00:00 2001 +From: "Joel Fernandes (Google)" +Date: Sat, 23 Sep 2023 01:14:08 +0000 +Subject: sched/rt: Fix live lock between select_fallback_rq() and RT push + +From: Joel Fernandes (Google) + +commit fc09027786c900368de98d03d40af058bcb01ad9 upstream. + +During RCU-boost testing with the TREE03 rcutorture config, I found that +after a few hours, the machine locks up. + +On tracing, I found that there is a live lock happening between 2 CPUs. +One CPU has an RT task running, while another CPU is being offlined +which also has an RT task running. During this offlining, all threads +are migrated. The migration thread is repeatedly scheduled to migrate +actively running tasks on the CPU being offlined. This results in a live +lock because select_fallback_rq() keeps picking the CPU that an RT task +is already running on only to get pushed back to the CPU being offlined. + +It is anyway pointless to pick CPUs for pushing tasks to if they are +being offlined only to get migrated away to somewhere else. This could +also add unwanted latency to this task. + +Fix these issues by not selecting CPUs in RT if they are not 'active' +for scheduling, using the cpu_active_mask. Other parts in core.c already +use cpu_active_mask to prevent tasks from being put on CPUs going +offline. + +With this fix I ran the tests for days and could not reproduce the +hang. Without the patch, I hit it in a few hours. + +Signed-off-by: Joel Fernandes (Google) +Signed-off-by: Ingo Molnar +Tested-by: Paul E. McKenney +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20230923011409.3522762-1-joel@joelfernandes.org +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/cpupri.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/sched/cpupri.c ++++ b/kernel/sched/cpupri.c +@@ -102,6 +102,7 @@ static inline int __cpupri_find(struct c + + if (lowest_mask) { + cpumask_and(lowest_mask, &p->cpus_mask, vec->mask); ++ cpumask_and(lowest_mask, lowest_mask, cpu_active_mask); + + /* + * We have to ensure that we have at least one bit diff --git a/queue-5.15/series b/queue-5.15/series index 07b0a8f09ea..0ae7ce9c526 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -161,3 +161,8 @@ revert-tty-n_gsm-fix-uaf-in-gsm_cleanup_mux.patch serial-8250_port-check-irq-data-before-use.patch nilfs2-fix-potential-use-after-free-in-nilfs_gccache_submit_read_data.patch netfilter-nf_tables-disallow-rule-removal-from-chain.patch +alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch +ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch +i2c-i801-unregister-tco_pdev-in-i801_probe-error-path.patch +kernel-sched-modify-initial-boot-task-idle-setup.patch +sched-rt-fix-live-lock-between-select_fallback_rq-and-rt-push.patch