linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
@ 2002-09-14  1:01 Alex Davis
  2002-09-14  9:53 ` Matthias Andree
  0 siblings, 1 reply; 16+ messages in thread
From: Alex Davis @ 2002-09-14  1:01 UTC (permalink / raw)
  To: matthias.andree; +Cc: linux-kernel

>> Second, why do we need to put the disks on standby before halting? I ask because putting
>To make the broken ones flush their caches...

The cleanup() function in ide-disk.c will flush the write cache. Also, would
someone please point me to some documentation that states the cache is flushed
when the disk is put in standby: when I called Maxtor about this, they said that
the cache is NOT flushed. BTW, if your disk is so broken as to require being put
in standby mode to flush its write cache, then you are at great risk for data
corruption.

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-14  1:01 Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19) Alex Davis
@ 2002-09-14  9:53 ` Matthias Andree
  2002-09-14 13:37   ` Alan Cox
  0 siblings, 1 reply; 16+ messages in thread
From: Matthias Andree @ 2002-09-14  9:53 UTC (permalink / raw)
  To: linux-kernel

On Fri, 13 Sep 2002, Alex Davis wrote:

> The cleanup() function in ide-disk.c will flush the write cache. Also, would
> someone please point me to some documentation that states the cache is flushed
> when the disk is put in standby: when I called Maxtor about this, they said that

How about this: The FLUSH CACHE command has only recently become a
mandatory command for non-PACKET devices, so there may be drives that do
implement a write cache, but do NOT implement the FLUSH CACHE -- and
still adhere to some older edition of the ATA standard.

> the cache is NOT flushed. BTW, if your disk is so broken as to require being put
> in standby mode to flush its write cache, then you are at great risk for data
> corruption.

See above. Disable Write Cache would also do with recent drives.

IBM specified for the DeskStar 40GV and 75GXP drives (DTLA, I use this
manual as I have that handy) that Soft Reset, Standby (Immediate) and
Flush Cache commands would only be executed after the completion of
writing to media (see the OEM manual, section 10.10 write cache
function, p.91 in my edition), and goes on "It is recommended that the
host system verify the completion of the write cache operation by
issuing Soft reset, the Standby (Immediate) command, or the Flush Cache
command to the device before power off."

I think I recall that some notebook drives would need the standby
immediate to flush the cache to work around firmware bugs with other
methods.


If I recall correctly, Windows' shutdown procedure was at some time in
the past changed to wait a couple of seconds before switching the ATX
computers off, to allow the drives to flush their caches. I can't quote
on a KB article though.

-- 
Matthias Andree

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-14  9:53 ` Matthias Andree
@ 2002-09-14 13:37   ` Alan Cox
  2002-09-14 13:42     ` Miquel van Smoorenburg
  0 siblings, 1 reply; 16+ messages in thread
From: Alan Cox @ 2002-09-14 13:37 UTC (permalink / raw)
  To: Matthias Andree; +Cc: linux-kernel

On Sat, 2002-09-14 at 10:53, Matthias Andree wrote:
> How about this: The FLUSH CACHE command has only recently become a
> mandatory command for non-PACKET devices, so there may be drives that do
> implement a write cache, but do NOT implement the FLUSH CACHE -- and
> still adhere to some older edition of the ATA standard.

Worse than that. There are drives that did implement it - as a no-op.
They didn't even say "Umm sorry no can do"

> See above. Disable Write Cache would also do with recent drives.

Except some drives have a habit of turning it back on quietly

> If I recall correctly, Windows' shutdown procedure was at some time in
> the past changed to wait a couple of seconds before switching the ATX
> computers off, to allow the drives to flush their caches. I can't quote
> on a KB article though.

Flush on shutdown was apparently one of the windows 98 service pack/hot
fix additions.


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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-14 13:37   ` Alan Cox
@ 2002-09-14 13:42     ` Miquel van Smoorenburg
  0 siblings, 0 replies; 16+ messages in thread
From: Miquel van Smoorenburg @ 2002-09-14 13:42 UTC (permalink / raw)
  To: linux-kernel

In article <1032010655.12892.8.camel@irongate.swansea.linux.org.uk>,
Alan Cox  <alan@lxorguk.ukuu.org.uk> wrote:
>> How about this: The FLUSH CACHE command has only recently become a
>> mandatory command for non-PACKET devices, so there may be drives that do
>> implement a write cache, but do NOT implement the FLUSH CACHE -- and
>> still adhere to some older edition of the ATA standard.
>
>Worse than that. There are drives that did implement it - as a no-op.
>They didn't even say "Umm sorry no can do"

Putting the drive in stand-by mode has the side effect of flushing
the cache. So before poweroff, send the FLUSH CACHE command,
then send the standby command, hope that one of them works ..

I put put-the-drive-in-standby-mode stuff in halt.c of sysvinit
after several reports of fs corruption at poweroff and it seems
to have fixed the problems for the people who reported them.

Mike.


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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13  2:37 Alex Davis
  2002-09-13 13:09 ` Alan Cox
  2002-09-14  0:21 ` Matthias Andree
@ 2002-09-14 17:09 ` jbradford
  2 siblings, 0 replies; 16+ messages in thread
From: jbradford @ 2002-09-14 17:09 UTC (permalink / raw)
  To: Alex Davis; +Cc: linux-kernel

> Second, why do we need to put the disks on standby before halting?

So that data that is in their internal RAM cache is flushed before the power is switched off.

> I ask because putting the disks on standby puts my hard drives into a coma!!
> When I power up after a halt, I have to go into the BIOS and force auto-detect to wake
> them back up. I've removed the "standby" code and things seem to be functioning normally.

That is very strange.

> I have an Epox 8K7A motherboard with two Maxtor Hard drives (model 5T040H4).

Never experienced that with a Maxtor hard disk.  Best person to ask would be Alan.

John.

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 17:39       ` Andre Hedrick
@ 2002-09-14  1:08         ` Alex Davis
  0 siblings, 0 replies; 16+ messages in thread
From: Alex Davis @ 2002-09-14  1:08 UTC (permalink / raw)
  To: Andre Hedrick, Alan Cox; +Cc: linux-kernel


--- Andre Hedrick <andre@linux-ide.org> wrote:
> 
> So Alex,
> 
> What did you do prior to flush cache being added or did you care?
Never had a problem.

> but it will have to wait unless Marcelo wants it fixed and doing
> half way solutions does not cut it.  If it is wrong in -ac that is where
> it shall be fixed first.
> 
I propose getting rid of the lines in ide_notify_disk that put the disk
in standby mode. The cache is already being flushed in the cleanup()
function. I can generate a patch against 2.4.19 ac4. 

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 17:54       ` Tomas Szepe
@ 2002-09-14  0:22         ` Matthias Andree
  0 siblings, 0 replies; 16+ messages in thread
From: Matthias Andree @ 2002-09-14  0:22 UTC (permalink / raw)
  To: linux-kernel

On Fri, 13 Sep 2002, Tomas Szepe wrote:

> > I dont think so. We can't go around with 15,000 "My bios cant XYZ"
> > options and "My PCI bus ...".
> 
> How about a kernel boot/module load option then?
> Something like "ide0=ata66,noshutdown"

So use reboot rather than halt. What's the issue here? Drives won't be
shut down on a reboot, and only use halt if you are to switch the power
off. (And if necessary, bug Epox about BIOS updates. Look as though the
board was not too old.)

-- 
Matthias Andree

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13  2:37 Alex Davis
  2002-09-13 13:09 ` Alan Cox
@ 2002-09-14  0:21 ` Matthias Andree
  2002-09-14 17:09 ` jbradford
  2 siblings, 0 replies; 16+ messages in thread
From: Matthias Andree @ 2002-09-14  0:21 UTC (permalink / raw)
  To: linux-kernel

On Thu, 12 Sep 2002, Alex Davis wrote:

> Second, why do we need to put the disks on standby before halting? I ask because putting

To make the broken ones flush their caches...

> the disks on standby puts my hard drives into a coma!! When I power up after a halt, I have

hard to believe. IDE drives spin up automatically from standby mode. If
not, they're broken. Plus, IDE drives will spin up from any state except
"defective" or "power loss" with a soft reset (and only broken drives
will lose their write cache over soft reset).

> to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
> code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
> Maxtor Hard drives (model 5T040H4).

My Maxtor 4W060H4 behaves well in standby.

Workaround: do a reboot :-)

-- 
Matthias Andree

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 15:14     ` Alan Cox
@ 2002-09-13 17:54       ` Tomas Szepe
  2002-09-14  0:22         ` Matthias Andree
  0 siblings, 1 reply; 16+ messages in thread
From: Tomas Szepe @ 2002-09-13 17:54 UTC (permalink / raw)
  To: Alan Cox; +Cc: Alex Davis, linux-kernel

> > > > I have
> > > > to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
> > > > code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
> > > > Maxtor Hard drives (model 5T040H4).
> > > 
> > > Congratulations your BIOS sucks 8)
> > 
> > Alan, obviously this should be made into a config option.
> 
> I dont think so. We can't go around with 15,000 "My bios cant XYZ"
> options and "My PCI bus ...".

How about a kernel boot/module load option then?
Something like "ide0=ata66,noshutdown"

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 16:15     ` Alan Cox
@ 2002-09-13 17:39       ` Andre Hedrick
  2002-09-14  1:08         ` Alex Davis
  0 siblings, 1 reply; 16+ messages in thread
From: Andre Hedrick @ 2002-09-13 17:39 UTC (permalink / raw)
  To: Alan Cox; +Cc: Alex Davis, linux-kernel


So Alex,

What did you do prior to flush cache being added or did you care?
If you are talking about suspend, apm, acpi issues -- I am not interested
at the moment.  It was not important to the folks at the top when I tried
to address the issue, and now I have my hands full with other things.

Sorry, but it will have to wait unless Marcelo wants it fixed and doing
half way solutions does not cut it.  If it is wrong in -ac that is where
it shall be fixed first.

Cheers,

Andre Hedrick
LAD Storage Consulting Group

On 13 Sep 2002, Alan Cox wrote:

> On Fri, 2002-09-13 at 16:19, Alex Davis wrote:
> > 
> > --- Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > > To make sure they have written back their caches...
> > 
> > This is redundant, since cleanup() flushes the write cache. Also, I spoke to a 
> > Maxtor tech support person and he said that putting the drives in standby mode
> > does NOT flush the write cache. 
> 
> Whether we should be putting drives in Standby is an Andre question I
> think. One dodgy bios isnt a good reason to change it
> 
> 
> >  Yet another thing: you are flushing the cache,
> > by calling cleanup(), AFTER you put the disks to sleep. I think that's backward.
> 
> That would be a bug, but the 2.4.19 IDE code isnt my problem
> 
> Alan
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 15:19   ` Alex Davis
@ 2002-09-13 16:15     ` Alan Cox
  2002-09-13 17:39       ` Andre Hedrick
  0 siblings, 1 reply; 16+ messages in thread
From: Alan Cox @ 2002-09-13 16:15 UTC (permalink / raw)
  To: Alex Davis; +Cc: linux-kernel

On Fri, 2002-09-13 at 16:19, Alex Davis wrote:
> 
> --- Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > To make sure they have written back their caches...
> 
> This is redundant, since cleanup() flushes the write cache. Also, I spoke to a 
> Maxtor tech support person and he said that putting the drives in standby mode
> does NOT flush the write cache. 

Whether we should be putting drives in Standby is an Andre question I
think. One dodgy bios isnt a good reason to change it


>  Yet another thing: you are flushing the cache,
> by calling cleanup(), AFTER you put the disks to sleep. I think that's backward.

That would be a bug, but the 2.4.19 IDE code isnt my problem

Alan


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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 13:09 ` Alan Cox
  2002-09-13 15:10   ` Tomas Szepe
@ 2002-09-13 15:19   ` Alex Davis
  2002-09-13 16:15     ` Alan Cox
  1 sibling, 1 reply; 16+ messages in thread
From: Alex Davis @ 2002-09-13 15:19 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel


--- Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> To make sure they have written back their caches...

This is redundant, since cleanup() flushes the write cache. Also, I spoke to a 
Maxtor tech support person and he said that putting the drives in standby mode
does NOT flush the write cache. Yet another thing: you are flushing the cache,
by calling cleanup(), AFTER you put the disks to sleep. I think that's backward.

I guess the gist of my monlogue is: has anybody reported a problem that has been
solved by putting the disks to sleep??

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 15:10   ` Tomas Szepe
@ 2002-09-13 15:14     ` Alan Cox
  2002-09-13 17:54       ` Tomas Szepe
  0 siblings, 1 reply; 16+ messages in thread
From: Alan Cox @ 2002-09-13 15:14 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: Alex Davis, linux-kernel

On Fri, 2002-09-13 at 16:10, Tomas Szepe wrote:
> > > I have
> > > to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
> > > code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
> > > Maxtor Hard drives (model 5T040H4).
> > 
> > Congratulations your BIOS sucks 8)
> 
> Alan, obviously this should be made into a config option.

I dont think so. We can't go around with 15,000 "My bios cant XYZ"
options and "My PCI bus ...".


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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13 13:09 ` Alan Cox
@ 2002-09-13 15:10   ` Tomas Szepe
  2002-09-13 15:14     ` Alan Cox
  2002-09-13 15:19   ` Alex Davis
  1 sibling, 1 reply; 16+ messages in thread
From: Tomas Szepe @ 2002-09-13 15:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: Alex Davis, linux-kernel

> > I have
> > to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
> > code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
> > Maxtor Hard drives (model 5T040H4).
> 
> Congratulations your BIOS sucks 8)

Alan, obviously this should be made into a config option.

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

* Re: Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
  2002-09-13  2:37 Alex Davis
@ 2002-09-13 13:09 ` Alan Cox
  2002-09-13 15:10   ` Tomas Szepe
  2002-09-13 15:19   ` Alex Davis
  2002-09-14  0:21 ` Matthias Andree
  2002-09-14 17:09 ` jbradford
  2 siblings, 2 replies; 16+ messages in thread
From: Alan Cox @ 2002-09-13 13:09 UTC (permalink / raw)
  To: Alex Davis; +Cc: linux-kernel

> Second, why do we need to put the disks on standby before halting? I ask because putting
> the disks on standby puts my hard drives into a coma!! When I power up after a halt, 

To make sure they have written back their caches, put themselves into
happy safe sleeping mode and are quiet.

> I have
> to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
> code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
> Maxtor Hard drives (model 5T040H4).
> 

Congratulations your BIOS sucks 8)


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

* Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)
@ 2002-09-13  2:37 Alex Davis
  2002-09-13 13:09 ` Alan Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Alex Davis @ 2002-09-13  2:37 UTC (permalink / raw)
  To: linux-kernel

The ide_notify_reboot function contains the following code fragment:


		for (unit = 0; unit < MAX_DRIVES; ++unit) {
			drive = &hwif->drives[unit];
			if (!drive->present)
				continue;

			/* set the drive to standby */
			printk("%s ", drive->name);
			if (event != SYS_RESTART)
				if (drive->driver != NULL && DRIVER(drive)->standby(drive))
				continue;

			if (drive->driver != NULL && DRIVER(drive)->cleanup(drive))
				continue;
		}

The standby() function returns 0 on success, and non-zero on failure. If standby() returns
failure status, the cleanup() call is skipped. Is this intentional?

Second, why do we need to put the disks on standby before halting? I ask because putting
the disks on standby puts my hard drives into a coma!! When I power up after a halt, I have
to go into the BIOS and force auto-detect to wake them back up. I've removed the "standby"
code and things seem to be functioning normally. I have an Epox 8K7A motherboard with two
Maxtor Hard drives (model 5T040H4).


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

end of thread, other threads:[~2002-09-14 16:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-14  1:01 Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19) Alex Davis
2002-09-14  9:53 ` Matthias Andree
2002-09-14 13:37   ` Alan Cox
2002-09-14 13:42     ` Miquel van Smoorenburg
  -- strict thread matches above, loose matches on Subject: below --
2002-09-13  2:37 Alex Davis
2002-09-13 13:09 ` Alan Cox
2002-09-13 15:10   ` Tomas Szepe
2002-09-13 15:14     ` Alan Cox
2002-09-13 17:54       ` Tomas Szepe
2002-09-14  0:22         ` Matthias Andree
2002-09-13 15:19   ` Alex Davis
2002-09-13 16:15     ` Alan Cox
2002-09-13 17:39       ` Andre Hedrick
2002-09-14  1:08         ` Alex Davis
2002-09-14  0:21 ` Matthias Andree
2002-09-14 17:09 ` jbradford

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).