aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-06-22 02:25:27 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:45 -0400
commite4a9c3732cea3e3c8c704aad86636090ffe6b25f (patch)
treefaea8e91b3d917dcdb4c89adbb021ac737a6cb35 /drivers/ata/libata-core.c
parent3b661a92e869ebe2358de8f4b3230ad84f7fce51 (diff)
[SCSI] libata, libsas: introduce sched_eh and end_eh port ops
When managing shost->host_eh_scheduled libata assumes that there is a 1:1 shost-to-ata_port relationship. libsas creates a 1:N relationship so it needs to manage host_eh_scheduled cumulatively at the host level. The sched_eh and end_eh port port ops allow libsas to track when domain devices enter/leave the "eh-pending" state under ha->lock (previously named ha->state_lock, but it is no longer just a lock for ha->state changes). Since host_eh_scheduled indicates eh without backing commands pinning the device it can be deallocated at any time. Move the taking of the domain_device reference under the port_lock to guarantee that the ata_port stays around for the duration of eh. Reviewed-by: Jacek Danecki <jacek.danecki@intel.com> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cece3a4d11ea..3fe1202c61ce 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -80,6 +80,8 @@ const struct ata_port_operations ata_base_port_ops = {
80 .prereset = ata_std_prereset, 80 .prereset = ata_std_prereset,
81 .postreset = ata_std_postreset, 81 .postreset = ata_std_postreset,
82 .error_handler = ata_std_error_handler, 82 .error_handler = ata_std_error_handler,
83 .sched_eh = ata_std_sched_eh,
84 .end_eh = ata_std_end_eh,
83}; 85};
84 86
85const struct ata_port_operations sata_port_ops = { 87const struct ata_port_operations sata_port_ops = {
@@ -6642,6 +6644,8 @@ struct ata_port_operations ata_dummy_port_ops = {
6642 .qc_prep = ata_noop_qc_prep, 6644 .qc_prep = ata_noop_qc_prep,
6643 .qc_issue = ata_dummy_qc_issue, 6645 .qc_issue = ata_dummy_qc_issue,
6644 .error_handler = ata_dummy_error_handler, 6646 .error_handler = ata_dummy_error_handler,
6647 .sched_eh = ata_std_sched_eh,
6648 .end_eh = ata_std_end_eh,
6645}; 6649};
6646 6650
6647const struct ata_port_info ata_dummy_port_info = { 6651const struct ata_port_info ata_dummy_port_info = {