Skip to contentSkip to conversation

Possible bug and question about ide_notify_reboot in drivers/ide/ide.c (2.4.19)

DISCUSSION Alex Davis 4 participants 4 messages Sep 14, 2002

lore
Share & tools
lore

Alex Davis

author
#0 lore raw
Quoted 2 lines
Quoted 1 line

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

#1 lore raw
Quoted 3 lines · Alex Davis

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.

Quoted 3 lines

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.

Signature · 1 line
Matthias Andree
#2 lore raw
Quoted 4 lines · Matthias Andree

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"

Quoted 1 line

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

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

Quoted 4 lines

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.

#3 lore raw

In article <[email protected]>,

Quoted 7 lines · Alan Cox
Quoted 4 lines

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.