lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 16 Nov 2011 10:42:11 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Lin Ming <ming.m.lin@...el.com>
cc:	Tejun Heo <tj@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
	"linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Jeff Garzik <jgarzik@...ox.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	James Bottomley <JBottomley@...allels.com>,
	"Huang, Ying" <ying.huang@...el.com>,
	"Zhang, Rui" <rui.zhang@...el.com>
Subject: Re: [PATCH v2 4/4] ata: add ata port runtime PM callbacks

On Wed, 16 Nov 2011, Lin Ming wrote:

> > > Something to be careful about is there are different types of suspend
> > > states (PMSG_*).  IIUC, runtime PM is using PMSG_SUSPEND.  Other
> > > states may or may not be compatible with PMSG_SUSPEND expectations, so
> > > you can skip suspend operation if the newly requested state is
> > > PMSG_SUSPEND but otherwise the controller needs to be woken up and
> > > told to comply to the new state.
> > 
> > That's right.  Surprisingly enough (and contrary to what I wrote
> > earlier), the sd_suspend() routine doesn't spin down a drive for
> > runtime suspend.  This probably should be considered a bug.
> > 
> > Anyway, it looks like the correct approach would be more like this:
> 
> Thanks.
> 
> I think ata_port_suspend also needs to call pm_runtime_resume, as below.
> 
> static int ata_port_suspend(struct device *dev)
> {
>         struct ata_port *ap = to_ata_port(dev);
>         int rc;
> 
>         pm_runtime_resume(dev);
>         rc = ata_port_request_pm(ap, PMSG_SUSPEND, 0, ATA_EHI_QUIET, 1);
>         return rc;
> }

Maybe not.  You know a lot more about the state of the ATA ports than
you do about the state of the SCSI devices.  If there's no difference
in the port states for runtime suspend and system sleep then you don't
have to power up the port just in order to power it down again.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ