aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Kurusa <levex@linux.com>2014-05-06 15:57:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-07 13:25:39 -0700
commita40aac07285bdf77ed67af1423676ff5548ef51b (patch)
tree17e57527f99592b8c9432c9f7a83629aa18a4498
parent019c8ec9e3c6a3616f10be9eda359f1927d1f8b1 (diff)
downloadlinux-linaro-stable-a40aac07285bdf77ed67af1423676ff5548ef51b.tar.gz
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/ata/libata-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9cf616b5210b..bf00fbcde8ad 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6300,6 +6300,8 @@ int ata_host_activate(struct ata_host *host, int irq,
static void ata_port_detach(struct ata_port *ap)
{
unsigned long flags;
+ struct ata_link *link;
+ struct ata_device *dev;
if (!ap->ops->error_handler)
goto skip_eh;
@@ -6319,6 +6321,13 @@ static void ata_port_detach(struct ata_port *ap)
cancel_delayed_work_sync(&ap->hotplug_task);
skip_eh:
+ /* clean up zpodd on port removal */
+ ata_for_each_link(link, ap, HOST_FIRST) {
+ ata_for_each_dev(dev, link, ALL) {
+ if (zpodd_dev_enabled(dev))
+ zpodd_exit(dev);
+ }
+ }
if (ap->pmp_link) {
int i;
for (i = 0; i < SATA_PMP_MAX_PORTS; i++)