Re: Force IDE cache flush on shutdown

From: Benjamin Herrenschmidt
Date: Thu May 06 2004 - 20:16:47 EST



> > + printk("Flushing cache: %s \n", drive->name);
> > + ide_cacheflush_p(drive);
> > + /* give the hardware time to finish; it may return prematurely to cheat
> > */ + mdelay(300);
>
> I really don't like it.
>
> Is this delay arbitrary or you know about such devices?

Agreed... Why not standby the disk instead ? We could re-use the exact
same code path as the Power Management... At least we know that once
standby complete, we are ok (though I noticed that some proprietary
OSes still impose a half a second delay after standby and before
removing power ... broken IDE disks ...)

In fact, I'd like to kill the shutdown() callback in drivers in general
as I think it's just a special case of a PM suspend in fact. The problem
is we need once for all to fix the meaning of the "state" passed to those
callbacks. Once that's done, we can have states for restart, shutdown and
kexec (which wants devices to be put idle -> stop DMA etc...)

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/