Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0c87cbd authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.3.4: Consistently Implement persistent port disable



Consistently implement persistent port disable.

Ability was to be managed in the adapter via firmware via flash settings.
However, not all firmware images supported it. Uniformly support it
everywhere.

Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 8fa38513
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -525,6 +525,7 @@ struct lpfc_hba {
#define FCP_XRI_ABORT_EVENT	0x20
#define FCP_XRI_ABORT_EVENT	0x20
#define ELS_XRI_ABORT_EVENT	0x40
#define ELS_XRI_ABORT_EVENT	0x40
#define ASYNC_EVENT		0x80
#define ASYNC_EVENT		0x80
#define LINK_DISABLED		0x100 /* Link disabled by user */
	struct lpfc_dmabuf slim2p;
	struct lpfc_dmabuf slim2p;


	MAILBOX_t *mbox;
	MAILBOX_t *mbox;
+6 −1
Original line number Original line Diff line number Diff line
@@ -394,7 +394,12 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
	case LPFC_INIT_MBX_CMDS:
	case LPFC_INIT_MBX_CMDS:
	case LPFC_LINK_DOWN:
	case LPFC_LINK_DOWN:
	case LPFC_HBA_ERROR:
	case LPFC_HBA_ERROR:
		len += snprintf(buf + len, PAGE_SIZE-len, "Link Down\n");
		if (phba->hba_flag & LINK_DISABLED)
			len += snprintf(buf + len, PAGE_SIZE-len,
				"Link Down - User disabled\n");
		else
			len += snprintf(buf + len, PAGE_SIZE-len,
				"Link Down\n");
		break;
		break;
	case LPFC_LINK_UP:
	case LPFC_LINK_UP:
	case LPFC_CLEAR_LA:
	case LPFC_CLEAR_LA:
+4 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,9 @@
typedef int (*node_filter)(struct lpfc_nodelist *, void *);
typedef int (*node_filter)(struct lpfc_nodelist *, void *);


struct fc_rport;
struct fc_rport;
void lpfc_dump_mem(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t);
void lpfc_down_link(struct lpfc_hba *, LPFC_MBOXQ_t *);
void lpfc_sli_read_link_ste(struct lpfc_hba *);
void lpfc_dump_mem(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t, uint16_t);
void lpfc_dump_wakeup_param(struct lpfc_hba *, LPFC_MBOXQ_t *);
void lpfc_dump_wakeup_param(struct lpfc_hba *, LPFC_MBOXQ_t *);
void lpfc_dump_static_vport(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t);
void lpfc_dump_static_vport(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t);
int lpfc_dump_fcoe_param(struct lpfc_hba *, struct lpfcMboxq *);
int lpfc_dump_fcoe_param(struct lpfc_hba *, struct lpfcMboxq *);
@@ -234,6 +236,7 @@ void lpfc_sli_def_mbox_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t,
int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t,
			struct lpfc_iocbq *, uint32_t);
			struct lpfc_iocbq *, uint32_t);
void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t);
void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t);
void lpfc_sli_bemem_bcopy(void *, void *, uint32_t);
void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *);
void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *);
void lpfc_sli_flush_fcp_rings(struct lpfc_hba *);
void lpfc_sli_flush_fcp_rings(struct lpfc_hba *);
int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
+2 −2
Original line number Original line Diff line number Diff line
@@ -2496,8 +2496,8 @@ typedef struct {
#define  DMP_VPORT_REGION_SIZE	 0x200
#define  DMP_VPORT_REGION_SIZE	 0x200
#define  DMP_MBOX_OFFSET_WORD	 0x5
#define  DMP_MBOX_OFFSET_WORD	 0x5


#define  DMP_REGION_FCOEPARAM	 0x17   /* fcoe param region */
#define  DMP_REGION_23	 	 0x17   /* fcoe param  and port state region */
#define  DMP_FCOEPARAM_RGN_SIZE	 0x400
#define  DMP_RGN23_SIZE	 	 0x400


#define  WAKE_UP_PARMS_REGION_ID    4
#define  WAKE_UP_PARMS_REGION_ID    4
#define  WAKE_UP_PARMS_WORD_SIZE   15
#define  WAKE_UP_PARMS_WORD_SIZE   15
+42 −17
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
		goto out_free_mbox;
		goto out_free_mbox;


	do {
	do {
		lpfc_dump_mem(phba, pmb, offset);
		lpfc_dump_mem(phba, pmb, offset, DMP_REGION_VPD);
		rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
		rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);


		if (rc != MBX_SUCCESS) {
		if (rc != MBX_SUCCESS) {
@@ -425,6 +425,9 @@ lpfc_config_port_post(struct lpfc_hba *phba)
		return -EIO;
		return -EIO;
	}
	}


	/* Check if the port is disabled */
	lpfc_sli_read_link_ste(phba);

	/* Reset the DFT_HBA_Q_DEPTH to the max xri  */
	/* Reset the DFT_HBA_Q_DEPTH to the max xri  */
	if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1))
	if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1))
		phba->cfg_hba_queue_depth =
		phba->cfg_hba_queue_depth =
@@ -524,7 +527,28 @@ lpfc_config_port_post(struct lpfc_hba *phba)
	/* Set up error attention (ERATT) polling timer */
	/* Set up error attention (ERATT) polling timer */
	mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL);
	mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL);


	lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed);
	/* Check if the port is disabled */
	lpfc_sli_read_serdes_param(phba);

	if (phba->hba_flag & LINK_DISABLED) {
		lpfc_printf_log(phba,
			KERN_ERR, LOG_INIT,
			"2598 Adapter Link is disabled.\n");
		lpfc_down_link(phba, pmb);
		pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
		rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
		if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) {
			lpfc_printf_log(phba,
			KERN_ERR, LOG_INIT,
			"2599 Adapter failed to issue DOWN_LINK"
			" mbox command rc 0x%x\n", rc);

			mempool_free(pmb, phba->mbox_mem_pool);
			return -EIO;
		}
	} else {
		lpfc_init_link(phba, pmb, phba->cfg_topology,
			phba->cfg_link_speed);
		pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
		pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
		lpfc_set_loopback_flag(phba);
		lpfc_set_loopback_flag(phba);
		rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
		rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
@@ -546,6 +570,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
				mempool_free(pmb, phba->mbox_mem_pool);
				mempool_free(pmb, phba->mbox_mem_pool);
			return -EIO;
			return -EIO;
		}
		}
	}
	/* MBOX buffer will be freed in mbox compl */
	/* MBOX buffer will be freed in mbox compl */
	pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
	pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
	lpfc_config_async(phba, pmb, LPFC_ELS_RING);
	lpfc_config_async(phba, pmb, LPFC_ELS_RING);
Loading