Bug 8855
Description
Thomas Renninger
2007-08-07 07:48:53 UTC
Created attachment 12297 [details]
acpidump for hp nx6310
Created attachment 12298 [details]
dmidecode for hp nx6310
Created attachment 12370 [details]
acpidump for hp nx7300
My hp nx7300 exposes the same problem of double spindown on shutdown (first one due to libata and the second one issued by ACPI)
Created attachment 12371 [details]
dmidecode for hp nx7300
(In reply to comment #0) > Disk spins down twice, one is done through ACPI, one from libata core. > > This may need blacklisting of a lot machines, this bug is simply for > dmidecode > and acpidump collecting for these. Maybe we can still find similarities for > working around in DSDT code... Well, I'm not sure about the blacklisting. Namely, if device_shutdown() in the power off sequence is replaced with device_suspend(), the problem doesn't appear. I'll post the details with an attachment. Created attachment 12910 [details]
Patch that works around the problem
The attached patch works around the problem by replacing the standard power off code with the code executed during hibernation, with the exception that S5 is used as the target state instead of S4.
Interestingly, if the "if (device_suspend(PMSG_SUSPEND))" line is removed from the patch, which makes device_shutdown() to be executed in all cases, the "double disk spin off" problem reappears. This means that we do something in device_suspend() which is not done in device_shutdown() and which prevents the disk drive from spinning on before S5 is actually entered.
Created attachment 12919 [details]
Similar problem (CK804 board)
I think I may be having the same problem with shutdown/suspend. On shutdown the computer never completely stops. Here is a "screenshot" of the problem.
Both suspend & shutdown used to work with 2.6.20. I haven't tried 2.6.21 but it does happend all the time on 2.6.22.
Created attachment 12920 [details] dmesg output Tried to get acpidump from http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools-20070714-debug.tar.gz to work but got this message: [root@localhost acpidump]# ./acpidump --table DSDT ACPI tables were not found. If you know location of RSD PTR table (from dmesg, etc), supply it with either --addr or -a option Vincent, your problem is different one. Please file a separate bug reporting power isn't powered off properly. Rafael, during suspend, the controller is suspended which includes a call to pci_disable_device(). Maybe that's what's causing the difference. I don't think the workaround is a proper one, it's more of a happy accident. Note that there are machines which burn cpu cycles if the ATA controller is disabled when ACPI suspend is requested. I don't know whether that would apply to STD too but it's surely possible that some other machines will break if we suspend devices before powering off. I don't think we can avoid blacklisting here. Thanks. Well, first, I don't think that my patch above is the way to go. Still, it illustrates quite well that there's a difference between device_shutdown() and device_suspend() that leads to the platform spinning the disk for the second time in the latter case. IMHO, we should try to understand what _exactly_ the difference is. I'm not a (S)ATA expert, though. If you can prepare a debug patch for me, I'll run it and try to learn something from that. :-) > ------- Comment #11 from rjwysocki@sisk.pl 2007-09-25 04:17 -------
> Well, first, I don't think that my patch above is the way to go. Still, it
> illustrates quite well that there's a difference between device_shutdown()
> and
> device_suspend() that leads to the platform spinning the disk for the second
> time in the latter case.
>
> IMHO, we should try to understand what _exactly_ the difference is. I'm not
> a
> (S)ATA expert, though. If you can prepare a debug patch for me, I'll run it
> and try to learn something from that. :-)
I think drivers/ata/libata-core.c:ata_pci_device_do_suspend() is what's
causing the difference. If you comment out pci_disable_device() and
pci_set_power_state() calls in the function, I think you'll see double
spindown with device_suspend() too. If you want resume to work
properly, you'll need to change pcim_enable_device() call to
pci_reenable_device().
Thanks.
I didn't follow up all the discussions about this one in detail. This bug should have been a collection of dmidecodes of machines which show up the double disk spin down (caused by BIOS triggered spin down) and therefore need blacklisting. AFAIK this is not needed anymore... How so? Is this problem resolved some other way? I don't know. The last post is a quarter of a year ago... I am not that deep involved in this issue, I just wanted to create a reference of affected machines here. If you think this bug still makes sense, pls reopen, but someone else than me should get assigned to it... This one seems to have slipped through the crack. Do we still have reporters? Hello? Sure, I have an affected box. I didn't have the time to run the test requested in Comment #12, but I can do that if still relevant. Thanks. Yes, please. :-) I will tomorrow. I see (or rather hear) the double disk spindown with device_suspend() if the call to pci_set_power_state() is removed from ata_pci_device_do_suspend(). Thanks for verifying, so that means the BIOS fails to issue spin down if the controller is powered down. Gee... BIOS should never do things like this. To which controller is the hard drive attached 1f.2? Is the controller fixed to ahci mode or can you switch between ahci and ata_piix? Can you please post the boot log and the result of 'lspci -nn'. Thanks. Created attachment 14414 [details]
Boot log from HP nx6325
This is not Intel. It's a HP nx6325 with an ATI chipsed, it uses sata_sil.
Created attachment 14415 [details]
Output of lspci -nn from HP nx6325
Rafael, can you please post the result of 'dmidecode' on the machine? We need to identify the machine to blacklist it. Also, does someone have a contact at HP? Are they doing this on all their laptops? Created attachment 14457 [details]
Output of dmidecode from HP nx6325
hmm, any update on this? Not that I know of. Created attachment 15441 [details]
no-spindown-on-shutdown-quirk.patch
This is nasty but I guess it's the only way to selectively disable spindown on shutdown. Can you please test this fixes the problem?
Rafael? ping Rafael. :) Ah, sorry. I haven't been using shutdown at all on this box for the last few months. I'll try the patch later today. I tried to apply it on top of today's linux-next, but it looks like we've run out of flags in libata.h . Since the double spin-down propagated to the hibernation code path as well, it's become really annoying. I'm going to play with the patch from Comment #28 a bit shortly. Created attachment 17507 [details]
Patch fixing "double spindown on shutdown" on nx6325
This is what I ended up with.
While it does fix the "double spindown on shutdown" problem, it doesn't fix the (recently introduced) "double spindown on hibernation" problem.
What is the function used for powering off SATA drives during suspend? Created attachment 17513 [details]
Patch that fixes "double spindown" problem on shutdown and hibernation on nx6325
This patch fixes things for me, but I guess it needs some more work. Tejun?
Created attachment 17527 [details]
dmidecode info for HP 2510p
My HP Compaq 2510p laptop has the same issue with 2.6.27-rc5 for both shutdown and hibernation.
dmidecode from hp/compaq nx6310 latest bios: http://unixy.pl/maciek/download/kernel/dmidecode.txt Created attachment 17530 [details]
dmidecode from nx6310
Created attachment 17545 [details]
Another dmidecode from HP NX6310 laptop with the latest bios
I need to know which SATA drivers are used on the affected systems. I guess it's sata_sil on the nx6310, but I'm not sure about the 2510p. Created attachment 17583 [details]
Updated patch with quirks
OK, I figured out this is AHCI on both nx6310 and 2510p. If that really is the case, please test this patch and report back, otherwise let me know which SATA driver is used on your system.
If you test the patch, please run 'dmesg | grep "PCI slot:"' and post the output.
nx6310 uses ATA_PIIX not SIL: maciek@gumis:~$ cat /boot/config-2.6.26.2 | grep SATA # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_SATA_PMP is not set CONFIG_SATA_AHCI=y # CONFIG_SATA_SIL24 is not set # CONFIG_SATA_SVW is not set # CONFIG_SATA_MV is not set # CONFIG_SATA_NV is not set # CONFIG_SATA_QSTOR is not set # CONFIG_SATA_PROMISE is not set # CONFIG_SATA_SX4 is not set # CONFIG_SATA_SIL is not set # CONFIG_SATA_SIS is not set # CONFIG_SATA_ULI is not set # CONFIG_SATA_VIA is not set # CONFIG_SATA_VITESSE is not set # CONFIG_SATA_INIC162X is not set maciek@gumis:~$ cat /boot/config-2.6.26.2 | grep CONFIG_ATA # CONFIG_ATALK is not set # CONFIG_ATA_OVER_ETH is not set CONFIG_ATA=y # CONFIG_ATA_NONSTANDARD is not set CONFIG_ATA_ACPI=y CONFIG_ATA_SFF=y CONFIG_ATA_PIIX=y # CONFIG_ATA_GENERIC is not set # CONFIG_ATARI_PARTITION is not set maciek@gumis:~$ lspci | grep SATA 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 01) Still should I test this patch? Yes, please. 2.6.27-rc4, nx6310: maciek@gumis:~$ dmesg | grep "PCI slot:" ahci 0000:00:1f.2: PCI slot: 31 BTW "double spin down" still occur. Created attachment 17602 [details]
dmesg from patched 2.6.27-rc4
(In reply to comment #45) > 2.6.27-rc4, nx6310: > > maciek@gumis:~$ dmesg | grep "PCI slot:" > ahci 0000:00:1f.2: PCI slot: 31 > > BTW "double spin down" still occur. Strange, according to the dmesg output it should work. Created attachment 17613 [details]
Debug patch to check the previous fix
Please apply this patch on top of the previous one and see if you have the 10s wait and the "libata: Skipping disk spindown" message during shutdown.
Note: With the patch from Comment #42 you will always hear the disk 'click' right before powering off the system, but it should not spin off earlier. A test patch from #48 (+#42). I hear that disk power off, after for moment power on and power off. I didn't see "libata: Skipping disk spindown" message during shutdown: http://unixy.pl/maciek/download/kernel/spin_down/20080904/img_0001.jpg Disk power on again on "ACPI: Preparing on enter system sleep state S5" Created attachment 17618 [details] Patch with quirks updated 2x I made a mistake in the patch from Comment #42, please try this one instead (please attach dmesg output). Created attachment 17636 [details]
Kernel 2.6.27-rc4 with latest patch. "Double spin down" doesn't occur
Created attachment 17638 [details]
Cleaned-up quirk patch
Thanks for testing!
This patch is a cleaned-up version that I'd like to submit for inclusion. I have removed the 2510p entry from it, because of the missing PCI slot information, but we'll able to add this box to the list in future.
Can you please test this one to make sure it still works on the nx6310 ?
Created attachment 17639 [details]
Last patch works fine, without any problems. Thanks for help
Created attachment 17640 [details]
dmesg from HP Compaq 2510p
Patch with id 17618 tested as requested, but does not work for me.
Possibly because my laptop uses a different disk driver (ata_piix instead of sata_sil)?
(In reply to comment #55) > Created an attachment (id=17640) [details] > dmesg from HP Compaq 2510p > > Patch with id 17618 tested as requested, but does not work for me. > Possibly because my laptop uses a different disk driver (ata_piix instead of > sata_sil)? Yes, it uses ata_piix, but I thought it would use AHCI. I'll prepare a patch for you to test in a while. Created attachment 17641 [details]
Cleaned-up quirk patch with support for HP 2510p (partial)
Frans, please test this patch and attach dmesg.
Created attachment 17642 [details]
dmesg from HP Compaq 2510p with latest patch
Seems to work correctly for me with patch 17641.
Created attachment 17646 [details]
Patch for nx6325, nx6310 and 2510p
This is the patch I'm going to submit. It contains all of the necessary information for HP nx6325, HP nx6310 and HP 2510p. Maciej, Frans, please verify that it works for you ("quirky BIOS" should be present in dmesg output).
Created attachment 17647 [details]
demsg from 2.6.27-rc4
Works OK on nx6310
I noticed one problem with patch id=17646 form comment #59 In 2.6.27-rc4(-rc5) a notice "click" (emergency head unload) from disk during hibernation (*not* during shutdown). It seems that power was cut off to fast. I remove this patch in 2.6.27-rc5 and hibernation works OK (on shutdown, except double spins down, too). differences between -rc4 and -rc5 (also I try this): -rc4: CONFIG_IDE=y -rc5: CONFIG_IDE is not set But this nothing change. Hm. On my box, without the patch from comment #59, I can hear two 'clicks' during hibernation (in the last phase), one caused by the kernel's disk spin-off and the second caused by the ACPI one. It seems to follow from your description that your box behaves differently during hibernation. Created attachment 17666 [details] Modified patch from comment #59 Please try this version of the patch and check if both hibernation and shutdown work as expected with it. With this very latest patch I still get the double spinoff during hibernation, but not during power off on the 2510p. Test patch from comment #63. Hibernation and shutdown works OK. Also SMART shows, that disk is power off correctly. Thanks for help. Created attachment 17702 [details] Patch from comment #59 modified 2x This patch should work correctly for both of you. Please test it. Tested witch 2.6.27-rc5 on nx6310, hibernation and shutdown woks OK Both shutdown and hibernation seem good now: only a single spin down with both. Tested with rc6 on my HP 2510p. One strange thing is that at the very end of hibernation I do hear a definite "pop" which I do not hear on shutdown. But the same "pop" is also there after the second spin down with unpatched 2.6.26.3 (and with rc5 with your previous patch). It does not result in an increase of the SMART power-off retract count though. I do hear the same "pop" if I force-shutdown the system by holding down the power button. So separate issue from your patch I think, but suggestions welcome. P.S. I'm not at all sure that the "pop" is from the disk. I hear it on suspend to RAM too. Ah, false alarm probably. I think the sound card is responsible: the "pop" seems to come from the speaker, but it's hard to localize with 100% certainty. Sorry for the noise. nx6310: shutdown XP: i hear silent "click" but it isn't emergency unload. The same on 2.6.27-rc(5..6) with/without(except double spin down) latest patch during shutdown and hibernation. And I think that patch works OK on my machine. When cut off power supply or push power button the "click" from disk is loud, and is different compared to normal shutdown/hibernation. Created attachment 17868 [details]
acpidump for HP nx7400
problem occurs only if the disk's power management settings have been altered with hdparm -B since cold boot (even if the original setting is restored with hdparm)
Created attachment 17869 [details]
dmidecode for HP nx7400
problem occurs only if the disk's power management settings have been altered with hdparm -B since cold boot (even if the original setting is restored with hdparm)
Hi all, Sorry to be a little late to the party, but I have the same problem on my HP nx7400 laptop with a Seagate Momentus 5400.2 disk. It's a little more complicated though, as the spindown-spinup issue only happens if I disable power management on the disk in order to fix the dreaded "frequent head unload" problem (see http://ata.wiki.kernel.org/index.php/Known_issues#Drives_which_perform_frequent_head_unloads_under_Linux). In other words, if I do nothing then my disk will die too early because of the unload stuff, if I fix that with hdparm -B 2555 then it will die too early because of the "spindown twice" problem. What I've been doing up to now is just reboot the laptop and use the power button when I see GRUB coming up. Restoring the original power management setting with hdparm -B 128 before shutting down doesn't help. I've added acpidump and dmidecode attachments for the HP nx7400. This BR is still open, but has been fixed ages ago by 2a6e58d2731dcc05dafa7f976d935e0f0627fcd7 (2.6.29-rc3). |