SATA suspend-to-ram patch - merge?
Hi,
Debugging a friend's new IBM Thinkpad T43, I found that I had to use this patch by Jens Axboe to get suspend-to-RAM working on his machine, to prevent SATA from completely flipping out on resume and hanging on any disk activity:
http://seclists.org/lists/linux-kernel/2005/May/0447.html
The patch is not in 2.6.13, and currently doesn't apply to either that or 2.6.12 - a quick-and-(very-)dirty rediff for only the drivers needed (ata_piix) worked for my purposes, and the machine suspends and resumes correctly now.
I investigated a little and noticed that the patch in its current form doesn't seem to exist in 2.6.14-rc1, but there are some new ATA commands
-- ATA_CMD_STANDBY etc. that have been introduced, which seem vaguely
relevant to the problem. I'm not sure whether those changes do any of the work that Jens' patch did, and I also haven't tested that kernel yet on my friend's machine.
Is Jens' patch still relevant? If so, should it be rediffed and merged into mainline? It doesn't seem to cause any weird side-effects.
More importantly, I would be inclined to properly rediff Jens' patch and merge it into Debian 2.6.12 kernel sources if there aren't any such side-effects, since it benefits everyone using SATA and suspend-to-ram (that is, users of relatively modern laptops.)
Thanks!
Signature · 1 line
Joshua Kwan
Quoted 7 lines · Joshua Kwan
Is Jens' patch still relevant? If so, should it be rediffed and merged into mainline? It doesn't seem to cause any weird side-effects.
More importantly, I would be inclined to properly rediff Jens' patch and merge it into Debian 2.6.12 kernel sources if there aren't any such side-effects, since it benefits everyone using SATA and suspend-to-ram (that is, users of relatively modern laptops.)
Jens' patch is technical correct for SATA, but really we want to do more stuff at the SCSI layer (see James Bottomley's response to Jens' patch).
Unfortunately, this also implies that we have to figure out which SCSI devices are available to be power-managed, and which SCSI devices are on a shared bus that should never be suspended.
So currently we are in limbo...
Jeff
Quoted 9 lines · Jeff Garzik
Quoted 7 lines · Joshua Kwan
Is Jens' patch still relevant? If so, should it be rediffed and merged into mainline? It doesn't seem to cause any weird side-effects.
More importantly, I would be inclined to properly rediff Jens' patch and merge it into Debian 2.6.12 kernel sources if there aren't any such side-effects, since it benefits everyone using SATA and suspend-to-ram (that is, users of relatively modern laptops.)
Quoted 8 lines
Jens' patch is technical correct for SATA, but really we want to do more stuff at the SCSI layer (see James Bottomley's response to Jens' patch).
Unfortunately, this also implies that we have to figure out which SCSI devices are available to be power-managed, and which SCSI devices are on a shared bus that should never be suspended.
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
Signature · 1 line
Jens Axboe
Quoted 4 lines
Quoted 1 line
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
Except that it actually does work, with Jen's patch.
Rather than sitting around for another six months hoping the problem will go away (it won't), perhaps we should just update/merge Jen's patch as a sorely needed interim fix.
This might then prod James et al into looking more at the SCSI side of things, and some year we might see this get replaced with a better scheme.
This is a real problem, and an immediate solution is needed last spring.
Cheers
Quoted 3 lines · Mark Lord
Rather than sitting around for another six months hoping the problem will go away (it won't), perhaps we should just update/merge Jen's patch as a sorely needed interim fix.
As a datapoint, we've been shipping it in Ubuntu for a month or so now and we haven't had any reported problems.
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 8 lines · Matthew Garrett
Quoted 3 lines · Mark Lord
Rather than sitting around for another six months hoping the problem will go away (it won't), perhaps we should just update/merge Jen's patch as a sorely needed interim fix.
As a datapoint, we've been shipping it in Ubuntu for a month or so now and we haven't had any reported problems.
(dunno why I was trimmed from the reply?)
SUSE has shipped it in 9.3 and now in 10.0 as well.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Mark Lord
Quoted 4 lines
Quoted 1 line
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
Except that it actually does work, with Jen's patch.
(Jens's, not Jen's!)
Yes, I'm very aware of that. The above note refers to what is currently shipping in Linus's tree, and sata suspend definitely does not work there.
Quoted 8 lines
Rather than sitting around for another six months hoping the problem will go away (it won't), perhaps we should just update/merge Jen's patch as a sorely needed interim fix.
This might then prod James et al into looking more at the SCSI side of things, and some year we might see this get replaced with a better scheme.
This is a real problem, and an immediate solution is needed last spring.
Could not have said it better myself. It's not like the patch is hack either.
Signature · 1 line
Jens Axboe
Quoted 8 lines · Mark Lord
Rather than sitting around for another six months hoping the problem will go away (it won't), perhaps we should just update/merge Jen's patch as a sorely needed interim fix.
This might then prod James et al into looking more at the SCSI side of things, and some year we might see this get replaced with a better scheme.
This is a real problem, and an immediate solution is needed last spring.
Folks, bitching around on lkml on this won't get you far. Send the patch to linux-scsi again, and explain what's the current stance on the disk synchronize cache and spindown issues.
Quoted 4 lines · Jens Axboe
Quoted 1 line
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
Not really, everyone on the planet who cares is using the existing patch and that just works. If the SCSI folks can't fix the SCSI layer to do power management then the scsi drivers just need to not provide pm methods until they catch up.
Blocking SATA suspend which people need for SCSI suspend which is utterly obscure and weird is pointless, as pretty much ever vendor except Red Hat has already decided.
Alan
Quoted 10 lines · Alan Cox
Quoted 4 lines · Jens Axboe
Quoted 1 line
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
Not really, everyone on the planet who cares is using the existing patch and that just works. If the SCSI folks can't fix the SCSI layer to do power management then the scsi drivers just need to not provide pm methods until they catch up.
It's a shame for the people not using distros, since they need to first experience the suspend failure, then google around for a solution, find the patch, etc. That is a shame, since it could have worked out of the box since 2.6.12 at least.
And it's a shame because it causes extra work for me everytime we update the SUSE kernel :-)
Signature · 1 line
Jens Axboe
Quoted 4 lines · Jens Axboe
It's a shame for the people not using distros, since they need to first experience the suspend failure, then google around for a solution, find the patch, etc. That is a shame, since it could have worked out of the box since 2.6.12 at least.
Its a symptom of general problems in this area. To get a sane kernel you have to not only pick a distro kernel right now but then add several other patches only found in other distributions.
SCSI suspend should not be blocking SATA suspend. If SCSI isn't with the program yet then SCSI should just not support suspend while allowing SATA to do so.
Alan
Quoted 8 lines · Alan Cox
Quoted 4 lines · Jens Axboe
It's a shame for the people not using distros, since they need to first experience the suspend failure, then google around for a solution, find the patch, etc. That is a shame, since it could have worked out of the box since 2.6.12 at least.
Quoted 7 lines
Its a symptom of general problems in this area. To get a sane kernel you have to not only pick a distro kernel right now but then add several other patches only found in other distributions.
SCSI suspend should not be blocking SATA suspend. If SCSI isn't with the program yet then SCSI should just not support suspend while allowing SATA to do so.
I agree with Alan, Mark and Jens -- indeded, one should do what makes sense.
Luben
Quoted 3 lines · Alan Cox
SCSI suspend should not be blocking SATA suspend. If SCSI isn't with the program yet then SCSI should just not support suspend while allowing SATA to do so.
Jens' patch updates the SCSI layer -- as is proper and needed.
Someone needs to take Jens patch to linux-scsi as Christoph mentioned, maybe there is a change in the wind...
Jeff
Quoted 9 lines · Jeff Garzik
Quoted 3 lines · Alan Cox
SCSI suspend should not be blocking SATA suspend. If SCSI isn't with the program yet then SCSI should just not support suspend while allowing SATA to do so.
Jens' patch updates the SCSI layer -- as is proper and needed.
Someone needs to take Jens patch to linux-scsi as Christoph mentioned, maybe there is a change in the wind...
Why not just send it to me and Andrew and get it merged.
The way we keep everybody honest (me, maintainers, and random developers) is with this concept called "open source", which means that anybody can fix a problem, and you don't need to wait for the "vendor".
Yes, it's good to go through channels, but when that doesn't work, it's good to go _past_ them too.
Linus
Quoted 8 lines · Linus Torvalds
Why not just send it to me and Andrew and get it merged.
The way we keep everybody honest (me, maintainers, and random developers) is with this concept called "open source", which means that anybody can fix a problem, and you don't need to wait for the "vendor".
Yes, it's good to go through channels, but when that doesn't work, it's good to go _past_ them too.
Umm, no one tried. The last time it came up there was a healthy discussion, but it stopped somewhere and no one followed up. There were two sets of patches from Jens and James and we need to arrive somewhere in the middle.
That's exactly what I said above, people should stop bitching and bring the patch up again - I'm pretty sure we'll find an acceptable variant real soon.
Quoted 10 lines · Christoph Hellwig
Quoted 8 lines · Linus Torvalds
Why not just send it to me and Andrew and get it merged.
The way we keep everybody honest (me, maintainers, and random developers) is with this concept called "open source", which means that anybody can fix a problem, and you don't need to wait for the "vendor".
Yes, it's good to go through channels, but when that doesn't work, it's good to go _past_ them too.
Quoted 8 lines
Umm, no one tried. The last time it came up there was a healthy discussion, but it stopped somewhere and no one followed up. There were two sets of patches from Jens and James and we need to arrive somewhere in the middle.
That's exactly what I said above, people should stop bitching and bring the patch up again - I'm pretty sure we'll find an acceptable variant real soon.
Sure, I'll brush up a version and post it tomorrow.
Signature · 1 line
Jens Axboe
Quoted 13 lines · Jens Axboe
Quoted 12 lines · Jeff Garzik
Quoted 7 lines · Joshua Kwan
Is Jens' patch still relevant? If so, should it be rediffed and merged into mainline? It doesn't seem to cause any weird side-effects.
More importantly, I would be inclined to properly rediff Jens' patch and merge it into Debian 2.6.12 kernel sources if there aren't any such side-effects, since it benefits everyone using SATA and suspend-to-ram (that is, users of relatively modern laptops.)
Jens' patch is technical correct for SATA, but really we want to do more stuff at the SCSI layer (see James Bottomley's response to Jens' patch).
Quoted 8 lines
Quoted 5 lines
Unfortunately, this also implies that we have to figure out which SCSI devices are available to be power-managed, and which SCSI devices are on a shared bus that should never be suspended.
So currently we are in limbo...
Which is a shame, since it means that software suspend on sata is basically impossible :)
so just go with Jens's patch for SATA until SCSI knows more about power management??
Signature · 1 line
~Randy
Hi!
Quoted 11 lines
Quoted 10 lines
Is Jens' patch still relevant? If so, should it be rediffed and merged
into mainline? It doesn't seem to cause any weird side-effects.More importantly, I would be inclined to properly rediff Jens' patch and
merge it into Debian 2.6.12 kernel sources if there aren't any such side-effects, since it benefits everyone using SATA and suspend-to-ram
(that is, users of relatively modern laptops.)
Quoted 7 lines
Jens' patch is technical correct for SATA, but really we want to do more stuff at the SCSI layer (see James Bottomley's response to Jens' patch).
Unfortunately, this also implies that we have to figure out which SCSI devices are available to be power-managed, and which SCSI devices are on a shared bus that should never be suspended.
I think that shared buses are rare enough to be safely ignored. We could simply say "never ever suspend machine with some disks on shared bus".
Pavel
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
Quoted 1 line · Pavel Machek
I think that shared buses are rare enough to be safely ignored.
Hardly. This potentially covers many enterprise installations that use fibre channel, iSCSI, plus the upcoming SAS device networks.
Desktop != the entire universe.
Quoted 2 lines
We could simply say "never ever suspend machine with some disks on shared bus".
This is indeed a fair statement, at least in the short term.
Jeff