linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* power_state: get rid of write-only variable in SATA
@ 2008-02-21 12:56 Pavel Machek
  2008-02-21 16:09 ` Jeff Garzik
  2008-02-24  5:29 ` Jeff Garzik
  0 siblings, 2 replies; 5+ messages in thread
From: Pavel Machek @ 2008-02-21 12:56 UTC (permalink / raw)
  To: kernel list, Linux-pm mailing list, jgarzik, linux-ide


power_state is scheduled for removal, and libata uses it in write-only
mode. Remove it.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b4985bc..a31572d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6542,8 +6542,6 @@ int ata_host_suspend(struct ata_host *ho
 	ata_lpm_enable(host);
 
 	rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
-	if (rc == 0)
-		host->dev->power.power_state = mesg;
 	return rc;
 }
 
@@ -6562,7 +6560,6 @@ void ata_host_resume(struct ata_host *ho
 {
 	ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET,
 			    ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
-	host->dev->power.power_state = PMSG_ON;
 
 	/* reenable link pm */
 	ata_lpm_disable(host);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: power_state: get rid of write-only variable in SATA
  2008-02-21 12:56 power_state: get rid of write-only variable in SATA Pavel Machek
@ 2008-02-21 16:09 ` Jeff Garzik
  2008-02-21 19:33   ` [linux-pm] " David Brownell
  2008-02-24  5:29 ` Jeff Garzik
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2008-02-21 16:09 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, Linux-pm mailing list, linux-ide

Pavel Machek wrote:
> power_state is scheduled for removal, and libata uses it in write-only
> mode. Remove it.
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index b4985bc..a31572d 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -6542,8 +6542,6 @@ int ata_host_suspend(struct ata_host *ho
>  	ata_lpm_enable(host);
>  
>  	rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
> -	if (rc == 0)
> -		host->dev->power.power_state = mesg;
>  	return rc;
>  }
>  
> @@ -6562,7 +6560,6 @@ void ata_host_resume(struct ata_host *ho
>  {
>  	ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET,
>  			    ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
> -	host->dev->power.power_state = PMSG_ON;
>  
>  	/* reenable link pm */
>  	ata_lpm_disable(host);

libata uses it under the assumption that "other parts" of the system are 
aware of this variable.

May I assume that the API has changed such that this is no longer necessary?

	Jeff




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-pm] power_state: get rid of write-only variable in SATA
  2008-02-21 16:09 ` Jeff Garzik
@ 2008-02-21 19:33   ` David Brownell
  2008-02-21 23:42     ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-02-21 19:33 UTC (permalink / raw)
  To: pavel, jgarzik; +Cc: linux-pm, linux-kernel, linux-ide

> libata uses it under the assumption that "other parts" of the system are 
> aware of this variable.
>
> May I assume that the API has changed such that this is no longer necessary?

Yes.  The original motivation for dev->power.power_state was to let
the writes to /sys/devices/.../power/state support a PCI-specific
policy for device power state transition.  And the motivation for
any driver (or framework) to modify that was that the PM core didn't
update it in all the relevant code paths (it wan't clear how to do
that either), which mean those sysfs files could make trouble.

That file is gone; everything supporting its usage can now go away.
(And the PCI-specific policy -- "only transitions to/from D0 are
allowed" -- can be managed by PCI drivers, and ignored by others
on more flexible hardware.)

The minor problem removing it is that there's some code which has
used fields in power_state for some driver state.  But if all that
usage is write-only in the drivers (is that true now for SATA?),
then it's safe to remove the /sys/devices/.../power/state support
from framework code and elsewhere.

- Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-pm] power_state: get rid of write-only variable in SATA
  2008-02-21 19:33   ` [linux-pm] " David Brownell
@ 2008-02-21 23:42     ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2008-02-21 23:42 UTC (permalink / raw)
  To: David Brownell; +Cc: jgarzik, linux-pm, linux-kernel, linux-ide

On Thu 2008-02-21 11:33:50, David Brownell wrote:
> > libata uses it under the assumption that "other parts" of the system are 
> > aware of this variable.

There are no other relevant parts, except one debug printk that is
getting removed.

> > May I assume that the API has changed such that this is no longer necessary?
> 
> Yes.  The original motivation for dev->power.power_state was to let

ACK.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: power_state: get rid of write-only variable in SATA
  2008-02-21 12:56 power_state: get rid of write-only variable in SATA Pavel Machek
  2008-02-21 16:09 ` Jeff Garzik
@ 2008-02-24  5:29 ` Jeff Garzik
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2008-02-24  5:29 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, Linux-pm mailing list, linux-ide

Pavel Machek wrote:
> power_state is scheduled for removal, and libata uses it in write-only
> mode. Remove it.
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index b4985bc..a31572d 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -6542,8 +6542,6 @@ int ata_host_suspend(struct ata_host *ho
>  	ata_lpm_enable(host);
>  
>  	rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
> -	if (rc == 0)
> -		host->dev->power.power_state = mesg;
>  	return rc;
>  }
>  
> @@ -6562,7 +6560,6 @@ void ata_host_resume(struct ata_host *ho
>  {
>  	ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET,
>  			    ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0);
> -	host->dev->power.power_state = PMSG_ON;
>  

applied

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-24  5:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 12:56 power_state: get rid of write-only variable in SATA Pavel Machek
2008-02-21 16:09 ` Jeff Garzik
2008-02-21 19:33   ` [linux-pm] " David Brownell
2008-02-21 23:42     ` Pavel Machek
2008-02-24  5:29 ` Jeff Garzik

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).