summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-24 15:25:30 +0900
committerJeff Garzik <jeff@garzik.org>2006-03-24 09:39:57 -0500
commit1f7dd3e9d62b25c7b79f913f37c2242a61295de4 (patch)
tree7fc6cfaeca33cdae056a3ed69f841327391c9e8e /drivers
parent5a529139554f12cb265715117a2153c936286294 (diff)
downloadop-kernel-dev-1f7dd3e9d62b25c7b79f913f37c2242a61295de4.zip
op-kernel-dev-1f7dd3e9d62b25c7b79f913f37c2242a61295de4.tar.gz
[PATCH] libata: check if port is disabled after internal command
libata core is being changed to disallow port/device disable on lower layers. However, some LLDDs (sata_mv) directly disable port on command failure. This patch makes ata_exec_internal() check whether a port got disabled after an internal command. If it is, AC_ERR_SYSTEM is added to err_mask and the port gets re-enabled. As internal command failure results in device disable for drivers which don't implement newer reset/EH callbacks, this change results in no behavior change for single device per port controllers. For slave-possible LLDDs which disable port on command failure, (1) such drivers don't exist currently, (2) issuing command to the other device of once-disabled port shouldn't result in catastrophe even if such driver exists. So, this should be enough as a temporary measure. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 1063928..9cd9053 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1009,6 +1009,22 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
ata_qc_free(qc);
+ /* XXX - Some LLDDs (sata_mv) disable port on command failure.
+ * Until those drivers are fixed, we detect the condition
+ * here, fail the command with AC_ERR_SYSTEM and reenable the
+ * port.
+ *
+ * Note that this doesn't change any behavior as internal
+ * command failure results in disabling the device in the
+ * higher layer for LLDDs without new reset/EH callbacks.
+ *
+ * Kill the following code as soon as those drivers are fixed.
+ */
+ if (ap->flags & ATA_FLAG_PORT_DISABLED) {
+ err_mask |= AC_ERR_SYSTEM;
+ ata_port_probe(ap);
+ }
+
return err_mask;
}
OpenPOWER on IntegriCloud