Linux USB
 help / color / mirror / Atom feed
* [PATCH v2] usb: Fix problem with xhci resume from suspend
@ 2024-09-19 18:42 Jose Alberto Reguero
  2024-09-19 19:18 ` Sergey Shtylyov
  2024-09-19 19:22 ` Sergey Shtylyov
  0 siblings, 2 replies; 6+ messages in thread
From: Jose Alberto Reguero @ 2024-09-19 18:42 UTC (permalink / raw)
  To: Greg KH, linux-usb, Mathias Nyman, jose.alberto.reguero

I have a ASUS PN51 S mini pc that has two xhci devices. One from AMD, and other
from ASMEDIA. The one from ASMEDIA have problems when resume from suspend, and
keep broken until unplug the  power cord. I use this kernel parameter:
xhci-hcd.quirks=128 and then it works ok. I make a path to reset only the
ASMEDIA xhci. 


Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com>

---
 drivers/usb/host/xhci-pci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index dc1e345ab67e..8f075ab63f65 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -76,6 +76,7 @@
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
 #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI			0x1242
 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI			0x2142
+#define PCI_DEVICE_ID_ASMEDIA_3042_XHCI			0x3042
 #define PCI_DEVICE_ID_ASMEDIA_3242_XHCI			0x3242
 
 static const char hcd_name[] = "xhci_hcd";
@@ -447,6 +448,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
 
+	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
+		xhci->quirks |= XHCI_RESET_ON_RESUME;
+
 	if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
 		xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: Fix problem with xhci resume from suspend
  2024-09-19 18:42 [PATCH v2] usb: Fix problem with xhci resume from suspend Jose Alberto Reguero
@ 2024-09-19 19:18 ` Sergey Shtylyov
  2024-09-23 21:39   ` Jose Alberto Reguero
  2024-09-19 19:22 ` Sergey Shtylyov
  1 sibling, 1 reply; 6+ messages in thread
From: Sergey Shtylyov @ 2024-09-19 19:18 UTC (permalink / raw)
  To: Jose Alberto Reguero, Greg KH, linux-usb, Mathias Nyman

On 9/19/24 21:42, Jose Alberto Reguero wrote:

> I have a ASUS PN51 S mini pc that has two xhci devices. One from AMD, and other
> from ASMEDIA. The one from ASMEDIA have problems when resume from suspend, and
> keep broken until unplug the  power cord. I use this kernel parameter:
> xhci-hcd.quirks=128 and then it works ok. I make a path to reset only the
> ASMEDIA xhci. 
> 
> 
> Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com>
> 
> ---
>  drivers/usb/host/xhci-pci.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index dc1e345ab67e..8f075ab63f65 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
[...]
> @@ -447,6 +448,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
>  		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
>  		xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
>  
> +	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
> +		pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)

   Hum, please either add 1 more tab here or start the continuation line
under pdev jn the broken up line. The *if* expression should not blend with
code in the branch.

> +		xhci->quirks |= XHCI_RESET_ON_RESUME;
> +
>  	if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
>  		xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;

MBR, Sergey

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: Fix problem with xhci resume from suspend
  2024-09-19 18:42 [PATCH v2] usb: Fix problem with xhci resume from suspend Jose Alberto Reguero
  2024-09-19 19:18 ` Sergey Shtylyov
@ 2024-09-19 19:22 ` Sergey Shtylyov
  2024-09-23 21:43   ` Jose Alberto Reguero
  1 sibling, 1 reply; 6+ messages in thread
From: Sergey Shtylyov @ 2024-09-19 19:22 UTC (permalink / raw)
  To: Jose Alberto Reguero, Greg KH, linux-usb, Mathias Nyman

The subject doesn't look well yet, consider s/th like:

usb: host: xhci-pci: fix problem with resuming from suspend

MBR, Sergey

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: Fix problem with xhci resume from suspend
  2024-09-19 19:18 ` Sergey Shtylyov
@ 2024-09-23 21:39   ` Jose Alberto Reguero
  2024-10-04 13:40     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Alberto Reguero @ 2024-09-23 21:39 UTC (permalink / raw)
  To: Sergey Shtylyov, Greg KH, linux-usb, Mathias Nyman


El 19/09/2024 a las 21:18, Sergey Shtylyov escribió:
> On 9/19/24 21:42, Jose Alberto Reguero wrote:
>
>> I have a ASUS PN51 S mini pc that has two xhci devices. One from AMD, and other
>> from ASMEDIA. The one from ASMEDIA have problems when resume from suspend, and
>> keep broken until unplug the  power cord. I use this kernel parameter:
>> xhci-hcd.quirks=128 and then it works ok. I make a path to reset only the
>> ASMEDIA xhci.
>>
>>
>> Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com>
>>
>> ---
>>   drivers/usb/host/xhci-pci.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
>> index dc1e345ab67e..8f075ab63f65 100644
>> --- a/drivers/usb/host/xhci-pci.c
>> +++ b/drivers/usb/host/xhci-pci.c
> [...]
>> @@ -447,6 +448,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
>>   		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
>>   		xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
>>   
>> +	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
>> +		pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
>     Hum, please either add 1 more tab here or start the continuation line
> under pdev jn the broken up line. The *if* expression should not blend with
> code in the branch.

I do in the next version.

Thanks for reviewing.

>> +		xhci->quirks |= XHCI_RESET_ON_RESUME;
>> +
>>   	if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
>>   		xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
> MBR, Sergey
Jose Alberto Reguero

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: Fix problem with xhci resume from suspend
  2024-09-19 19:22 ` Sergey Shtylyov
@ 2024-09-23 21:43   ` Jose Alberto Reguero
  0 siblings, 0 replies; 6+ messages in thread
From: Jose Alberto Reguero @ 2024-09-23 21:43 UTC (permalink / raw)
  To: Sergey Shtylyov, Greg KH, linux-usb, Mathias Nyman

El 19/09/2024 a las 21:22, Sergey Shtylyov escribió:
> The subject doesn't look well yet, consider s/th like:
>
> usb: host: xhci-pci: fix problem with resuming from suspend
>
> MBR, Sergey

I look at it in the next version.

Thanks for reviewing.

Jose Alberto Reguero


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] usb: Fix problem with xhci resume from suspend
  2024-09-23 21:39   ` Jose Alberto Reguero
@ 2024-10-04 13:40     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2024-10-04 13:40 UTC (permalink / raw)
  To: Jose Alberto Reguero; +Cc: Sergey Shtylyov, linux-usb, Mathias Nyman

On Mon, Sep 23, 2024 at 11:39:23PM +0200, Jose Alberto Reguero wrote:
> 
> El 19/09/2024 a las 21:18, Sergey Shtylyov escribió:
> > On 9/19/24 21:42, Jose Alberto Reguero wrote:
> > 
> > > I have a ASUS PN51 S mini pc that has two xhci devices. One from AMD, and other
> > > from ASMEDIA. The one from ASMEDIA have problems when resume from suspend, and
> > > keep broken until unplug the  power cord. I use this kernel parameter:
> > > xhci-hcd.quirks=128 and then it works ok. I make a path to reset only the
> > > ASMEDIA xhci.
> > > 
> > > 
> > > Signed-off-by: Jose Alberto Reguero <jose.alberto.reguero@gmail.com>
> > > 
> > > ---
> > >   drivers/usb/host/xhci-pci.c | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> > > index dc1e345ab67e..8f075ab63f65 100644
> > > --- a/drivers/usb/host/xhci-pci.c
> > > +++ b/drivers/usb/host/xhci-pci.c
> > [...]
> > > @@ -447,6 +448,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
> > >   		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
> > >   		xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
> > > +	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
> > > +		pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
> >     Hum, please either add 1 more tab here or start the continuation line
> > under pdev jn the broken up line. The *if* expression should not blend with
> > code in the branch.
> 
> I do in the next version.

No need, I fixed this up already and applied it, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-04 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 18:42 [PATCH v2] usb: Fix problem with xhci resume from suspend Jose Alberto Reguero
2024-09-19 19:18 ` Sergey Shtylyov
2024-09-23 21:39   ` Jose Alberto Reguero
2024-10-04 13:40     ` Greg KH
2024-09-19 19:22 ` Sergey Shtylyov
2024-09-23 21:43   ` Jose Alberto Reguero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox