linux_dsm_epyc7002/include/scsi
James.Smart@Emulex.Com 19a7b4aebf [SCSI] update fc_transport for removal of block/unblock functions
We recently went back to implement a board reset. When we perform the
reset, we wanted to tear down the internal data structures and rebuild
them. Unfortunately, when it came to the rport structure, things were
odd. If we deleted them, the scsi targets and sdevs would be
torn down. Not a good thing for a temporary reset. We could block the
rports, but we either maintain the internal structures to keep the
rport reference (perhaps even replicating what's in the transport),
or we have to fatten the fc transport with new search routines to find
the rport (and deal with a case of a dangling rport that the driver
forgets).

It dawned on me that we had actually reached this state incorrectly.
When the fc transport first started, we did the block/unblock first, then
added the rport interface. The purpose of block/unblock is to hide the
temporary disappearance of the rport (e.g. being deleted, then readded).
Why are we making the driver do the block/unblock ? We should be making
the transport have only an rport add/delete, and the let the transport
handle the block/unblock.

So... This patch removes the existing fc_remote_port_block/unblock
functions. It moves the block/unblock functionality into the
fc_remote_port_add/delete functions.  Updates for the lpfc driver are
included. Qlogic driver updates are also enclosed, thanks to the
contributions of Andrew Vasquez. [Note: the qla2xxx changes are
relative to the scsi-misc-2.6 tree as of this morning - which does
not include the recent patches sent by Andrew]. The zfcp driver does
not use the block/unblock functions.

One last comment: The resulting behavior feels very clean. The LLDD is
concerned only with add/delete, which corresponds to the physical
disappearance.  However, the fact that the scsi target and sdevs are
not immediately torn down after the LLDD calls delete causes an
interesting scenario... the midlayer can call the xxx_slave_alloc and
xxx_queuecommand functions with a sdev that is at the location the
rport used to be. The driver must validate the device exists when it
first enters these functions. In thinking about it, this has always
been the case for the LLDD and these routines. The existing drivers
already check for existence. However, this highlights that simple
validation via data structure dereferencing needs to be watched.
To deal with this, a new transport function, fc_remote_port_chkready()
was created that LLDDs should call when they first enter these two
routines. It validates the rport state, and returns a scsi result
which could be returned. In addition to solving the above, it also
creates consistent behavior from the LLDD's when the block and deletes
are occuring.

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28 21:20:07 -05:00
..
iscsi_if.h [SCSI] open-iscsi/linux-iscsi-5 Initiator: Header files 2005-08-06 09:33:41 -05:00
iscsi_proto.h [SCSI] iscsi: rename some proto defs 2005-09-20 12:35:27 -05:00
scsi_cmnd.h [PATCH] gfp_t: drivers/scsi 2005-10-28 08:16:50 -07:00
scsi_dbg.h [SCSI] convert sd to scsi_execute_req (and update the scsi_execute_req API) 2005-08-28 11:33:52 -05:00
scsi_device.h [SCSI] introduce sfoo_printk, sfoo_id, sfoo_channel helpers 2005-10-28 20:47:24 -05:00
scsi_devinfo.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
scsi_driver.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
scsi_eh.h Merge by hand (conflicts in sd.c) 2005-09-06 17:52:54 -05:00
scsi_host.h [SCSI] kill unused scsi_scan_single_target() 2005-10-28 20:29:18 -05:00
scsi_ioctl.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
scsi_request.h [PATCH] gfp_t: drivers/scsi 2005-10-28 08:16:50 -07:00
scsi_tcq.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
scsi_transport_fc.h [SCSI] update fc_transport for removal of block/unblock functions 2005-10-28 21:20:07 -05:00
scsi_transport_iscsi.h [SCSI] open-iscsi/linux-iscsi-5 Initiator: Header files 2005-08-06 09:33:41 -05:00
scsi_transport_sas.h [SCSI] sas: add support for PHY resets 2005-10-28 19:08:03 -05:00
scsi_transport_spi.h [SCSI] add ability to deny binding to SPI transport class 2005-08-14 14:42:25 -05:00
scsi_transport.h [SCSI] fix target scanning oops with fc transport class 2005-08-08 17:14:55 -05:00
scsi.h [SCSI] add TYPE_RBC to our type table 2005-07-11 12:38:33 -05:00
scsicam.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sg_request.h [PATCH] I2O: Adaptec specific SG_IO access, firmware access through sysfs and 2400A workaround 2005-06-24 00:05:28 -07:00
sg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00