[Bug 229210] New: SATA drive powered off incorrectly
https://bugzilla.novell.com/show_bug.cgi?id=229210 Summary: SATA drive powered off incorrectly Product: openSUSE 10.2 Version: Final Platform: i686 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: axgrau@yahoo.co.uk QAContact: qa@suse.de The hard drive heads park with a click noise when shutting down the computer. This is an Acer TravelMate 4200 laptop with a Hitachi Travelstar SATA drive (Model HTS541010G9AT00). Suse 10.1 powers off the computer correctly, probably because of a libata-acpi-suspend patch which now has been dropped. From Suse 10.1 kernel source: +/** + * ata_device_shutdown - send Standby Immediate command to drive + * @ap: target ata_port + * @dev: target device on the ata_port + * + * This command makes it safe to power-off a drive. + * Otherwise the heads may be flying at the wrong place + * when the power is removed. + */ +int ata_device_shutdown(struct ata_port *ap, struct ata_device *dev) +{ + + if (!ata_dev_present(dev)) + return 0; + + ata_standby_drive(ap, dev); + ap->flags |= ATA_FLAG_SUSPENDED; + + return 0; +} + This problem is addressed also in Debian (bug #348172), where they patch the halt command in sysvinit so that halt -h spins down not only IDE disks but also SATA disks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 gregkh@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|kernel- |hare@novell.com |maintainers@forge.provo.nove| |ll.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 hare@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|hare@novell.com |teheo@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |axgrau@yahoo.co.uk ------- Comment #1 from teheo@novell.com 2007-01-08 10:54 MST ------- I'm not really sure whether this can be called a bug. Modern disks don't need software spin down. Just powering off is enough. Clicking or not, it should be okay. Do you have any other reason than the noise to believe that the behavior should be changed? Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 axgrau@yahoo.co.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|axgrau@yahoo.co.uk | ------- Comment #2 from axgrau@yahoo.co.uk 2007-01-08 15:06 MST ------- According to the specifications on the Hitachi website, the required power-off sequence is: 1) Issue one of the following commands: - Standby - Standby immediate - Sleep without issuing the Flush Cache command 2) Wait until the Command Complete status is returned. 3) Terminate power to HDD This is on page 31 of the pdf at www.hitachigst.com/tech/techlib.nsf/techdocs/17351B59F3028F4486256D3D0065D995/$file/d7k250S_sp.pdf It seems to me that step 1 is not performed correctly by the vanilla kernel, and I would consider this is a bug that could potentially lead to the damage of the disk. The fix used in Suse 10.1 doesn't seem trivially applicable to the new kernel, so I'm sorry I have not the knowledge to propose a patch. I also found a similar report in Ubuntu (https://launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/63937) which has been forwarded upstream (http://bugzilla.kernel.org/show_bug.cgi?id=7396). Unfortunately this hasn't been addressed so far. I should add that the disk spins down properly when I suspend to ram. Hopefully this issue will be resolved upstream, but it would be nice if a fix were made available also for Suse 10.2. Thank you. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #3 from teheo@novell.com 2007-01-11 04:48 MST ------- I see. libata doesn't spin down the drive because SCSI midlayer no longer issues START_STOP_DRIVE on shutdown. The change was for multi-initiator SCSI disks and on the basis that no modern disks need explicit parking, which I think is true. I don't see easy kernel solution here. For the time being, it's best handled by hdparm as the debian guys chose to deal with the issue. I'll ask this bug to be reassigned. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |ro@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ro@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|ro@novell.com |teheo@novell.com Status|ASSIGNED |NEW -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 auxsvr@yahoo.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |auxsvr@yahoo.com ------- Comment #9 from auxsvr@yahoo.com 2007-02-17 08:25 MST ------- I have a problem that may be related: when shutting down, the HDD (I have a SATA and a PATA connected on a promise tx2plus SATA controller) spins down then up for about half a second then the system halts. This behaviour started appearing in early 2.6 kernels; earlier versions would shut down correctly (just like windows xp does). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |auxsvr@yahoo.com ------- Comment #10 from teheo@novell.com 2007-02-21 07:09 MST ------- John, that sounds like a different issue. Or at least different symptom. Can you please post '/var/log/boot.msg' and the result of 'hdparm -I /dev/yourdrive' and, if possible, netconsole log of shutting down (does the kernel say anything while the drive spins up)? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #11 from auxsvr@yahoo.com 2007-02-21 07:31 MST ------- Created an attachment (id=120314) --> (https://bugzilla.novell.com/attachment.cgi?id=120314&action=view) hdparm -I /dev/sda output -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #12 from auxsvr@yahoo.com 2007-02-21 07:50 MST ------- Created an attachment (id=120319) --> (https://bugzilla.novell.com/attachment.cgi?id=120319&action=view) /var/log/boot.msg The system had previously crashed as I was experimenting with suspend to RAM, which suspends the PC, wakes it up normally (everything works fine for a while) and crashes upon disk access (I even removed ata_piix before STR), but that's another story! By the way, when suspending to RAM, the disks shutdown normally. When shutting down, the kernel emits a "Syncing md devices" message, during which the spin down-up-down sequence I described above occurs. The disks aren't in RAID configuration (actually the controller thinks every disk is a separate RAID array, but linux sees them as autonomous disks). This behaviour is independent of whether the nVidia and the VMware kernel modules are loaded. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|auxsvr@yahoo.com | ------- Comment #13 from teheo@novell.com 2007-02-22 00:37 MST ------- I see. Your drive seems to spin up harddrive on flush even when the cache is actually empty. Note taken. sata_promise is not yet fully ready for suspend. The next release should behave better. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #14 from auxsvr@yahoo.com 2007-02-28 09:12 MST ------- I activated suspend to write in the BIOS and now disks shutdown normally! I deactivated it and was unable to reproduce the spin down-up-down behaviour (which was happening for years, only on linux and forced me to reboot when wanting to shutdown to avoid disk strain), so maybe you should ignore my previous postings until I find out what is really going on here. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |axgrau@yahoo.co.uk ------- Comment #15 from teheo@novell.com 2007-02-28 09:22 MST ------- What exactly is 'suspend to write' in BIOS? What's the exact wording and what does the manual say about it? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #16 from auxsvr@yahoo.com 2007-02-28 10:11 MST ------- Sorry, I meant suspend to RAM (STR or S3). My BIOS DSDT has no problems for what it's worth (I've checked it with the Intel ASL compiler). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|axgrau@yahoo.co.uk | ------- Comment #17 from teheo@novell.com 2007-03-12 09:39 MST ------- This is being worked on. Please stand by. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |LATER ------- Comment #18 from teheo@novell.com 2007-03-20 10:14 MST ------- Okay, patches submitted for upstream review. http://thread.gmane.org/gmane.linux.scsi/30487 As the change involves rewrite of libata suspend/resume support. I don't think it's suitable for SL102 or SLES10SP1 update. We also need to update shutdown(8) to fix the problem completely. Please take a look at the last patch. http://article.gmane.org/gmane.linux.ide/17392 Ruediger: I'm resolving this bug entry as LATER and will let you know if the proposed change is agreed upon. I'll then port it to SL102 and (future) SLES10SP2 branches and you'll need to update shutdown(8) as described in the last patch. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |teheo@novell.com Status|RESOLVED |REOPENED Resolution|LATER | ------- Comment #19 from teheo@novell.com 2007-05-14 09:34 MST ------- Okay, fix has made into the tree and shutdown(8) needs updating. Reopening and reassigning to Ruediger. Please take a look at the following page for more info. http://linux-ata.org/shutdown.html (will be updated to the following page soon) http://htj.dyndns.org/shutdown.html Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|teheo@novell.com |ro@novell.com Status|REOPENED |NEW ------- Comment #20 from teheo@novell.com 2007-05-14 09:35 MST ------- Reassigning... If you have any question, just ask. Thanks and sorry about the mess. :-( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ro@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|Basesystem |Basesystem Product|openSUSE 10.2 |openSUSE 10.3 Version|Final |Alpha 0plus -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ro@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|ro@novell.com |werner@novell.com Status|ASSIGNED |NEW ------- Comment #21 from ro@novell.com 2007-06-04 16:03 MST ------- so if I get this right, this is about patching the shutdown binary from the sysvinit package. Reassigning accordingly. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |axgrau@yahoo.co.uk ------- Comment #22 from werner@novell.com 2007-06-05 03:04 MST ------- The program shutdown does _never_ powerdown any HW. This is done by the program `halt` called as the last program at poweroff/halt[1]. Beside this, where can I find the patch or the necessary user space systemcalls for inclusion in the source code of halt? Without a patch I's like to close this bug as WONTFIX. {1] shutdown cause the running /sbin/init to execute the boot scripts for runlevel 0 aka halt. After shutting down all services and processes the script /etc/init.d/halt executes in the last line the program haltwith the appropiate options, e.g. for poweroff the disks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #23 from werner@novell.com 2007-06-05 06:20 MST ------- Created an attachment (id=144169) --> (https://bugzilla.novell.com/attachment.cgi?id=144169&action=view) sysvinit-2.86-hddown.patch With this patch I use /sys/block/ to detected nonm removable media aka hard disks. Should work with all disks found in /sys/block/. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |RESOLVED Info Provider|axgrau@yahoo.co.uk | Resolution| |FIXED ------- Comment #24 from werner@novell.com 2007-06-05 06:49 MST ------- I've done a few small changes on the last patch to speed up the stuff even for large systems. Please test the submitted sysvinit package together with the last aaa_base from `Tue Jun 5 12:04:35 CEST 2007' or newer. This because the sysfs /sys should stay mounted throughout the halt/poweroff phase. otherwise the code will fail. If the tests fail please reopen the bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Comment #25 from teheo@novell.com 2007-06-05 22:28 MST ------- It should be a bit more complex than that. Problems... 1. Will cause double spindown for some drives on newer kernels. 2. HDIO_DRIVE_CMD only works on ide and recent libata drivers. 3. Issuing spin down to multi-initiator drives will cause problems. Luckily, #2 and #3 cancel each other. We can choose one of the followings. 1. (simple one) Don't do anything. The kernel changes have been improved such that the kernel does the right thing if userland shutdown (halt/poweroff) doesn't do anything prior to initiating kernel shutdown, so newer distributions (10.3 and SLE11) will do the right thing without any update to userland sysvinit but all existing ones will shorten lifespan of drives on each poweroff. 2. (more complex but better one) Update shutdown such that it behaves according to section 3-1-a of http://linux-ata.org/shutdown.html and issue update for existing distributions which have libata drivers (SL102 and SLE9/10). Note that the shutdown(8) should only spin down libata drives. Debian is taking this path. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEEDINFO Info Provider| |teheo@novell.com ------- Comment #26 from werner@novell.com 2007-06-06 02:43 MST ------- Do have some lines of sample code around? This because if http://linux-ata.org/shutdown.html#3-1.%20If%20you%20are%20shutdown(8)%20maintainer%20of%20a%20distro,|outline is true, then the patch accessing only /dev/sda upto /dev/sdh with the ioctl HDIO_DRIVE_CMD used by debian also is useless. Beside this: what does Check whether /sys/class/scsi_disk/h:c:i:l/manage_start_stop exists. If it doesn't, synchronize cache and spin the disk down as before. If it does, do nothing and continue to the next disk. The file is also accessible as /sys/block/sdX/device/scsi_disk:*/manage_start_stop. mean? Should I check not only /sys/block/sd<x>/removable but also /sys/block/sd<x>/device/scsi_disk:*/manage_start_stop and skip the ioctl HDIO_DRIVE_CMD if the later one does _not_ exists? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #27 from teheo@novell.com 2007-06-06 02:53 MST ------- AFAIK, Henrique is working on debian fix. I'll ask him whether he has working code now. Yeah, you need to check manage_start_stop and issue FLUSH CACHE followed by STANDBYNOW if the file is *not* there. I'm not sure about the removeable test tho (does debian do that?). Also, the preferred way to issue direct commands is using SAT commands over SG_IO but HDIO_DRIVE_CMD works and is much simpler. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #28 from werner@novell.com 2007-06-06 02:54 MST ------- What about kernels do not having /sys/class/scsi_disk/h:c:i:l/ nor /sys/block/sd<x>/device/scsi_disk:h:c:i:l/ like this one: /suse/werner> uname -r 2.6.21-rc7-3-default /suse/werner> lsscsi [0:0:0:0] disk Maxtor 3 4098H4 0811 /dev/sda [6:0:0:0] disk Hama CF Card Reader 9317 /dev/sdb [6:0:0:1] disk Hama SM Card Reader 9317 /dev/sdc [6:0:0:2] disk Hama SD Card Reader 9317 /dev/sdd [6:0:0:3] disk Hama MS Card Reader 9317 /dev/sde /suse/werner> ls -Gl /sys/block/sda/ total 0 -r--r--r-- 1 root 4096 Jun 6 10:45 dev lrwxrwxrwx 1 root 0 Jun 6 10:45 device -> ./../devices/pci0000:00/0000:00:06.0/0000:02:00.1/usb2/2-3/2-3:1.0/host0/target0:0:0/0:0:0:0 drwxr-xr-x 2 root 0 May 14 14:52 holders drwxr-xr-x 3 root 0 May 14 14:52 queue -r--r--r-- 1 root 4096 Jun 6 10:45 range -r--r--r-- 1 root 4096 Jun 6 10:45 removable drwxr-xr-x 3 root 0 May 14 14:52 sda1 -r--r--r-- 1 root 4096 Jun 6 10:45 size drwxr-xr-x 2 root 0 May 14 14:52 slaves -r--r--r-- 1 root 4096 Jun 6 10:45 stat lrwxrwxrwx 1 root 0 Jun 6 10:46 subsystem -> ../../block --w------- 1 root 4096 Jun 6 10:45 uevent /suse/werner> ls -Gl /sys/class/scsi_disk/0:0:0:0/ total 0 -r--r--r-- 1 root 4096 Jun 6 10:45 FUA -rw-r--r-- 1 root 4096 Jun 6 10:45 allow_restart -rw-r--r-- 1 root 4096 Jun 6 10:45 cache_type lrwxrwxrwx 1 root 0 Jun 6 10:45 device -> ./../../devices/pci0000:00/0000:00:06.0/0000:02:00.1/usb2/2-3/2-3:1.0/host0/target0:0:0/0:0:0:0 lrwxrwxrwx 1 root 0 Jun 6 10:45 subsystem -> ../../../class/scsi_disk --w------- 1 root 4096 Jun 6 10:45 uevent why does the link /sys/block/sda/device/scsi_disk:0:0:0:0 not exist: /suse/werner> ls -Gl /sys/block/sda/device/scsi_disk:0:0:0:0 ls: cannot access /sys/block/sda/device/scsi_disk:0:0:0:0: No such file or directory -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #29 from teheo@novell.com 2007-06-06 03:00 MST ------- Hmmm.... That's weird. The link gotta be there if /sys/block/sda exists. Can you post /var/log/boot.msg? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #30 from werner@novell.com 2007-06-06 03:02 MST ------- I've found an other system with an SATA system also kernel 2.6.21 witout the link scsi_disk:0:0:0:0 within /sys/block/sda/device/ : /suse/werner> uname -r 2.6.21-10-default /suse/werner> ls /sys/block/sda/ dev device holders queue range removable sda1 sda2 sda3 sda4 size slaves stat subsystem uevent /suse/werner> ls /sys/block/sda/device/ block:sda driver iodone_cnt model queue_type scsi_level timeout vendor delete generic ioerr_cnt power rescan state type device_blocked iocounterbits iorequest_cnt queue_depth rev subsystem uevent .. but no scsi_disk:0:0:0:0 link ... is this kind of link gone within newer kernels? In other works do I have always to loop over /sys/block/ and within this loop over /sys/class/scsi_disk/ ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #31 from werner@novell.com 2007-06-06 03:04 MST ------- Created an attachment (id=144397) --> (https://bugzilla.novell.com/attachment.cgi?id=144397&action=view) /var/log/boot.msg of the system in Comment #28 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #32 from werner@novell.com 2007-06-06 03:05 MST ------- Created an attachment (id=144398) --> (https://bugzilla.novell.com/attachment.cgi?id=144398&action=view) /var/log/boot.msg of the system in Comment #30 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #33 from werner@novell.com 2007-06-06 03:11 MST ------- OK with readlink I could work around the missing sym links, like in bash code /suse/werner> dev=$(readlink /sys/block/sda/device) /suse/werner> ls /sys/class/scsi_disk/${dev##*/} FUA allow_restart cache_type device subsystem uevent nevertheless, using readlink makes the code a slow dog. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |REOPENED Info Provider|teheo@novell.com | ------- Comment #34 from teheo@novell.com 2007-06-06 03:25 MST ------- Ah... right. It seems to be unfortunate side effect of sysfs class updates. Does turning on CONFIG_SYSFS_DEPRECATED make any difference? It seems using readlink is the only option at this point. :-( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |ASSIGNED ------- Comment #35 from werner@novell.com 2007-06-06 03:47 MST ------- Then http://linux-ata.org/shutdown.html should be updated as fast as possible ;) I'll try to modify the patch. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144169|0 |1 is obsolete| | ------- Comment #36 from werner@novell.com 2007-06-06 04:56 MST ------- Created an attachment (id=144427) --> (https://bugzilla.novell.com/attachment.cgi?id=144427&action=view) sysvinit-2.86-hddown.patch With this patch we check for SATA/SCSI disks if the entry /sys/class/scsi_disk/<device>/manage_start_stop exists, if yes search for next disk, if no do ioctl HDIO_DRIVE_CMD. This check is not done for old IDE disks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #37 from werner@novell.com 2007-06-06 05:00 MST ------- Are there some comments on the last patch? I've added some more comments to explain, when I skip an disk or continue to search for the next disk. The _GNU_SOURCE is defined to get the GNU version of basename(3) from string.h. Hopefully the basename of such a device like '0:0:0:0' is unique within all subsystems otherwise we run into trouble. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #38 from teheo@novell.com 2007-06-06 05:11 MST ------- Yeap, mostly looks good. Just two things. 1. Please issue FLUSH CACHE (0xEA or 0xE7 depending on capacity) 2. It would be better if we issue HDIO_DRIVE_CMD to only libata devices (vendor ATA). Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210
------- Comment #39 from werner@novell.com 2007-06-06 05:33 MST -------
Such a FLUSH ... can this be done both like
uchar flush_e7[4] = {WIN_FLUSH_CACHE,0,0,0};
uchar flush_ea[4] = {WIN_FLUSH_CACHE_EXT,0,0,0};
ioctl(fd, HDIO_DRIVE_CMD, &flush_e7);
ioctl(fd, HDIO_DRIVE_CMD, &flush_ea);
or does it harm if both ioctl's are preformed? The return
value of the last for 0xEA could be ignored. Beside this
0xEA isn't known by hdparm(8) ... at least in STABLE.
Beside this: what does 2) of comment #38 mean. My code definitly access only
IDE and SCSI/SATA disks. AFAIK the ioctls should be applicable to IDE disks.
Is there a difference between real SCSI disks and SATA disks? If true, how to
determine this difference from /sys/block/sd<x> and/or
/sys/class/scsi_disc:
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |teheo@novell.com ------- Comment #40 from werner@novell.com 2007-06-06 05:35 MST ------- Info on comment #39 needed ;) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #41 from werner@novell.com 2007-06-06 06:19 MST ------- Just found that for libata maintained disk the string value in /sys/class/scsi_disk/0:0:0:0/device/vendor is simply ATA whereas real SCSI disks show up the real vendor string number. Is this true? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #42 from werner@novell.com 2007-06-06 06:52 MST ------- The vendor string is `ATA ' ... ahmmm including 5 white spaces!(?) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144427|0 |1 is obsolete| | ------- Comment #43 from werner@novell.com 2007-06-06 07:52 MST ------- Created an attachment (id=144481) --> (https://bugzilla.novell.com/attachment.cgi?id=144481&action=view) sysvinit-2.86-hddown.patch OK, next try, with this patch I skip also real SCSI disks. Beside this a FLUSH CACHE is perfomed, first the extended variant and if this fails the standard variant. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 ------- Comment #44 from werner@novell.com 2007-06-06 07:54 MST ------- Are there some comments on the last patch? Does this work, first the extended FLUSH CACHE 0xEA and if this fails the normal FLUSH CACHE 0xE7? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|teheo@novell.com | ------- Comment #45 from teheo@novell.com 2007-06-07 00:32 MST ------- It generally looks good to me. 1. I think we can use more continue's instead of goto empty's. 2. 0xE7 should be used if /block/sdX/size is smaller than 1 << 28; otherwise, 0xEA. 0xEA is a reserved command for devices which don't support LBA48 and might cause problems. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |teheo@novell.com ------- Comment #46 from werner@novell.com 2007-06-11 05:05 MST ------- One problem: I've a system with two disks from Hitachi, both SATA disks and I guess that both can do LBA48 but nevertheless one of the disk is a small one whereas the the other is a large one: /suse/werner> cat /sys/block/sda/device/model /sys/block/sda/size Hitachi HDT72502 488397168 /suse/werner> cat /sys/block/sdb/device/model /sys/block/sdb/size Hitachi HDS72168 160836480 boole:werner # hdparm -I /dev/sda | grep LBA LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 488397168 LBA, IORDY(can be disabled) * SCT LBA Segment Access (AC2) boole:werner # hdparm -I /dev/sdb | grep LBA LBA user addressable sectors: 160836480 LBA48 user addressable sectors: 160836480 LBA, IORDY(can be disabled) * SCT LBA Segment Access (AC2) the question rises: is there a way (beside a huge SG_IO ioctl) to determine the LBA48 capability from /sys fs? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|teheo@novell.com | ------- Comment #47 from teheo@novell.com 2007-06-11 05:34 MST ------- Sorry, I was confused a bit. Well, this FLUSH/FLUSH_EXT thing is confusing. Here's the story as I know it. During LBA48 discussion, someone thought that it would be cool to use FLUSH_CACHE(0xE7) to only flush sectors before 1 << 28, while using FLUSH_CACHE_EXT(0xEA) to flush the area beyond, which clearly isn't a good idea as it buys almost nothing and makes FLUSH_CACHE undependable, so final version of the standard scrapped it out and made 0xE7 do everything but some vendors went ahead and implemented the original proposal of separate FLUSH_CACHE and FLUSH_CACHE_EXT. So, we all have to live with this mess and here's the sanctioned way to deal with it. 1. check capacity, if it's smaller than 1<<28, just use 0xE7. 2. if it's equal to or larger than 1<<28, issue IDENTIFY command to acquire ID data. Test bit 13 of word 83. If the bit is set, use 0xEA and fall back to 0xE7 if that fails. If the bit is not set, use 0xE7. Note that ID data is 256 le16 words. You'll need to swap bytes in each word in be machines. Please refer to hdparm code for details. It's pretty complex. It would be better if we can co-work with Henrique and other ppl so that we all have the same code base. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144481|0 |1 is obsolete| | ------- Comment #48 from werner@novell.com 2007-06-11 08:04 MST ------- Created an attachment (id=145327) --> (https://bugzilla.novell.com/attachment.cgi?id=145327&action=view) sysvinit-2.86-hddown.patch Now with checking bit 13 in word 83 of the disk identity for FLUSH CACHE EXT. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |teheo@novell.com ------- Comment #49 from werner@novell.com 2007-06-11 08:09 MST ------- OK with the patch in attachment (id=145327) of comment #48, I'll test now for the bit 13 in word 83, this should be work even on big endian architecures. Beside this I've create some helper functions (strstrip, hdopen, and flush_cache_ext) to get the function list_disks() more readable. Some comments? I'd really like to close this bug :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 teheo@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|teheo@novell.com | ------- Comment #50 from teheo@novell.com 2007-06-11 19:42 MST ------- Yeap, looks good. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145327|0 |1 is obsolete| | ------- Comment #51 from werner@novell.com 2007-06-12 03:42 MST ------- Created an attachment (id=145545) --> (https://bugzilla.novell.com/attachment.cgi?id=145545&action=view) sysvinit-2.86-hddown.patch Now the final patch, changes in comparision to the last one: add a notice about the author, swap only the id word 83 due the others aren't used anywhere. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #52 from werner@novell.com 2007-06-12 03:44 MST ------- Fixed -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145545|0 |1 is obsolete| | ------- Comment #53 from werner@novell.com 2007-06-12 08:24 MST ------- Created an attachment (id=145621) --> (https://bugzilla.novell.com/attachment.cgi?id=145621&action=view) sysvinit-2.86-hddown.patch Compare long integers instead of FILE pointers. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145621|0 |1 is obsolete| | ------- Comment #54 from werner@novell.com 2007-06-13 05:11 MST ------- Created an attachment (id=145904) --> (https://bugzilla.novell.com/attachment.cgi?id=145904&action=view) sysvinit-2.86-hddown.patch Avoid HDIO_DRIVE_CM ioctl for real SCSI disks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=229210#c55
--- Comment #55 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c56
--- Comment #56 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c57
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c58
--- Comment #58 from Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c59
--- Comment #59 from Tejun Heo
Please update shutdown(8) to do the followings. * For each libata hard disk o Check whether /sys/class/scsi_disk/h:c:i:l/manage_start_stop exists. If it doesn't, synchronize cache and spin the disk down as before. If it does, do nothing and continue to the next disk. The file is also accessible as /sys/block/sdX/device/scsi_disk:*/manage_start_stop. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=229210#c60
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c61
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c62
--- Comment #62 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c63
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c64
--- Comment #64 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c65
--- Comment #65 from Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c66
--- Comment #66 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c67
--- Comment #67 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c68
--- Comment #68 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c69
--- Comment #69 from Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c70
--- Comment #70 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c71
--- Comment #71 from Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c72
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c73
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c74
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c75
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c76
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c77
--- Comment #77 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c78
--- Comment #78 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c79
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c80
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c81
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c82
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c83
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c84
--- Comment #84 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=229210#c85
--- Comment #85 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c86
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c87
--- Comment #87 from Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c88
--- Comment #88 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c89
--- Comment #89 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c90
--- Comment #90 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c91
--- Comment #91 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c92
--- Comment #92 from John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c93
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c94
Tejun Heo
https://bugzilla.novell.com/show_bug.cgi?id=229210#c95
John McManaman
https://bugzilla.novell.com/show_bug.cgi?id=229210#c96
Tejun Heo
participants (1)
-
bugzilla_noreply@novell.com