]> git.karo-electronics.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 20:03:35 +0000 (13:03 -0700)
commitbcefd0d7f34b989c254197bd57c52c848d5ca1cf
tree59a9f11358b415b421b6362e9dc65e6f9df98d3e
parentbfa65173414a6a2128b9f7c8f2e873a8a7e36d66
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