From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:59610 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbdDJQIp (ORCPT ); Mon, 10 Apr 2017 12:08:45 -0400 Subject: Patch "platform/x86: asus-wmi: Set specified XUSB2PR value for X550LB" has been added to the 4.9-stable tree To: gregkh@linuxfoundation.org, alexander.levin@verizon.com, andriy.shevchenko@linux.intel.com, andy.shevchenko@gmail.com, corentin.chary@gmail.com, kai.chiuan@gmail.com, stable@vger.kernel.org Cc: , From: Date: Mon, 10 Apr 2017 18:06:37 +0200 In-Reply-To: <20170404193158.19041-91-alexander.levin@verizon.com> Message-ID: <1491840397173138@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled platform/x86: asus-wmi: Set specified XUSB2PR value for X550LB to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: platform-x86-asus-wmi-set-specified-xusb2pr-value-for-x550lb.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Apr 10 17:43:56 CEST 2017 From: alexander.levin@verizon.com Date: Tue, 4 Apr 2017 19:32:36 +0000 Subject: platform/x86: asus-wmi: Set specified XUSB2PR value for X550LB To: "gregkh@linuxfoundation.org" Cc: "stable@vger.kernel.org" Message-ID: <20170404193158.19041-91-alexander.levin@verizon.com> From: Kai-Chuan Hsieh [ Upstream commit 8023eff10e7b0327898f17f0b553d2e45c71cef3 ] The bluetooth adapter Atheros AR3012 can't be enumerated and make the bluetooth function broken. T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#= 5 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3362 Rev=00.02 S: Manufacturer=Atheros Communications S: Product=Bluetooth USB Host Controller S: SerialNumber=Alaska Day 2006 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 I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb The error is: usb 2-6: device not accepting address 7, error -62 usb usb2-port6: unable to enumerate USB device It is caused by adapter's connected port is mapped to xHC controller, but the xHCI is not supported by the usb device. The output of 'sudo lspci -nnxxx -s 00:14.0': 00:14.0 USB controller [0c03]: Intel Corporation 8 Series USB xHCI HC [8086:9c31] (rev 04) 00: 86 80 31 9c 06 04 90 02 04 30 03 0c 00 00 00 00 10: 04 00 a0 f7 00 00 00 00 00 00 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 43 10 1f 20 30: 00 00 00 00 70 00 00 00 00 00 00 00 0b 01 00 00 40: fd 01 36 80 89 c6 0f 80 00 00 00 00 00 00 00 00 50: 5f 2e ce 0f 00 00 00 00 00 00 00 00 00 00 00 00 60: 30 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 01 80 c2 c1 08 00 00 00 00 00 00 00 00 00 00 00 80: 05 00 87 00 0c a0 e0 fe 00 00 00 00 a1 41 00 00 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a0: 00 01 04 00 00 00 00 00 00 00 00 00 00 00 00 00 b0: 0f 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 c0: 03 c0 30 00 00 00 00 00 03 0c 00 00 00 00 00 00 d0: f9 01 00 00 f9 01 00 00 0f 00 00 00 0f 00 00 00 e0: 00 08 00 00 00 00 00 00 00 00 00 00 d8 d8 00 00 f0: 00 00 00 00 00 00 00 00 b1 0f 04 08 00 00 00 00 By referencing Intel Platform Controller Hub(PCH) datasheet, the xHC USB 2.0 Port Routing(XUSB2PR) at offset 0xD0-0xD3h decides the setting of mapping the port to EHCI controller or xHC controller. And the port mapped to xHC will enable xHCI during bus resume. The setting of disabling bluetooth adapter's connected port is 0x000001D9. The value can be obtained by few times 1 bit flip operation. The suited configuration should have the 'lsusb -t' result with bluetooth using ehci: /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M |__ Port 5: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M |__ Port 5: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M |__ Port 6: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M |__ Port 6: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M Signed-off-by: Kai-Chuan Hsieh Acked-by: Corentin Chary Reviewed-by: Andy Shevchenko [andy: resolve merge conflict in asus-wmi.h] Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++ drivers/platform/x86/asus-wmi.c | 29 +++++++++++++++++++++++++++++ drivers/platform/x86/asus-wmi.h | 1 + 3 files changed, 43 insertions(+) --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c @@ -116,6 +116,10 @@ static struct quirk_entry quirk_asus_ux3 .wmi_backlight_native = true, }; +static struct quirk_entry quirk_asus_x550lb = { + .xusb2pr = 0x01D9, +}; + static int dmi_matched(const struct dmi_system_id *dmi) { quirks = dmi->driver_data; @@ -407,6 +411,15 @@ static const struct dmi_system_id asus_q }, .driver_data = &quirk_asus_ux303ub, }, + { + .callback = dmi_matched, + .ident = "ASUSTeK COMPUTER INC. X550LB", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "X550LB"), + }, + .driver_data = &quirk_asus_x550lb, + }, {}, }; --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -156,6 +156,9 @@ MODULE_LICENSE("GPL"); #define ASUS_FAN_CTRL_MANUAL 1 #define ASUS_FAN_CTRL_AUTO 2 +#define USB_INTEL_XUSB2PR 0xD0 +#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 + struct bios_args { u32 arg0; u32 arg1; @@ -1080,6 +1083,29 @@ exit: return result; } +static void asus_wmi_set_xusb2pr(struct asus_wmi *asus) +{ + struct pci_dev *xhci_pdev; + u32 orig_ports_available; + u32 ports_available = asus->driver->quirks->xusb2pr; + + xhci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI, + NULL); + + if (!xhci_pdev) + return; + + pci_read_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, + &orig_ports_available); + + pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, + cpu_to_le32(ports_available)); + + pr_info("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n", + orig_ports_available, ports_available); +} + /* * Hwmon device */ @@ -2087,6 +2113,9 @@ static int asus_wmi_add(struct platform_ if (asus->driver->quirks->wmi_backlight_native) acpi_video_set_dmi_backlight_type(acpi_backlight_native); + if (asus->driver->quirks->xusb2pr) + asus_wmi_set_xusb2pr(asus); + if (acpi_video_get_backlight_type() == acpi_backlight_vendor) { err = asus_wmi_backlight_init(asus); if (err && err != -ENODEV) --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h @@ -53,6 +53,7 @@ struct quirk_entry { * and let the ACPI interrupt to send out the key event. */ int no_display_toggle; + u32 xusb2pr; bool (*i8042_filter)(unsigned char data, unsigned char str, struct serio *serio); Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are queue-4.9/staging-android-ashmem-lseek-failed-due-to-no-fmode_lseek.patch queue-4.9/arm64-dts-hisi-fix-hip06-sas-am-max-trans-quirk.patch queue-4.9/scsi-ufs-introduce-ufshcd_quirk_prdt_byte_gran-quirk.patch queue-4.9/acpi-button-change-default-behavior-to-lid_init_state-open.patch queue-4.9/usb-musb-da8xx-fix-host-mode-suspend.patch queue-4.9/drm-i915-fix-intel_bdw_ids-definition.patch queue-4.9/sysfs-be-careful-of-error-returns-from-ops-show.patch queue-4.9/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch queue-4.9/mips-end-spinlocks-with-.insn.patch queue-4.9/mmc-sdhci-of-esdhc-remove-default-broken-cd-for-arm.patch queue-4.9/kvm-arm-arm64-fix-locking-for-kvm_free_stage2_pgd.patch queue-4.9/powerpc-disable-hfscr-if-tm-is-not-supported.patch queue-4.9/metag-usercopy-add-missing-fixups.patch queue-4.9/nios2-reserve-boot-memory-for-device-tree.patch queue-4.9/alsa-usb-audio-add-implicit-fb-quirk-for-axe-fx-ii.patch queue-4.9/svcauth_gss-close-connection-when-dropping-an-incoming-message.patch queue-4.9/platform-x86-asus-wmi-detect-quirk_no_rfkill-from-the-dsdt.patch queue-4.9/ring-buffer-fix-return-value-check-in-test_ringbuffer.patch queue-4.9/ppdev-check-before-attaching-port.patch queue-4.9/firmware-qcom-scm-fix-interrupted-scm-calls.patch queue-4.9/pci-add-broadcom-northstar2-paxc-quirk-for-device-class-and-mpss.patch queue-4.9/powerpc-64-fix-flush_-d-i-cache_range-called-from-modules.patch queue-4.9/drm-sun4i-tcon-move-soc-specific-quirks-to-a-dt-matched-data-structure.patch queue-4.9/acpi-gpio-do-not-fall-back-to-parsing-_crs-when-we-get-a-deferral.patch queue-4.9/pci-explain-arm64-acpi-mcfg-quirk-kconfig-and-build-strategy.patch queue-4.9/metag-usercopy-add-early-abort-to-copy_to_user.patch queue-4.9/powerpc-crypto-crc32c-vpmsum-fix-missing-preempt_disable.patch queue-4.9/hid-multitouch-do-not-retrieve-all-reports-for-all-devices.patch queue-4.9/arm-arm64-kvm-take-mmap_sem-in-kvm_arch_prepare_memory_region.patch queue-4.9/arm-dts-stih407-family-set-snps-dis_u3_susphy_quirk.patch queue-4.9/rx51-broken-build.patch queue-4.9/mips-ralink-fix-typos-in-rt3883-pinctrl.patch queue-4.9/cfg80211-check-rdev-resume-callback-only-for-registered-wiphy.patch queue-4.9/metag-usercopy-set-flags-before-addz.patch queue-4.9/asoc-intel-bytct_rt5640-change-default-capture-settings.patch queue-4.9/metag-usercopy-fix-src-fixup-in-from-user-rapf-loops.patch queue-4.9/hid-asus-fix-keyboard-support.patch queue-4.9/drm-sun4i-add-compatible-string-for-a31-a31s-tcon-timing-controller.patch queue-4.9/arm64-pci-manage-controller-specific-data-on-per-controller-basis.patch queue-4.9/platform-x86-acer-wmi-only-supports-amw0_guid1-on-acer-family.patch queue-4.9/xtensa-make-__pa-work-with-uncached-kseg-addresses.patch queue-4.9/asoc-codecs-rt5670-add-quirk-for-lenovo-thinkpad-10.patch queue-4.9/clk-lpc32xx-add-a-quirk-for-pwm-and-ms-clock-dividers.patch queue-4.9/powerpc-mm-add-missing-global-tlb-invalidate-if-cxl-is-active.patch queue-4.9/tools-power-turbostat-dump-atom-p-states-correctly.patch queue-4.9/clocksource-drivers-arm_arch_timer-don-t-assume-clock-runs-in-suspend.patch queue-4.9/asoc-intel-cht_bsw_rt5645-add-baytrail-mclk-support.patch queue-4.9/watchdog-s3c2410-fix-infinite-interrupt-in-soft-mode.patch queue-4.9/arm64-pci-search-acpi-namespace-to-ensure-ecam-space-is-reserved.patch queue-4.9/pci-add-mcfg-quirks-for-cavium-thunderx-pass1.x-host-controller.patch queue-4.9/drm-i915-actually-drive-the-bdw-reserved-ids.patch queue-4.9/net-mlx4_core-use-device-id-defines.patch queue-4.9/scsi-ufs-introduce-a-new-ufshcd_statea-ufshcd_state_eh_scheduled.patch queue-4.9/hid-sensor-hub-add-quirk-for-microsoft-surface-3.patch queue-4.9/serial-8250_omap-add-omap_dma_tx_kick-quirk-for-am437x.patch queue-4.9/brcmfmac-use-local-iftype-avoiding-use-after-free-of-virtual-interface.patch queue-4.9/pci-acpi-check-for-platform-specific-mcfg-quirks.patch queue-4.9/drm-vmwgfx-remove-getparam-error-message.patch queue-4.9/mac80211-unconditionally-start-new-netdev-queues-with-itxq-support.patch queue-4.9/dm-verity-fec-fix-bufio-leaks.patch queue-4.9/x86-intel_idle-add-cpu-model-0x4a-atom-z34xx-series.patch queue-4.9/hid-wacom-don-t-apply-generic-settings-to-old-devices.patch queue-4.9/hid-sensor-hub-add-quirk-for-microchip-mm7150.patch queue-4.9/arm-kernel-add-smc-structure-parameter.patch queue-4.9/usb-storage-add-ignore-residue-quirk-for-initio-inic-3619.patch queue-4.9/drm-vmwgfx-type-check-lookups-of-fence-objects.patch queue-4.9/hid-asus-add-i2c-touchpad-support.patch queue-4.9/nvme-simplify-stripe-quirk.patch queue-4.9/drm-sun4i-add-compatible-strings-for-a31-a31s-display-pipelines.patch queue-4.9/dm-verity-fec-limit-error-correction-recursion.patch queue-4.9/drm-edid-constify-edid-quirk-list.patch queue-4.9/s390-uaccess-get_user-should-zero-on-failure-again.patch queue-4.9/dm-raid-fix-null-pointer-dereference-for-raid1-without-bitmap.patch queue-4.9/random-use-chacha20-for-get_random_int-long.patch queue-4.9/ptrace-fix-ptrace_listen-race-corrupting-task-state.patch queue-4.9/drm-vmwgfx-fix-integer-overflow-in-vmw_surface_define_ioctl.patch queue-4.9/pci-sort-the-list-of-devices-with-d3-delay-quirk-by-id.patch queue-4.9/pci-add-mcfg-quirks-for-x-gene-host-controller.patch queue-4.9/hid-i2c-hid-add-a-simple-quirk-to-fix-device-defects.patch queue-4.9/drm-msm-adreno-move-function-declarations-to-header-file.patch queue-4.9/s390-decompressor-fix-initrd-corruption-caused-by-bss-clear.patch queue-4.9/pci-disable-msi-for-hisilicon-hip06-hip07-root-ports.patch queue-4.9/mips-check-tlb-before-handle_ri_rdhwr-for-loongson-3.patch queue-4.9/pci-add-acs-quirk-for-intel-union-point.patch queue-4.9/asoc-intel-baytrail-add-quirk-for-lenovo-thinkpad-10.patch queue-4.9/can-flexcan-add-quirk-flexcan_quirk_enable_eacen_rrs.patch queue-4.9/metag-usercopy-drop-unused-macros.patch queue-4.9/pci-expand-vpd-access-disabled-quirk-message.patch queue-4.9/drm-i915-more-.is_mobile-cleanups-for-bdw.patch queue-4.9/hid-multitouch-enable-the-surface-4-type-cover-pro-jp-to-report-multitouch-data.patch queue-4.9/iio-bmg160-reset-chip-when-probing.patch queue-4.9/orangefs-move-features-validation-to-fix-filesystem-hang.patch queue-4.9/arm64-mm-unaligned-access-by-user-land-should-be-received-as-sigbus.patch queue-4.9/powerpc-don-t-try-to-fix-up-misaligned-load-with-reservation-instructions.patch queue-4.9/usb-chipidea-msm-rely-on-core-to-override-ahbburst.patch queue-4.9/scsi-ufs-refactor-device-descriptor-reading.patch queue-4.9/asoc-intel-bytcr_rt5640-quirks-for-insyde-devices.patch queue-4.9/mips-lantiq-fix-missing-xbar-kernel-panic.patch queue-4.9/metag-usercopy-zero-rest-of-buffer-from-copy_from_user.patch queue-4.9/xfs-honor-falloc_fl_keep_size-when-punching-ends-of-files.patch queue-4.9/hid-multitouch-enable-the-surface-3-type-cover-to-report-multitouch-data.patch queue-4.9/scsi-ufs-issue-link-starup-2-times-if-device-isn-t-active.patch queue-4.9/asoc-rt5670-add-missing-10ec5072-acpi-id.patch queue-4.9/metag-usercopy-fix-alignment-error-checking.patch queue-4.9/x86-reboot-quirks-add-asus-eeebook-x205ta-reboot-quirk.patch queue-4.9/input-gpio_keys-add-support-for-gpio-descriptors.patch queue-4.9/pci-xgene-fix-double-free-on-init-error.patch queue-4.9/acpi-save-nvs-memory-for-lenovo-g50-45.patch queue-4.9/asoc-intel-cht_bsw_rt5645-harden-acpi-device-detection.patch queue-4.9/sata-ahci-da850-implement-a-workaround-for-the-softreset-quirk.patch queue-4.9/reset-treeid-to-zero-on-smb2-tree_connect.patch queue-4.9/pci-add-acs-quirk-for-qualcomm-qdf2400-and-qdf2432.patch queue-4.9/tools-power-turbostat-decode-baytrail-cc6-and-mc6-demotion-configuration.patch queue-4.9/arm-davinci-pm-support-da8xx-dt-platforms.patch queue-4.9/documentation-stable-kernel-rules-fix-stable-tag-format.patch queue-4.9/drm-mga-remove-device_is_agp-callback.patch queue-4.9/usb-host-xhci-plat-enable-broken_ped-quirk-if-platform-requested.patch queue-4.9/mm-mempolicy.c-fix-error-handling-in-set_mempolicy-and-mbind.patch queue-4.9/pci-add-mcfg-quirks-for-qualcomm-qdf2432-host-controller.patch queue-4.9/amd-xgbe-prepare-for-working-with-more-than-one-type-of-phy.patch queue-4.9/arm-arm64-kvm-take-mmap_sem-in-stage2_unmap_vm.patch queue-4.9/mm-page_alloc.c-fix-print-order-in-show_free_areas.patch queue-4.9/usb-dwc3-host-pass-quirk-broken-port-ped-property-for-known-broken-revisions.patch queue-4.9/hid-usbhid-add-quirk-for-the-futaba-tosd-5711bb-vfd.patch queue-4.9/mmc-sdhci-msm-enable-few-quirks.patch queue-4.9/hid-usbhid-add-quirk-for-mayflash-dragonrise-dolphinbar.patch queue-4.9/arm-smccc-update-hvc-comment-to-describe-new-quirk-parameter.patch queue-4.9/hid-usbhid-add-quirks-for-mayflash-dragonrise-gamecube-and-ps3-adapters.patch queue-4.9/pci-thunder-pem-factor-out-resource-lookup.patch queue-4.9/pci-acpi-extend-pci_mcfg_lookup-to-return-ecam-config-accessors.patch queue-4.9/mips-c-r4k-fix-loongson-3-s-vcache-scache-waysize-calculation.patch queue-4.9/platform-x86-asus-wmi-set-specified-xusb2pr-value-for-x550lb.patch queue-4.9/drm-vmwgfx-avoid-calling-vzalloc-with-a-0-size-in-vmw_get_cap_3d_ioctl.patch queue-4.9/usb-xhci-add-quirk-flag-for-broken-ped-bits.patch queue-4.9/scsi-ufs-ensure-that-host-pa_tactivate-is-higher-than-device.patch queue-4.9/mips-force-o32-fp64-support-on-32bit-mips64r6-kernels.patch queue-4.9/arm-davinci-add-skeleton-for-pdata-quirks.patch queue-4.9/usb-dwc3-gadget-delay-unmap-of-bounced-requests.patch queue-4.9/x86-reboot-quirks-fix-typo-in-asus-eeebook-x205ta-reboot-quirk.patch queue-4.9/mips-add-mips_cpu_ftlb-for-loongson-3a-r2.patch queue-4.9/alsa-usb-audio-add-native-dsd-support-for-teac-501-503-dac.patch queue-4.9/kbuild-use-cc-disable-warning-consistently-for-maybe-uninitialized.patch queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch queue-4.9/pci-add-mcfg-quirks-for-hisilicon-hip05-06-07-host-controllers.patch queue-4.9/hid-microsoft-add-surface-4-type-cover-pro-4-not-jp-versions.patch queue-4.9/ppdev-fix-registering-same-device-name.patch queue-4.9/pci-add-mcfg-quirks-for-cavium-thunderx-pass2.x-host-controller.patch queue-4.9/x86-reboot-quirks-add-asus-eeebook-x205ta-w-reboot-quirk.patch queue-4.9/acpi-sysfs-provide-quirk-mechanism-to-prevent-gpe-flooding.patch queue-4.9/scsi-ufs-add-quirk-to-increase-host-pa_saveconfigtime.patch queue-4.9/drm-ttm-drm-vmwgfx-relax-permission-checking-when-opening-surfaces.patch queue-4.9/arm64-pci-add-local-struct-device-pointers.patch queue-4.9/drm-vmwgfx-null-pointer-dereference-in-vmw_surface_define_ioctl.patch queue-4.9/asoc-sun4i-i2s-add-quirks-to-handle-a31-compatible.patch