2008-11-04 04:57:38

by Steven Noonan

[permalink] [raw]
Subject: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

Instead of waiting a painful 5000ms, quirk_usb_disable_ehci() now does a
1000ms loop to wait for the BIOS to acknowledge the handoff.

Cc: Andrew Morton <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Greg KH <[email protected]>
Cc: David Brownell <[email protected]>
Signed-off-by: Steven Noonan <[email protected]>
---
drivers/usb/host/pci-quirks.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index ae6e70e..1968ba1 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -271,7 +271,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
/* if boot firmware now owns EHCI, spin till
* it hands it over.
*/
- msec = 5000;
+ msec = 1000;
while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
tried_handoff = 1;
msleep(10);
--
1.5.6.3


2008-11-04 05:32:53

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

Steven Noonan wrote:
> Instead of waiting a painful 5000ms, quirk_usb_disable_ehci() now does a
> 1000ms loop to wait for the BIOS to acknowledge the handoff.
>
> Cc: Andrew Morton <[email protected]>
> Cc: Alan Stern <[email protected]>
> Cc: Greg KH <[email protected]>
> Cc: David Brownell <[email protected]>
> Signed-off-by: Steven Noonan <[email protected]>
> ---
> drivers/usb/host/pci-quirks.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index ae6e70e..1968ba1 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -271,7 +271,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
> /* if boot firmware now owns EHCI, spin till
> * it hands it over.
> */
> - msec = 5000;
> + msec = 1000;
> while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
> tried_handoff = 1;

That tells us nothing about the original reason for choosing the 5000
value, and what if any impact lowering the value has on those who
thought 5000 was needed.

Jeff


2008-11-04 06:52:15

by David Brownell

[permalink] [raw]
Subject: Re: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

On Monday 03 November 2008, Jeff Garzik wrote:
> That tells us nothing about the original reason for choosing the 5000
> value, and what if any impact lowering the value has on those who
> thought 5000 was needed.

You mean, the source code should have a comment about that?

The *original* BIOS-broken timeout was some fraction of a second
(I'm thinking 250 msec, maybe not), but I got some reports about
BIOS versions that were too sluggish to work with that. ISTR
that half a second wasn't quite reliable, so 1+ seconds seemed
to be called for.

So rather than incremental increases, it went from 250 msec up
to 5000 msec, and this is the first complaint we've had about
that in *many* years.

- Dave

2008-11-04 07:47:54

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

David Brownell wrote:
> On Monday 03 November 2008, Jeff Garzik wrote:
>> That tells us nothing about the original reason for choosing the 5000
>> value, and what if any impact lowering the value has on those who
>> thought 5000 was needed.
>
> You mean, the source code should have a comment about that?

I was thinking changeset description (email body), but source code
comment works too.

Jeff


2008-11-04 07:54:20

by Steven Noonan

[permalink] [raw]
Subject: Re: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

On Mon, Nov 3, 2008 at 11:47 PM, Jeff Garzik <[email protected]> wrote:
> David Brownell wrote:
>>
>> On Monday 03 November 2008, Jeff Garzik wrote:
>>>
>>> That tells us nothing about the original reason for choosing the 5000
>>> value, and what if any impact lowering the value has on those who thought
>>> 5000 was needed.
>>
>> You mean, the source code should have a comment about that?
>
> I was thinking changeset description (email body), but source code comment
> works too.
>
> Jeff
>

I really need to start getting into the habit of 'reply to all'.
Apologies for the extra email, Jeff:



Sorry, I should really be more verbose in the commit log.

The five second delay is really quite irritating to have to deal with
every boot up, and I very seriously doubt any non-broken bios takes
more than a second to do the actual handoff.

- Steven


>
>
>

2008-11-05 10:22:54

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] EHCI pci-quirks.c: wait for BIOS handoff too long

On Mon 2008-11-03 20:57:15, Steven Noonan wrote:
> Instead of waiting a painful 5000ms, quirk_usb_disable_ehci() now does a
> 1000ms loop to wait for the BIOS to acknowledge the handoff.
>
> Cc: Andrew Morton <[email protected]>
> Cc: Alan Stern <[email protected]>
> Cc: Greg KH <[email protected]>
> Cc: David Brownell <[email protected]>
> Signed-off-by: Steven Noonan <[email protected]>
> ---
> drivers/usb/host/pci-quirks.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index ae6e70e..1968ba1 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
> @@ -271,7 +271,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
> /* if boot firmware now owns EHCI, spin till
> * it hands it over.
> */
> - msec = 5000;
> + msec = 1000;
> while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
> tried_handoff = 1;
> msleep(10);

If the bios is non-broken, it will acknowledge hndover and it takes
10msec total.

If the bios is broken, 5 seconds may be handy.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html