From 77fc3c609d44aca47d8181174101ea5eb96fcae1 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Fri, 27 Apr 2018 13:08:45 -0400 Subject: [PATCH] Fix a bluetooth autosuspend issue on some XPS 13s (rhbz 1514836) --- ...-btusb-autosuspend-XPS-13-9360-fixes.patch | 107 ++++++++++++++++++ kernel.spec | 6 + 2 files changed, 113 insertions(+) create mode 100644 Bluetooth-btusb-autosuspend-XPS-13-9360-fixes.patch diff --git a/Bluetooth-btusb-autosuspend-XPS-13-9360-fixes.patch b/Bluetooth-btusb-autosuspend-XPS-13-9360-fixes.patch new file mode 100644 index 000000000..f197ae48c --- /dev/null +++ b/Bluetooth-btusb-autosuspend-XPS-13-9360-fixes.patch @@ -0,0 +1,107 @@ +From b24b8a41fb5461d1f2105b18a3106cb0a2d5e058 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 26 Apr 2018 20:52:06 +0200 +Subject: [PATCH 1/2] Bluetooth: btusb: Add Dell XPS 13 9360 to + btusb_needs_reset_resume_table + +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: Jeremy Cline +--- + drivers/bluetooth/btusb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 366a49c7c08f..409d7eff08a4 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -392,6 +392,13 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = { + 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"), ++ }, ++ }, + {} + }; + +-- +2.17.0 + +From 50f2db2f8eccc7a31d899a0dee35f3a1f0c740fe Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 27 Apr 2018 11:26:43 +0200 +Subject: [PATCH 2/2] Bluetooth: btusb: Only check needs_reset_resume DMI table + for QCA rome chipsets + +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: Jeremy Cline +--- + drivers/bluetooth/btusb.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 409d7eff08a4..ebc9cb23a108 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -2846,6 +2846,12 @@ static int btusb_config_oob_wake(struct hci_dev *hdev) + } + #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) + { +@@ -2968,9 +2974,6 @@ static int btusb_probe(struct usb_interface *intf, + 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) +@@ -3057,6 +3060,7 @@ static int btusb_probe(struct usb_interface *intf, + if (id->driver_info & BTUSB_QCA_ROME) { + data->setup_on_usb = btusb_setup_qca; + hdev->set_bdaddr = btusb_set_bdaddr_ath3012; ++ btusb_check_needs_reset_resume(intf); + } + + #ifdef CONFIG_BT_HCIBTUSB_RTL +-- +2.17.0 + diff --git a/kernel.spec b/kernel.spec index a810a4f91..572946fd4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -671,6 +671,9 @@ Patch506: ACPI-video-Only-default-only_lcd-to-true-on-Win8-ready-_desktops_.patc # rhbz 1565131 Patch507: xhci-Fix-Kernel-oops-in-xhci-dbgtty.patch +# rhbz 1514836 +Patch508: Bluetooth-btusb-autosuspend-XPS-13-9360-fixes.patch + # END OF PATCH DEFINITIONS %endif @@ -1920,6 +1923,9 @@ fi # # %changelog +* Fri Apr 27 2018 Jeremy Cline +- Fix an issue with bluetooth autosupsend on some XPS 13 9360 (rhbz 1514836) + * Fri Apr 27 2018 Peter Robinson - Enable QLogic NICs on ARM