]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
libata: fix hotplug for drivers which don't implement LPM
authorTejun Heo <tj@kernel.org>
Thu, 24 Feb 2011 18:30:37 +0000 (19:30 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 19:50:05 +0000 (12:50 -0700)
commit873cd78f82db88cac1109a45a348248fcd4a84de
tree485b278c4cd17cc53524391c44d66a09dfe62c85
parent5618c45b73c413eba6b4504ec41eea4f9117fd03
libata: fix hotplug for drivers which don't implement LPM

commit eb0e85e36b971ec31610eda7e3ff5c11c1c44785 upstream.

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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/libata-eh.c