I searched for this bug on bugzilla.kernel.org and found a patch. Unfortunately Tejun Heo told me that this patch will be applied earliest to linux-2.6.21.1. For that reason I want to request that the patch is added to all current and future gentoo-sources (and other kernel sources) until 2.6.21.1. Patch: http://bugzilla.kernel.org/attachment.cgi?id=10122&action=view Reproducible: Always Steps to Reproduce: 1. Use AHCI on a Thinkpad T60 for example 2. Run shutdown -h now or echo disk > /sys/power/state Actual Results: Harddisk is switched off uncleanly. SMART values disk_shift and power-off_retract_count are increased. Expected Results: Harddisk is switched of using right ATA commands. I thinks this bug is critical because this is not a intended behavior for harddisks.
Hi, unfortunately noone seems to be willing to react here. I want to point out two important things: 1. Every modern notebook with SATA (and PATA) kernels is affected. 2. Because of the Emergency Head Resets (or however it was called) it it likely that the harddrive breaks far earlier than designed!!! And at least in my opinion a broken harddrive is the worst thing that can happen. Hope someone integrates at soon ... (Is there a public holiday?)
(In reply to comment #1) > Hi, unfortunately noone seems to be willing to react here. I want to point out > two important things: > > 1. Every modern notebook with SATA (and PATA) kernels is affected. > 2. Because of the Emergency Head Resets (or however it was called) it it likely > that the harddrive breaks far earlier than designed!!! And at least in my > opinion a broken harddrive is the worst thing that can happen. > > Hope someone integrates at soon ... (Is there a public holiday?) 1. You might know, Gentoo is a voluntary project; means we *dedicate* _our_ free time to this project. 2. Our free time might be short (or we might not be able to dedicate much of our time), I know at least dsd hasn't much at the moment. 3. I'm going to look into this before we release the genpatch set for 2.6.21
(In reply to comment #2) > 1. You might know, Gentoo is a voluntary project; means we *dedicate* _our_ > free time to this project. I know and really appreciate that. > 2. Our free time might be short (or we might not be able to dedicate much of > our time), I know at least dsd hasn't much at the moment. Thats absolutely fine with me. Only a small respond would be great so that I and other users know that it has been recognized at least. > 3. I'm going to look into this before we release the genpatch set for 2.6.21 Thanks :)
We'll certainly be sure to have this fixed properly long before 2.6.21 goes stable. It doesn't affect all configurations, only some. We also need to fix the userspace part.
This isn't a 2.6.21 regression, I mismarked it earlier. There's a lot of stuff to digest here, I need to revisit it later. Relevant LKML threads: Loud "pop" coming from hard drive on reboot Weird hard disk noise on shutdown (bug #7674) Upstream bugs: http://bugzilla.kernel.org/show_bug.cgi?id=7674 http://bugzilla.kernel.org/show_bug.cgi?id=7838 More links: http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commit;h=c3c94c5a2fb43a654e777f509d5032b0db8ed09f http://article.gmane.org/gmane.linux.scsi/30489 http://article.gmane.org/gmane.linux.ide/17392 http://thread.gmane.org/gmane.linux.scsi/30487/focus=17392
Here's what I did now for now (a workaround): I tested patching kernel 2.6.20 and 2.6.21 (also the ones installed with gentoo-sources) with the implementation of START/STOP management. To do this just patch your kernel with the following patches: 1 - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=684b7fe976554d12e6266d7280c87a0f3feff02e 2 - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=62d42a62770dd66da2d3df693e70f4e5fae1716a 3 - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=e73aec8247032ee730b5f38edf48922c4f72522e;hp=a4d04a4cd9881e89fdc62107b6b57053438f2b30 4 - http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=3721050afc6cb6ddf6de0f782e2054ebcc225e9b;hp=ad8c31bb69d60c0c6bc6431bccdf67e5a96c0d31 5 - http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c3c94c5a2fb43a654e777f509d5032b0db8ed09f;hp=3721050afc6cb6ddf6de0f782e2054ebcc225e9b Then sdev->mange_start_stop will be present in your kernel. With this you can (works as a workaround, the final patches are not applied yet) just give "# echo 1 > /sys/class/scsi_disk/0\:0\:0\:0/manage_start_stop" to see you hard disk switch off normally. The final solution depends on these patches: 1 - http://article.gmane.org/gmane.linux.scsi/30489 2 - http://article.gmane.org/gmane.linux.ide/17392 Both patches are not upstream yet, and will need some modifications on 'shutdown(8)' to work with every cases. I'll try to backport both patches so we can use them as soon they're upstream (patch 3 change lots of things and patch doesn't work ok with 2.6.20 and 2.6.21).
The situation is now simpler: all that needs doing is shutdown modified as described in the URL below, plus the 2 patches in that patchset. http://thread.gmane.org/gmane.linux.ide/18485 I'll look into making the shutdown changes when those patches go into Linus' tree.
Created attachment 118829 [details, diff] All patches that make start/stop management work Almost all patches are applied successfully at 2.6.21, the only patch that has problem is http://thread.gmane.org/gmane.linux.ide/18485 , because it tries to apply the patch at file drivers/ata/pata_cmd640.c and this file doesn't exist in 2.6.21 yet. Removing this part of the patch let everything ok. If it helps, I put one patch that has every patch needed to make this work as attachment. This patch is composed of patches 1, 3, 4 and 5 from comment #6 and also patches http://article.gmane.org/gmane.linux.ide/18486 and http://article.gmane.org/gmane.linux.ide/18487 . Now it just need the shutdown modification.
Patches already upstream in 2.6.22-rc1 1- http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9666f4009c22f6520ac3fb8a19c9e32ab973e828 2- http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=920a4b1038e442700a1cfac77ea7e20bd615a2c3 Now, it's time to make the shutdown(8) fix.
*** Bug 178559 has been marked as a duplicate of this bug. ***
Looks like our shutdown utilities don't halt scsi disks anyway. http://marc.info/?l=linux-ide&m=117920048530447&w=2
(In reply to comment #11) > Looks like our shutdown utilities don't halt scsi disks anyway. > http://marc.info/?l=linux-ide&m=117920048530447&w=2 > Yeah. For everybody else interested, seems after all that no userland modifications will be needed: http://thread.gmane.org/gmane.linux.ide/18846
I guess that now we have the final solution, no userland modification needed: http://thread.gmane.org/gmane.linux.ide/18934
OK. All patches are ready but I'm going to give this some more time being tested in the 2.6.22 tree before backporting it.
Fixed in gentoo-sources-2.6.21-r2 (genpatches-2.6.21-3)
*** Bug 189636 has been marked as a duplicate of this bug. ***