libata: perform port detach in EH
authorTejun Heo <tj@kernel.org>
Mon, 3 Nov 2008 11:04:37 +0000 (20:04 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 29 Dec 2008 03:43:21 +0000 (22:43 -0500)
commitece180d1cfe5fa751eaa85bf796cf28b2150af15
treeaca9d485036858ed3f1859e679473cebd3476845
parentad74e4c18d0962397314460d0da312e72c8bd02d
libata: perform port detach in EH

ata_port_detach() first made sure EH saw ATA_PFLAG_UNLOADING and then
assumed EH context belongs to it and performed detach operation
itself.  However, UNLOADING doesn't disable all of EH and this could
lead to problems including triggering WARN_ON()'s in EH path.

This patch makes port detach behave more like other EH actions such
that ata_port_detach() requests EH to detach and waits for completion.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
include/linux/libata.h