From: Greg Kroah-Hartman Date: Mon, 7 Aug 2017 20:38:34 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v4.12.6~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af9843d0c0894be8400dde76a03bcebb5261e27f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-hda-fix-speaker-output-from-vaio-vpcl14m1r.patch asoc-do-not-close-shared-backend-dailink.patch kvm-async_pf-make-rcu-irq-exit-if-not-triggered-from-idle-task.patch libata-array-underflow-in-ata_find_dev.patch mmc-core-fix-access-to-hs400-es-devices.patch parisc-increase-thread-and-stack-size-to-32kb.patch workqueue-restore-wq_unbound-max_active-1-to-be-ordered.patch --- diff --git a/queue-4.4/alsa-hda-fix-speaker-output-from-vaio-vpcl14m1r.patch b/queue-4.4/alsa-hda-fix-speaker-output-from-vaio-vpcl14m1r.patch new file mode 100644 index 00000000000..09544c5e053 --- /dev/null +++ b/queue-4.4/alsa-hda-fix-speaker-output-from-vaio-vpcl14m1r.patch @@ -0,0 +1,30 @@ +From 3f3c371421e601fa93b6cb7fb52da9ad59ec90b4 Mon Sep 17 00:00:00 2001 +From: "Sergei A. Trusov" +Date: Wed, 2 Aug 2017 20:23:48 +1000 +Subject: ALSA: hda - Fix speaker output from VAIO VPCL14M1R + +From: Sergei A. Trusov + +commit 3f3c371421e601fa93b6cb7fb52da9ad59ec90b4 upstream. + +Sony VAIO VPCL14M1R needs the quirk to make the speaker working properly. + +Tested-by: Dmitriy +Signed-off-by: Sergei A. Trusov +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 +@@ -2233,6 +2233,7 @@ static const struct snd_pci_quirk alc882 + SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), + SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), + SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), ++ SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), + SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), + SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), + diff --git a/queue-4.4/asoc-do-not-close-shared-backend-dailink.patch b/queue-4.4/asoc-do-not-close-shared-backend-dailink.patch new file mode 100644 index 00000000000..6805d5eb118 --- /dev/null +++ b/queue-4.4/asoc-do-not-close-shared-backend-dailink.patch @@ -0,0 +1,39 @@ +From b1cd2e34c69a2f3988786af451b6e17967c293a0 Mon Sep 17 00:00:00 2001 +From: Banajit Goswami +Date: Fri, 14 Jul 2017 23:15:05 -0700 +Subject: ASoC: do not close shared backend dailink + +From: Banajit Goswami + +commit b1cd2e34c69a2f3988786af451b6e17967c293a0 upstream. + +Multiple frontend dailinks may be connected to a backend +dailink at the same time. When one of frontend dailinks is +closed, the associated backend dailink should not be closed +if it is connected to other active frontend dailinks. Change +ensures that backend dailink is closed only after all +connected frontend dailinks are closed. + +Signed-off-by: Gopikrishnaiah Anandan +Signed-off-by: Banajit Goswami +Signed-off-by: Patrick Lai +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/soc-pcm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/soc/soc-pcm.c ++++ b/sound/soc/soc-pcm.c +@@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_so + dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", + be->dai_link->name, event, dir); + ++ if ((event == SND_SOC_DAPM_STREAM_STOP) && ++ (be->dpcm[dir].users >= 1)) ++ continue; ++ + snd_soc_dapm_stream_event(be, dir, event); + } + diff --git a/queue-4.4/kvm-async_pf-make-rcu-irq-exit-if-not-triggered-from-idle-task.patch b/queue-4.4/kvm-async_pf-make-rcu-irq-exit-if-not-triggered-from-idle-task.patch new file mode 100644 index 00000000000..3631ff58ff3 --- /dev/null +++ b/queue-4.4/kvm-async_pf-make-rcu-irq-exit-if-not-triggered-from-idle-task.patch @@ -0,0 +1,75 @@ +From 337c017ccdf2653d0040099433fc1a2b1beb5926 Mon Sep 17 00:00:00 2001 +From: Wanpeng Li +Date: Tue, 1 Aug 2017 05:20:03 -0700 +Subject: KVM: async_pf: make rcu irq exit if not triggered from idle task +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Wanpeng Li + +commit 337c017ccdf2653d0040099433fc1a2b1beb5926 upstream. + + WARNING: CPU: 5 PID: 1242 at kernel/rcu/tree_plugin.h:323 rcu_note_context_switch+0x207/0x6b0 + CPU: 5 PID: 1242 Comm: unity-settings- Not tainted 4.13.0-rc2+ #1 + RIP: 0010:rcu_note_context_switch+0x207/0x6b0 + Call Trace: + __schedule+0xda/0xba0 + ? kvm_async_pf_task_wait+0x1b2/0x270 + schedule+0x40/0x90 + kvm_async_pf_task_wait+0x1cc/0x270 + ? prepare_to_swait+0x22/0x70 + do_async_page_fault+0x77/0xb0 + ? do_async_page_fault+0x77/0xb0 + async_page_fault+0x28/0x30 + RIP: 0010:__d_lookup_rcu+0x90/0x1e0 + +I encounter this when trying to stress the async page fault in L1 guest w/ +L2 guests running. + +Commit 9b132fbe5419 (Add rcu user eqs exception hooks for async page +fault) adds rcu_irq_enter/exit() to kvm_async_pf_task_wait() to exit cpu +idle eqs when needed, to protect the code that needs use rcu. However, +we need to call the pair even if the function calls schedule(), as seen +from the above backtrace. + +This patch fixes it by informing the RCU subsystem exit/enter the irq +towards/away from idle for both n.halted and !n.halted. + +Cc: Paolo Bonzini +Cc: Radim Krčmář +Cc: Paul E. McKenney +Signed-off-by: Wanpeng Li +Reviewed-by: Paolo Bonzini +Signed-off-by: Radim Krčmář +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/kvm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/x86/kernel/kvm.c ++++ b/arch/x86/kernel/kvm.c +@@ -151,6 +151,8 @@ void kvm_async_pf_task_wait(u32 token) + if (hlist_unhashed(&n.link)) + break; + ++ rcu_irq_exit(); ++ + if (!n.halted) { + local_irq_enable(); + schedule(); +@@ -159,11 +161,11 @@ void kvm_async_pf_task_wait(u32 token) + /* + * We cannot reschedule. So halt. + */ +- rcu_irq_exit(); + native_safe_halt(); + local_irq_disable(); +- rcu_irq_enter(); + } ++ ++ rcu_irq_enter(); + } + if (!n.halted) + finish_wait(&n.wq, &wait); diff --git a/queue-4.4/libata-array-underflow-in-ata_find_dev.patch b/queue-4.4/libata-array-underflow-in-ata_find_dev.patch new file mode 100644 index 00000000000..7130e1d2113 --- /dev/null +++ b/queue-4.4/libata-array-underflow-in-ata_find_dev.patch @@ -0,0 +1,44 @@ +From 59a5e266c3f5c1567508888dd61a45b86daed0fa Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 19 Jul 2017 13:06:41 +0300 +Subject: libata: array underflow in ata_find_dev() + +From: Dan Carpenter + +commit 59a5e266c3f5c1567508888dd61a45b86daed0fa upstream. + +My static checker complains that "devno" can be negative, meaning that +we read before the start of the loop. I've looked at the code, and I +think the warning is right. This come from /proc so it's root only or +it would be quite a quite a serious bug. The call tree looks like this: + +proc_scsi_write() <- gets id and channel from simple_strtoul() +-> scsi_add_single_device() <- calls shost->transportt->user_scan() + -> ata_scsi_user_scan() + -> ata_find_dev() + +Signed-off-by: Dan Carpenter +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-scsi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/ata/libata-scsi.c ++++ b/drivers/ata/libata-scsi.c +@@ -2832,10 +2832,12 @@ static unsigned int atapi_xlat(struct at + static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) + { + if (!sata_pmp_attached(ap)) { +- if (likely(devno < ata_link_max_devices(&ap->link))) ++ if (likely(devno >= 0 && ++ devno < ata_link_max_devices(&ap->link))) + return &ap->link.device[devno]; + } else { +- if (likely(devno < ap->nr_pmp_links)) ++ if (likely(devno >= 0 && ++ devno < ap->nr_pmp_links)) + return &ap->pmp_link[devno].device[0]; + } + diff --git a/queue-4.4/mmc-core-fix-access-to-hs400-es-devices.patch b/queue-4.4/mmc-core-fix-access-to-hs400-es-devices.patch new file mode 100644 index 00000000000..09fcc303af5 --- /dev/null +++ b/queue-4.4/mmc-core-fix-access-to-hs400-es-devices.patch @@ -0,0 +1,46 @@ +From 773dc118756b1f38766063e90e582016be868f09 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Wed, 1 Mar 2017 14:11:47 -0800 +Subject: mmc: core: Fix access to HS400-ES devices + +From: Guenter Roeck + +commit 773dc118756b1f38766063e90e582016be868f09 upstream. + +HS400-ES devices fail to initialize with the following error messages. + +mmc1: power class selection to bus width 8 ddr 0 failed +mmc1: error -110 whilst initialising MMC card + +This was seen on Samsung Chromebook Plus. Code analysis points to +commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without +high-speed mode"), which attempts to set the bus width for all but +HS200 devices unconditionally. However, for HS400-ES, the bus width +is already selected. + +Cc: Anssi Hannula +Cc: Douglas Anderson +Cc: Brian Norris +Fixes: 3d4ef329757c ("mmc: core: fix multi-bit bus width ...") +Signed-off-by: Guenter Roeck +Reviewed-by: Douglas Anderson +Reviewed-by: Shawn Lin +Tested-by: Heiko Stuebner +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -1581,7 +1581,7 @@ static int mmc_init_card(struct mmc_host + err = mmc_select_hs400(card); + if (err) + goto free_card; +- } else { ++ } else if (!mmc_card_hs400es(card)) { + /* Select the desired bus width optionally */ + err = mmc_select_bus_width(card); + if (!IS_ERR_VALUE(err) && mmc_card_hs(card)) { diff --git a/queue-4.4/parisc-increase-thread-and-stack-size-to-32kb.patch b/queue-4.4/parisc-increase-thread-and-stack-size-to-32kb.patch new file mode 100644 index 00000000000..0f264b5a292 --- /dev/null +++ b/queue-4.4/parisc-increase-thread-and-stack-size-to-32kb.patch @@ -0,0 +1,44 @@ +From 8f8201dfed91a43ac38c899c82f81eef3d36afd9 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 31 Jul 2017 08:38:27 +0200 +Subject: parisc: Increase thread and stack size to 32kb + +From: Helge Deller + +commit 8f8201dfed91a43ac38c899c82f81eef3d36afd9 upstream. + +Since kernel 4.11 the thread and irq stacks on parisc randomly overflow +the default size of 16k. The reason why stack usage suddenly grew is yet +unknown. + +Signed-off-by: Helge Deller +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/include/asm/thread_info.h | 2 +- + arch/parisc/kernel/irq.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/parisc/include/asm/thread_info.h ++++ b/arch/parisc/include/asm/thread_info.h +@@ -34,7 +34,7 @@ struct thread_info { + + /* thread information allocation */ + +-#define THREAD_SIZE_ORDER 2 /* PA-RISC requires at least 16k stack */ ++#define THREAD_SIZE_ORDER 3 /* PA-RISC requires at least 32k stack */ + /* Be sure to hunt all references to this down when you change the size of + * the kernel stack */ + #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) +--- a/arch/parisc/kernel/irq.c ++++ b/arch/parisc/kernel/irq.c +@@ -380,7 +380,7 @@ static inline int eirr_to_irq(unsigned l + /* + * IRQ STACK - used for irq handler + */ +-#define IRQ_STACK_SIZE (4096 << 2) /* 16k irq stack size */ ++#define IRQ_STACK_SIZE (4096 << 3) /* 32k irq stack size */ + + union irq_stack_union { + unsigned long stack[IRQ_STACK_SIZE/sizeof(unsigned long)]; diff --git a/queue-4.4/series b/queue-4.4/series index 76398b55707..ccff79b315f 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -2,3 +2,6 @@ parisc-increase-thread-and-stack-size-to-32kb.patch libata-array-underflow-in-ata_find_dev.patch workqueue-restore-wq_unbound-max_active-1-to-be-ordered.patch mmc-core-fix-access-to-hs400-es-devices.patch +alsa-hda-fix-speaker-output-from-vaio-vpcl14m1r.patch +asoc-do-not-close-shared-backend-dailink.patch +kvm-async_pf-make-rcu-irq-exit-if-not-triggered-from-idle-task.patch diff --git a/queue-4.4/workqueue-restore-wq_unbound-max_active-1-to-be-ordered.patch b/queue-4.4/workqueue-restore-wq_unbound-max_active-1-to-be-ordered.patch new file mode 100644 index 00000000000..117e24acb76 --- /dev/null +++ b/queue-4.4/workqueue-restore-wq_unbound-max_active-1-to-be-ordered.patch @@ -0,0 +1,53 @@ +From 5c0338c68706be53b3dc472e4308961c36e4ece1 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Tue, 18 Jul 2017 18:41:52 -0400 +Subject: workqueue: restore WQ_UNBOUND/max_active==1 to be ordered + +From: Tejun Heo + +commit 5c0338c68706be53b3dc472e4308961c36e4ece1 upstream. + +The combination of WQ_UNBOUND and max_active == 1 used to imply +ordered execution. After NUMA affinity 4c16bd327c74 ("workqueue: +implement NUMA affinity for unbound workqueues"), this is no longer +true due to per-node worker pools. + +While the right way to create an ordered workqueue is +alloc_ordered_workqueue(), the documentation has been misleading for a +long time and people do use WQ_UNBOUND and max_active == 1 for ordered +workqueues which can lead to subtle bugs which are very difficult to +trigger. + +It's unlikely that we'd see noticeable performance impact by enforcing +ordering on WQ_UNBOUND / max_active == 1 workqueues. Let's +automatically set __WQ_ORDERED for those workqueues. + +Signed-off-by: Tejun Heo +Reported-by: Christoph Hellwig +Reported-by: Alexei Potashnik +Fixes: 4c16bd327c74 ("workqueue: implement NUMA affinity for unbound workqueues") +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/workqueue.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -3834,6 +3834,16 @@ struct workqueue_struct *__alloc_workque + struct workqueue_struct *wq; + struct pool_workqueue *pwq; + ++ /* ++ * Unbound && max_active == 1 used to imply ordered, which is no ++ * longer the case on NUMA machines due to per-node pools. While ++ * alloc_ordered_workqueue() is the right way to create an ordered ++ * workqueue, keep the previous behavior to avoid subtle breakages ++ * on NUMA. ++ */ ++ if ((flags & WQ_UNBOUND) && max_active == 1) ++ flags |= __WQ_ORDERED; ++ + /* see the comment above the definition of WQ_POWER_EFFICIENT */ + if ((flags & WQ_POWER_EFFICIENT) && wq_power_efficient) + flags |= WQ_UNBOUND;