From: Greg Kroah-Hartman Date: Sat, 12 May 2018 19:27:35 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v3.18.109~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00d8851829f3452858d27b9fd01f201a6ad6a859;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: bluetooth-btusb-add-dell-xps-13-9360-to-btusb_needs_reset_resume_table.patch bluetooth-btusb-only-check-needs_reset_resume-dmi-table-for-qca-rome-chipsets.patch cpufreq-schedutil-avoid-using-invalid-next_freq.patch pci-pm-always-check-pme-wakeup-capability-for-runtime-wakeup-support.patch pci-pm-check-device_may_wakeup-in-pci_enable_wake.patch revert-bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch --- diff --git a/queue-4.14/bluetooth-btusb-add-dell-xps-13-9360-to-btusb_needs_reset_resume_table.patch b/queue-4.14/bluetooth-btusb-add-dell-xps-13-9360-to-btusb_needs_reset_resume_table.patch new file mode 100644 index 00000000000..c0d5c84fa07 --- /dev/null +++ b/queue-4.14/bluetooth-btusb-add-dell-xps-13-9360-to-btusb_needs_reset_resume_table.patch @@ -0,0 +1,41 @@ +From 596b07a9a22656493726edf1739569102bd3e136 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 26 Apr 2018 20:52:06 +0200 +Subject: Bluetooth: btusb: Add Dell XPS 13 9360 to btusb_needs_reset_resume_table + +From: Hans de Goede + +commit 596b07a9a22656493726edf1739569102bd3e136 upstream. + +The Dell XPS 13 9360 uses a QCA Rome chip which needs to be reset +(and have its firmware reloaded) for bluetooth to work after +suspend/resume. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514836 +Cc: stable@vger.kernel.org +Cc: Garrett LeSage +Reported-and-tested-by: Garrett LeSage +Signed-off-by: Hans de Goede +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/bluetooth/btusb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -395,6 +395,13 @@ static const struct dmi_system_id btusb_ + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 3060"), + }, + }, ++ { ++ /* Dell XPS 9360 (QCA ROME device 0cf3:e300) */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), ++ }, ++ }, + {} + }; + diff --git a/queue-4.14/bluetooth-btusb-only-check-needs_reset_resume-dmi-table-for-qca-rome-chipsets.patch b/queue-4.14/bluetooth-btusb-only-check-needs_reset_resume-dmi-table-for-qca-rome-chipsets.patch new file mode 100644 index 00000000000..d21fa9ee15e --- /dev/null +++ b/queue-4.14/bluetooth-btusb-only-check-needs_reset_resume-dmi-table-for-qca-rome-chipsets.patch @@ -0,0 +1,66 @@ +From fc54910280eb38bde923cdf0898e74687d8e6989 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 27 Apr 2018 11:26:43 +0200 +Subject: Bluetooth: btusb: Only check needs_reset_resume DMI table for QCA rome chipsets + +From: Hans de Goede + +commit fc54910280eb38bde923cdf0898e74687d8e6989 upstream. + +Jeremy Cline correctly points out in rhbz#1514836 that a device where the +QCA rome chipset needs the USB_QUIRK_RESET_RESUME quirk, may also ship +with a different wifi/bt chipset in some configurations. + +If that is the case then we are needlessly penalizing those other chipsets +with a reset-resume quirk, typically causing 0.4W extra power use because +this disables runtime-pm. + +This commit moves the DMI table check to a btusb_check_needs_reset_resume() +helper (so that we can easily also call it for other chipsets) and calls +this new helper only for QCA_ROME chipsets for now. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514836 +Cc: stable@vger.kernel.org +Cc: Jeremy Cline +Suggested-by: Jeremy Cline +Signed-off-by: Hans de Goede +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/bluetooth/btusb.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -2902,6 +2902,12 @@ static int btusb_config_oob_wake(struct + } + #endif + ++static void btusb_check_needs_reset_resume(struct usb_interface *intf) ++{ ++ if (dmi_check_system(btusb_needs_reset_resume_table)) ++ interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; ++} ++ + static int btusb_probe(struct usb_interface *intf, + const struct usb_device_id *id) + { +@@ -3037,9 +3043,6 @@ static int btusb_probe(struct usb_interf + hdev->send = btusb_send_frame; + hdev->notify = btusb_notify; + +- if (dmi_check_system(btusb_needs_reset_resume_table)) +- interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME; +- + #ifdef CONFIG_PM + err = btusb_config_oob_wake(hdev); + if (err) +@@ -3177,6 +3180,7 @@ static int btusb_probe(struct usb_interf + hdev->setup = btusb_setup_csr; + + set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); ++ btusb_check_needs_reset_resume(intf); + } + + if (id->driver_info & BTUSB_SNIFFER) { diff --git a/queue-4.14/cpufreq-schedutil-avoid-using-invalid-next_freq.patch b/queue-4.14/cpufreq-schedutil-avoid-using-invalid-next_freq.patch new file mode 100644 index 00000000000..6298573e828 --- /dev/null +++ b/queue-4.14/cpufreq-schedutil-avoid-using-invalid-next_freq.patch @@ -0,0 +1,43 @@ +From 97739501f207efe33145b918817f305b822987f8 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Wed, 9 May 2018 11:44:56 +0200 +Subject: cpufreq: schedutil: Avoid using invalid next_freq + +From: Rafael J. Wysocki + +commit 97739501f207efe33145b918817f305b822987f8 upstream. + +If the next_freq field of struct sugov_policy is set to UINT_MAX, +it shouldn't be used for updating the CPU frequency (this is a +special "invalid" value), but after commit b7eaf1aab9f8 (cpufreq: +schedutil: Avoid reducing frequency of busy CPUs prematurely) it +may be passed as the new frequency to sugov_update_commit() in +sugov_update_single(). + +Fix that by adding an extra check for the special UINT_MAX value +of next_freq to sugov_update_single(). + +Fixes: b7eaf1aab9f8 (cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely) +Reported-by: Viresh Kumar +Cc: 4.12+ # 4.12+ +Signed-off-by: Rafael J. Wysocki +Acked-by: Viresh Kumar +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched/cpufreq_schedutil.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/sched/cpufreq_schedutil.c ++++ b/kernel/sched/cpufreq_schedutil.c +@@ -282,7 +282,8 @@ static void sugov_update_single(struct u + * Do not reduce the frequency if the CPU has not been idle + * recently, as the reduction is likely to be premature then. + */ +- if (busy && next_f < sg_policy->next_freq) { ++ if (busy && next_f < sg_policy->next_freq && ++ sg_policy->next_freq != UINT_MAX) { + next_f = sg_policy->next_freq; + + /* Reset cached freq as next_freq has changed */ diff --git a/queue-4.14/pci-pm-always-check-pme-wakeup-capability-for-runtime-wakeup-support.patch b/queue-4.14/pci-pm-always-check-pme-wakeup-capability-for-runtime-wakeup-support.patch new file mode 100644 index 00000000000..ca128197d18 --- /dev/null +++ b/queue-4.14/pci-pm-always-check-pme-wakeup-capability-for-runtime-wakeup-support.patch @@ -0,0 +1,67 @@ +From 8feaec33b9868582654cd3d5355225dcb79aeca6 Mon Sep 17 00:00:00 2001 +From: Kai Heng Feng +Date: Mon, 7 May 2018 14:11:20 +0800 +Subject: PCI / PM: Always check PME wakeup capability for runtime wakeup support + +From: Kai Heng Feng + +commit 8feaec33b9868582654cd3d5355225dcb79aeca6 upstream. + +USB controller ASM1042 stops working after commit de3ef1eb1cd0 (PM / +core: Drop run_wake flag from struct dev_pm_info). + +The device in question is not power managed by platform firmware, +furthermore, it only supports PME# from D3cold: +Capabilities: [78] Power Management version 3 + Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot-,D3cold+) + Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME- + +Before commit de3ef1eb1cd0, the device never gets runtime suspended. +After that commit, the device gets runtime suspended to D3hot, which can +not generate any PME#. + +usb_hcd_pci_probe() unconditionally calls device_wakeup_enable(), hence +device_can_wakeup() in pci_dev_run_wake() always returns true. + +So pci_dev_run_wake() needs to check PME wakeup capability as its first +condition. + +In addition, change wakeup flag passed to pci_target_state() from false +to true, because we want to find the deepest state different from D3cold +that the device can still generate PME#. In this case, it's D0 for the +device in question. + +Fixes: de3ef1eb1cd0 (PM / core: Drop run_wake flag from struct dev_pm_info) +Signed-off-by: Kai-Heng Feng +Cc: 4.13+ # 4.13+ +Acked-by: Bjorn Helgaas +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -2120,16 +2120,16 @@ bool pci_dev_run_wake(struct pci_dev *de + { + struct pci_bus *bus = dev->bus; + +- if (device_can_wakeup(&dev->dev)) +- return true; +- + if (!dev->pme_support) + return false; + + /* PME-capable in principle, but not from the target power state */ +- if (!pci_pme_capable(dev, pci_target_state(dev, false))) ++ if (!pci_pme_capable(dev, pci_target_state(dev, true))) + return false; + ++ if (device_can_wakeup(&dev->dev)) ++ return true; ++ + while (bus->parent) { + struct pci_dev *bridge = bus->self; + diff --git a/queue-4.14/pci-pm-check-device_may_wakeup-in-pci_enable_wake.patch b/queue-4.14/pci-pm-check-device_may_wakeup-in-pci_enable_wake.patch new file mode 100644 index 00000000000..a3f0f6cc1c4 --- /dev/null +++ b/queue-4.14/pci-pm-check-device_may_wakeup-in-pci_enable_wake.patch @@ -0,0 +1,100 @@ +From cfcadfaad7251d8b640713724b388164d75465b2 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Wed, 9 May 2018 00:18:32 +0200 +Subject: PCI / PM: Check device_may_wakeup() in pci_enable_wake() + +From: Rafael J. Wysocki + +commit cfcadfaad7251d8b640713724b388164d75465b2 upstream. + +Commit 0847684cfc5f0 (PCI / PM: Simplify device wakeup settings code) +went too far and dropped the device_may_wakeup() check from +pci_enable_wake() which causes wakeup to be enabled during system +suspend, hibernation or shutdown for some PCI devices that are not +allowed by user space to wake up the system from sleep (or power off). + +As a result of this, excessive power is drawn by some of the affected +systems while in sleep states or off. + +Restore the device_may_wakeup() check in pci_enable_wake(), but make +sure that the PCI bus type's runtime suspend callback will not call +device_may_wakeup() which is about system wakeup from sleep and not +about device wakeup from runtime suspend. + +Fixes: 0847684cfc5f0 (PCI / PM: Simplify device wakeup settings code) +Reported-by: Joseph Salisbury +Cc: 4.13+ # 4.13+ +Signed-off-by: Rafael J. Wysocki +Acked-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci.c | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -1892,7 +1892,7 @@ void pci_pme_active(struct pci_dev *dev, + EXPORT_SYMBOL(pci_pme_active); + + /** +- * pci_enable_wake - enable PCI device as wakeup event source ++ * __pci_enable_wake - enable PCI device as wakeup event source + * @dev: PCI device affected + * @state: PCI state from which device will issue wakeup events + * @enable: True to enable event generation; false to disable +@@ -1910,7 +1910,7 @@ EXPORT_SYMBOL(pci_pme_active); + * Error code depending on the platform is returned if both the platform and + * the native mechanism fail to enable the generation of wake-up events + */ +-int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) ++static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) + { + int ret = 0; + +@@ -1951,6 +1951,23 @@ int pci_enable_wake(struct pci_dev *dev, + + return ret; + } ++ ++/** ++ * pci_enable_wake - change wakeup settings for a PCI device ++ * @pci_dev: Target device ++ * @state: PCI state from which device will issue wakeup events ++ * @enable: Whether or not to enable event generation ++ * ++ * If @enable is set, check device_may_wakeup() for the device before calling ++ * __pci_enable_wake() for it. ++ */ ++int pci_enable_wake(struct pci_dev *pci_dev, pci_power_t state, bool enable) ++{ ++ if (enable && !device_may_wakeup(&pci_dev->dev)) ++ return -EINVAL; ++ ++ return __pci_enable_wake(pci_dev, state, enable); ++} + EXPORT_SYMBOL(pci_enable_wake); + + /** +@@ -1963,9 +1980,9 @@ EXPORT_SYMBOL(pci_enable_wake); + * should not be called twice in a row to enable wake-up due to PCI PM vs ACPI + * ordering constraints. + * +- * This function only returns error code if the device is not capable of +- * generating PME# from both D3_hot and D3_cold, and the platform is unable to +- * enable wake-up power for it. ++ * This function only returns error code if the device is not allowed to wake ++ * up the system from sleep or it is not capable of generating PME# from both ++ * D3_hot and D3_cold and the platform is unable to enable wake-up power for it. + */ + int pci_wake_from_d3(struct pci_dev *dev, bool enable) + { +@@ -2096,7 +2113,7 @@ int pci_finish_runtime_suspend(struct pc + + dev->runtime_d3cold = target_state == PCI_D3cold; + +- pci_enable_wake(dev, target_state, pci_dev_run_wake(dev)); ++ __pci_enable_wake(dev, target_state, pci_dev_run_wake(dev)); + + error = pci_set_power_state(dev, target_state); + diff --git a/queue-4.14/revert-bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch b/queue-4.14/revert-bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch new file mode 100644 index 00000000000..e95da0199b9 --- /dev/null +++ b/queue-4.14/revert-bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch @@ -0,0 +1,44 @@ +From 544a591668813583021474fa5c7ff4942244d654 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 26 Apr 2018 14:18:19 +0200 +Subject: Revert "Bluetooth: btusb: Fix quirk for Atheros 1525/QCA6174" + +From: Hans de Goede + +commit 544a591668813583021474fa5c7ff4942244d654 upstream. + +Commit f44cb4b19ed4 ("Bluetooth: btusb: Fix quirk for Atheros +1525/QCA6174") is causing bluetooth to no longer work for several +people, see: https://bugzilla.redhat.com/show_bug.cgi?id=1568911 + +So lets revert it for now and try to find another solution for +devices which need the modified quirk. + +Cc: stable@vger.kernel.org +Cc: Takashi Iwai +Signed-off-by: Hans de Goede +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/bluetooth/btusb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -235,6 +235,7 @@ static const struct usb_device_id blackl + { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, ++ { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 }, +@@ -267,7 +268,6 @@ static const struct usb_device_id blackl + { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, + + /* QCA ROME chipset */ +- { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_QCA_ROME }, + { USB_DEVICE(0x0cf3, 0xe007), .driver_info = BTUSB_QCA_ROME }, + { USB_DEVICE(0x0cf3, 0xe009), .driver_info = BTUSB_QCA_ROME }, + { USB_DEVICE(0x0cf3, 0xe300), .driver_info = BTUSB_QCA_ROME }, diff --git a/queue-4.14/series b/queue-4.14/series index b0a3121c101..0aba8a44b90 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -41,3 +41,9 @@ drm-atomic-clean-old_state-new_state-in-drm_atomic_state_default_clear.patch drm-atomic-clean-private-obj-old_state-new_state-in-drm_atomic_state_default_clear.patch net-atm-fix-potential-spectre-v1.patch atm-zatm-fix-potential-spectre-v1.patch +pci-pm-always-check-pme-wakeup-capability-for-runtime-wakeup-support.patch +pci-pm-check-device_may_wakeup-in-pci_enable_wake.patch +cpufreq-schedutil-avoid-using-invalid-next_freq.patch +revert-bluetooth-btusb-fix-quirk-for-atheros-1525-qca6174.patch +bluetooth-btusb-add-dell-xps-13-9360-to-btusb_needs_reset_resume_table.patch +bluetooth-btusb-only-check-needs_reset_resume-dmi-table-for-qca-rome-chipsets.patch