freebsd-nq/sys/dev/isp
Kenneth D. Merry 5704e6f06c Close a race in the isp(4) driver that caused devices to disappear
and not automatically come back if they were gone for a short
period of time.

The isp(4) driver has a 30 second gone device timer that gets
activated whenever a device goes away.  If the device comes back
before the timer expires, we don't send a notification to CAM that
it has gone away.  If, however, there is a command sent to the
device while it is gone and before it comes back, the isp(4) driver
sends the command back with CAM_SEL_TIMEOUT status.

CAM responds to the CAM_SEL_TIMEOUT status by removing the device.
In the case where a device comes back within the 30 second gone
device timer window, though, we weren't telling CAM the device
came back.

So, fix this by tracking whether we have told CAM the device is
gone, and if we have, send a rescan if it comes back within the 30
second window.

ispvar.h:
	In the fcportdb_t structure, add a new bitfield,
	reported_gone.  This gets set whenever we return a command
	with CAM_SEL_TIMEOUT status on a Fibre Channel device.

isp_freebsd.c:
	In isp_done(), if we're sending CAM_SEL_TIMEOUT for for a
	command sent to a FC device, set the reported_gone bit.

	In isp_async(), in the ISPASYNC_DEV_STAYED case, rescan the
	device in question if it is mapped to a target ID and has
	been reported gone.

	In isp_make_here(), take a port database entry argument,
	and clear the reported_gone bit when we send a rescan to
	CAM.

	In isp_make_gone(), take a port database entry as an
	argument, and set the reported_gone bit when we send an
	async event telling CAM consumers that the device is gone.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-01-08 17:51:12 +00:00
..
DriverManual.txt
Hardware.txt
isp_freebsd.c Close a race in the isp(4) driver that caused devices to disappear 2015-01-08 17:51:12 +00:00
isp_freebsd.h Fix Fibre Channel Command Reference Number handling in the isp(4) driver. 2015-01-08 17:41:28 +00:00
isp_ioctl.h
isp_library.c Make isp_find_pdb_by_*() search for targets in portdb in reverse order. 2014-11-26 12:25:00 +00:00
isp_library.h
isp_pci.c Add missing calls to bus_dmamap_unload() when freeing static DMA 2014-06-13 18:20:44 +00:00
isp_sbus.c Reform the busdma API so that new types may be added without modifying 2013-02-12 16:57:20 +00:00
isp_stds.h
isp_target.c
isp_target.h
isp.c Fix incorrect check, blocking MULTIID functionality. 2014-11-26 15:03:21 +00:00
ispmbox.h Use the C99 flexible array construct to denote a variable amount of 2014-10-13 16:23:58 +00:00
ispreg.h When fiddling with options of which registers to copy out for 2013-07-13 21:24:25 +00:00
ispvar.h Close a race in the isp(4) driver that caused devices to disappear 2015-01-08 17:51:12 +00:00