summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2015-04-07 21:07:13 +0200
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 16:46:35 +0200
commitea4142f6b10585f271a40ee52eec2f55e48aeccf (patch)
tree553816bdcdf18b3c887c3d10fc3933b2a0d3c937 /drivers/scsi/lpfc/lpfc_init.c
parentlpfc: Linux lpfc driver doesn't re-establish the link after a cable pull on L... (diff)
downloadlinux-ea4142f6b10585f271a40ee52eec2f55e48aeccf.tar.xz
linux-ea4142f6b10585f271a40ee52eec2f55e48aeccf.zip
lpfc: Fix host reset escalation killing all IOs.
Fix host reset escalation killing all IOs. SLI-3 adapters will use a new host template. The template differs from SLI-4 adapters in that it does not have an eh_host_reset_handler. Lpfc has traditionally never had a host_reset. The host reset handler was added when we ran into a stuck hardware condition on a SLI-4 adapter. The host_reset will reset and reinit the pci function, clearing the hardware condition. Unfortunately, the host reset handler uses attach/detach code paths, which makes scsi_add_host() and scsi_remove_host() calls. Meaning, a host_reset will completely remove the scsi_host from the system. As a new call to scsi_add_host() is made, the shost# changes, which results in completely new scsi_devices and device names. All the older scsi devices on the old shost# are now orphaned and unrecoverable. We realize we need to re-implement the host_reset_handler so the scsi_host stays registered across the host_reset, but that will be a rather lengthy effort. In the short term, we had an immediate need to restore the SLI-3 devices to their working behavior, with the easiest path being to remove their host_reset handler. Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 4ba91af11678..74672e0263ff 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3257,12 +3257,17 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
struct Scsi_Host *shost;
int error = 0;
- if (dev != &phba->pcidev->dev)
+ if (dev != &phba->pcidev->dev) {
shost = scsi_host_alloc(&lpfc_vport_template,
sizeof(struct lpfc_vport));
- else
- shost = scsi_host_alloc(&lpfc_template,
+ } else {
+ if (phba->sli_rev == LPFC_SLI_REV4)
+ shost = scsi_host_alloc(&lpfc_template,
sizeof(struct lpfc_vport));
+ else
+ shost = scsi_host_alloc(&lpfc_template_s3,
+ sizeof(struct lpfc_vport));
+ }
if (!shost)
goto out;