Skip to contentSkip to conversation

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

DISCUSSION Alex Davis 6 participants 12 messages Sep 13, 2002 – Sep 14, 2002

lore
Share & tools
lore

Alex Davis

author
#0 lore raw

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

#1 lore raw
Quoted 2 lines

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.

Quoted 5 lines

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)

#2 lore raw
Quoted 6 lines
Quoted 4 lines

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.

#3 lore raw
Quoted 8 lines · Tomas Szepe
Quoted 6 lines
Quoted 4 lines

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

#4 lore raw
Quoted 11 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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"

#5 lore raw
Quoted 5 lines · Tomas Szepe
Quoted 2 lines

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

Signature · 1 line
Matthias Andree
author
#6 lore raw
In reply to Alan Cox
Quoted 1 line · --- Alan Cox

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

#7 lore raw
Quoted 7 lines · Alex Davis
Quoted 1 line · --- Alan Cox

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

Quoted 2 lines

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

#8 lore raw

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

Quoted 26 lines · Alan Cox
Quoted 7 lines · Alex Davis
Quoted 1 line · --- Alan Cox

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

Quoted 2 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author
#9 lore raw
Quoted 4 lines · --- Andre Hedrick

So Alex,

What did you do prior to flush cache being added or did you care?

Never had a problem.

Quoted 4 lines

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

#10 lore raw
In reply to Alex Davis
Quoted 1 line · Alex Davis

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

Quoted 1 line

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

Quoted 3 lines

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

Signature · 1 line
Matthias Andree
#11 lore raw
In reply to Alex Davis
Quoted 1 line

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.

Quoted 3 lines

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.

Quoted 1 line

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.