Re: 2.5 Problem Report Status

From: Patrick Mochel (mochel@osdl.org)
Date: Wed Oct 23 2002 - 12:03:51 EST


On Wed, 23 Oct 2002 jbradford@dial.pipex.com wrote:

> > > > 2.5 Kernel Problem Reports as of 22 Oct
> > > > Status Discussion Problem Title
> > > >
> > > > --------------------------------------------------------------------------
> > > > open 17 Oct 2002 IDE not powered down on shutdown
> > > > 55. http://marc.theaimsgroup.com/?l=linux-kernel&m=103476420012508&w=2
> > > >
> > > > --------------------------------------------------------------------------
> > > >
> > > > --------------------------------------------------------------------------
> > > > open 22 Oct 2002 2.5.44 fs corruption
> > > > 77. http://marc.theaimsgroup.com/?l=linux-kernel&m=103532467828806&w=2
> > > >
> > > > --------------------------------------------------------------------------
> > >
> > > Any possibility that the above two problems are related - I.E. disks
> > > are not being flushed properly on shutdown?
> >
> > Possibly. I would be suprised however
>
> Alan - have there been any changes to the flush/spindown code between
> 2.5.42 and 2.5.44? I remember a discussion about a month ago where
> you said that it's necessary to do both, but that the order could be
> wrong. I am seriously begining to suspect that something is
> definitely wrong, because I can actually hear the disk spindown for a
> fraction of a second, then spin up again, (at least with 2.5.43, so
> far not with 2.5.44).

It's my fault. At least the the problem about the disk not spinning down.
The driver core code was changed in 2.5.44 to call ->shutdown() instead of
->remove() during system power transitions, and none of the drivers got
converted over before 2.5.44 went out. I'm really sorry about this, and I
sincerely hope that it hasn't bitten any too bad..

Concerning the actual shutdown, I'm simply calling the ide driver's
->standby() method. At least in the case of ide disks, there is a call in
the driver's ->cleanup() method to flush the cache. Should this be
moved to ->standby()? Or, should we call ->flushcache() for all drives
from ->shutdown()?

Initial patch appended.

Thanks,

        -pat

===== drivers/ide/ide.c 1.33 vs edited =====
--- 1.33/drivers/ide/ide.c Fri Oct 18 12:44:11 2002
+++ edited/drivers/ide/ide.c Wed Oct 23 09:42:27 2002
@@ -3351,6 +3351,14 @@
         return 0;
 }
 
+static void ide_drive_shutdown(struct device * dev)
+{
+ ide_drive_t * drive = container_of(dev,ide_drive_t,gendev);
+ ide_driver_t * drive = drive->driver;
+ if (driver && driver->standby)
+ driver->standby(drive);
+}
+
 int ide_register_driver(ide_driver_t *driver)
 {
         struct list_head list;
@@ -3372,6 +3380,7 @@
         driver->gen_driver.name = driver->name;
         driver->gen_driver.bus = &ide_bus_type;
         driver->gen_driver.remove = ide_drive_remove;
+ driver->gen_driver.shutdown = ide_drive_shutdown;
         return driver_register(&driver->gen_driver);
 }
 

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



This archive was generated by hypermail 2b29 : Wed Oct 23 2002 - 22:01:05 EST