libata: fix hotplug for drivers which don't implement LPM
PATCH 1/1 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.
--- drivers/ata/libata-eh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-eh.c +1 -1
@@ -1618,7 +1618,7 @@ static void ata_eh_analyze_serror(struct ata_link *link)* host links. For disabled PMP links, only N bit is * considered as X bit is left at 1 for link plugging. */ -if (link->lpm_policy !=ATA_LPM_MAX_POWER ) +if (link->lpm_policy >ATA_LPM_MAX_POWER ) hotplug_mask =0 ;/* hotplug doesn't work w/ LPM */ else if (!(link->flags &ATA_LFLAG_DISABLED ) ||ata_is_host_link (link)) hotplug_mask =SERR_PHYRDY_CHG |SERR_DEV_XCHG ;
Jeff Garzik
AppliedQuoted 8 lines · Tejun Heo
ata_eh_analyze_serror()suppresses hotplug notifications if LPM is being used because LPM generates spurious hotplug events. It compared whetherlink->lpm_policywas different fromATA_LPM_MAX_POWERto determine whether LPM is enabled; however, this is incorrect as for drivers which don't implement LPM,lpm_policyis alwaysATA_LPM_UNKNOWN. This disabled hotplug detection for all drivers which don't implement LPM.
Quoted 5 lines
Fix it by comparing whether
lpm_policyis greater thanATA_LPM_MAX_POWER.Signed-off-by Tejun Heo<[email protected]>
applied, though putting this into 2.6.38.1 is preferred to changing this at -rc7... stable@ cc'd.
Quoted 9 lines · Jeff Garzik
Quoted 8 lines · Tejun Heo
ata_eh_analyze_serror()suppresses hotplug notifications if LPM is being used because LPM generates spurious hotplug events. It compared whetherlink->lpm_policywas different fromATA_LPM_MAX_POWERto determine whether LPM is enabled; however, this is incorrect as for drivers which don't implement LPM,lpm_policyis alwaysATA_LPM_UNKNOWN. This disabled hotplug detection for all drivers which don't implement LPM.
Quoted 8 lines
Quoted 5 lines
Fix it by comparing whether
lpm_policyis greater thanATA_LPM_MAX_POWER.Signed-off-by Tejun Heo<[email protected]>applied, though putting this into 2.6.38.1 is preferred to changing this at -rc7... stable@ cc'd.
Understood. As long as it ends up in stable@, either way is okay with me. Thank you.
Signature · 1 line
tejun