Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Miquel van Smoorenburg <miquels@cistron.nl>
To: Tejun Heo <htejun@gmail.com>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org,
	Chuck Ebbert <cebbert@redhat.com>, Jeff Garzik <jeff@garzik.org>,
	Francesco Pretto <ceztko@gmail.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	hmh@hmh.eng.br, Daniel Drake <dsd@gentoo.org>
Subject: Re: [PATCH] libata: remove	libata.spindown_compat
Date: Sat, 19 May 2007 13:06:19 +0200	[thread overview]
Message-ID: <1179572779.23670.13.camel@localhost.localdomain> (raw)
In-Reply-To: <464C6A0E.7020601@gmail.com>

On Thu, 2007-05-17 at 16:43 +0200, Tejun Heo wrote:
> 
> I'll attach the updated version of http://linux-ata.org/shutdown.html
> as a reply to this mail.

It says:

>When a disk is powered off, it needs to flush its write cache and then
>unload its heads so that they don't crash onto the recording surfaces.
>Most disks have mechanical mechanism to unload its heads even when
>power is abruptly cut. This is usually called emergency unload and
>causes popping sound on some disks and may have negative effect on the
>lifetime of the disk, so the operating system must tell the disks to
>unload the heads prior to shutting the system down.

>In ATA, this is achieved by issuing FLUSH CACHE followed by STANDBYNOW
>and the IDE drivers (drivers/ide/*) have always issued the sequence
>prior to powering off. libata uses SCSI sd driver as its high level
>disk driver and the sd driver, unfortunately, issues only the cache
>flush command during shutdown. This is mainly because SCSI disks can be
>accessed by multiple initiators (hosts) and spinning down disks because
>one initiator goes down can disturb others. Because of this
>implementation detail, libata drivers up to kernel version 2.6.21 don't
>issue the STANDBYNOW command before powering off.

This is not quite correct.

The reason halt(8) spins down IDE disks is that, way back when (november
2001 I guess, from the changelog), the IDE drivers did not flush the
cache on poweroff. The result was that on some machines, poweroff was so
fast that the power of the drive got turned off while it still had some
unflushed data in the write-cache, resulting in filesystem corruption.
This problem did not exist with SCSI, apparently.

To fix this issue, halt(8) started issueing WIN_STANDBYNOW1 (0xE0) and
WIN_STANDBYNOW2 (0x94) ioctls before halt and poweroff, as that was more
reliable than "flush cache" and the effect was the same.

Mike.

  parent reply	other threads:[~2007-05-19 11:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 14:43 [PATCH] libata: remove libata.spindown_compat Tejun Heo
2007-05-17 14:54 ` Tejun Heo
2007-05-18  0:58 ` Jeff Garzik
2007-05-19 11:06 ` Miquel van Smoorenburg [this message]
2007-05-19 11:14   ` [Pkg-sysvinit-devel] " Tejun Heo
2007-05-19 13:48     ` Henrique de Moraes Holschuh
2007-05-19 16:47       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1179572779.23670.13.camel@localhost.localdomain \
    --to=miquels@cistron.nl \
    --cc=cebbert@redhat.com \
    --cc=ceztko@gmail.com \
    --cc=dsd@gentoo.org \
    --cc=hmh@hmh.eng.br \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=pkg-sysvinit-devel@lists.alioth.debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox