mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
libata: clean up ZPODD when a port is detached
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. Cc: [email protected] Reviewed-by: Aaron Lu <[email protected]> Signed-off-by: Levente Kurusa <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
This commit is contained in:
parent
e783c51cce
commit
a6f9bf4d2f
1 changed files with 9 additions and 0 deletions
|
|
@ -6314,6 +6314,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;
|
||||
|
|
@ -6333,6 +6335,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++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue