libata: ata_dev_disable() should be called from EH context

ata_port_detach() calls ata_dev_disable() with host lock held but
ata_dev_disable() should be called from EH context. ata_port_detach()
steals EH context by setting ATA_PFLAG_UNLOADAING and flushing EH.
Drop locking around ata_dev_disable() and note that ata_port_detach()
owns EH context at that point.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Tejun Heo and committed by Jeff Garzik 7f9ad9b8 ce2e0abb

+2 -6
+2 -6
drivers/ata/libata-core.c
··· 7210 7211 ata_port_wait_eh(ap); 7212 7213 - /* EH is now guaranteed to see UNLOADING, so no new device 7214 - * will be attached. Disable all existing devices. 7215 */ 7216 - spin_lock_irqsave(ap->lock, flags); 7217 - 7218 ata_port_for_each_link(link, ap) { 7219 ata_link_for_each_dev(dev, link) 7220 ata_dev_disable(dev); 7221 } 7222 - 7223 - spin_unlock_irqrestore(ap->lock, flags); 7224 7225 /* Final freeze & EH. All in-flight commands are aborted. EH 7226 * will be skipped and retrials will be terminated with bad
··· 7210 7211 ata_port_wait_eh(ap); 7212 7213 + /* EH is now guaranteed to see UNLOADING - EH context belongs 7214 + * to us. Disable all existing devices. 7215 */ 7216 ata_port_for_each_link(link, ap) { 7217 ata_link_for_each_dev(dev, link) 7218 ata_dev_disable(dev); 7219 } 7220 7221 /* Final freeze & EH. All in-flight commands are aborted. EH 7222 * will be skipped and retrials will be terminated with bad