linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] xhci: Unconditionally switch ports to xHCI on powerup
@ 2012-08-21  4:06 manoj.iyer
  2012-08-21  4:06 ` [PATCH 1/1] " manoj.iyer
  0 siblings, 1 reply; 7+ messages in thread
From: manoj.iyer @ 2012-08-21  4:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: sarah.a.sharp, gregkh, linux-usb, manoj.iyer

From: Manoj Iyer <manoj.iyer@canonical.com>

USB 3.0 devices show up as high-speed devices on powerup, after an
s3 cycle they are correctly recognized as SuperSpeed. At powerup
unconditionally switch the port to xHCI like we do when we resume
from suspend.

BugLink: http://bugs.launchpad.net/bugs/1000424

Test results:
This patch was tested by me on a Lenovo system:

00:14.0 USB controller [0c03]: Intel Corporation Panther Point USB xHCI Host Con
troller [8086:1e31] (rev 04) (prog-if 30 [XHCI])
        Subsystem: Lenovo Device [17aa:5002]
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step
ping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort
- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 41
        Region 0: Memory at 90600000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [70] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0-,D1-,D2-,D3h
ot+,D3cold+)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
                Address: 00000000fee0300c  Data: 4169
        Kernel driver in use: xhci_hcd

== BEFORE PATCH ==
[   25.982350] eth1: no IPv6 routers present
[   27.577663] usb 2-1.1: new high-speed USB device number 3 using ehci_hcd
[   27.674465] scsi6 : usb-storage 2-1.1:1.0
[   28.673788] scsi 6:0:0:0: Direct-Access     JetFlash Transcend 16GB   1.00 PQ: 0 ANSI: 5
[   28.674667] sd 6:0:0:0: Attached scsi generic sg3 type 0
[   28.677284] sd 6:0:0:0: [sdc] 30871552 512-byte logical blocks: (15.8 GB/14.7 GiB)
[   28.677832] sd 6:0:0:0: [sdc] Write Protect is off
[   28.677839] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
[   28.678454] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[   28.682117]  sdc: sdc1
[   28.684179] sd 6:0:0:0: [sdc] Attached SCSI removable disk

== AFTER PATCH USB 3.0 PORT ==
[   56.653501] usb 4-1: new SuperSpeed USB device number 2 using xhci_hcd
[   56.672677] scsi6 : usb-storage 4-1:1.0
[   57.669912] scsi 6:0:0:0: Direct-Access     JetFlash Transcend 16GB   1.00 PQ: 0 ANSI: 5
[   57.671100] sd 6:0:0:0: [sdc] 30871552 512-byte logical blocks: (15.8 GB/14.7 GiB)
[   57.671185] sd 6:0:0:0: Attached scsi generic sg3 type 0
[   57.671389] sd 6:0:0:0: [sdc] Write Protect is off
[   57.671392] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
[   57.671499] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[   57.674480]  sdc: sdc1
[   57.675180] sd 6:0:0:0: [sdc] Attached SCSI removable disk


== AFTER PATCH USB 2.0 PORT ==
[  112.468810] usb 4-1: USB disconnect, device number 2
[  117.688925] usb 1-1.2: new high-speed USB device number 5 using ehci_hcd
[  117.786131] scsi7 : usb-storage 1-1.2:1.0
[  118.785809] scsi 7:0:0:0: Direct-Access     JetFlash Transcend 16GB   1.00 PQ: 0 ANSI: 5
[  118.788004] sd 7:0:0:0: Attached scsi generic sg3 type 0
[  118.789848] sd 7:0:0:0: [sdc] 30871552 512-byte logical blocks: (15.8 GB/14.7 GiB)
[  118.790287] sd 7:0:0:0: [sdc] Write Protect is off
[  118.790294] sd 7:0:0:0: [sdc] Mode Sense: 23 00 00 00
[  118.791072] sd 7:0:0:0: [sdc] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[  118.796448]  sdc: sdc1
[  118.798525] sd 7:0:0:0: [sdc] Attached SCSI removable disk

Manoj Iyer (1):
  xhci: Unconditionally switch ports to xHCI on powerup

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

-- 
1.7.9.5


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

* [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-21  4:06 [PATCH 0/1] xhci: Unconditionally switch ports to xHCI on powerup manoj.iyer
@ 2012-08-21  4:06 ` manoj.iyer
  2012-08-21 11:21   ` Sergei Shtylyov
  2012-08-21 12:12   ` Andiry Xu
  0 siblings, 2 replies; 7+ messages in thread
From: manoj.iyer @ 2012-08-21  4:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: sarah.a.sharp, gregkh, linux-usb, manoj.iyer

From: Manoj Iyer <manoj.iyer@canonical.com>

USB 3.0 devices show up as high-speed devices on powerup, after an
s3 cycle they are correctly recognized as SuperSpeed. At powerup
unconditionally switch the port to xHCI like we do when we resume
from suspend.

BugLink: http://bugs.launchpad.net/bugs/1000424

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
 drivers/usb/host/xhci-pci.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 9bfd4ca11..5c8dbea 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
 	if (!pci_set_mwi(pdev))
 		xhci_dbg(xhci, "MWI active\n");
 
+	/*
+	 * USB SuperSpeed ports are recognized as HighSpeed ports on powerup
+	 * unconditionally switch the ports to xHCI like we do when resume
+	 * from suspend.
+	 */
+	if (usb_is_intel_switchable_xhci(pdev))
+		usb_enable_xhci_ports(pdev);
+
 	xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
 	return 0;
 }
-- 
1.7.9.5


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

* Re: [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-21  4:06 ` [PATCH 1/1] " manoj.iyer
@ 2012-08-21 11:21   ` Sergei Shtylyov
  2012-08-21 12:12   ` Andiry Xu
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2012-08-21 11:21 UTC (permalink / raw)
  To: manoj.iyer; +Cc: linux-kernel, sarah.a.sharp, gregkh, linux-usb

Hello.

On 21-08-2012 8:06, manoj.iyer@canonical.com wrote:

> From: Manoj Iyer <manoj.iyer@canonical.com>

> USB 3.0 devices show up as high-speed devices on powerup, after an
> s3 cycle they are correctly recognized as SuperSpeed. At powerup
> unconditionally switch the port to xHCI like we do when we resume
> from suspend.

> BugLink: http://bugs.launchpad.net/bugs/1000424

> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
> ---
>   drivers/usb/host/xhci-pci.c |    8 ++++++++
>   1 file changed, 8 insertions(+)

> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 9bfd4ca11..5c8dbea 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
>   	if (!pci_set_mwi(pdev))
>   		xhci_dbg(xhci, "MWI active\n");
>
> +	/*
> +	 * USB SuperSpeed ports are recognized as HighSpeed ports on powerup

    Devices, not ports?

> +	 * unconditionally switch the ports to xHCI like we do when resume

    s/resume/resuming/

> +	 * from suspend.
> +	 */
> +	if (usb_is_intel_switchable_xhci(pdev))
> +		usb_enable_xhci_ports(pdev);
> +

WBR, Sergei


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

* Re: [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-21  4:06 ` [PATCH 1/1] " manoj.iyer
  2012-08-21 11:21   ` Sergei Shtylyov
@ 2012-08-21 12:12   ` Andiry Xu
  2012-08-21 16:16     ` Manoj Iyer
  1 sibling, 1 reply; 7+ messages in thread
From: Andiry Xu @ 2012-08-21 12:12 UTC (permalink / raw)
  To: manoj.iyer; +Cc: linux-kernel, sarah.a.sharp, gregkh, linux-usb

On Tue, Aug 21, 2012 at 12:06 PM,  <manoj.iyer@canonical.com> wrote:
> From: Manoj Iyer <manoj.iyer@canonical.com>
>
> USB 3.0 devices show up as high-speed devices on powerup, after an
> s3 cycle they are correctly recognized as SuperSpeed. At powerup
> unconditionally switch the port to xHCI like we do when we resume
> from suspend.
>
> BugLink: http://bugs.launchpad.net/bugs/1000424
>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
> ---
>  drivers/usb/host/xhci-pci.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 9bfd4ca11..5c8dbea 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
>         if (!pci_set_mwi(pdev))
>                 xhci_dbg(xhci, "MWI active\n");
>
> +       /*
> +        * USB SuperSpeed ports are recognized as HighSpeed ports on powerup
> +        * unconditionally switch the ports to xHCI like we do when resume
> +        * from suspend.
> +        */
> +       if (usb_is_intel_switchable_xhci(pdev))
> +               usb_enable_xhci_ports(pdev);
> +

Strange. This should have been called during system power up, in
quirk_usb_handoff_xhci() of pci_quirks.c. Do you see that routine get
called during power up?

Thanks,
Andiry

>         xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
>         return 0;
>  }
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-21 12:12   ` Andiry Xu
@ 2012-08-21 16:16     ` Manoj Iyer
  2012-08-22  3:31       ` Andiry Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Manoj Iyer @ 2012-08-21 16:16 UTC (permalink / raw)
  To: Andiry Xu; +Cc: manoj.iyer, linux-kernel, sarah.a.sharp, gregkh, linux-usb


Looks like in pci-quirks.c, we enter the do() while() loop, reach the end 
of extended capabilities and goto hc_init: label, skipping the switch. 
Probably moving the switch under the hc_init label might work? Currently 
we switch unconditionally on resume, so we could do the same at powerup as 
well.

On Tue, 21 Aug 2012, Andiry Xu wrote:

> On Tue, Aug 21, 2012 at 12:06 PM,  <manoj.iyer@canonical.com> wrote:
>> From: Manoj Iyer <manoj.iyer@canonical.com>
>>
>> USB 3.0 devices show up as high-speed devices on powerup, after an
>> s3 cycle they are correctly recognized as SuperSpeed. At powerup
>> unconditionally switch the port to xHCI like we do when we resume
>> from suspend.
>>
>> BugLink: http://bugs.launchpad.net/bugs/1000424
>>
>> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
>> ---
>>  drivers/usb/host/xhci-pci.c |    8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
>> index 9bfd4ca11..5c8dbea 100644
>> --- a/drivers/usb/host/xhci-pci.c
>> +++ b/drivers/usb/host/xhci-pci.c
>> @@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
>>         if (!pci_set_mwi(pdev))
>>                 xhci_dbg(xhci, "MWI active\n");
>>
>> +       /*
>> +        * USB SuperSpeed ports are recognized as HighSpeed ports on powerup
>> +        * unconditionally switch the ports to xHCI like we do when resume
>> +        * from suspend.
>> +        */
>> +       if (usb_is_intel_switchable_xhci(pdev))
>> +               usb_enable_xhci_ports(pdev);
>> +
>
> Strange. This should have been called during system power up, in
> quirk_usb_handoff_xhci() of pci_quirks.c. Do you see that routine get
> called during power up?
>
> Thanks,
> Andiry
>
>>         xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
>>         return 0;
>>  }
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

--
====================
Manoj Iyer
Ubuntu/Canonical
Hardware Enablement
====================

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

* Re: [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-21 16:16     ` Manoj Iyer
@ 2012-08-22  3:31       ` Andiry Xu
  2012-08-22 16:09         ` Manoj Iyer
  0 siblings, 1 reply; 7+ messages in thread
From: Andiry Xu @ 2012-08-22  3:31 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: linux-kernel, sarah.a.sharp, gregkh, linux-usb

On Wed, Aug 22, 2012 at 12:16 AM, Manoj Iyer <manoj.iyer@canonical.com> wrote:
>
> Looks like in pci-quirks.c, we enter the do() while() loop, reach the end of
> extended capabilities and goto hc_init: label, skipping the switch. Probably
> moving the switch under the hc_init label might work? Currently we switch
> unconditionally on resume, so we could do the same at powerup as well.
>

If this is a must-to-do thing for Intel Panther Point platform, then
we need to make sure it's called on power up and resume. Yes, I think
moving the code below hc_init label should work and I think it's a
better solution than your original patch.

Thanks,
Andiry

>
> On Tue, 21 Aug 2012, Andiry Xu wrote:
>
>> On Tue, Aug 21, 2012 at 12:06 PM,  <manoj.iyer@canonical.com> wrote:
>>>
>>> From: Manoj Iyer <manoj.iyer@canonical.com>
>>>
>>> USB 3.0 devices show up as high-speed devices on powerup, after an
>>> s3 cycle they are correctly recognized as SuperSpeed. At powerup
>>> unconditionally switch the port to xHCI like we do when we resume
>>> from suspend.
>>>
>>> BugLink: http://bugs.launchpad.net/bugs/1000424
>>>
>>> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
>>> ---
>>>  drivers/usb/host/xhci-pci.c |    8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
>>> index 9bfd4ca11..5c8dbea 100644
>>> --- a/drivers/usb/host/xhci-pci.c
>>> +++ b/drivers/usb/host/xhci-pci.c
>>> @@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci,
>>> struct pci_dev *pdev)
>>>         if (!pci_set_mwi(pdev))
>>>                 xhci_dbg(xhci, "MWI active\n");
>>>
>>> +       /*
>>> +        * USB SuperSpeed ports are recognized as HighSpeed ports on
>>> powerup
>>> +        * unconditionally switch the ports to xHCI like we do when
>>> resume
>>> +        * from suspend.
>>> +        */
>>> +       if (usb_is_intel_switchable_xhci(pdev))
>>> +               usb_enable_xhci_ports(pdev);
>>> +
>>
>>
>> Strange. This should have been called during system power up, in
>> quirk_usb_handoff_xhci() of pci_quirks.c. Do you see that routine get
>> called during power up?
>>
>> Thanks,
>> Andiry
>>
>>>         xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
>>>         return 0;
>>>  }
>>> --
>>> 1.7.9.5
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>
> --
> ====================
> Manoj Iyer
> Ubuntu/Canonical
> Hardware Enablement
> ====================

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

* Re: [PATCH 1/1] xhci: Unconditionally switch ports to xHCI on powerup
  2012-08-22  3:31       ` Andiry Xu
@ 2012-08-22 16:09         ` Manoj Iyer
  0 siblings, 0 replies; 7+ messages in thread
From: Manoj Iyer @ 2012-08-22 16:09 UTC (permalink / raw)
  To: Andiry Xu; +Cc: Manoj Iyer, linux-kernel, sarah.a.sharp, gregkh, linux-usb


> If this is a must-to-do thing for Intel Panther Point platform, then
> we need to make sure it's called on power up and resume. Yes, I think
> moving the code below hc_init label should work and I think it's a
> better solution than your original patch.

Yes it effects a lot of machines (Lenovo), I will send out a new seperate 
patch with the fix.

Thanks
Manoj

>
> Thanks,
> Andiry
>
>>
>> On Tue, 21 Aug 2012, Andiry Xu wrote:
>>
>>> On Tue, Aug 21, 2012 at 12:06 PM,  <manoj.iyer@canonical.com> wrote:
>>>>
>>>> From: Manoj Iyer <manoj.iyer@canonical.com>
>>>>
>>>> USB 3.0 devices show up as high-speed devices on powerup, after an
>>>> s3 cycle they are correctly recognized as SuperSpeed. At powerup
>>>> unconditionally switch the port to xHCI like we do when we resume
>>>> from suspend.
>>>>
>>>> BugLink: http://bugs.launchpad.net/bugs/1000424
>>>>
>>>> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
>>>> ---
>>>>  drivers/usb/host/xhci-pci.c |    8 ++++++++
>>>>  1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
>>>> index 9bfd4ca11..5c8dbea 100644
>>>> --- a/drivers/usb/host/xhci-pci.c
>>>> +++ b/drivers/usb/host/xhci-pci.c
>>>> @@ -48,6 +48,14 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci,
>>>> struct pci_dev *pdev)
>>>>         if (!pci_set_mwi(pdev))
>>>>                 xhci_dbg(xhci, "MWI active\n");
>>>>
>>>> +       /*
>>>> +        * USB SuperSpeed ports are recognized as HighSpeed ports on
>>>> powerup
>>>> +        * unconditionally switch the ports to xHCI like we do when
>>>> resume
>>>> +        * from suspend.
>>>> +        */
>>>> +       if (usb_is_intel_switchable_xhci(pdev))
>>>> +               usb_enable_xhci_ports(pdev);
>>>> +
>>>
>>>
>>> Strange. This should have been called during system power up, in
>>> quirk_usb_handoff_xhci() of pci_quirks.c. Do you see that routine get
>>> called during power up?
>>>
>>> Thanks,
>>> Andiry
>>>
>>>>         xhci_dbg(xhci, "Finished xhci_pci_reinit\n");
>>>>         return 0;
>>>>  }
>>>> --
>>>> 1.7.9.5
>>>>
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>>
>>>
>>
>> --
>> ====================
>> Manoj Iyer
>> Ubuntu/Canonical
>> Hardware Enablement
>> ====================
>
>

--
====================
Manoj Iyer
Ubuntu/Canonical
Hardware Enablement
====================

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

end of thread, other threads:[~2012-08-22 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21  4:06 [PATCH 0/1] xhci: Unconditionally switch ports to xHCI on powerup manoj.iyer
2012-08-21  4:06 ` [PATCH 1/1] " manoj.iyer
2012-08-21 11:21   ` Sergei Shtylyov
2012-08-21 12:12   ` Andiry Xu
2012-08-21 16:16     ` Manoj Iyer
2012-08-22  3:31       ` Andiry Xu
2012-08-22 16:09         ` Manoj Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).