[PATCH] usbnet: prevent device rpm suspend in usbnet_probe function

2016-11-04 Thread Kai-Heng Feng
Sometimes cdc_mbim failed to probe if runtime pm is enabled: [9.305626] cdc_mbim: probe of 2-2:1.12 failed with error -22 This can be solved by increase its pm usage counter. Signed-off-by: Kai-Heng Feng --- drivers/net/usb/usbnet.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

Re: [PATCH] usbnet: prevent device rpm suspend in usbnet_probe function

2016-11-07 Thread Kai-Heng Feng
Hi, On Mon, Nov 7, 2016 at 7:02 PM, Oliver Neukum wrote: > On Fri, 2016-11-04 at 17:57 +0800, Kai-Heng Feng wrote: >> Sometimes cdc_mbim failed to probe if runtime pm is enabled: >> [9.305626] cdc_mbim: probe of 2-2:1.12 failed with error -22 >> >> This can be solv

Re: [PATCH] usbnet: prevent device rpm suspend in usbnet_probe function

2016-11-09 Thread Kai-Heng Feng
Hi, On Wed, Nov 9, 2016 at 8:32 PM, Bjørn Mork wrote: > Oliver Neukum writes: > >> On Tue, 2016-11-08 at 13:44 -0500, Alan Stern wrote: >> >>> These problems could very well be caused by running at SuperSpeed >>> (USB-3) instead of high speed (USB-2). Yes, it's running at SuperSpeed, on a Kabyl

Re: [PATCH] usbnet: prevent device rpm suspend in usbnet_probe function

2016-11-16 Thread Kai-Heng Feng
On Mon, Nov 14, 2016 at 3:34 PM, Kai-Heng Feng wrote: > On Fri, Nov 11, 2016 at 10:44 PM, Mathias Nyman > wrote: >> On 10.11.2016 13:22, Oliver Neukum wrote: >>> >>> On Thu, 2016-11-10 at 12:09 +0100, Bjørn Mork wrote: >>>> >>>> Kai-Heng Fe

Re: cdc_mbim: probe of 2-2:1.12 failed with error -22

2016-11-16 Thread Kai-Heng Feng
On Wed, Nov 16, 2016 at 6:47 PM, Greg KH wrote: > On Wed, Nov 16, 2016 at 06:42:27PM +0800, Kai-Heng Feng wrote: >> Originally I sent a not-working patch to the mailing list [1], turns >> out the patch is far from correct. >> >> Bjørn Mork suggests that we can cover t

Re: cdc_mbim: probe of 2-2:1.12 failed with error -22

2016-11-16 Thread Kai-Heng Feng
On Wed, Nov 16, 2016 at 6:56 PM, Kai-Heng Feng wrote: > On Wed, Nov 16, 2016 at 6:47 PM, Greg KH wrote: >> On Wed, Nov 16, 2016 at 06:42:27PM +0800, Kai-Heng Feng wrote: >>> Originally I sent a not-working patch to the mailing list [1], turns >>> out the patch is far

Titan Ridge xHCI may stop to working after re-plugging the dock

2019-07-09 Thread Kai-Heng Feng
Hi Mika and Mathias, I’ve filed a bug [1] which renders docking station unusable. I am not sure it's a bug in PCI, Thunderbolt or xHCI so raise the issue to you both. [1] https://bugzilla.kernel.org/show_bug.cgi?id=203885 Kai-Heng

Re: Titan Ridge xHCI may stop to working after re-plugging the dock

2019-07-19 Thread Kai Heng Feng
Hi Felipe, at 3:23 PM, Felipe Balbi wrote: Hi, Oliver Neukum writes: Am Dienstag, den 09.07.2019, 21:10 +0800 schrieb Kai-Heng Feng: Hi Mika and Mathias, I’ve filed a bug [1] which renders docking station unusable. I am not sure it's a bug in PCI, Thunderbolt or xHCI so raise the

Re: Titan Ridge xHCI may stop to working after re-plugging the dock

2019-07-22 Thread Kai-Heng Feng
Hi Felipe, at 18:51, Felipe Balbi wrote: Hi, Kai Heng Feng writes: Oliver Neukum writes: Am Dienstag, den 09.07.2019, 21:10 +0800 schrieb Kai-Heng Feng: Hi Mika and Mathias, I’ve filed a bug [1] which renders docking station unusable. I am not sure it's a bug in PCI, Thunderbo

Re: Titan Ridge xHCI may stop to working after re-plugging the dock

2019-07-25 Thread Kai-Heng Feng
at 22:45, Mathias Nyman wrote: On 22.7.2019 12.44, Kai-Heng Feng wrote: Hi Mika and Mathias, I’ve filed a bug [1] which renders docking station unusable. I am not sure it's a bug in PCI, Thunderbolt or xHCI so raise the issue to you both. [1] https://bugzilla.kernel.org/show_bug.c

Re: [PATCH v2] USB: Disable USB2 LPM at shutdown

2019-08-05 Thread Kai-Heng Feng
Hi Greg, at 17:22, Kai-Heng Feng wrote: at 22:17, Alan Stern wrote: I agree with Kai-Heng, this seems like a fairly light-weight solution to a reasonable problem. Thanks for your review. As to the issue of how much it will slow down system shutdowns, I have no idea. Probably not very

[RESEND] [PATCH v2] USB: Disable USB2 LPM at shutdown

2019-08-05 Thread Kai-Heng Feng
x27;t get enumerated even after a reboot. Disable LPM at shutdown to solve the issue. [1] https://bugs.launchpad.net/bugs/1757218 [2] https://patchwork.kernel.org/patch/10607097/ Signed-off-by: Kai-Heng Feng --- v2: Use new LPM helpers. drivers/usb/core/port.c | 9 + 1 file chang

Re: Titan Ridge xHCI may stop to working after re-plugging the dock

2019-08-12 Thread Kai-Heng Feng
Hi Mathias, at 21:24, Kai-Heng Feng wrote: at 22:45, Mathias Nyman wrote: [snipped] Yes, disabling runtime PM can workaround this issue. What’s next step here? Is it a firmware bug? Kai-Heng Kai-Heng -Mathias

[PATCH] xhci: Fix USB ports for Dell Inspiron 5775

2018-03-18 Thread Kai-Heng Feng
-port3: couldn't allocate usb_device AMD suggests that a delay before xHC suspends can fix the issue. I can confirm it fixes the issue, so use the suspend delay quirk for Raven Ridge's xHC. Cc: sta...@vger.kernel.org Signed-off-by: Kai-Heng Feng --- drivers/usb/host/xhci-pci.c | 5 +++

[PATCH v7] usb: core: Add "quirks" parameter for usbcore

2018-03-19 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. Also, the quirk parameter can XOR the builtin quirks for debugging purpose. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-Heng F

Re: [PATCH v6] usb: core: Add "quirks" parameter for usbcore

2018-03-19 Thread Kai Heng Feng
Kai Heng Feng wrote: Matthew Wilcox wrote: On Tue, Mar 13, 2018 at 03:26:19PM +0800, Kai-Heng Feng wrote: + usbcore.quirks= + [USB] A list of quirks entries to supplement or + override the built-in usb core quirk list. List

Re: [bug report] usb: core: Add "quirks" parameter for usbcore

2018-03-22 Thread Kai-Heng Feng
Hi Dan, Dan Carpenter wrote: Hello Kai-Heng Feng, This is a semi-automatic email about new static checker warnings. I ran Smatch but didn't see the error message: $ make -j`nproc` CHECK="~/smatch/smatch -p=kernel" C=1 bzImage modules | tee warns.txt`" Also, "v

[PATCH 2/2] usb: core: Add USB_QUIRK_DELAY_CTRL_MSG to usbcore quirks

2018-03-23 Thread Kai-Heng Feng
There's a new quirk, USB_QUIRK_DELAY_CTRL_MSG. Add it to usbcore quirks for completeness. Signed-off-by: Kai-Heng Feng --- Documentation/admin-guide/kernel-parameters.txt | 4 +++- drivers/usb/core/quirks.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-)

[PATCH 1/2] usb: core: Copy parameter string correctly and remove superfluous null check

2018-03-23 Thread Kai-Heng Feng
superfluous null check. This is found by Smatch. Fixes: 027bd6cafd9a ("usb: core: Add "quirks" parameter for usbcore") Cc: Dan Carpenter Signed-off-by: Kai-Heng Feng --- drivers/usb/core/quirks.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --gi

Re: [PATCH] xhci: Fix USB ports for Dell Inspiron 5775

2018-04-09 Thread Kai Heng Feng
Hi Matthias, On Mar 18, 2018, at 11:11 PM, Kai-Heng Feng wrote: The Dell Inspiron 5775 is a Raven Ridge. The Enable Slot command timed out when a USB device gets plugged: [ 212.156326] xhci_hcd :03:00.3: Error while assigning device slot ID [ 212.156340] xhci_hcd :03:00.3: Max

Re: [PATCH v6] xhci : AMD Promontory USB disable port support

2017-10-04 Thread Kai-Heng Feng
ay after you remove a device on >> that port and re-plug it in again. It's a known limitation of the chip. >> As a workaround we can clear the PORT_WAKE_BITS. >> >> Signed-off-by: Joe Lee >> >> --- > > > Kai-Heng Feng, > Do you have the time to c

[PATCH] usb: core: lower log level when device is not able to deal with string

2017-11-07 Thread Kai-Heng Feng
USB devices should work just fine when they don't support language id. Lower the log level so user won't panic in the future. BugLink: https://bugs.launchpad.net/bugs/1729618 Signed-off-by: Kai-Heng Feng --- drivers/usb/core/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH] usb: quirks: Add no-lpm quirk for KY-688 USB 3.1 Type-C Hub

2017-11-13 Thread Kai-Heng Feng
KY-688 USB 3.1 Type-C Hub internally uses a Genesys Logic hub to connect to Realtek r8153. Similar to commit ("7496cfe5431f2 usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter"), no-lpm can make r8153 ethernet work. Signed-off-by: Kai-Heng Feng --- drivers/usb/core/qu

[PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-22 Thread Kai-Heng Feng
.net/bugs/1729674 Cc: Mario Limonciello Signed-off-by: Kai-Heng Feng --- drivers/net/usb/r8152.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index d51d9abf7986..58b80b5e7803 100644 ---

Re: [PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-23 Thread Kai Heng Feng
> On 23 Nov 2017, at 3:58 PM, Greg KH wrote: > > On Thu, Nov 23, 2017 at 01:38:38AM -0500, Kai-Heng Feng wrote: >> r8153 on Dell TB dock corrupts rx packets. >> >> The root cause is not found yet, but disabling rx checksumming can >> workaround the issue. We

Re: [PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-23 Thread Kai Heng Feng
> On 23 Nov 2017, at 5:24 PM, Greg KH wrote: > > On Thu, Nov 23, 2017 at 04:53:41PM +0800, Kai Heng Feng wrote: >> >> What I want to do here is to finding this connection: >> Realtek r8153 <-> SMSC hub (USD ID: 0424:5537) <-> >> ASMedia XHCI cont

Re: [PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-24 Thread Kai Heng Feng
> On 24 Nov 2017, at 4:28 PM, Greg KH wrote: > > The bcdDevice is different between the dock device and the "real" > device, why not use that? Yea, I’ll poke around and see if bcdDevice alone can be a good predicate. > Then there is still a bug. Who as ASMedia is working on this, have they >

Re: [PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-24 Thread Kai Heng Feng
> Also the MAC address is different, can you just trigger off of Dell's > MAC address space instead of the address space of the dongle device? A really good idea, never thought of this. Thanks for the hint :) Still, I need to ask Dell folks to get all the answers. Kai-Heng -- To unsubscribe fro

Re: [PATCH] r8152: disable rx checksum offload on Dell TB dock

2017-11-28 Thread Kai Heng Feng
> On 27 Nov 2017, at 11:13 PM, > wrote: > > This is quite surprising to me too. The externally plugged in r8153 dongle, > was it connected over type C port or over type A port? AFAIK Type C port is > actually Alpine ridge pass through port. It is not connected to XHCI > controller > or US

Several issues on AMD Promontory [1022:43bb]

2017-12-03 Thread Kai-Heng Feng
Hi Joe, I’ve had several issues on AMD Promontory [1022:43bb] XHCI controller, apparently you are the right guy to ask ;) Board: ASUS PRIME B350M-A BIOS version: 3203 Here are the issues: 1. The port stops responding after plugging high speed devices several times. The XHCI resumes then immediat

Re: Several issues on AMD Promontory [1022:43bb]

2017-12-05 Thread Kai Heng Feng
> On 5 Dec 2017, at 4:52 PM, Joe Lee wrote: > > Hi Kai-Hen, > I want to know what this kernel version? v4.15-rc2. The issue happens on all kernel version though. > > >All three issue can still be reproduced with or without your patch, > >"[PATCH v8] xhci : AMD Promontory USB disable port supp

[PATCH] xhci: Fix front USB ports on ASUS PRIME B350M-A

2017-12-05 Thread Kai-Heng Feng
reset [ 549.116746] usb usb4: root hub lost power or was reset Based on previous guesswork, the issue can be workaround by doing PCI reset on [1b21:1343] (04:00.0). Cc: Joe Lee Signed-off-by: Kai-Heng Feng --- drivers/pci/quirks.c | 2 ++ drivers/usb/host/pci-quirks.c | 3 +++ 2 files chang

[PATCH] usb: core: Add "quirks" parameter for usbcore

2017-12-06 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-Heng Feng --- Documentation/admin-guide/kernel-parameters.txt | 55 +

Re: [PATCH] usb: core: Add "quirks" parameter for usbcore

2017-12-06 Thread Kai Heng Feng
> On 6 Dec 2017, at 5:13 PM, Greg KH wrote: > > On Wed, Dec 06, 2017 at 05:09:32PM +0800, Kai-Heng Feng wrote: >> +/* Works only for digits and letters, but small and fast */ >> +#define TOLOWER(x) ((x) | 0x20) > > What is wrong with the in-kernel version of tolow

[PATCH v2] usb: core: Add "quirks" parameter for usbcore

2017-12-06 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-Heng Feng --- v2: use in-kernel tolower() function. Documentation/admin-guide

Re: [PATCH] xhci: Fix front USB ports on ASUS PRIME B350M-A

2017-12-06 Thread Kai-Heng Feng
On Wed, Dec 6, 2017 at 1:14 AM, Bjorn Helgaas wrote: > [+cc Rafael, linux-pm] > > On Wed, Dec 06, 2017 at 12:22:42AM +0800, Kai-Heng Feng wrote: >> The board in question has three XHCI HCs: >> 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] USB 3.1 >>

Re: [PATCH v2] usb: core: Add "quirks" parameter for usbcore

2017-12-06 Thread Kai Heng Feng
> On 6 Dec 2017, at 10:10 PM, Greg KH wrote: > > On Wed, Dec 06, 2017 at 06:26:21PM +0800, Kai-Heng Feng wrote: >> Trying quirks in usbcore needs to rebuild the driver or the entire >> kernel if it's builtin. It can save a lot of time if usbcore has similar >> a

Re: [PATCH] usb: Add device quirk for Logitech HD Pro Webcam C925e

2017-12-18 Thread Kai-Heng Feng
Hi, > On 19 Dec 2017, at 12:04 AM, Dmitry Fleytman > wrote: > > From: Dmitry Fleytman Dmitry Fleytman > > Commit e0429362ab15 > ("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e") > introduced quirk to workaround an issue with some Logitech webcams. > > There is one more mo

[PATCH 2/2] usb: quirks: Add reset-resume quirk for Dell DW1820 QCA Rome Bluetooth

2017-12-20 Thread Kai-Heng Feng
inal issue, but we should do it before btusb_open(). Hence, add reset-resume quirk in usb core intead of btusb. Cc: sta...@vger.kernel.org Cc: Leif Liddy Cc: Matthias Kaehlcke Cc: Brian Norris Cc: Daniel Drake Signed-off-by: Kai-Heng Feng --- drivers/usb/core/quirks.c | 3 +++ 1 file

[PATCH 1/2] Revert "Bluetooth: btusb: fix QCA Rome suspend/resume"

2017-12-20 Thread Kai-Heng Feng
e/quirks.c. Cc: sta...@vger.kernel.org Cc: Leif Liddy Cc: Matthias Kaehlcke Cc: Brian Norris Cc: Daniel Drake Signed-off-by: Kai-Heng Feng --- Daniel, Cc you because this also affects your original quirk patch for Realtek btusb. drivers/bluetooth/btusb.c | 6 -- 1 file changed, 6 deletions(-)

Re: [PATCH 1/2] Revert "Bluetooth: btusb: fix QCA Rome suspend/resume"

2018-01-02 Thread Kai Heng Feng
> On 21 Dec 2017, at 7:43 PM, Daniel Drake wrote: > > On Wed, Dec 20, 2017 at 6:53 PM, Brian Norris > wrote: >> >> On Wed, Dec 20, 2017 at 07:00:07PM +0800, Kai-Heng Feng wrote: >>> This commit causes a regression on some QCA ROME chips. The USB devic

[PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-16 Thread Kai-Heng Feng
Mario Limonciello Signed-off-by: Kai-Heng Feng --- v2: - Disable RX aggregation instead of disable RX checksum - Use bcdDevice and iSerialNumber to uniquely identify Dell TB16 drivers/net/usb/r8152.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/usb/r8152.c b/driver

Re: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-17 Thread Kai Heng Feng
> On 18 Jan 2018, at 11:04 AM, Hayes Wang wrote: > > [...] >>> r8153 on Dell TB15/16 dock corrupts rx packets. >>> >>> This change is suggested by Realtek. They guess that the XHCI >>> controller doesn't have enough buffer, and their guesswork is correct, >>> once the RX aggregation gets disabl

Re: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-18 Thread Kai Heng Feng
> On 18 Jan 2018, at 10:50 PM, David Miller wrote: > > From: Hayes Wang > Date: Thu, 18 Jan 2018 03:04:08 + > >> [...] r8153 on Dell TB15/16 dock corrupts rx packets. This change is suggested by Realtek. They guess that the XHCI controller doesn't have enough buffer,

Paired bluetooth keyboards lead to system auto resume from S3 when WoL enabled for e1000e

2018-01-30 Thread Kai Heng Feng
Hi, This is actually a continuation of [1] with more findings. The machine in question is a CFL desktop. The auto resume roughly happens in 5 ~ 10 mins. After further digging, I found out that the e1000e and XHCI always shares the same wakeup count in /sys/kernel/debug/wakeup_sources, so I did so

Re: [PATCH] Add delay-init quirk for Corsair K70 RGB keyboards

2018-02-04 Thread Kai Heng Feng
> On 2 Feb 2018, at 11:51 PM, JackStocker wrote: > > From: Jack Stocker > > Following on from this patch: https://lkml.org/lkml/2017/11/3/516, > Corsair K70 RGB keyboards also require the DELAY_INIT quirk to > start correctly at boot. > > Device ids found here: > usb 3-3: New USB device foun

Re: [PATCH v2] Add delay-init quirk for Corsair K70 RGB keyboards

2018-02-04 Thread Kai Heng Feng
> On 5 Feb 2018, at 12:18 AM, JackStocker wrote: > > Do you mean like this? Yes, with proper commit message. > > Signed-off-by: JackStocker > --- > drivers/usb/core/quirks.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c > i

[PATCH v2] xhci: Fix front USB ports on ASUS PRIME B350M-A

2018-02-19 Thread Kai-Heng Feng
;t suspend (hcd_pci_runtime_suspend returned -110) Delay before running xHC command CMD_RUN can workaround the issue. Use a new quirk to make the delay only targets to the affected xHC. Signed-off-by: Kai-Heng Feng --- v2: Instead of doing xHC reset and disabling D3cold, a simple delay can workaround the issue

Re: [PATCH v2] xhci: Fix front USB ports on ASUS PRIME B350M-A

2018-02-20 Thread Kai-Heng Feng
> On 20 Feb 2018, at 4:24 PM, Mathias Nyman > wrote: > > Hi > > On 19.02.2018 21:06, Kai-Heng Feng wrote: >> When a USB device gets plugged on ASUS PRIME B350M-A's front ports, the >> xHC stops working: >> [ 549.114587] xhci_hcd :02:00.0: W

[PATCH v3] usb: core: Add "quirks" parameter for usbcore

2018-02-25 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. Also, the quirk parameter can XOR the builtin quirks for debugging purpose. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-Heng Fe

Re: [PATCH v3] usb: core: Add "quirks" parameter for usbcore

2018-02-25 Thread Kai-Heng Feng
On Sun, Feb 25, 2018 at 11:18 PM, Matthew Wilcox wrote: > On Sun, Feb 25, 2018 at 08:38:33PM +0800, Kai-Heng Feng wrote: >> v2: Use in-kernel tolower() function. > > ... why are you using tolower at all? > > You've got 13 quirks already; you may need to use upper case

[PATCH v4] usb: core: Add "quirks" parameter for usbcore

2018-02-26 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. Also, the quirk parameter can XOR the builtin quirks for debugging purpose. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-

Re: [PATCH v4] usb: core: Add "quirks" parameter for usbcore

2018-02-28 Thread Kai Heng Feng
On 28 Feb 2018, at 10:47 PM, Matthew Wilcox wrote: On Mon, Feb 26, 2018 at 11:04:57PM +0800, Kai-Heng Feng wrote: +static char quirks_param[128]; +module_param_string(quirks, quirks_param, sizeof(quirks_param), 0644); +MODULE_PARM_DESC(quirks, "Add/modify USB quirks by specifying q

Re: [PATCH v2] xhci: Fix front USB ports on ASUS PRIME B350M-A

2018-03-06 Thread Kai Heng Feng
Hi Matthias, Do you have any concern about this patch? Hopefully this can get merged for v4.16… Kai-Heng -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.ht

[PATCH v5] usb: core: Add "quirks" parameter for usbcore

2018-03-07 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. Also, the quirk parameter can XOR the builtin quirks for debugging purpose. This is inspired by usbhid and usb-storage. Signed-off-by: Kai-Heng F

Re: [PATCH 4/4] xhci: Fix front USB ports on ASUS PRIME B350M-A

2018-03-08 Thread Kai Heng Feng
Hi, On Mar 9, 2018, at 1:06 AM, Greg KH wrote: On Thu, Mar 08, 2018 at 05:17:17PM +0200, Mathias Nyman wrote: From: Kai-Heng Feng When a USB device gets plugged on ASUS PRIME B350M-A's front ports, the xHC stops working: [ 549.114587] xhci_hcd :02:00.0: WARN: xHC CMD_RUN ti

[PATCH v6] usb: core: Add "quirks" parameter for usbcore

2018-03-13 Thread Kai-Heng Feng
troduce this new "dynamic" function. Now users can use "usbcore.quirks=" as short term workaround before the next kernel release. Also, the quirk parameter can XOR the builtin quirks for debugging purpose. This is inspired by usbhid and usb-storage. Signed-off-by: K

Re: [PATCH v6] usb: core: Add "quirks" parameter for usbcore

2018-03-13 Thread Kai Heng Feng
Matthew Wilcox wrote: On Tue, Mar 13, 2018 at 03:26:19PM +0800, Kai-Heng Feng wrote: + usbcore.quirks= + [USB] A list of quirks entries to supplement or + override the built-in usb core quirk list. List + entries are

Runtime PM enabled EHCI does not respond to device plugging.

2017-05-18 Thread Kai-Heng Feng
Hi, This issue happens on Carrizo AMD laptops, only EHCI is affected, XHCI works fine on the same machine. I can see lots of USB wakeup and resume messages showed every two seconds. Plug USB devices to the EHCI port does not change anything. dmesg with ehci-hcd, ehci-pci and usbcore dynamic debu

Re: Runtime PM enabled EHCI does not respond to device plugging.

2017-05-21 Thread Kai-Heng Feng
Hi, On Sat, May 20, 2017 at 12:13 AM, Alan Stern wrote: [snip] > > Your log shows that the 2-1.1 device is a USB2.0-CRW card reader, and > it uses the rtsx_usb driver. This driver probes the reader every few > seconds to see whether a card has been inserted (actually, it probes > _twice_: once t

Re: Runtime PM enabled EHCI does not respond to device plugging.

2017-05-22 Thread Kai-Heng Feng
On Tue, May 23, 2017 at 3:21 AM, Alan Stern wrote: > On Mon, 22 May 2017, Kai-Heng Feng wrote: > >> So in order to detect SD card under runtime PM, it's a perfectly >> normal behavior, right? > > Yes. Thanks for the info. > >> Sorry for not explaining t

Re: Runtime PM enabled EHCI does not respond to device plugging.

2017-05-23 Thread Kai-Heng Feng
On Wed, May 24, 2017 at 12:43 AM, Alan Stern wrote: >> >> Output of `cat /sys/kernel/debug/usb/usbmon/1u`: >> Runtime PM disabled as attachment. > > When you say "runtime PM disabled", you mean that it is disabled for > the EHCI controller but enabled for other devices, right? Yes, disabled for t

Re: Runtime PM enabled EHCI does not respond to device plugging.

2017-05-25 Thread Kai-Heng Feng
On Wed, May 24, 2017 at 11:34 PM, Alan Stern wrote: > On Wed, 24 May 2017, Kai-Heng Feng wrote: > >> On Wed, May 24, 2017 at 12:43 AM, Alan Stern >> wrote: >> >> >> >> Output of `cat /sys/kernel/debug/usb/usbmon/1u`: >> >> Runtime PM disa

Re: Runtime PM enabled EHCI does not respond to device plugging.

2017-05-25 Thread Kai-Heng Feng
On Fri, May 26, 2017 at 1:01 AM, Alan Stern wrote: > On Thu, 25 May 2017, Kai-Heng Feng wrote: > >> > My mistake; we need to see the information from "lspci -vv -s 00:12.0" >> > with two "v"'s, not just one. >> >> Before wakeup: >

[PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-09 Thread Kai-Heng Feng
d-off-by: Kai-Heng Feng --- drivers/usb/host/ehci-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 93326974ff4b..616685f83954 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -181,6 +181,8 @@ s

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-12 Thread Kai-Heng Feng
On Fri, Jun 9, 2017 at 10:43 PM, Alan Stern wrote: > On Fri, 9 Jun 2017, Kai-Heng Feng wrote: > >> As Alan Stern points out [1], the PME signal is not enabled when >> controller is in D3, therefore it's not being woken up when new deivces >> get plugged in. >> &

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-12 Thread Kai-Heng Feng
On Mon, Jun 12, 2017 at 3:04 PM, Kai-Heng Feng wrote: > On Fri, Jun 9, 2017 at 10:43 PM, Alan Stern wrote: >> On Fri, 9 Jun 2017, Kai-Heng Feng wrote: >> >> Is this really the right solution? Maybe it would be better to allow >> the controller to go into D3 provided

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-12 Thread Kai-Heng Feng
D3 when it should. For "lspci -vv" output, see > > http://marc.info/?l=linux-usb&m=149570231732519&w=2 > > On Mon, 12 Jun 2017, Kai-Heng Feng wrote: > >> On Mon, Jun 12, 2017 at 3:04 PM, Kai-Heng Feng >> wrote: >> > On Fri, Jun 9, 2017

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-14 Thread Kai-Heng Feng
On Wed, Jun 14, 2017 at 1:28 AM, Bjorn Helgaas wrote: > > The lspci output [1] shows: > > 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI > Controller (rev 39) (prog-if 20 [EHCI]) > Capabilities: [c0] Power Management version 2 > Flags: PMEClk- DSI- D1+ D2+ Aux

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-15 Thread Kai-Heng Feng
On Thu, Jun 15, 2017 at 2:55 AM, Alan Stern wrote: > On Tue, 13 Jun 2017, Bjorn Helgaas wrote: > >> [+cc Rafael, linux-pm] >> >> On Tue, Jun 13, 2017 at 12:21:15PM +0800, Kai-Heng Feng wrote: >> > On Mon, Jun 12, 2017 at 10:18 PM, Alan Stern >> > wro

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-15 Thread Kai-Heng Feng
On Thu, Jun 15, 2017 at 10:12 PM, Alan Stern wrote: > On Thu, 15 Jun 2017, Kai-Heng Feng wrote: > >> On Wed, Jun 14, 2017 at 1:28 AM, Bjorn Helgaas wrote: >> > >> > The lspci output [1] shows: >> > >> > 00:12.0 USB controller: Advanced Micro D

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-16 Thread Kai-Heng Feng
On Fri, Jun 16, 2017 at 11:07 AM, Kai-Heng Feng wrote: > On Thu, Jun 15, 2017 at 10:12 PM, Alan Stern > wrote: >> Those documents refer to a hardware bug with a workaround in the BIOS. >> Have you checked to see if your BIOS is up to date? > > Yes, it's up to dat

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-18 Thread Kai-Heng Feng
On Sat, Jun 17, 2017 at 1:30 AM, Alan Stern wrote: > On Sat, 17 Jun 2017, Kai-Heng Feng wrote: > >> On Fri, Jun 16, 2017 at 11:07 AM, Kai-Heng Feng >> wrote: >> > On Thu, Jun 15, 2017 at 10:12 PM, Alan Stern >> > wrote: >> >> Those documents

Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller

2017-06-19 Thread Kai-Heng Feng
On Tue, Jun 20, 2017 at 2:32 AM, Alan Stern wrote: > > It's possible that the test was invalid. Kai-Heng did not say whether > /sys/.../power/wakeup was set to "enabled" for both the EHCI controller > and the USB root hub beneath it, before the test was started. If > either of them was set to "d

[PATCH] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter

2017-08-04 Thread Kai-Heng Feng
The Realtek r8153 ethernet does not work on Genesys Logic hub, no-lpm quirk can make it work. Since another r8153 dongle at my hand does not have the issue, so add the quirk to the hub instead. Signed-off-by: Kai-Heng Feng --- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions

Re: [PATCH] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter

2017-08-07 Thread Kai-Heng Feng
On Mon, Aug 7, 2017 at 5:08 PM, Oliver Neukum wrote: > Am Freitag, den 04.08.2017, 17:34 +0800 schrieb Kai-Heng Feng: >> The Realtek r8153 ethernet does not work on Genesys Logic hub, no-lpm >> quirk can make it work. > > So can you confirm it works with LPM on another hub

[PATCH v2] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter

2017-08-07 Thread Kai-Heng Feng
-off-by: Kai-Heng Feng --- v2: Clarify that the adapter uses a hub internally. drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 3116edfcdc18..c96daf34431e 100644 --- a/drivers/usb/core/quirks.c +++ b

Re: [PATCH v2] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter

2017-08-08 Thread Kai-Heng Feng
On Tue, Aug 8, 2017 at 4:28 PM, Oliver Neukum wrote: > Am Dienstag, den 08.08.2017, 14:32 +0800 schrieb Kai-Heng Feng: >> Moshi USB to Ethernet Adapter internally uses a Genesys Logic hub to >> connect to Realtek r8153. >> >> The Realtek r8153 ethernet does not work

[PATCH v3] usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter

2017-08-08 Thread Kai-Heng Feng
instead. Signed-off-by: Kai-Heng Feng --- v3: Update comment to reflect the quirk is for the hub. v2: Clarify that the adapter uses a hub internally. drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index

Runtime PM enabled USB port no longer responses to hotplug after commit dec08194ff

2017-08-11 Thread Kai-Heng Feng
Hi, My ASUS PRIME B350M-A uses this XHCI chip: 03:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] USB 3.1 XHCI Controller [1022:43bb] (rev 02) ...which matches to the PCI_DEVICE_ID_AMD_PROMONTORYA_2. Revert commit dec08194ffeccfa1cf085906b53d301930eae18f ("xhci: Limit USB2 port w

[PATCH] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard

2017-08-15 Thread Kai-Heng Feng
issue. Hence add the quirk for Corsair Strafe RGB. BugLink: https://bugs.launchpad.net/bugs/1678477 Signed-off-by: Kai-Heng Feng --- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 574da2b4529c..1ea5060dae69

[PATCH] usb: xhci: Renesas uPD720202 needs short TX quirk

2017-08-17 Thread Kai-Heng Feng
? [77122.622952] handle_tx_event: 541 callbacks suppressed No more warning messages with XHCI_TRUST_TX_LENGTH applied. BugLink: https://bugs.launchpad.net/bugs/1710548 Signed-off-by: Kai-Heng Feng --- drivers/usb/host/xhci-pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH] usb: xhci: Renesas uPD720202 needs short TX quirk

2017-08-18 Thread Kai-Heng Feng
Hi, On Fri, Aug 18, 2017 at 3:22 PM, Felipe Balbi wrote: > > hi, > > Kai-Heng Feng writes: >> When plugging Logitech C920 webcam, warning messages filled up dmesg: >> [77117.655018] xhci_hcd :0c:00.0: WARN Successful completion on short >> TX: ne

[PATCH] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"

2017-08-22 Thread Kai-Heng Feng
fected, so revert the commit. Conflicts: drivers/usb/host/xhci-pci.c drivers/usb/host/xhci.h Signed-off-by: Kai-Heng Feng --- drivers/usb/host/xhci-hub.c | 3 --- drivers/usb/host/xhci-pci.c | 12 drivers/usb/host/xhci.h | 2 +- 3 files changed, 1 insert

Re: [PATCH] usb: Add device quirk for Logitech HD Pro Webcam C920-C

2017-08-24 Thread Kai-Heng Feng
On Mon, Aug 21, 2017 at 6:03 PM, Dmitry Fleytman wrote: > Commit e0429362ab15 > ("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e") > introduced quirk to workaround an issue with some Logitech webcams. > > Apparently model C920-C has the same issue so applying > the same quirk as

Re: [PATCH] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"

2017-08-28 Thread Kai-Heng Feng
On Mon, Aug 28, 2017 at 6:14 PM, Mathias Nyman wrote: > On 28.08.2017 12:29, Greg KH wrote: >> >> On Tue, Aug 22, 2017 at 05:14:47PM +0800, Kai-Heng Feng wrote: >>> >>> This reverts commit dec08194ffeccfa1cf085906b53d301930eae18f. >>> >>> Commi

Re: [PATCH] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"

2017-09-15 Thread Kai-Heng Feng
On Mon, Aug 28, 2017 at 9:56 PM, Kai-Heng Feng wrote: > On Mon, Aug 28, 2017 at 6:14 PM, Mathias Nyman > wrote: >> On 28.08.2017 12:29, Greg KH wrote: >> >> Adding more people who were involved in the original patch. >> >> Users are now seeing the unrespons

Re: [PATCH v6] xhci : AMD Promontory USB disable port support

2017-09-26 Thread Kai-Heng Feng
remove a device on >> that port and re-plug it in again. It's a known limitation of the chip. >> As a workaround we can clear the PORT_WAKE_BITS. >> >> Signed-off-by: Joe Lee >> >> --- Hi Mathias, > > > Kai-Heng Feng, > Do you have the time to

Re: [1/5] xhci: Fix perceived dead host due to runtime suspend race with event handler

2018-07-11 Thread Kai-Heng Feng
Hi Mathias, at 21:19, Mathias Nyman wrote: Don't rely on event interrupt (EINT) bit alone to detect pending port change in resume. If no change event is detected the host may be suspended again, oterwise roothubs are resumed. There is a lag in xHC setting EINT. If we don't notice the pending

[PATCH 0/5 v3] Keep rtsx_usb suspended when there's no card

2018-07-25 Thread Kai-Heng Feng
Hi, This is based on Ulf's work [1] [2]. This patch series can keep rtsx_usb suspended, to save ~0.5W on Intel platforms and ~1.5W on AMD platforms. [1] https://patchwork.kernel.org/patch/10440583/ [2] https://patchwork.kernel.org/patch/10445725/ Kai-Heng Feng (5): misc: rtsx_usb: Us

[PATCH 3/5] memstick: rtsx_usb_ms: Use ms_dev() helper

2018-07-25 Thread Kai-Heng Feng
Use ms_dev() helper for consistency. Signed-off-by: Kai-Heng Feng --- drivers/memstick/host/rtsx_usb_ms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c index 4f64563df7de..cd12f3d1c088 100644

[PATCH 2/5] memstick: Prevent memstick host from getting runtime suspended during card detection

2018-07-25 Thread Kai-Heng Feng
rs on, so the host can be inadvertently suspended. Increment rpm count before calling memstick_check(), and decrement rpm count afterward, as now we are sure the memstick host should be suspended or not. Signed-off-by: Kai-Heng Feng --- drivers/memstick/core/memstick.c | 4 1 file chang

[PATCH 4/5] memstick: rtsx_usb_ms: Support runtime power management

2018-07-25 Thread Kai-Heng Feng
ection function from kthread to delayed_work, which can be scheduled when the host is resumed and can be canceled when the host is suspended. Use an idle function check if there's no card and the power mode is MEMSTICK_POWER_OFF. If both criteria are met, put the device to suspend. Signed-o

[PATCH 5/5] misc: rtsx_usb: / memstick: rtsx_usb_ms: Avoid long delay before system suspend

2018-07-25 Thread Kai-Heng Feng
There's a long power-on delay at the end of rtsx_usb_ms_set_param(). This delay is noticeable right before system suspend. To prevent already suspended memstick host from getting powered on by PM core, use DPM_FLAG_SMART_SUSPEND to avoid the situation. Signed-off-by: Kai-Heng Feng --- dr

[PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection

2018-07-25 Thread Kai-Heng Feng
Although rtsx_usb doesn't support card removal detection, card insertion will resume rtsx_usb by USB remote wakeup signaling. When rtsx_usb gets resumed, also resumes its child devices, rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there's a card in its slot. Signed-off-by: Kai

Re: [PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection

2018-09-13 Thread Kai-Heng Feng
Hi Alan, Ulf, at 14:17, Kai-Heng Feng wrote: Although rtsx_usb doesn't support card removal detection, card insertion will resume rtsx_usb by USB remote wakeup signaling. When rtsx_usb gets resumed, also resumes its child devices, rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there

Re: [PATCH] usb: core: safely deal with the dynamic quirk lists

2018-09-17 Thread Kai-Heng Feng
Signed-off-by: Harry Pan Thanks for the catch! This issue doesn't appear when usbcore is built as module. Acked-by: Kai-Heng Feng --- drivers/usb/core/quirks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c in

Re: [PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection

2018-09-17 Thread Kai-Heng Feng
at 21:41, Alan Stern wrote: On Thu, 13 Sep 2018, Kai-Heng Feng wrote: I am working on the next version of this series, and the last missing puzzle is to differentiate system-wide resume from runtime resume in usb_driver's resume() and reset_resume() callback. The parent device, rts

[PATCH] usb: core: Check portchange C_PORT_RESET after resetting

2018-10-02 Thread Kai-Heng Feng
that port. When the reset signaling is complete, the hub sets the C_PORT_RESET status change and immediately enables the port." So let's also check C_PORT_RESET for reset completion. Signed-off-by: Kai-Heng Feng --- drivers/usb/core/hub.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH] USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub

2018-10-18 Thread Kai-Heng Feng
igned-off-by: Kai-Heng Feng --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ drivers/usb/core/hub.c | 5 + drivers/usb/core/quirks.c | 6 ++ include/linux/usb/quirks.h | 3 +++ 4 files changed, 16 insertions(+)

  1   2   >