libata: clean up ZPODD when a port is detached
authorLevente Kurusa <levex@linux.com>
Tue, 6 May 2014 13:57:48 +0000 (15:57 +0200)
committerJiri Slaby <jslaby@suse.cz>
Mon, 9 Jun 2014 13:53:50 +0000 (15:53 +0200)
commit7573a26d8ea5d43719307b6c4234ca666795979d
treeb6e61beb20ce0e4eadd919c795caeb8f768dd0ca
parentae5b411abd7a36af90aa0313e3e992b065eac944
libata: clean up ZPODD when a port is detached

commit a6f9bf4d2f965b862b95213303d154e02957eed8 upstream.

When a ZPODD device is unbound via sysfs, the ACPI notify handler
is not removed. This causes panics as observed in Bug #74601. The
panic only happens when the wake happens from outside the kernel
(i.e. inserting a media or pressing a button). Add a loop to
ata_port_detach which loops through the port's devices and checks
if zpodd is enabled, if so call zpodd_exit.

Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/ata/libata-core.c