]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] cxgb4i: Remove the scsi host device when removing device
authorThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Fri, 11 Jan 2013 19:12:09 +0000 (17:12 -0200)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 30 Jan 2013 00:58:06 +0000 (11:58 +1100)
commit697be7ab53f990a550dc4b25d3344ea89291d621
treea487c300e1ef6b1b939bcd1f3871f26b9914fa09
parent91ed741dd0e890fda2ecd1c849f7b8323523cc9b
[SCSI] cxgb4i: Remove the scsi host device when removing device

When doing a hotplug remove of a cxgb4 device, there are still dandling
symlinks at /sys/class/scsi_host/hostX to the removed PCI device. The
upper layer device may also try to send data, which may crash the
system.

The DETACH message from the lower level driver is sent to the ULD when
the device is removed, when the scsi host should be removed from the
system, avoiding any problems.

After this patch, there are no more dangling symlinks and many attempts
to crash the system while there is SCSI activity and removing the device
have failed. Adding the device back again works as expected, with the
scsi hosts showing up again.

Based on a patch by Karen Xie.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c