2006-05-28 20:34:22

by Jeff Garzik

[permalink] [raw]
Subject: [git patch] libata resume fix


Please pull from 'upstream-fixes' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

to receive the following updates:

drivers/scsi/libata-core.c | 1 +
1 file changed, 1 insertion(+)

Mark Lord:
the latest consensus libata resume fix

diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index fa476e7..b046ffa 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4297,6 +4297,7 @@ static int ata_start_drive(struct ata_po
int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
{
if (ap->flags & ATA_FLAG_SUSPENDED) {
+ ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
ap->flags &= ~ATA_FLAG_SUSPENDED;
ata_set_mode(ap);
}


2006-05-29 21:36:10

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

On Sun, 2006-05-28 at 16:34 -0400, Jeff Garzik wrote:
> Please pull from 'upstream-fixes' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
>
> to receive the following updates:
>
> drivers/scsi/libata-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> Mark Lord:
> the latest consensus libata resume fix

If your devices are coming from poweron-reset then you will have to wait
up to 31 seconds :( And yes, I _did_ have such a device at one point.

Ben.


> diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
> index fa476e7..b046ffa 100644
> --- a/drivers/scsi/libata-core.c
> +++ b/drivers/scsi/libata-core.c
> @@ -4297,6 +4297,7 @@ static int ata_start_drive(struct ata_po
> int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
> {
> if (ap->flags & ATA_FLAG_SUSPENDED) {
> + ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
> ap->flags &= ~ATA_FLAG_SUSPENDED;
> ata_set_mode(ap);
> }
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2006-05-30 13:22:35

by Mark Lord

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

Benjamin Herrenschmidt wrote:
> On Sun, 2006-05-28 at 16:34 -0400, Jeff Garzik wrote:
>> Please pull from 'upstream-fixes' branch of
>> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
>>
>> to receive the following updates:
>>
>> drivers/scsi/libata-core.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> Mark Lord:
>> the latest consensus libata resume fix
>
> If your devices are coming from poweron-reset then you will have to wait
> up to 31 seconds :( And yes, I _did_ have such a device at one point.

Not in a suspend/resume capable notebook, though.

I don't know of *any* notebook drives that take longer
than perhaps five seconds to spin-up and accept commands.
Such a slow drive wouldn't really be tolerated by end-users,
which is why they don't exist.

But I suppose people will want to suspend/resume bigger machines
too, in which case a 10000rpm Raptor might need 15 seconds or so.

We could bump up the existing timeout, I suppose.

Perhaps Jeff could comment on any potential harm in libata
for going all the way to 3100000 with the timeout?

Cheers

2006-05-30 18:27:06

by Linus Torvalds

[permalink] [raw]
Subject: Re: [git patch] libata resume fix



On Tue, 30 May 2006, Mark Lord wrote:
>
> Not in a suspend/resume capable notebook, though.
>
> I don't know of *any* notebook drives that take longer
> than perhaps five seconds to spin-up and accept commands.
> Such a slow drive wouldn't really be tolerated by end-users,
> which is why they don't exist.

Indeed. In fact, I'd be surprised to see it in a desktop too.

At least at one point, in order to get a M$ hw qualification (whatever
it's called - but every single hw manufacturer wants it, because some
vendors won't use your hardware if you don't have it), a laptop needed to
boot up in less than 30 seconds or something.

And that wasn't the disk spin-up time. That was the time until the Windows
desktop was visible.

Desktops could do a bit longer, and I think servers didn't have any time
limits, but the point is that selling a disk that takes a long time to
start working is actually not that easy.

The market that has accepted slow bootup times is historically the server
market (don't ask me why - you'd think that with five-nines uptime
guarantees you'd want fast bootup), and so you'll find large SCSI disks in
particular with long spin-up times. In the laptop and desktop space I'd be
very surprised to see anythign longer than a few seconds.

Linus

2006-05-30 18:40:45

by Ric Wheeler

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

Linus Torvalds wrote:

>On Tue, 30 May 2006, Mark Lord wrote:
>
>
>>Not in a suspend/resume capable notebook, though.
>>
>>I don't know of *any* notebook drives that take longer
>>than perhaps five seconds to spin-up and accept commands.
>>Such a slow drive wouldn't really be tolerated by end-users,
>>which is why they don't exist.
>>
>>
>
>Indeed. In fact, I'd be surprised to see it in a desktop too.
>
>At least at one point, in order to get a M$ hw qualification (whatever
>it's called - but every single hw manufacturer wants it, because some
>vendors won't use your hardware if you don't have it), a laptop needed to
>boot up in less than 30 seconds or something.
>
>And that wasn't the disk spin-up time. That was the time until the Windows
>desktop was visible.
>
>Desktops could do a bit longer, and I think servers didn't have any time
>limits, but the point is that selling a disk that takes a long time to
>start working is actually not that easy.
>
>The market that has accepted slow bootup times is historically the server
>market (don't ask me why - you'd think that with five-nines uptime
>guarantees you'd want fast bootup), and so you'll find large SCSI disks in
>particular with long spin-up times. In the laptop and desktop space I'd be
>very surprised to see anythign longer than a few seconds.
>
> Linus
>
>
With many data centera applications, delayed spin up of SCSI (and
increasingly S-ATA) drives is a feature meant to avoid blowing a circuit
when you spin up too many drives at once ;-)

Ric

2006-05-30 22:35:26

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

On Tue, 2006-05-30 at 09:22 -0400, Mark Lord wrote:
> Benjamin Herrenschmidt wrote:
> > On Sun, 2006-05-28 at 16:34 -0400, Jeff Garzik wrote:
> >> Please pull from 'upstream-fixes' branch of
> >> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
> >>
> >> to receive the following updates:
> >>
> >> drivers/scsi/libata-core.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> Mark Lord:
> >> the latest consensus libata resume fix
> >
> > If your devices are coming from poweron-reset then you will have to wait
> > up to 31 seconds :( And yes, I _did_ have such a device at one point.
>
> Not in a suspend/resume capable notebook, though.

Maybe, but 2 seconds is just "abitrary". I know some ATAPI devices (in
notebooks) that will drive the bus (and thus pollute whatever you try to
do) for way more than 2 seconds if they are reset with a CD in the
drive.

> I don't know of *any* notebook drives that take longer
> than perhaps five seconds to spin-up and accept commands.
> Such a slow drive wouldn't really be tolerated by end-users,
> which is why they don't exist.

They do, especially ATAPI.

> But I suppose people will want to suspend/resume bigger machines
> too, in which case a 10000rpm Raptor might need 15 seconds or so.
>
> We could bump up the existing timeout, I suppose.
>
> Perhaps Jeff could comment on any potential harm in libata
> for going all the way to 3100000 with the timeout?


2006-05-30 22:38:12

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

On Tue, 2006-05-30 at 11:26 -0700, Linus Torvalds wrote:
>
> On Tue, 30 May 2006, Mark Lord wrote:
> >
> > Not in a suspend/resume capable notebook, though.
> >
> > I don't know of *any* notebook drives that take longer
> > than perhaps five seconds to spin-up and accept commands.
> > Such a slow drive wouldn't really be tolerated by end-users,
> > which is why they don't exist.
>
> Indeed. In fact, I'd be surprised to see it in a desktop too.

Seen some drives at one point (I think those were maxtor) that take
_exactly_ 30 seconds to stop asserting BUSY after a HW reset.

> At least at one point, in order to get a M$ hw qualification (whatever
> it's called - but every single hw manufacturer wants it, because some
> vendors won't use your hardware if you don't have it), a laptop needed to
> boot up in less than 30 seconds or something.
>
> And that wasn't the disk spin-up time. That was the time until the Windows
> desktop was visible.

Doesn't window spin drives asynchronously ? The main problem I've seen
in practice (appart from the above maxtor drives) are ATAPI CD/DVD
drives. There are whole generations of those that will happily drive
your bus to some crazy state (even when only slave and not selected) for
a long time while they spin up and try to identify the disk in them on a
hard reset (and if they have trouble identifying the disk, like a
scratched disk, that can take a loooong time).

> Desktops could do a bit longer, and I think servers didn't have any time
> limits, but the point is that selling a disk that takes a long time to
> start working is actually not that easy.
>
> The market that has accepted slow bootup times is historically the server
> market (don't ask me why - you'd think that with five-nines uptime
> guarantees you'd want fast bootup), and so you'll find large SCSI disks in
> particular with long spin-up times. In the laptop and desktop space I'd be
> very surprised to see anythign longer than a few seconds.

It's only a timeout. If you drives are fast, it will come up fast... if
you drives are slow, it will come up slow, and if your drives are
broken, you'll wait at most 31 seconds. Seems ok to me... It would be
nicer in the long run if libata could resume asynchronously (by keeping
the request queue blocked until full resume and polling the BUSY from a
thread or a timer), but I don't think we should lower the timeout.

Ben.


2006-05-31 06:45:35

by Jens Axboe

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

On Wed, May 31 2006, Benjamin Herrenschmidt wrote:
> > At least at one point, in order to get a M$ hw qualification (whatever
> > it's called - but every single hw manufacturer wants it, because some
> > vendors won't use your hardware if you don't have it), a laptop needed to
> > boot up in less than 30 seconds or something.
> >
> > And that wasn't the disk spin-up time. That was the time until the Windows
> > desktop was visible.
>
> Doesn't window spin drives asynchronously ? The main problem I've seen
> in practice (appart from the above maxtor drives) are ATAPI CD/DVD
> drives. There are whole generations of those that will happily drive
> your bus to some crazy state (even when only slave and not selected) for
> a long time while they spin up and try to identify the disk in them on a
> hard reset (and if they have trouble identifying the disk, like a
> scratched disk, that can take a loooong time).

FWIW, I've seen the very same thing. Resume/power-up with a cd/dvd that
has a media loaded can take _ages_ to get ready.

> > Desktops could do a bit longer, and I think servers didn't have any time
> > limits, but the point is that selling a disk that takes a long time to
> > start working is actually not that easy.
> >
> > The market that has accepted slow bootup times is historically the server
> > market (don't ask me why - you'd think that with five-nines uptime
> > guarantees you'd want fast bootup), and so you'll find large SCSI disks in
> > particular with long spin-up times. In the laptop and desktop space I'd be
> > very surprised to see anythign longer than a few seconds.
>
> It's only a timeout. If you drives are fast, it will come up fast... if
> you drives are slow, it will come up slow, and if your drives are
> broken, you'll wait at most 31 seconds. Seems ok to me... It would be
> nicer in the long run if libata could resume asynchronously (by keeping
> the request queue blocked until full resume and polling the BUSY from a
> thread or a timer), but I don't think we should lower the timeout.

In reality it probably doesn't matter much, since everything will be
stalled until the queue is unfrozen anyways. Unless of course you have
several slow-to-resume devices so you would at least get some overlap.
But it would be nicer from a design view point.

--
Jens Axboe

2006-05-31 06:57:17

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [git patch] libata resume fix


> In reality it probably doesn't matter much, since everything will be
> stalled until the queue is unfrozen anyways. Unless of course you have
> several slow-to-resume devices so you would at least get some overlap.
> But it would be nicer from a design view point.

In practice, it would be nice because most of X would restore while you
wait, it generally doesn't need the disk to do so unless you are heavy
on swap (or used suspend-to-disk :), that's one example among others...

At least letting other drivers restore in parallel, will improve things,
even if actual running of userland programs might still be stalled until
the disk kicks back in. But the whole experience of waking up the
machine will be improved from a black text screen waiting for the drive
to spin up ... :)

Ben.


2006-05-31 21:59:41

by Bill Davidsen

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

Linus Torvalds wrote:
>
> On Tue, 30 May 2006, Mark Lord wrote:
>> Not in a suspend/resume capable notebook, though.
>>
>> I don't know of *any* notebook drives that take longer
>> than perhaps five seconds to spin-up and accept commands.
>> Such a slow drive wouldn't really be tolerated by end-users,
>> which is why they don't exist.
>
> Indeed. In fact, I'd be surprised to see it in a desktop too.
>
> At least at one point, in order to get a M$ hw qualification (whatever
> it's called - but every single hw manufacturer wants it, because some
> vendors won't use your hardware if you don't have it), a laptop needed to
> boot up in less than 30 seconds or something.
>
> And that wasn't the disk spin-up time. That was the time until the Windows
> desktop was visible.
>
> Desktops could do a bit longer, and I think servers didn't have any time
> limits, but the point is that selling a disk that takes a long time to
> start working is actually not that easy.
>
> The market that has accepted slow bootup times is historically the server
> market (don't ask me why - you'd think that with five-nines uptime
> guarantees you'd want fast bootup), and so you'll find large SCSI disks in
> particular with long spin-up times. In the laptop and desktop space I'd be
> very surprised to see anythign longer than a few seconds.

The trade-off is that if I have a 15k rpm SCSI drive, it would take a
lot of design changes to make it spin up quickly, and improve a function
which is usually done on a server once every MTBF when replacing the
failed unit.

I think the majority of very large or very fast drives are in systems
which don't (deliberately) power cycles often, in rooms where heat is an
issue. And to spin up quickly take a larger power supply... 30 sec is
fine with most users.

Couldn't find a spin-up time for the new Seagate 750GB drive, but the
seek sure is fast!

--
Bill Davidsen <[email protected]>
Obscure bug of 2004: BASH BUFFER OVERFLOW - if bash is being run by a
normal user and is setuid root, with the "vi" line edit mode selected,
and the character set is "big5," an off-by-one errors occurs during
wildcard (glob) expansion.

2006-06-01 03:28:50

by Robert Hancock

[permalink] [raw]
Subject: Re: [git patch] libata resume fix

Bill Davidsen wrote:
> The trade-off is that if I have a 15k rpm SCSI drive, it would take a
> lot of design changes to make it spin up quickly, and improve a function
> which is usually done on a server once every MTBF when replacing the
> failed unit.
>
> I think the majority of very large or very fast drives are in systems
> which don't (deliberately) power cycles often, in rooms where heat is an
> issue. And to spin up quickly take a larger power supply... 30 sec is
> fine with most users.
>
> Couldn't find a spin-up time for the new Seagate 750GB drive, but the
> seek sure is fast!

I wouldn't guess that even a 15K drive would take nearly that long. For
boot time on servers it doesn't matter much though, disk spinup time is
in the noise compared to the insane BIOS delays on most of them during
bootup. Like on some servers (ahem.. IBM) which have about a 15 second
delay on the main BIOS screen, 10 second delays on every network boot
ROM, a 1 minute delay on the SCSI controller before it even starts
scanning the bus, then another good 10 seconds before it starts booting.
Gets annoying after a few reboots..

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/