From: Greg Kroah-Hartman Date: Thu, 16 Jul 2015 17:42:49 +0000 (-0700) Subject: 4.0-stable patches X-Git-Tag: v4.0.9~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e57d5ecb1c0027f6ee42b1c9d2fc9064528483b2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.0-stable patches added patches: alsa-hda-add-headset-support-to-acer-aspire-v5.patch alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch alsa-pcm-fix-pcm_class-sysfs-output.patch disable-write-buffering-on-toshiba-topic95.patch gpio-crystalcove-set-irqchip_skip_set_wake-for-the-irqchip.patch ipr-increase-default-adapter-init-stage-change-timeout.patch rcu-correctly-handle-non-empty-tiny-rcu-callback-list-with-none-ready.patch --- diff --git a/queue-4.0/alsa-hda-add-headset-support-to-acer-aspire-v5.patch b/queue-4.0/alsa-hda-add-headset-support-to-acer-aspire-v5.patch new file mode 100644 index 00000000000..1ff39ad47cd --- /dev/null +++ b/queue-4.0/alsa-hda-add-headset-support-to-acer-aspire-v5.patch @@ -0,0 +1,56 @@ +From 7819717b11346b8a5420b223b46600e394049c66 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Sat, 27 Jun 2015 10:21:13 +0200 +Subject: ALSA: hda - Add headset support to Acer Aspire V5 + +From: Takashi Iwai + +commit 7819717b11346b8a5420b223b46600e394049c66 upstream. + +Acer Aspire V5 with ALC282 codec needs the similar quirk like Dell +laptops to support the headset mic. The headset mic pin is 0x19 and +it's not exposed by BIOS, thus we need to fix the pincfg as well. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96201 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4394,6 +4394,7 @@ enum { + ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, + ALC269_FIXUP_HEADSET_MODE, + ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, ++ ALC269_FIXUP_ASPIRE_HEADSET_MIC, + ALC269_FIXUP_ASUS_X101_FUNC, + ALC269_FIXUP_ASUS_X101_VERB, + ALC269_FIXUP_ASUS_X101, +@@ -4663,6 +4664,15 @@ static const struct hda_fixup alc269_fix + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_headset_mode_no_hp_mic, + }, ++ [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC269_FIXUP_HEADSET_MODE, ++ }, + [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { +@@ -4937,6 +4947,8 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), ++ SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), ++ SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), + SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), + SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), + SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), diff --git a/queue-4.0/alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch b/queue-4.0/alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch new file mode 100644 index 00000000000..a54d9334656 --- /dev/null +++ b/queue-4.0/alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch @@ -0,0 +1,46 @@ +From ec56af67a10a0d82b79027878a81fce08d002d50 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Wed, 24 Jun 2015 10:46:33 +0200 +Subject: ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out + +From: David Henningsson + +commit ec56af67a10a0d82b79027878a81fce08d002d50 upstream. + +Thinkpad X250, when attached to a dock, has two headphone outs but +no line out. Make sure we don't try to turn this into one headphone +and one line out (since that disables the headphone amp on the dock). + +Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1 + +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4421,6 +4421,7 @@ enum { + ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, + ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC292_FIXUP_TPT440_DOCK, ++ ALC292_FIXUP_TPT440_DOCK2, + ALC283_FIXUP_BXBT2807_MIC, + ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, + ALC282_FIXUP_ASPIRE_V5_PINS, +@@ -4864,6 +4865,12 @@ static const struct hda_fixup alc269_fix + .chain_id = ALC269_FIXUP_HEADSET_MODE + }, + [ALC292_FIXUP_TPT440_DOCK] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc269_fixup_pincfg_no_hp_to_lineout, ++ .chained = true, ++ .chain_id = ALC292_FIXUP_TPT440_DOCK2 ++ }, ++ [ALC292_FIXUP_TPT440_DOCK2] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x16, 0x21211010 }, /* dock headphone */ diff --git a/queue-4.0/alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch b/queue-4.0/alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch new file mode 100644 index 00000000000..fe93e46a4fc --- /dev/null +++ b/queue-4.0/alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch @@ -0,0 +1,54 @@ +From 4df3fd1700abbb53bd874143dfd1f9ac9e7cbf4b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 29 Jun 2015 08:38:02 +0200 +Subject: ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 + +From: Takashi Iwai + +commit 4df3fd1700abbb53bd874143dfd1f9ac9e7cbf4b upstream. + +Fujitsu Lifebook E780 sets the sequence number 0x0f to only only of +the two headphones, thus the driver tries to assign another as the +line-out, and this results in the inconsistent mapping between the +created jack ctl and the actual I/O. Due to this, PulseAudio doesn't +handle it properly and gets the silent output. + +The fix is to ignore the non-HP sequencer checks. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=99681 +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4374,6 +4374,7 @@ enum { + ALC269_FIXUP_LIFEBOOK, + ALC269_FIXUP_LIFEBOOK_EXTMIC, + ALC269_FIXUP_LIFEBOOK_HP_PIN, ++ ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, + ALC269_FIXUP_AMIC, + ALC269_FIXUP_DMIC, + ALC269VB_FIXUP_AMIC, +@@ -4536,6 +4537,10 @@ static const struct hda_fixup alc269_fix + { } + }, + }, ++ [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc269_fixup_pincfg_no_hp_to_lineout, ++ }, + [ALC269_FIXUP_AMIC] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { +@@ -5046,6 +5051,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), + SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), + SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), ++ SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), + SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), + SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), + SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), diff --git a/queue-4.0/alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch b/queue-4.0/alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch new file mode 100644 index 00000000000..e0d513edc56 --- /dev/null +++ b/queue-4.0/alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch @@ -0,0 +1,40 @@ +From 650474fb737c3e0ea0f6ab8e43c2cd161080ce5c Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Wed, 24 Jun 2015 14:37:18 -0400 +Subject: ALSA: hda - set proper caps for newer AMD hda audio in KB/KV + +From: Alex Deucher + +commit 650474fb737c3e0ea0f6ab8e43c2cd161080ce5c upstream. + +Fixes audio problems on newer asics. + +Noticed by: Kelly Anderson +Signed-off-by: Alex Deucher +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2056,6 +2056,8 @@ static const struct pci_device_id azx_id + { PCI_DEVICE(0x1022, 0x780d), + .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, + /* ATI HDMI */ ++ { PCI_DEVICE(0x1002, 0x1308), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + { PCI_DEVICE(0x1002, 0x793b), + .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, + { PCI_DEVICE(0x1002, 0x7919), +@@ -2064,6 +2066,8 @@ static const struct pci_device_id azx_id + .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, + { PCI_DEVICE(0x1002, 0x970f), + .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, ++ { PCI_DEVICE(0x1002, 0x9840), ++ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, + { PCI_DEVICE(0x1002, 0xaa00), + .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI }, + { PCI_DEVICE(0x1002, 0xaa08), diff --git a/queue-4.0/alsa-pcm-fix-pcm_class-sysfs-output.patch b/queue-4.0/alsa-pcm-fix-pcm_class-sysfs-output.patch new file mode 100644 index 00000000000..4f978e3a9a5 --- /dev/null +++ b/queue-4.0/alsa-pcm-fix-pcm_class-sysfs-output.patch @@ -0,0 +1,43 @@ +From 60b93030b44a8c2cd015cebe5624fd7552ec67ec Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 23 Jun 2015 11:56:22 +0200 +Subject: ALSA: pcm: Fix pcm_class sysfs output + +From: Takashi Iwai + +commit 60b93030b44a8c2cd015cebe5624fd7552ec67ec upstream. + +The pcm_class sysfs of each PCM substream gives only "none" since the +recent code change to embed the struct device. Fix the code to point +directly to the embedded device object properly. + +Fixes: ef46c7af93f9 ('ALSA: pcm: Embed struct device') +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/pcm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/core/pcm.c ++++ b/sound/core/pcm.c +@@ -1044,7 +1044,8 @@ void snd_pcm_detach_substream(struct snd + static ssize_t show_pcm_class(struct device *dev, + struct device_attribute *attr, char *buf) + { +- struct snd_pcm *pcm; ++ struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev); ++ struct snd_pcm *pcm = pstr->pcm; + const char *str; + static const char *strs[SNDRV_PCM_CLASS_LAST + 1] = { + [SNDRV_PCM_CLASS_GENERIC] = "generic", +@@ -1053,8 +1054,7 @@ static ssize_t show_pcm_class(struct dev + [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", + }; + +- if (! (pcm = dev_get_drvdata(dev)) || +- pcm->dev_class > SNDRV_PCM_CLASS_LAST) ++ if (pcm->dev_class > SNDRV_PCM_CLASS_LAST) + str = "none"; + else + str = strs[pcm->dev_class]; diff --git a/queue-4.0/disable-write-buffering-on-toshiba-topic95.patch b/queue-4.0/disable-write-buffering-on-toshiba-topic95.patch new file mode 100644 index 00000000000..d7d6cd65b33 --- /dev/null +++ b/queue-4.0/disable-write-buffering-on-toshiba-topic95.patch @@ -0,0 +1,65 @@ +From 2fb22a8042fe96b4220843f79241c116d90922c4 Mon Sep 17 00:00:00 2001 +From: Ryan Underwood +Date: Sun, 25 Jan 2015 16:07:09 -0800 +Subject: Disable write buffering on Toshiba ToPIC95 + +From: Ryan Underwood + +commit 2fb22a8042fe96b4220843f79241c116d90922c4 upstream. + +Disable write buffering on the Toshiba ToPIC95 if it is enabled by +somebody (it is not supposed to be a power-on default according to +the datasheet). On the ToPIC95, practically no 32-bit Cardbus card +will work under heavy load without locking up the whole system if +this is left enabled. I tried about a dozen. It does not affect +16-bit cards. This is similar to the O2 bugs in early controller +revisions it seems. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55961 +Signed-off-by: Ryan C. Underwood +Signed-off-by: Dominik Brodowski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pcmcia/topic.h | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/drivers/pcmcia/topic.h ++++ b/drivers/pcmcia/topic.h +@@ -104,6 +104,9 @@ + #define TOPIC_EXCA_IF_CONTROL 0x3e /* 8 bit */ + #define TOPIC_EXCA_IFC_33V_ENA 0x01 + ++#define TOPIC_PCI_CFG_PPBCN 0x3e /* 16-bit */ ++#define TOPIC_PCI_CFG_PPBCN_WBEN 0x0400 ++ + static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff) + { + struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); +@@ -138,6 +141,7 @@ static int topic97_override(struct yenta + static int topic95_override(struct yenta_socket *socket) + { + u8 fctrl; ++ u16 ppbcn; + + /* enable 3.3V support for 16bit cards */ + fctrl = exca_readb(socket, TOPIC_EXCA_IF_CONTROL); +@@ -146,6 +150,18 @@ static int topic95_override(struct yenta + /* tell yenta to use exca registers to power 16bit cards */ + socket->flags |= YENTA_16BIT_POWER_EXCA | YENTA_16BIT_POWER_DF; + ++ /* Disable write buffers to prevent lockups under load with numerous ++ Cardbus cards, observed on Tecra 500CDT and reported elsewhere on the ++ net. This is not a power-on default according to the datasheet ++ but some BIOSes seem to set it. */ ++ if (pci_read_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, &ppbcn) == 0 ++ && socket->dev->revision <= 7 ++ && (ppbcn & TOPIC_PCI_CFG_PPBCN_WBEN)) { ++ ppbcn &= ~TOPIC_PCI_CFG_PPBCN_WBEN; ++ pci_write_config_word(socket->dev, TOPIC_PCI_CFG_PPBCN, ppbcn); ++ dev_info(&socket->dev->dev, "Disabled ToPIC95 Cardbus write buffers.\n"); ++ } ++ + return 0; + } + diff --git a/queue-4.0/gpio-crystalcove-set-irqchip_skip_set_wake-for-the-irqchip.patch b/queue-4.0/gpio-crystalcove-set-irqchip_skip_set_wake-for-the-irqchip.patch new file mode 100644 index 00000000000..9346934b9bf --- /dev/null +++ b/queue-4.0/gpio-crystalcove-set-irqchip_skip_set_wake-for-the-irqchip.patch @@ -0,0 +1,33 @@ +From 61e749d7e1627d375156553ea0ae83c4f6bb5a9b Mon Sep 17 00:00:00 2001 +From: Aaron Lu +Date: Thu, 28 May 2015 10:58:49 +0800 +Subject: gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip + +From: Aaron Lu + +commit 61e749d7e1627d375156553ea0ae83c4f6bb5a9b upstream. + +The CrystalCove GPIO irqchip doesn't have irq_set_wake callback defined +so we should set IRQCHIP_SKIP_SET_WAKE for it or it would cause an irq +desc's wake_depth unbalanced warning during system resume phase from the +gpio_keys driver, which is the driver for the power button of the ASUS +T100 laptop. + +Signed-off-by: Aaron Lu +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-crystalcove.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpio/gpio-crystalcove.c ++++ b/drivers/gpio/gpio-crystalcove.c +@@ -250,6 +250,7 @@ static struct irq_chip crystalcove_irqch + .irq_set_type = crystalcove_irq_type, + .irq_bus_lock = crystalcove_bus_lock, + .irq_bus_sync_unlock = crystalcove_bus_sync_unlock, ++ .flags = IRQCHIP_SKIP_SET_WAKE, + }; + + static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data) diff --git a/queue-4.0/ipr-increase-default-adapter-init-stage-change-timeout.patch b/queue-4.0/ipr-increase-default-adapter-init-stage-change-timeout.patch new file mode 100644 index 00000000000..8b5a63255d2 --- /dev/null +++ b/queue-4.0/ipr-increase-default-adapter-init-stage-change-timeout.patch @@ -0,0 +1,33 @@ +From 45c44b5ff9caa743ed9c2bfd44307c536c9caf1e Mon Sep 17 00:00:00 2001 +From: Brian King +Date: Wed, 13 May 2015 08:50:27 -0500 +Subject: ipr: Increase default adapter init stage change timeout + +From: Brian King + +commit 45c44b5ff9caa743ed9c2bfd44307c536c9caf1e upstream. + +Increase the default init stage change timeout from 15 seconds to 30 seconds. +This resolves issues we have seen with some adapters not transitioning +to the first init stage within 15 seconds, which results in adapter +initialization failures. + +Signed-off-by: Brian King +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/ipr.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/ipr.h ++++ b/drivers/scsi/ipr.h +@@ -268,7 +268,7 @@ + #define IPR_RUNTIME_RESET 0x40000000 + + #define IPR_IPL_INIT_MIN_STAGE_TIME 5 +-#define IPR_IPL_INIT_DEFAULT_STAGE_TIME 15 ++#define IPR_IPL_INIT_DEFAULT_STAGE_TIME 30 + #define IPR_IPL_INIT_STAGE_UNKNOWN 0x0 + #define IPR_IPL_INIT_STAGE_TRANSOP 0xB0000000 + #define IPR_IPL_INIT_STAGE_MASK 0xff000000 diff --git a/queue-4.0/rcu-correctly-handle-non-empty-tiny-rcu-callback-list-with-none-ready.patch b/queue-4.0/rcu-correctly-handle-non-empty-tiny-rcu-callback-list-with-none-ready.patch new file mode 100644 index 00000000000..017779e920a --- /dev/null +++ b/queue-4.0/rcu-correctly-handle-non-empty-tiny-rcu-callback-list-with-none-ready.patch @@ -0,0 +1,48 @@ +From 6e91f8cb138625be96070b778d9ba71ce520ea7e Mon Sep 17 00:00:00 2001 +From: "Paul E. McKenney" +Date: Mon, 11 May 2015 11:13:05 -0700 +Subject: rcu: Correctly handle non-empty Tiny RCU callback list with none ready + +From: "Paul E. McKenney" + +commit 6e91f8cb138625be96070b778d9ba71ce520ea7e upstream. + +If, at the time __rcu_process_callbacks() is invoked, there are callbacks +in Tiny RCU's callback list, but none of them are ready to be invoked, +the current list-management code will knit the non-ready callbacks out +of the list. This can result in hangs and possibly worse. This commit +therefore inserts a check for there being no callbacks that can be +invoked immediately. + +This bug is unlikely to occur -- you have to get a new callback between +the time rcu_sched_qs() or rcu_bh_qs() was called, but before we get to +__rcu_process_callbacks(). It was detected by the addition of RCU-bh +testing to rcutorture, which in turn was instigated by Iftekhar Ahmed's +mutation testing. Although this bug was made much more likely by +915e8a4fe45e (rcu: Remove fastpath from __rcu_process_callbacks()), this +did not cause the bug, but rather made it much more probable. That +said, it takes more than 40 hours of rcutorture testing, on average, +for this bug to appear, so this fix cannot be considered an emergency. + +Signed-off-by: Paul E. McKenney +Reviewed-by: Josh Triplett +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/rcu/tiny.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/kernel/rcu/tiny.c ++++ b/kernel/rcu/tiny.c +@@ -182,6 +182,11 @@ static void __rcu_process_callbacks(stru + + /* Move the ready-to-invoke callbacks to a local list. */ + local_irq_save(flags); ++ if (rcp->donetail == &rcp->rcucblist) { ++ /* No callbacks ready, so just leave. */ ++ local_irq_restore(flags); ++ return; ++ } + RCU_TRACE(trace_rcu_batch_start(rcp->name, 0, rcp->qlen, -1)); + list = rcp->rcucblist; + rcp->rcucblist = *rcp->donetail; diff --git a/queue-4.0/series b/queue-4.0/series index d37c86b3796..59141ad77e1 100644 --- a/queue-4.0/series +++ b/queue-4.0/series @@ -7,3 +7,12 @@ mnt-update-fs_fully_visible-to-test-for-permanently-empty-directories.patch mnt-refactor-the-logic-for-mounting-sysfs-and-proc-in-a-user-namespace.patch mnt-modify-fs_fully_visible-to-deal-with-locked-ro-nodev-and-atime.patch sysfs-create-mountpoints-with-sysfs_create_mount_point.patch +gpio-crystalcove-set-irqchip_skip_set_wake-for-the-irqchip.patch +rcu-correctly-handle-non-empty-tiny-rcu-callback-list-with-none-ready.patch +ipr-increase-default-adapter-init-stage-change-timeout.patch +disable-write-buffering-on-toshiba-topic95.patch +alsa-pcm-fix-pcm_class-sysfs-output.patch +alsa-hda-fix-dock-headphone-on-thinkpad-x250-seen-as-a-line-out.patch +alsa-hda-set-proper-caps-for-newer-amd-hda-audio-in-kb-kv.patch +alsa-hda-add-headset-support-to-acer-aspire-v5.patch +alsa-hda-fix-the-dock-headphone-output-on-fujitsu-lifebook-e780.patch