2002-09-20 14:20:13

by Padraig Brady

[permalink] [raw]
Subject: hdparm -Y hangup

This seems like a bug in the ide driver not issuing a reset?

On RH7.3 (2.4.18-3) if I do:
$ hdparm -Y /dev/hda
$ do stuff and disk spins up
$ hdparm -Y /dev/hda
$ everything hangs waiting for disk

cheers,
P?draig.

Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIX4: IDE controller on PCI bus 00 dev f9
PIIX4: chipset revision 2
PIIX4: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio
hda: Maxtor 4D040H2, ATA DISK drive
hdc: SAMSUNG CD-ROM SC-148C, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
blk: queue c035e6a4, I/O limit 4095Mb (mask 0xffffffff)
hda: 78125000 sectors (40000 MB) w/2048KiB Cache, CHS=4863/255/63, UDMA(66)
ide-floppy driver 0.99.newide
Partition check:
hda: hda1 hda2 hda3 hda4 < hda5 hda6 >


2002-09-21 18:00:16

by jbradford

[permalink] [raw]
Subject: Re: hdparm -Y hangup

> This seems like a bug in the ide driver not issuing a reset?
>
> On RH7.3 (2.4.18-3) if I do:
> $ hdparm -Y /dev/hda
> $ do stuff and disk spins up
> $ hdparm -Y /dev/hda
> $ everything hangs waiting for disk

It *IS* a bug, but only Mark Lord, (the hdparm maintainer), and I seem to care about it - everybody else says, "just do hdparm -y instead", which is missing the point.

Incidently, I think you mean:

On RH7.3 (2.4.18-3) if I do:
$ hdparm -y /dev/hda
$ do stuff and disk spins up
$ hdparm -Y /dev/hda
$ everything hangs waiting for disk

with a lower case y for the first example.

So, unless you, I, or Mark Lord fixes it, it stays broken :-).

John.

2002-09-23 08:28:15

by Padraig Brady

[permalink] [raw]
Subject: Re: hdparm -Y hangup

[email protected] wrote:
>>This seems like a bug in the ide driver not issuing a reset?
>>
>>On RH7.3 (2.4.18-3) if I do:
>>$ hdparm -Y /dev/hda
>>$ do stuff and disk spins up
>>$ hdparm -Y /dev/hda
>>$ everything hangs waiting for disk
>
> It *IS* a bug, but only Mark Lord, (the hdparm maintainer), and I seem to care about it - everybody else says, "just do hdparm -y instead", which is missing the point.

Hrm, OK thanks for the info. Perhaps it should be removed
from hdparm or a (DANGEROUS) put beside the description
until it's fixed.

>
> Incidently, I think you mean:
>
> On RH7.3 (2.4.18-3) if I do:
> $ hdparm -y /dev/hda
> $ do stuff and disk spins up
> $ hdparm -Y /dev/hda
> $ everything hangs waiting for disk
>
> with a lower case y for the first example.

No it seemed to wake up correctly the first time with -Y.
As you say -y works always.

> So, unless you, I, or Mark Lord fixes it, it stays broken :-).

cheers,
P?draig.

2002-09-23 09:31:20

by jbradford

[permalink] [raw]
Subject: Re: hdparm -Y hangup

> Hrm, OK thanks for the info. Perhaps it should be removed
> from hdparm or a (DANGEROUS) put beside the description
> until it's fixed.

The person to contact would be Mark Lord, the hdparm maintainer, (see the hdparm manual page for his E-Mail address).

> > Incidently, I think you mean:
> >
> > On RH7.3 (2.4.18-3) if I do:
> > $ hdparm -y /dev/hda
> > $ do stuff and disk spins up
> > $ hdparm -Y /dev/hda
> > $ everything hangs waiting for disk
> >
> > with a lower case y for the first example.
>
> No it seemed to wake up correctly the first time with -Y.

That *is* strange.

> As you say -y works always.

On the systems I have tried it, yes - I'm not saying it always works.

John.

2002-09-23 23:03:45

by Peter

[permalink] [raw]
Subject: Re: hdparm -Y hangup


Not so -- we do so care! I get the same behavior on 2.4.19-ac4.

I ran hdparm -Y /dev/hdd on an IBM 120GB DeskStar. The specs sheet
recommends no more than 8 hours of power-on a day, so I use it as a backup
drive. The machine it's on is never turned off.

Clarification: is it the case that hdparm -Y (sleep) will cool the drive
off better than hdparm -y (suspend)?

I read somewhere that -Y only works on unmounted drives. This appears to
be false. Comments?

Cheers,
Peter

[email protected] wrote,

>> On RH7.3 (2.4.18-3) if I do:
>> $ hdparm -Y /dev/hda
>> $ do stuff and disk spins up
>> $ hdparm -Y /dev/hda
>> $ everything hangs waiting for disk
>
>It *IS* a bug, but only Mark Lord, (the hdparm maintainer), and I seem to
>care about it - everybody else says, "just do hdparm -y instead", which
>is missing the point.

2002-09-24 21:09:23

by Bill Davidsen

[permalink] [raw]
Subject: Re: hdparm -Y hangup

On Mon, 23 Sep 2002 [email protected] wrote:

> > Hrm, OK thanks for the info. Perhaps it should be removed
> > from hdparm or a (DANGEROUS) put beside the description
> > until it's fixed.
>
> The person to contact would be Mark Lord, the hdparm maintainer, (see the hdparm manual page for his E-Mail address).

Rather than have Mark Lord set the option DANGEROUS (it shouldn't be)
perhaps it could be made to work more than once... Odd problem, is
something not getting set or cleared when the drive is spun up the first
time?

--
bill davidsen <[email protected]>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

2002-09-25 07:39:49

by jbradford

[permalink] [raw]
Subject: Re: hdparm -Y hangup

> > > Hrm, OK thanks for the info. Perhaps it should be removed
> > > from hdparm or a (DANGEROUS) put beside the description
> > > until it's fixed.
> >
> > The person to contact would be Mark Lord, the hdparm maintainer, (see the
> > hdparm manual page for his E-Mail address).
>
> Rather than have Mark Lord set the option DANGEROUS (it shouldn't be)
> perhaps it could be made to work more than once... Odd problem, is
> something not getting set or cleared when the drive is spun up the first
> time?

With my Maxtor disk connected to a PIIX3 IDE interface and stock kernel 2.4.19, I get this behavior:

# hdparm -Y /dev/hda

Disk sleeps

# find

No disk activity - it doesn't wake up. It doesn't work once for me, it always hangs on the first attempt.

So, I try dmesg on another console - no new output.

# hdparm -w /dev/hda

Performs a device reset, and the disk spins up.

# dmesg

hda: ide_set_handler: handler not null; c0181050
hda: dma_intr: status=0xd0 { Busy }
hda: DMA disabled
hda: ide_set_handler: handler not null; old=c0181050, new=c017b160
bug: kernel timer added twice at c017afe1.
hda: ide_set_handler: handler not null; old=c017b160, new=c017b160
ide0: reset: success

Obviously, if you're going to try to repeat this, sync the disk beforehand, because I assume that a device reset will loose data in the disk's write cache.

John.

2002-09-25 14:53:26

by Mark Lord

[permalink] [raw]
Subject: Re: hdparm -Y hangup

Peter wrote:
>
> Clarification: is it the case that hdparm -Y (sleep) will cool the drive
> off better than hdparm -y (suspend)?

In theory, -Y is capable of greater power (heat) savings than -y,
but in practice this will be model-specific and probably
will pale in comparism to the huge savings from -y alone.

>
> I read somewhere that -Y only works on unmounted drives. This appears to
> be false. Comments?

It should work on the raw drive regardless.

Cheers
--
Mark Lord
Real-Time Remedies Inc.
[email protected]

2002-09-25 15:03:03

by Padraig Brady

[permalink] [raw]
Subject: Re: hdparm -Y hangup

Mark Lord wrote:
> Peter wrote:
>
>>
>> Clarification: is it the case that hdparm -Y (sleep) will cool the
>> drive off better than hdparm -y (suspend)?
>
>
> In theory, -Y is capable of greater power (heat) savings than -y,
> but in practice this will be model-specific and probably
> will pale in comparism to the huge savings from -y alone.

True. Is there any chance you could mark -Y (DANGEROUS).
Even if it is dangerous currently because of an IDE bug
it still is dangerous.

>> I read somewhere that -Y only works on unmounted drives. This appears
>> to be false. Comments?
>
> It should work on the raw drive regardless.

thanks,
P?draig.

2002-09-25 15:59:15

by jbradford

[permalink] [raw]
Subject: Re: hdparm -Y hangup

> >> Clarification: is it the case that hdparm -Y (sleep) will cool the
> >> drive off better than hdparm -y (suspend)?
> >
> >
> > In theory, -Y is capable of greater power (heat) savings than -y,
> > but in practice this will be model-specific and probably
> > will pale in comparism to the huge savings from -y alone.

Agreed. It may well be less than one watt of power saving.

> True. Is there any chance you could mark -Y (DANGEROUS).
> Even if it is dangerous currently because of an IDE bug
> it still is dangerous.

I strongly disagree - we don't know that it fails on more than a few configurations at the moment. If you mark everything as (DANGEROUS), then you might as well not mark any of it (DANGEROUS), and delete the whole package.

We need to establish what causes the -Y problem, and then ask Mark to put a note saying something like, 'Do not use on kernels < 2.4.X'

When I said the person to ask would be Mark, I *didn't* mean that I thought it *should* be marked (DANGEROUS), only that we should be investigating it!!!

> >> I read somewhere that -Y only works on unmounted drives. This appears
> >> to be false. Comments?
> >
> > It should work on the raw drive regardless.

There is no reason why it should fail on a mounted drive.

John.