summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 50f3ef04809d..f9476fb3ac43 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -4029,7 +4029,7 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap)
4029 /* are we suspending? */ 4029 /* are we suspending? */
4030 spin_lock_irqsave(ap->lock, flags); 4030 spin_lock_irqsave(ap->lock, flags);
4031 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) || 4031 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) ||
4032 ap->pm_mesg.event == PM_EVENT_ON) { 4032 ap->pm_mesg.event & PM_EVENT_RESUME) {
4033 spin_unlock_irqrestore(ap->lock, flags); 4033 spin_unlock_irqrestore(ap->lock, flags);
4034 return; 4034 return;
4035 } 4035 }
@@ -4040,10 +4040,13 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap)
4040 /* 4040 /*
4041 * If we have a ZPODD attached, check its zero 4041 * If we have a ZPODD attached, check its zero
4042 * power ready status before the port is frozen. 4042 * power ready status before the port is frozen.
4043 * Only needed for runtime suspend.
4043 */ 4044 */
4044 ata_for_each_dev(dev, &ap->link, ENABLED) { 4045 if (PMSG_IS_AUTO(ap->pm_mesg)) {
4045 if (zpodd_dev_enabled(dev)) 4046 ata_for_each_dev(dev, &ap->link, ENABLED) {
4046 zpodd_on_suspend(dev); 4047 if (zpodd_dev_enabled(dev))
4048 zpodd_on_suspend(dev);
4049 }
4047 } 4050 }
4048 4051
4049 /* tell ACPI we're suspending */ 4052 /* tell ACPI we're suspending */
@@ -4057,7 +4060,7 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap)
4057 if (ap->ops->port_suspend) 4060 if (ap->ops->port_suspend)
4058 rc = ap->ops->port_suspend(ap, ap->pm_mesg); 4061 rc = ap->ops->port_suspend(ap, ap->pm_mesg);
4059 4062
4060 ata_acpi_set_state(ap, PMSG_SUSPEND); 4063 ata_acpi_set_state(ap, ap->pm_mesg);
4061 out: 4064 out:
4062 /* report result */ 4065 /* report result */
4063 spin_lock_irqsave(ap->lock, flags); 4066 spin_lock_irqsave(ap->lock, flags);
@@ -4097,7 +4100,7 @@ static void ata_eh_handle_port_resume(struct ata_port *ap)
4097 /* are we resuming? */ 4100 /* are we resuming? */
4098 spin_lock_irqsave(ap->lock, flags); 4101 spin_lock_irqsave(ap->lock, flags);
4099 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) || 4102 if (!(ap->pflags & ATA_PFLAG_PM_PENDING) ||
4100 ap->pm_mesg.event != PM_EVENT_ON) { 4103 !(ap->pm_mesg.event & PM_EVENT_RESUME)) {
4101 spin_unlock_irqrestore(ap->lock, flags); 4104 spin_unlock_irqrestore(ap->lock, flags);
4102 return; 4105 return;
4103 } 4106 }
@@ -4116,7 +4119,7 @@ static void ata_eh_handle_port_resume(struct ata_port *ap)
4116 ata_for_each_dev(dev, link, ALL) 4119 ata_for_each_dev(dev, link, ALL)
4117 ata_ering_clear(&dev->ering); 4120 ata_ering_clear(&dev->ering);
4118 4121
4119 ata_acpi_set_state(ap, PMSG_ON); 4122 ata_acpi_set_state(ap, ap->pm_mesg);
4120 4123
4121 if (ap->ops->port_resume) 4124 if (ap->ops->port_resume)
4122 rc = ap->ops->port_resume(ap); 4125 rc = ap->ops->port_resume(ap);