All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
@ 2016-01-07 17:23 Babu Moger
  2016-01-07 17:29 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Babu Moger @ 2016-01-07 17:23 UTC (permalink / raw)
  To: mathias.nyman; +Cc: gregkh, linux-usb, linux-kernel, babu.moger

I have never seen auto handoff working on TI and RENESAS cards.
Eventually, we force handoff. This code forces the handoff
unconditionally. It saves 5 seconds boot time for each card.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
---
 drivers/usb/host/pci-quirks.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index f940056..b7ee895 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1003,6 +1003,13 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
 	} while (1);
 
+	/* Auto handoff never worked for these devices. Force it and continue */
+	if (pdev->vendor == PCI_VENDOR_ID_TI ||
+			pdev->vendor == PCI_VENDOR_ID_RENESAS) {
+		val  =  (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
+		writel(val, base + ext_cap_offset);
+	}
+
 	/* If the BIOS owns the HC, signal that the OS wants it, and wait */
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
-- 
1.7.1


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

* Re: [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-07 17:23 [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers Babu Moger
@ 2016-01-07 17:29 ` Greg KH
  2016-01-07 17:51   ` Babu Moger
  2016-01-08  0:04 ` [PATCH v2] " Babu Moger
  2016-01-08 15:39 ` Babu Moger
  2 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2016-01-07 17:29 UTC (permalink / raw)
  To: Babu Moger; +Cc: mathias.nyman, linux-usb, linux-kernel

On Thu, Jan 07, 2016 at 09:23:27AM -0800, Babu Moger wrote:
> I have never seen auto handoff working on TI and RENESAS cards.
> Eventually, we force handoff. This code forces the handoff
> unconditionally. It saves 5 seconds boot time for each card.
> 
> Signed-off-by: Babu Moger <babu.moger@oracle.com>
> ---
>  drivers/usb/host/pci-quirks.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index f940056..b7ee895 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -1003,6 +1003,13 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
>  		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
>  	} while (1);
>  
> +	/* Auto handoff never worked for these devices. Force it and continue */
> +	if (pdev->vendor == PCI_VENDOR_ID_TI ||
> +			pdev->vendor == PCI_VENDOR_ID_RENESAS) {
> +		val  =  (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;

odd spaces here, why this format?

And are you sure that all TI and Renesas host controllers have this
issue?  That's a very wide and broad test you are making here...

thanks,

greg k-h

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

* Re: [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-07 17:29 ` Greg KH
@ 2016-01-07 17:51   ` Babu Moger
  2016-01-07 18:28     ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Babu Moger @ 2016-01-07 17:51 UTC (permalink / raw)
  To: Greg KH; +Cc: mathias.nyman, linux-usb, linux-kernel

On 1/7/2016 11:29 AM, Greg KH wrote:
> On Thu, Jan 07, 2016 at 09:23:27AM -0800, Babu Moger wrote:
>> I have never seen auto handoff working on TI and RENESAS cards.
>> Eventually, we force handoff. This code forces the handoff
>> unconditionally. It saves 5 seconds boot time for each card.
>>
>> Signed-off-by: Babu Moger <babu.moger@oracle.com>
>> ---
>>  drivers/usb/host/pci-quirks.c |    7 +++++++
>>  1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
>> index f940056..b7ee895 100644
>> --- a/drivers/usb/host/pci-quirks.c
>> +++ b/drivers/usb/host/pci-quirks.c
>> @@ -1003,6 +1003,13 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
>>  		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
>>  	} while (1);
>>  
>> +	/* Auto handoff never worked for these devices. Force it and continue */
>> +	if (pdev->vendor == PCI_VENDOR_ID_TI ||
>> +			pdev->vendor == PCI_VENDOR_ID_RENESAS) {
>> +		val  =  (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
> 
> odd spaces here, why this format?

 Thanks. I will fix this. checkpatch.pl did not catch it.

> 
> And are you sure that all TI and Renesas host controllers have this
> issue?  That's a very wide and broad test you are making here...

 True, that is broad. I have tested these cards. I can probably add both vendor
 and device id combination.
 # lspci  -nn |grep -i usb
 0002:03:00.0 USB controller [0c03]: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller [104c:8241] (rev 02)
 0000:05:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller [1912:0014] (rev 03)
 
> 
> thanks,
> 
> greg k-h
> 

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

* Re: [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-07 17:51   ` Babu Moger
@ 2016-01-07 18:28     ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2016-01-07 18:28 UTC (permalink / raw)
  To: Babu Moger; +Cc: mathias.nyman, linux-usb, linux-kernel

On Thu, Jan 07, 2016 at 11:51:21AM -0600, Babu Moger wrote:
> On 1/7/2016 11:29 AM, Greg KH wrote:
> > On Thu, Jan 07, 2016 at 09:23:27AM -0800, Babu Moger wrote:
> >> I have never seen auto handoff working on TI and RENESAS cards.
> >> Eventually, we force handoff. This code forces the handoff
> >> unconditionally. It saves 5 seconds boot time for each card.
> >>
> >> Signed-off-by: Babu Moger <babu.moger@oracle.com>
> >> ---
> >>  drivers/usb/host/pci-quirks.c |    7 +++++++
> >>  1 files changed, 7 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> >> index f940056..b7ee895 100644
> >> --- a/drivers/usb/host/pci-quirks.c
> >> +++ b/drivers/usb/host/pci-quirks.c
> >> @@ -1003,6 +1003,13 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
> >>  		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
> >>  	} while (1);
> >>  
> >> +	/* Auto handoff never worked for these devices. Force it and continue */
> >> +	if (pdev->vendor == PCI_VENDOR_ID_TI ||
> >> +			pdev->vendor == PCI_VENDOR_ID_RENESAS) {
> >> +		val  =  (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
> > 
> > odd spaces here, why this format?
> 
>  Thanks. I will fix this. checkpatch.pl did not catch it.
> 
> > 
> > And are you sure that all TI and Renesas host controllers have this
> > issue?  That's a very wide and broad test you are making here...
> 
>  True, that is broad. I have tested these cards. I can probably add both vendor
>  and device id combination.
>  # lspci  -nn |grep -i usb
>  0002:03:00.0 USB controller [0c03]: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller [104c:8241] (rev 02)
>  0000:05:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller [1912:0014] (rev 03)

Please do so, only add the devices you _know_ need this.

thanks,

greg k-h

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

* [PATCH v2] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-07 17:23 [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers Babu Moger
  2016-01-07 17:29 ` Greg KH
@ 2016-01-08  0:04 ` Babu Moger
  2016-01-08  1:01   ` Greg KH
  2016-01-08 15:39 ` Babu Moger
  2 siblings, 1 reply; 9+ messages in thread
From: Babu Moger @ 2016-01-08  0:04 UTC (permalink / raw)
  To: mathias.nyman; +Cc: gregkh, linux-usb, linux-kernel, babu.moger

I have never seen auto handoff working on TI and RENESAS cards.
Eventually, we force handoff. This code forces the handoff
unconditionally. It saves 5 seconds boot time for each card.

Changes v0 -> v1
 Made changes per comments from Greg KH.
 Extra space removal in assignment
 Added both vendor and device id checks.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
---
 drivers/usb/host/pci-quirks.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index f940056..0915f44 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1003,6 +1003,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
 	} while (1);
 
+	/* Auto handoff never worked for these devices. Force it and continue */
+	if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
+			(pdev->vendor == PCI_VENDOR_ID_RENESAS
+			 && pdev->device == 0x0014)) {
+		val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
+		writel(val, base + ext_cap_offset);
+	}
+
 	/* If the BIOS owns the HC, signal that the OS wants it, and wait */
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
-- 
1.7.1

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

* Re: [PATCH v2] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-08  0:04 ` [PATCH v2] " Babu Moger
@ 2016-01-08  1:01   ` Greg KH
  2016-01-08 15:36     ` Babu Moger
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2016-01-08  1:01 UTC (permalink / raw)
  To: Babu Moger; +Cc: mathias.nyman, linux-usb, linux-kernel

On Thu, Jan 07, 2016 at 04:04:51PM -0800, Babu Moger wrote:
> I have never seen auto handoff working on TI and RENESAS cards.
> Eventually, we force handoff. This code forces the handoff
> unconditionally. It saves 5 seconds boot time for each card.
> 
> Changes v0 -> v1
>  Made changes per comments from Greg KH.
>  Extra space removal in assignment
>  Added both vendor and device id checks.

This "changes" stuff goes below the --- line, not here in the body where
I would have to hand-edit the patch to remove it.

v2? :)

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

* Re: [PATCH v2] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-08  1:01   ` Greg KH
@ 2016-01-08 15:36     ` Babu Moger
  0 siblings, 0 replies; 9+ messages in thread
From: Babu Moger @ 2016-01-08 15:36 UTC (permalink / raw)
  To: Greg KH; +Cc: mathias.nyman, linux-usb, linux-kernel


On 1/7/2016 7:01 PM, Greg KH wrote:
> On Thu, Jan 07, 2016 at 04:04:51PM -0800, Babu Moger wrote:
>> I have never seen auto handoff working on TI and RENESAS cards.
>> Eventually, we force handoff. This code forces the handoff
>> unconditionally. It saves 5 seconds boot time for each card.
>>
>> Changes v0 -> v1
>>  Made changes per comments from Greg KH.
>>  Extra space removal in assignment
>>  Added both vendor and device id checks.
> 
> This "changes" stuff goes below the --- line, not here in the body where
> I would have to hand-edit the patch to remove it.
> 
> v2? :)
Sure. Re-posting it. Used the sample http://linuxtv.org/wiki/index.php/Development:_How_to_submit_patches
 

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

* [PATCH v2] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-07 17:23 [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers Babu Moger
  2016-01-07 17:29 ` Greg KH
  2016-01-08  0:04 ` [PATCH v2] " Babu Moger
@ 2016-01-08 15:39 ` Babu Moger
  2016-03-16 22:26   ` Babu Moger
  2 siblings, 1 reply; 9+ messages in thread
From: Babu Moger @ 2016-01-08 15:39 UTC (permalink / raw)
  To: mathias.nyman; +Cc: gregkh, linux-usb, linux-kernel, babu.moger

I have never seen auto handoff working on TI and RENESAS cards.
Eventually, we force handoff. This code forces the handoff
unconditionally. It saves 5 seconds boot time for each card.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
---
v2: 
 Made changes per comments from Greg KH.
 Extra space removal in assignment
 Added both vendor and device id checks.

 drivers/usb/host/pci-quirks.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index f940056..0915f44 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1003,6 +1003,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
 	} while (1);
 
+	/* Auto handoff never worked for these devices. Force it and continue */
+	if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
+			(pdev->vendor == PCI_VENDOR_ID_RENESAS
+			 && pdev->device == 0x0014)) {
+		val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
+		writel(val, base + ext_cap_offset);
+	}
+
 	/* If the BIOS owns the HC, signal that the OS wants it, and wait */
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
-- 
1.7.1

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

* Re: [PATCH v2] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
  2016-01-08 15:39 ` Babu Moger
@ 2016-03-16 22:26   ` Babu Moger
  0 siblings, 0 replies; 9+ messages in thread
From: Babu Moger @ 2016-03-16 22:26 UTC (permalink / raw)
  To: mathias.nyman; +Cc: gregkh, linux-usb, linux-kernel

Its  been a while since I submit this patch. Ping 1. 

On 1/8/2016 9:39 AM, Babu Moger wrote:
> I have never seen auto handoff working on TI and RENESAS cards.
> Eventually, we force handoff. This code forces the handoff
> unconditionally. It saves 5 seconds boot time for each card.
> 
> Signed-off-by: Babu Moger <babu.moger@oracle.com>
> ---
> v2: 
>  Made changes per comments from Greg KH.
>  Extra space removal in assignment
>  Added both vendor and device id checks.
> 
>  drivers/usb/host/pci-quirks.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index f940056..0915f44 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -1003,6 +1003,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
>  		ext_cap_offset = xhci_find_next_cap_offset(base, ext_cap_offset);
>  	} while (1);
>  
> +	/* Auto handoff never worked for these devices. Force it and continue */
> +	if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
> +			(pdev->vendor == PCI_VENDOR_ID_RENESAS
> +			 && pdev->device == 0x0014)) {
> +		val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
> +		writel(val, base + ext_cap_offset);
> +	}
> +
>  	/* If the BIOS owns the HC, signal that the OS wants it, and wait */
>  	if (val & XHCI_HC_BIOS_OWNED) {
>  		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
> 

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

end of thread, other threads:[~2016-03-16 22:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07 17:23 [PATCH] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers Babu Moger
2016-01-07 17:29 ` Greg KH
2016-01-07 17:51   ` Babu Moger
2016-01-07 18:28     ` Greg KH
2016-01-08  0:04 ` [PATCH v2] " Babu Moger
2016-01-08  1:01   ` Greg KH
2016-01-08 15:36     ` Babu Moger
2016-01-08 15:39 ` Babu Moger
2016-03-16 22:26   ` Babu Moger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.