]> git.karo-electronics.de Git - karo-tx-linux.git/commit
libata, libsas: introduce sched_eh and end_eh port ops
authorDan Williams <dan.j.williams@intel.com>
Fri, 2 Mar 2012 02:44:25 +0000 (18:44 -0800)
committerDan Williams <dan.j.williams@intel.com>
Fri, 16 Mar 2012 15:53:50 +0000 (08:53 -0700)
commit705885cb7b906ebddafbaedd693c355f8350ac4e
treec3bbf4308f94b131de5bdd5cc0600624a0821ad9
parent3c1dbbd2529c659745c047c449037e4f94d326cb
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.

Cc: Tejun Heo <tj@kernel.org>
Acked-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/scsi/libsas/sas_ata.c
drivers/scsi/libsas/sas_discover.c
drivers/scsi/libsas/sas_event.c
drivers/scsi/libsas/sas_init.c
drivers/scsi/libsas/sas_scsi_host.c
include/linux/libata.h
include/scsi/libsas.h
include/scsi/sas_ata.h