diff mbox

[4/6] libata: resume in the background

Message ID 6fca4cfe76c75939ec952c6a80c003e09d6f954c.1384030893.git.psusi@ubuntu.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Phillip Susi Nov. 9, 2013, 9:03 p.m. UTC
Don't block the resume path waiting for the disk to
spin up.
---
 drivers/ata/libata-core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Sergei Shtylyov Nov. 11, 2013, 1:10 p.m. UTC | #1
On 10-11-2013 1:03, Phillip Susi wrote:

> Don't block the resume path waiting for the disk to
> spin up.
> ---
>   drivers/ata/libata-core.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)

> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 686c441..128ce0d 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -5421,20 +5421,18 @@ static int __ata_port_resume_common(struct ata_port *ap, pm_message_t mesg,
>   static int ata_port_resume_common(struct device *dev, pm_message_t mesg)
>   {
>   	struct ata_port *ap = to_ata_port(dev);
> +	static int dontcare;
>
> -	return __ata_port_resume_common(ap, mesg, NULL);
> +	return __ata_port_resume_common(ap, mesg, &dontcare);
>   }
>
>   static int ata_port_resume(struct device *dev)
>   {
>   	int rc;
>
> +	if (pm_runtime_suspended(dev))
> +		return 0;
>   	rc = ata_port_resume_common(dev, PMSG_RESUME);
> -	if (!rc) {
> -		pm_runtime_disable(dev);
> -		pm_runtime_set_active(dev);
> -		pm_runtime_enable(dev);
> -	}

     With this modification, you don't need 'rc' anymore.

>   	return rc;
>   }
>

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 686c441..128ce0d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5421,20 +5421,18 @@  static int __ata_port_resume_common(struct ata_port *ap, pm_message_t mesg,
 static int ata_port_resume_common(struct device *dev, pm_message_t mesg)
 {
 	struct ata_port *ap = to_ata_port(dev);
+	static int dontcare;
 
-	return __ata_port_resume_common(ap, mesg, NULL);
+	return __ata_port_resume_common(ap, mesg, &dontcare);
 }
 
 static int ata_port_resume(struct device *dev)
 {
 	int rc;
 
+	if (pm_runtime_suspended(dev))
+		return 0;
 	rc = ata_port_resume_common(dev, PMSG_RESUME);
-	if (!rc) {
-		pm_runtime_disable(dev);
-		pm_runtime_set_active(dev);
-		pm_runtime_enable(dev);
-	}
 
 	return rc;
 }