First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 174373
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Daniel Drake <dsd@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: @4u <gentoo4u@vplace.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
libata_start_stop_management.patch All patches that make start/stop management work patch Ricardo Salveti 2007-05-11 05:39 0000 90.68 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 174373 depends on: Show dependency tree
Show dependency graph
Bug 174373 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-04-13 07:07 0000
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.

------- Comment #1 From @4u 2007-04-17 06:17:53 0000 -------
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?)

------- Comment #2 From Christian Heim (RETIRED) 2007-04-26 07:31:48 0000 -------
(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

------- Comment #3 From @4u 2007-04-26 07:43:29 0000 -------
(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 :)

------- Comment #4 From Daniel Drake 2007-04-26 23:54:39 0000 -------
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.

------- Comment #5 From Daniel Drake 2007-05-03 02:07:43 0000 -------
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

------- Comment #6 From Ricardo Salveti 2007-05-08 08:53:27 0000 -------
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).

------- Comment #7 From Daniel Drake 2007-05-10 22:48:17 0000 -------
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.

------- Comment #8 From Ricardo Salveti 2007-05-11 05:39:28 0000 -------
Created an attachment (id=118829) [edit]
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.

------- Comment #9 From Ricardo Salveti 2007-05-14 14:16:52 0000 -------
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.

------- Comment #10 From Jakub Moc (RETIRED) 2007-05-14 20:39:33 0000 -------
*** Bug 178559 has been marked as a duplicate of this bug. ***

------- Comment #11 From Daniel Drake 2007-05-15 03:43:44 0000 -------
Looks like our shutdown utilities don't halt scsi disks anyway.
http://marc.info/?l=linux-ide&m=117920048530447&w=2

------- Comment #12 From Francesco Pretto 2007-05-15 16:12:12 0000 -------
(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

------- Comment #13 From Ricardo Salveti 2007-05-17 23:21:07 0000 -------
I guess that now we have the final solution, no userland modification needed:

http://thread.gmane.org/gmane.linux.ide/18934

------- Comment #14 From Daniel Drake 2007-05-18 23:12:37 0000 -------
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.

------- Comment #15 From Daniel Drake 2007-05-25 02:41:29 0000 -------
Fixed in gentoo-sources-2.6.21-r2 (genpatches-2.6.21-3)

------- Comment #16 From Jakub Moc (RETIRED) 2007-08-20 20:03:28 0000 -------
*** Bug 189636 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug