[Suspend2-devel] Re: [ltp] [PATCH] 2.6.17: Unload disks heads before powering down

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Fri, 29 Sep 2006 09:16:30 -0300


On Fri, 29 Sep 2006, Nigel Cunningham wrote:
> > No drivers seem to check system_state for SYSTEM_SUSPEND_DISK.  Looks like
> > something that needs a fix.
> 
> My understanding, which may be wrong, is that drivers shouldn't be
> looking at system_state. They should be passed a parameter telling them
> what to do, and should listen to it. I think the problem is that

For system_state == SYSTEM_RESTART, this functionality simply doesn't exist,
so all we can do is band-aid it currently, AFAIK.

You have shutdown handlers in buses (which are not even exported to the
device drivers of many subsystems, including scsi!)...

All in all, it is another of those areas of the kernel that are just plain
incomplete.

> kernel_restart_prepare is calling device_shutdown at all. It should be
> calling some sort of device function to ensure data is flushed, but I'm
> not sure device_shutdown is the right function.

Do you want me to try a hand at fixing this and submit the patches to you?

> > I had also silent corruption that ended up with ext3 doing very bad things
> > and hanging (no in-disk filesystem corruption though) even with
> > suspend-to-RAM (S3) in 2.6.17+suspend2.  So it may be older than 2.2.7,
> > and/or the mainline change that broke it might have been from 2.6.16 to
> > 2.6.17.
> > 
> > At least now the kernel is screaming blood murder, so it is not silent
> > anymore.
> 
> With 2.6.17? I've seen issues with 2.6.18 reported, but not .17. Perhaps
> there is a particular driver that causing you problems there.

2.6.17+suspend2 had issues, yes. But they were *very* different from what I
have observed with 2.6.18+suspend2.  2.6.17+suspend2 had silent corruption
on S3 (and I don't recall if it had issues in S4).  I have not *seen* any
such silent corruption+ext3 hang problems with 2.6.18+suspend2 (in fact, I
haven't seen any problems at all in 2.6.18+suspend2 *S3*), but they were a
bit hard to reproduce, so it is possible they are still there.  

OTOH, the kernel screaming blood murder about page cache corruption I have
never seen in 2.6.17+suspend2 S4, and I see every time in 2.6.18+suspend2
S4.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh