From: Greg Kroah-Hartman Date: Tue, 6 Mar 2018 18:50:06 +0000 (-0800) Subject: 4.4-stable patches X-Git-Tag: v4.14.25~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01acb6f82ffbb73939eed3e37eadda80f2f375b3;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-hda-add-a-power_save-blacklist.patch alsa-usb-audio-add-a-quirck-for-b-w-px-headphones.patch cpufreq-s3c24xx-fix-broken-s3c_cpufreq_init.patch x86-xen-zero-msr_ia32_spec_ctrl-before-suspend.patch --- diff --git a/queue-4.4/alsa-hda-add-a-power_save-blacklist.patch b/queue-4.4/alsa-hda-add-a-power_save-blacklist.patch new file mode 100644 index 00000000000..61012f8a158 --- /dev/null +++ b/queue-4.4/alsa-hda-add-a-power_save-blacklist.patch @@ -0,0 +1,110 @@ +From 1ba8f9d308174e647b864c36209b4d7934d99888 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 22 Feb 2018 14:20:35 +0100 +Subject: ALSA: hda: Add a power_save blacklist + +From: Hans de Goede + +commit 1ba8f9d308174e647b864c36209b4d7934d99888 upstream. + +On some boards setting power_save to a non 0 value leads to clicking / +popping sounds when ever we enter/leave powersaving mode. Ideally we would +figure out how to avoid these sounds, but that is not always feasible. + +This commit adds a blacklist for devices where powersaving is known to +cause problems and disables it on these devices. + +Note I tried to put this blacklist in userspace first: +https://github.com/systemd/systemd/pull/8128 + +But the systemd maintainers rightfully pointed out that it would be +impossible to then later remove entries once we actually find a way to +make power-saving work on listed boards without issues. Having this list +in the kernel will allow removal of the blacklist entry in the same commit +which fixes the clicks / plops. + +The blacklist only applies to the default power_save module-option value, +if a user explicitly sets the module-option then the blacklist is not +used. + +[ added an ifdef CONFIG_PM for the build error -- tiwai] + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104 +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198611 +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 38 ++++++++++++++++++++++++++++++++++++-- + 1 file changed, 36 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -179,7 +179,7 @@ static const struct kernel_param_ops par + }; + #define param_check_xint param_check_int + +-static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; ++static int power_save = -1; + module_param(power_save, xint, 0644); + MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " + "(in second, 0 = disable)."); +@@ -2055,6 +2055,24 @@ out_free: + return err; + } + ++#ifdef CONFIG_PM ++/* On some boards setting power_save to a non 0 value leads to clicking / ++ * popping sounds when ever we enter/leave powersaving mode. Ideally we would ++ * figure out how to avoid these sounds, but that is not always feasible. ++ * So we keep a list of devices where we disable powersaving as its known ++ * to causes problems on these devices. ++ */ ++static struct snd_pci_quirk power_save_blacklist[] = { ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ ++ SND_PCI_QUIRK(0x1849, 0x0c0c, "Asrock B85M-ITX", 0), ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ ++ SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0), ++ /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */ ++ SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0), ++ {} ++}; ++#endif /* CONFIG_PM */ ++ + /* number of codec slots for each chipset: 0 = default slots (i.e. 4) */ + static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = { + [AZX_DRIVER_NVIDIA] = 8, +@@ -2067,6 +2085,7 @@ static int azx_probe_continue(struct azx + struct hdac_bus *bus = azx_bus(chip); + struct pci_dev *pci = chip->pci; + int dev = chip->dev_index; ++ int val; + int err; + + hda->probe_continued = 1; +@@ -2142,7 +2161,22 @@ static int azx_probe_continue(struct azx + + chip->running = 1; + azx_add_card_list(chip); +- snd_hda_set_power_save(&chip->bus, power_save * 1000); ++ ++ val = power_save; ++#ifdef CONFIG_PM ++ if (val == -1) { ++ const struct snd_pci_quirk *q; ++ ++ val = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; ++ q = snd_pci_quirk_lookup(chip->pci, power_save_blacklist); ++ if (q && val) { ++ dev_info(chip->card->dev, "device %04x:%04x is on the power_save blacklist, forcing power_save to 0\n", ++ q->subvendor, q->subdevice); ++ val = 0; ++ } ++ } ++#endif /* CONFIG_PM */ ++ snd_hda_set_power_save(&chip->bus, val * 1000); + if (azx_has_pm_runtime(chip) || hda->use_vga_switcheroo) + pm_runtime_put_noidle(&pci->dev); + diff --git a/queue-4.4/alsa-usb-audio-add-a-quirck-for-b-w-px-headphones.patch b/queue-4.4/alsa-usb-audio-add-a-quirck-for-b-w-px-headphones.patch new file mode 100644 index 00000000000..0f7e424d9f4 --- /dev/null +++ b/queue-4.4/alsa-usb-audio-add-a-quirck-for-b-w-px-headphones.patch @@ -0,0 +1,75 @@ +From 240a8af929c7c57dcde28682725b29cf8474e8e5 Mon Sep 17 00:00:00 2001 +From: Erik Veijola +Date: Fri, 23 Feb 2018 14:06:52 +0200 +Subject: ALSA: usb-audio: Add a quirck for B&W PX headphones + +From: Erik Veijola + +commit 240a8af929c7c57dcde28682725b29cf8474e8e5 upstream. + +The capture interface doesn't work and the playback interface only +supports 48 kHz sampling rate even though it advertises more rates. + +Signed-off-by: Erik Veijola +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks-table.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +--- a/sound/usb/quirks-table.h ++++ b/sound/usb/quirks-table.h +@@ -3277,4 +3277,51 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge + } + }, + ++{ ++ /* ++ * Bower's & Wilkins PX headphones only support the 48 kHz sample rate ++ * even though it advertises more. The capture interface doesn't work ++ * even on windows. ++ */ ++ USB_DEVICE(0x19b5, 0x0021), ++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { ++ .ifnum = QUIRK_ANY_INTERFACE, ++ .type = QUIRK_COMPOSITE, ++ .data = (const struct snd_usb_audio_quirk[]) { ++ { ++ .ifnum = 0, ++ .type = QUIRK_AUDIO_STANDARD_MIXER, ++ }, ++ /* Capture */ ++ { ++ .ifnum = 1, ++ .type = QUIRK_IGNORE_INTERFACE, ++ }, ++ /* Playback */ ++ { ++ .ifnum = 2, ++ .type = QUIRK_AUDIO_FIXED_ENDPOINT, ++ .data = &(const struct audioformat) { ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels = 2, ++ .iface = 2, ++ .altsetting = 1, ++ .altset_idx = 1, ++ .attributes = UAC_EP_CS_ATTR_FILL_MAX | ++ UAC_EP_CS_ATTR_SAMPLE_RATE, ++ .endpoint = 0x03, ++ .ep_attr = USB_ENDPOINT_XFER_ISOC, ++ .rates = SNDRV_PCM_RATE_48000, ++ .rate_min = 48000, ++ .rate_max = 48000, ++ .nr_rates = 1, ++ .rate_table = (unsigned int[]) { ++ 48000 ++ } ++ } ++ }, ++ } ++ } ++}, ++ + #undef USB_DEVICE_VENDOR_SPEC diff --git a/queue-4.4/bluetooth-btusb-use-dmi-matching-for-qca-reset_resume-quirking.patch b/queue-4.4/bluetooth-btusb-use-dmi-matching-for-qca-reset_resume-quirking.patch deleted file mode 100644 index 1d298f66e3b..00000000000 --- a/queue-4.4/bluetooth-btusb-use-dmi-matching-for-qca-reset_resume-quirking.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 1fdb926974695d3dbc05a429bafa266fdd16510e Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 20 Feb 2018 09:06:18 +0100 -Subject: Bluetooth: btusb: Use DMI matching for QCA reset_resume quirking - -From: Hans de Goede - -commit 1fdb926974695d3dbc05a429bafa266fdd16510e upstream. - -Commit 61f5acea8737 ("Bluetooth: btusb: Restore QCA Rome suspend/resume fix -with a "rewritten" version") applied the USB_QUIRK_RESET_RESUME to all QCA -USB Bluetooth modules. But it turns out that the resume problems are not -caused by the QCA Rome chipset, on most platforms it resumes fine. The -resume problems are actually a platform problem (likely the platform -cutting all power when suspended). - -The USB_QUIRK_RESET_RESUME quirk also disables runtime suspend, so by -matching on usb-ids, we're causing all boards with these chips to use extra -power, to fix resume problems which only happen on some boards. - -This commit fixes this by applying the quirk based on DMI matching instead -of on usb-ids, so that we match the platform and not the chipset. - -Here is the /sys/kernel/debug/usb/devices for the Bluetooth module: - -T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=04 Dev#= 5 Spd=12 MxCh= 0 -D: Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 -P: Vendor=0cf3 ProdID=e300 Rev= 0.01 -C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA -I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms -E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms -E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms -I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms -I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms -I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms -I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms -I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms -I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms -E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514836 -Fixes: 61f5acea8737 ("Bluetooth: btusb: Restore QCA Rome suspend/resume..") -Cc: stable@vger.kernel.org -Cc: Brian Norris -Cc: Kai-Heng Feng -Reported-and-tested-by: Kevin Fenzi -Signed-off-by: Hans de Goede -Signed-off-by: Marcel Holtmann -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/bluetooth/btusb.c | 25 +++++++++++++++++++------ - 1 file changed, 19 insertions(+), 6 deletions(-) - ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -21,6 +21,7 @@ - * - */ - -+#include - #include - #include - #include -@@ -349,6 +350,21 @@ static const struct usb_device_id blackl - { } /* Terminating entry */ - }; - -+/* The Bluetooth USB module build into some devices needs to be reset on resume, -+ * this is a problem with the platform (likely shutting off all power) not with -+ * the module itself. So we use a DMI list to match known broken platforms. -+ */ -+static const struct dmi_system_id btusb_needs_reset_resume_table[] = { -+ { -+ /* Lenovo Yoga 920 (QCA Rome device 0cf3:e300) */ -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), -+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920"), -+ }, -+ }, -+ {} -+}; -+ - #define BTUSB_MAX_ISOC_FRAMES 10 - - #define BTUSB_INTR_RUNNING 0 -@@ -2970,12 +2986,6 @@ static int btusb_probe(struct usb_interf - if (id->driver_info & BTUSB_QCA_ROME) { - data->setup_on_usb = btusb_setup_qca; - hdev->set_bdaddr = btusb_set_bdaddr_ath3012; -- -- /* QCA Rome devices lose their updated firmware over suspend, -- * but the USB hub doesn't notice any status change. -- * explicitly request a device reset on resume. -- */ -- interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; - } - - #ifdef CONFIG_BT_HCIBTUSB_RTL -@@ -3118,6 +3128,9 @@ static void btusb_disconnect(struct usb_ - hci_free_dev(hdev); - } - -+ if (dmi_check_system(btusb_needs_reset_resume_table)) -+ interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; -+ - #ifdef CONFIG_PM - static int btusb_suspend(struct usb_interface *intf, pm_message_t message) - { diff --git a/queue-4.4/cpufreq-s3c24xx-fix-broken-s3c_cpufreq_init.patch b/queue-4.4/cpufreq-s3c24xx-fix-broken-s3c_cpufreq_init.patch new file mode 100644 index 00000000000..c613e10fe89 --- /dev/null +++ b/queue-4.4/cpufreq-s3c24xx-fix-broken-s3c_cpufreq_init.patch @@ -0,0 +1,47 @@ +From 0373ca74831b0f93cd4cdbf7ad3aec3c33a479a5 Mon Sep 17 00:00:00 2001 +From: Viresh Kumar +Date: Fri, 23 Feb 2018 09:38:28 +0530 +Subject: cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() + +From: Viresh Kumar + +commit 0373ca74831b0f93cd4cdbf7ad3aec3c33a479a5 upstream. + +commit a307a1e6bc0d "cpufreq: s3c: use cpufreq_generic_init()" +accidentally broke cpufreq on s3c2410 and s3c2412. + +These two platforms don't have a CPU frequency table and used to skip +calling cpufreq_table_validate_and_show() for them. But with the +above commit, we started calling it unconditionally and that will +eventually fail as the frequency table pointer is NULL. + +Fix this by calling cpufreq_table_validate_and_show() conditionally +again. + +Fixes: a307a1e6bc0d "cpufreq: s3c: use cpufreq_generic_init()" +Cc: 3.13+ # v3.13+ +Signed-off-by: Viresh Kumar +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpufreq/s3c24xx-cpufreq.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/cpufreq/s3c24xx-cpufreq.c ++++ b/drivers/cpufreq/s3c24xx-cpufreq.c +@@ -364,7 +364,13 @@ struct clk *s3c_cpufreq_clk_get(struct d + static int s3c_cpufreq_init(struct cpufreq_policy *policy) + { + policy->clk = clk_arm; +- return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency); ++ ++ policy->cpuinfo.transition_latency = cpu_cur.info->latency; ++ ++ if (ftab) ++ return cpufreq_table_validate_and_show(policy, ftab); ++ ++ return 0; + } + + static int __init s3c_cpufreq_initclks(void) diff --git a/queue-4.4/series b/queue-4.4/series index cedd945ef8e..fbaf30ed84b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,4 +1,7 @@ -bluetooth-btusb-use-dmi-matching-for-qca-reset_resume-quirking.patch tpm-st33zp24-fix-potential-buffer-overruns-caused-by-bit-glitches-on-the-bus.patch tpm_i2c_infineon-fix-potential-buffer-overruns-caused-by-bit-glitches-on-the-bus.patch tpm_i2c_nuvoton-fix-potential-buffer-overruns-caused-by-bit-glitches-on-the-bus.patch +alsa-usb-audio-add-a-quirck-for-b-w-px-headphones.patch +alsa-hda-add-a-power_save-blacklist.patch +cpufreq-s3c24xx-fix-broken-s3c_cpufreq_init.patch +x86-xen-zero-msr_ia32_spec_ctrl-before-suspend.patch diff --git a/queue-4.4/x86-xen-zero-msr_ia32_spec_ctrl-before-suspend.patch b/queue-4.4/x86-xen-zero-msr_ia32_spec_ctrl-before-suspend.patch new file mode 100644 index 00000000000..9941ad5fab1 --- /dev/null +++ b/queue-4.4/x86-xen-zero-msr_ia32_spec_ctrl-before-suspend.patch @@ -0,0 +1,78 @@ +From 71c208dd54ab971036d83ff6d9837bae4976e623 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Mon, 26 Feb 2018 15:08:18 +0100 +Subject: x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend + +From: Juergen Gross + +commit 71c208dd54ab971036d83ff6d9837bae4976e623 upstream. + +Older Xen versions (4.5 and before) might have problems migrating pv +guests with MSR_IA32_SPEC_CTRL having a non-zero value. So before +suspending zero that MSR and restore it after being resumed. + +Signed-off-by: Juergen Gross +Signed-off-by: Thomas Gleixner +Reviewed-by: Jan Beulich +Cc: stable@vger.kernel.org +Cc: xen-devel@lists.xenproject.org +Cc: boris.ostrovsky@oracle.com +Link: https://lkml.kernel.org/r/20180226140818.4849-1-jgross@suse.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/suspend.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/x86/xen/suspend.c ++++ b/arch/x86/xen/suspend.c +@@ -1,11 +1,14 @@ + #include + #include ++#include + + #include + #include + #include + #include + ++#include ++#include + #include + #include + #include +@@ -68,6 +71,8 @@ static void xen_pv_post_suspend(int susp + xen_mm_unpin_all(); + } + ++static DEFINE_PER_CPU(u64, spec_ctrl); ++ + void xen_arch_pre_suspend(void) + { + if (xen_pv_domain()) +@@ -84,6 +89,9 @@ void xen_arch_post_suspend(int cancelled + + static void xen_vcpu_notify_restore(void *data) + { ++ if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) ++ wrmsrl(MSR_IA32_SPEC_CTRL, this_cpu_read(spec_ctrl)); ++ + /* Boot processor notified via generic timekeeping_resume() */ + if (smp_processor_id() == 0) + return; +@@ -93,7 +101,15 @@ static void xen_vcpu_notify_restore(void + + static void xen_vcpu_notify_suspend(void *data) + { ++ u64 tmp; ++ + tick_suspend_local(); ++ ++ if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) { ++ rdmsrl(MSR_IA32_SPEC_CTRL, tmp); ++ this_cpu_write(spec_ctrl, tmp); ++ wrmsrl(MSR_IA32_SPEC_CTRL, 0); ++ } + } + + void xen_arch_resume(void)