[SCSI] cxgb4i: Remove the scsi host device when removing device
[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 <c8883472cb5fbead63941b41bccc869c7deaf90f@linux.vnet.ibm.com>
Cc: Karen Xie <1b08c48383c1f854263962314570f7dfb58ce4b7@chelsio.com>
Reviewed-by: Mike Christie <6fe105eefab41990d7ec714c6c25ade3095cdb48@cs.wisc.edu>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas