All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Jeff Garzik <jgarzik@pobox.com>, Aaron Lu <aaron.lwe@gmail.com>,
	Jack Wang <jack_wang@usish.com>,
	Shane Huang <shane.huang@amd.com>,
	Oliver Neukum <oliver@neukum.org>,
	linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: sd: set ready_to_power_off for scsi disk
Date: Fri, 14 Sep 2012 13:20:42 +0800	[thread overview]
Message-ID: <20120914052041.GA5177@mint-spring.sh.intel.com> (raw)
In-Reply-To: <1347528404.2720.28.camel@dabdike.int.hansenpartnership.com>

On Thu, Sep 13, 2012 at 10:26:44AM +0100, James Bottomley wrote:
> On Thu, 2012-09-13 at 17:07 +0800, Aaron Lu wrote:
> > So I think this is basically 2 things, one is the runtime suspend of the
> > disk, another is when it is runtime suspended, how to remove its power.
> > I'm currently doing the latter one, which is simpler, so I want to do it
> > first :-)
> 
> Well, I don't like the way the interaction of the patches is going.
> You're the one proposing powering down the device outside of the
> standards defined transitions, so you need to be responsible for the
> actions that necessitates, including synchronizing the cache. The specs

OK, I'll update the code.

> (SPC-4) say that cache management is explicitly unnecessary for the
> standard SCSI power states (Active, Idle, Standby and Stopped), so

Just read the SPC-4 spec, in section 5.12.3, it has words like this:

Logical units that contain cache memory shall write all cached data to
the medium for the logical unit(e.g., as a logical unit would do in
response to a SYNCHRONIZE CACHE command as described SBC-3) prior to
entering into any power condition that prevents accessing the
media(e.g., before a hard drive stops its spindle motor during a change
to the standby power condition).

So this looks like cache needs to be synced before the device enter
standby/stopped power condition. Or do I miss somthing?

> someone at some point is going to read that and remove the unnecessary
> cache sync in the code.  When that happens, you'll start getting data
> loss.

Indeed, I'll make sure cache gets synced when we are to power off the
device. Thanks for the remind.

-Aaron

  parent reply	other threads:[~2012-09-14  5:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13  7:40 [PATCH 0/2] Support runtime power off of HDD Aaron Lu
2012-09-13  7:40 ` [PATCH 1/2] scsi: sd: set ready_to_power_off for scsi disk Aaron Lu
2012-09-13  8:14   ` James Bottomley
2012-09-13  8:23     ` Aaron Lu
2012-09-13  8:37       ` James Bottomley
2012-09-13  8:49         ` Aaron Lu
2012-09-13  8:56           ` James Bottomley
2012-09-13  9:07             ` Aaron Lu
2012-09-13  9:26               ` James Bottomley
2012-09-13 10:16                 ` Oliver Neukum
2012-09-13 10:51                   ` James Bottomley
2012-09-13 12:34                     ` Oliver Neukum
2012-09-13 16:24                       ` Alan Stern
2012-09-13 20:18                         ` Oliver Neukum
2012-09-13 20:46                           ` Alan Stern
2012-09-14  6:57                         ` Aaron Lu
2012-09-14  8:15                         ` James Bottomley
2012-09-14  5:20                 ` Aaron Lu [this message]
2012-09-14  8:17                   ` James Bottomley
2012-09-14  8:48                     ` Aaron Lu
2012-09-14 10:26                       ` James Bottomley
2012-09-14 13:54                         ` Aaron Lu
2012-09-17 15:01                           ` Aaron Lu
2012-09-13  7:40 ` [PATCH 2/2] libata: acpi: set can_power_off for both ODD and HDD Aaron Lu

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=20120914052041.GA5177@mint-spring.sh.intel.com \
    --to=aaron.lu@intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=aaron.lwe@gmail.com \
    --cc=jack_wang@usish.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=shane.huang@amd.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.