linux/drivers
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
..
acorn [ARM] Fix pcf8583 to build 2005-09-20 21:01:13 +01:00
acpi [PATCH] `unaligned access' in acpi get_root_bridge_busnr() 2005-10-19 23:04:31 -07:00
atm [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
base [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
block Merge branch 'sx8' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2005-10-28 09:16:58 -07:00
bluetooth [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
cdrom
char Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-28 09:24:22 -07:00
connector [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
cpufreq [PATCH] cpufreq: SMP fix for conservative governor 2005-10-27 16:29:24 -07:00
crypto
dio
eisa
fc4
firmware [PATCH] dell_rbu: changes in packet update mechanism 2005-10-11 09:46:53 -07:00
hwmon [PATCH] hdaps: small update. 2005-09-22 22:17:34 -07:00
i2c [PATCH] ppc64: SMU driver update & i2c support 2005-09-22 22:17:35 -07:00
ide [PATCH] ide: Workaround PM problem 2005-10-10 08:40:47 -07:00
ieee1394 [PATCH] gfp_t: remaining bits of drivers/* 2005-10-28 08:16:51 -07:00
infiniband [PATCH] gfp_t: drivers/infiniband 2005-10-28 08:16:50 -07:00
input [PATCH] uniput - fix crash on SMP 2005-10-17 17:03:57 -07:00
isdn [PATCH] proc_mkdir() should be used to create procfs directories 2005-09-29 08:46:26 -07:00
macintosh [PATCH] Fix ppc64 smu driver locking 2005-09-29 15:42:58 -07:00
mca
md [PATCH] gfp_t: remaining bits of drivers/* 2005-10-28 08:16:51 -07:00
media [PATCH] Kconfig: saa7134-dvb should not select cx22702 2005-10-23 16:38:39 -07:00
message [SCSI] mptsas: white space fixes and version bump 2005-10-28 19:10:34 -05:00
mfd [ARM] 2956/1: fix the "Fix gcc4 build errors in ucb1x00-core.c" 2005-10-10 18:22:17 +01:00
misc
mmc [ARM] 3/4: Remove asm/hardware.h from Versatile and Integrator io.h 2005-10-28 14:05:16 +01:00
mtd [ARM] 3/4: Remove asm/hardware.h from SA1100 io.h 2005-10-28 14:25:28 +01:00
net Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-28 09:24:22 -07:00
nubus
oprofile
parisc [PATCH] gfp_t: dma-mapping (parisc) 2005-10-28 08:16:48 -07:00
parport
pci PCI: be more verbose about resource quirks 2005-10-25 20:40:09 -07:00
pcmcia [ARM] Fix sparse warnings 2005-10-28 14:29:43 +01:00
pnp
s390 Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2005-10-28 09:05:25 -07:00
sbus
scsi [SCSI] update fc_transport for removal of block/unblock functions 2005-10-28 21:20:07 -05:00
serial [ARM] 3029/1: Add HWUART support for PXA 255/26x 2005-10-28 16:25:02 +01:00
sh
sn
tc
telephony
usb Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-28 09:24:22 -07:00
video [ARM] 3/4: Remove asm/hardware.h from Versatile and Integrator io.h 2005-10-28 14:05:16 +01:00
w1 [PATCH] Dallas's 1-wire bus compile error 2005-10-14 17:10:13 -07:00
zorro
Kconfig
Makefile