linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Aaron Lu <aaron.lu@intel.com>, Jeff Garzik <jgarzik@pobox.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Jeff Wu <jeff.wu@amd.com>,
	Aaron Lu <aaron.lwe@gmail.com>,
	linux-ide@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v9 07/10] block: add a new interface to block events
Date: Sun, 18 Nov 2012 13:56:57 -0800	[thread overview]
Message-ID: <20121118215657.GA25790@mtj.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1211181221350.4991-100000@netrider.rowland.org>

Hello, Alan.

On Sun, Nov 18, 2012 at 12:41:06PM -0500, Alan Stern wrote:
> >  If so (I can't see how
> > else it would behave), it may not really work.  I mean, you would be
> > spending about ten seconds reinitiaizing everything and then enter
> > sleep and do it all over again two seconds later, most likely wasting
> > power in the process.  Sounds weird to me.  What am I missing?
> 
> Does it really take 10 seconds to recover from an ATA suspend?  That 
> sounds awfully long.

If it's using the same ->suspend ops as the regular system suspend,
10secs isn't a crazy number.  If the controller goes offline, the PHY
would go offline too and the only way to come back from that is
performing full probing sequence.  From SATA procotol POV, it isn't
too bad.  It's just link initiazliation followed by IDENTIFY and some
config commands.

The problem is that SATA devices aren't really designed to be used
like that.  If you reset a ODD w/ a media in it, it'll probably spin
it up and try to re-establish media state during probe sequence.  It
isn't designed that way and has never been used like that.  SATA has
its own dynamic link power management (DIPM/HIPM) tho.

So, this whole autopm thing doesn't sound like a good idea to me.

> The two second value is merely the default interval for media polling.  
> Devices with no async notification mechanism require some sort of
> polling if anybody wants to know when media is inserted or removed,
> and the polling can't be carried out if the device's port is suspended.

Yeah, I know.  I wrote that thing. :)

> You asked about autopm.  "Autopm" is a rather vague and ugly term I
> made up; it means that the kernel automatically suspends the device
> after some specified idle time.  In the case of optical drives, "idle"  
> currently means the device file is not open (which implies the drive
> doesn't contain a mounted filesystem).  As far as I know, the kernel
> has no direct way to affect the power level of an optical drive that
> isn't ZP.  For these devices "suspended" is merely a logical state,
> meaning that the device isn't in use and therefore its parent can be
> put into a low-power mode.
>
> Regardless, an optical drive can't remain suspended when polling
> occurs.  So unless there's some other mechanism for getting the
> information about media changes, suspended drives (and their parents)  
> will have to be resumed periodically for polling.
> 
> Hence there's a tradeoff.  How can we use the minimum amount of energy
> while still polling the drive acceptably often?  In general, the kernel
> doesn't know.  That's why these things can be controlled from
> userspace.  And the answer may be different for ATA drives vs.  
> USB-connected drives.
> 
> Does this answer your questions?

I think the only reason autopm doesn't blow up for SATA devices is
that userland usually automatically mounts them thus effectively
disabling autopm.  I *think* the only sane thing we can do is doing
autopm iff zpodd is available && no media.

Thanks.

-- 
tejun

  reply	other threads:[~2012-11-18 21:56 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  6:51 [PATCH v9 00/10] ZPODD Patches Aaron Lu
2012-11-09  6:51 ` [PATCH v9 01/10] scsi: sr: support runtime pm Aaron Lu
2012-11-09  6:51 ` [PATCH v9 02/10] ata: zpodd: Add CONFIG_SATA_ZPODD Aaron Lu
2012-11-09  6:51 ` [PATCH v9 03/10] ata: zpodd: identify and init ZPODD devices Aaron Lu
2012-11-12 18:53   ` Tejun Heo
2012-11-14  1:32     ` Aaron Lu
2012-11-18 14:38       ` Tejun Heo
2012-11-19  2:15         ` Aaron Lu
2012-11-09  6:51 ` [PATCH v9 04/10] libata: acpi: move acpi notification code to zpodd Aaron Lu
2012-11-12 18:55   ` Tejun Heo
2012-11-14  1:36     ` Aaron Lu
2012-11-09  6:51 ` [PATCH v9 05/10] libata: separate ATAPI code Aaron Lu
2012-11-12 18:57   ` Tejun Heo
2012-11-13 12:49     ` Aaron Lu
2012-11-18 15:01       ` Tejun Heo
2012-11-19  2:21         ` Aaron Lu
2012-11-19 14:51           ` Tejun Heo
2012-11-09  6:51 ` [PATCH v9 06/10] ata: zpodd: check zero power ready status Aaron Lu
2012-11-12 19:13   ` Tejun Heo
2012-11-13 13:20     ` Aaron Lu
2012-11-14  2:18     ` Aaron Lu
2012-11-18 15:00       ` Tejun Heo
2012-11-19  3:09         ` Aaron Lu
2012-11-19 14:56           ` Tejun Heo
2012-11-19 15:06             ` James Bottomley
2012-11-26  0:33               ` Rafael J. Wysocki
2012-11-26  0:45                 ` Aaron Lu
2012-11-26  5:03                 ` James Bottomley
2012-11-26  5:09                   ` Aaron Lu
2012-11-26  7:32                     ` James Bottomley
2012-11-26  8:27                       ` Aaron Lu
2012-11-26 13:17                         ` James Bottomley
2012-11-26 16:21                           ` Alan Stern
2012-11-26 19:15                             ` James Bottomley
2012-11-27  1:41                           ` Aaron Lu
2012-11-28  0:51                   ` Rafael J. Wysocki
2012-11-28  1:39                     ` Tejun Heo
2012-11-28  2:24                       ` Aaron Lu
2012-11-28  8:56                       ` James Bottomley
2012-12-03  8:13                         ` Aaron Lu
2012-12-03  8:25                           ` James Bottomley
2012-12-03  8:59                             ` Aaron Lu
2012-12-03 16:23                             ` Tejun Heo
2012-12-03 18:56                               ` Jeff Garzik
2012-12-04  5:04                                 ` Aaron Lu
2012-12-04 12:11                               ` James Bottomley
2012-12-07  6:13                                 ` Aaron Lu
2012-12-10  3:26                                   ` Aaron Lu
2012-12-11  5:10                                     ` Tejun Heo
2012-12-18  8:30                                       ` Aaron Lu
2012-12-20  6:07                               ` Aaron Lu
2012-12-25 17:17                                 ` Tejun Heo
2012-12-26  1:42                                   ` Aaron Lu
2012-12-28 21:16                                     ` Tejun Heo
2013-01-04  1:04                                       ` Aaron Lu
2012-11-30  8:55                       ` Aaron Lu
2012-11-30 11:15                         ` Rafael J. Wysocki
2012-11-20  6:00             ` Aaron Lu
2012-11-20  8:59               ` Aaron Lu
2012-11-26  0:50                 ` Rafael J. Wysocki
2012-11-26  0:48                   ` Aaron Lu
2012-11-26  1:03                     ` Rafael J. Wysocki
2012-11-26  1:05                       ` Aaron Lu
2012-11-26  1:11                         ` Rafael J. Wysocki
2012-11-26  1:09                           ` Aaron Lu
2012-11-26  1:22                             ` Rafael J. Wysocki
2012-11-26  1:22                               ` Aaron Lu
2012-11-26  1:17                           ` Aaron Lu
2012-11-09  6:51 ` [PATCH v9 07/10] block: add a new interface to block events Aaron Lu
2012-11-12 19:14   ` Tejun Heo
2012-11-12 19:18     ` Alan Stern
2012-11-12 19:21       ` Tejun Heo
2012-11-12 19:34         ` Alan Stern
2012-11-18 15:05           ` Tejun Heo
2012-11-18 17:41             ` Alan Stern
2012-11-18 21:56               ` Tejun Heo [this message]
2012-11-18 21:58                 ` Tejun Heo
2012-11-18 23:28                 ` Alan Stern
2012-11-18 23:35                   ` Tejun Heo
2012-11-19  2:07                     ` Alan Stern
2012-11-19  3:21                       ` Aaron Lu
2012-11-19 14:50                       ` Tejun Heo
2012-11-09  6:52 ` [PATCH v9 08/10] scsi: sr: support (un)block events Aaron Lu
2012-11-09  6:52 ` [PATCH v9 09/10] ata: zpodd: handle power transition of ODD Aaron Lu
2012-11-09  6:52 ` [PATCH v9 10/10] ata: expose pm qos flags to user space for ata device 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=20121118215657.GA25790@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=aaron.lu@intel.com \
    --cc=aaron.lwe@gmail.com \
    --cc=jeff.wu@amd.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=rjw@sisk.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).