diff options
author | Tejun Heo <tj@kernel.org> | 2011-02-24 13:30:37 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-03-02 02:34:20 -0500 |
commit | eb0e85e36b971ec31610eda7e3ff5c11c1c44785 (patch) | |
tree | 264924c95c0a12e952008c3658a93c096883b3e6 /drivers/ata/libata-eh.c | |
parent | 3e1f2356ce231488dc1fa844e5ce91bcb59fc2a1 (diff) |
libata: fix hotplug for drivers which don't implement LPM
ata_eh_analyze_serror() suppresses hotplug notifications if LPM is
being used because LPM generates spurious hotplug events. It compared
whether link->lpm_policy was different from ATA_LPM_MAX_POWER to
determine whether LPM is enabled; however, this is incorrect as for
drivers which don't implement LPM, lpm_policy is always
ATA_LPM_UNKNOWN. This disabled hotplug detection for all drivers
which don't implement LPM.
Fix it by comparing whether lpm_policy is greater than
ATA_LPM_MAX_POWER.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 17a637877d03..e16850e8d2f8 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1618,7 +1618,7 @@ static void ata_eh_analyze_serror(struct ata_link *link) | |||
1618 | * host links. For disabled PMP links, only N bit is | 1618 | * host links. For disabled PMP links, only N bit is |
1619 | * considered as X bit is left at 1 for link plugging. | 1619 | * considered as X bit is left at 1 for link plugging. |
1620 | */ | 1620 | */ |
1621 | if (link->lpm_policy != ATA_LPM_MAX_POWER) | 1621 | if (link->lpm_policy > ATA_LPM_MAX_POWER) |
1622 | hotplug_mask = 0; /* hotplug doesn't work w/ LPM */ | 1622 | hotplug_mask = 0; /* hotplug doesn't work w/ LPM */ |
1623 | else if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link)) | 1623 | else if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link)) |
1624 | hotplug_mask = SERR_PHYRDY_CHG | SERR_DEV_XCHG; | 1624 | hotplug_mask = SERR_PHYRDY_CHG | SERR_DEV_XCHG; |