]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/lpfc/lpfc_vport.c
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / scsi / lpfc / lpfc_vport.c
index 4e36998a266c364d9cf0d1de423386978bb618fa..9a0339dbc024bb02483aaa2a0f383d1134b03143 100644 (file)
@@ -1,9 +1,11 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
+ * Copyright (C) 2017 Broadcom. All Rights Reserved. The term      *
+ * “Broadcom” refers to Broadcom Limited and/or its subsidiaries.  *
  * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
- * www.emulex.com                                                  *
+ * www.broadcom.com                                                *
  * Portions Copyright (C) 2004-2005 Christoph Hellwig              *
  *                                                                 *
  * This program is free software; you can redistribute it and/or   *
@@ -34,6 +36,7 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport_fc.h>
+
 #include "lpfc_hw4.h"
 #include "lpfc_hw.h"
 #include "lpfc_sli.h"
@@ -403,6 +406,22 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
                vport->fdmi_port_mask = phba->pport->fdmi_port_mask;
        }
 
+       if ((phba->nvmet_support == 0) &&
+           ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
+            (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME))) {
+               /* Create NVME binding with nvme_fc_transport. This
+                * ensures the vport is initialized.
+                */
+               rc = lpfc_nvme_create_localport(vport);
+               if (rc) {
+                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                                       "6003 %s status x%x\n",
+                                       "NVME registration failed, ",
+                                       rc);
+                       goto error_out;
+               }
+       }
+
        /*
         * In SLI4, the vpi must be activated before it can be used
         * by the port.