diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-06-22 02:25:27 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:58:45 -0400 |
commit | e4a9c3732cea3e3c8c704aad86636090ffe6b25f (patch) | |
tree | faea8e91b3d917dcdb4c89adbb021ac737a6cb35 /include/linux/libata.h | |
parent | 3b661a92e869ebe2358de8f4b3230ad84f7fce51 (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 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6e887c742a2..53da442f892 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -846,6 +846,8 @@ struct ata_port_operations { | |||
846 | void (*error_handler)(struct ata_port *ap); | 846 | void (*error_handler)(struct ata_port *ap); |
847 | void (*lost_interrupt)(struct ata_port *ap); | 847 | void (*lost_interrupt)(struct ata_port *ap); |
848 | void (*post_internal_cmd)(struct ata_queued_cmd *qc); | 848 | void (*post_internal_cmd)(struct ata_queued_cmd *qc); |
849 | void (*sched_eh)(struct ata_port *ap); | ||
850 | void (*end_eh)(struct ata_port *ap); | ||
849 | 851 | ||
850 | /* | 852 | /* |
851 | * Optional features | 853 | * Optional features |
@@ -1167,6 +1169,8 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
1167 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | 1169 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, |
1168 | ata_postreset_fn_t postreset); | 1170 | ata_postreset_fn_t postreset); |
1169 | extern void ata_std_error_handler(struct ata_port *ap); | 1171 | extern void ata_std_error_handler(struct ata_port *ap); |
1172 | extern void ata_std_sched_eh(struct ata_port *ap); | ||
1173 | extern void ata_std_end_eh(struct ata_port *ap); | ||
1170 | extern int ata_link_nr_enabled(struct ata_link *link); | 1174 | extern int ata_link_nr_enabled(struct ata_link *link); |
1171 | 1175 | ||
1172 | /* | 1176 | /* |