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

Commit f91b392c authored by James.Smart@Emulex.Com's avatar James.Smart@Emulex.Com Committed by James Bottomley
Browse files

[SCSI] lpfc: Fix for "Unknown IOCB command Data: x0 x3 x0 x0"



Fix for "Unknown IOCB command Data: x0 x3 x0 x0" messages and
inability to see devices

On some platforms, the host-memory based ring mgmt area was not
zero. Also, driver wasn't manipulating the entire 32bits of the ring
pointers.

Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 09703d38
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1429,6 +1429,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
	if (!phba->slim2p)
		goto out_iounmap;

	memset(phba->slim2p, 0, SLI2_SLIM_SIZE);

	/* Initialize the SLI Layer to run with lpfc HBAs. */
	lpfc_sli_setup(phba);
+6 −1
Original line number Diff line number Diff line
@@ -531,6 +531,7 @@ lpfc_config_port(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
	size_t offset;
	struct lpfc_hgp hgp;
	void __iomem *to_slim;
	int i;

	memset(pmb, 0, sizeof(LPFC_MBOXQ_t));
	mb->mbxCommand = MBX_CONFIG_PORT;
@@ -587,7 +588,11 @@ lpfc_config_port(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
	/* write HGP data to SLIM at the required longword offset */
	memset(&hgp, 0, sizeof(struct lpfc_hgp));
	to_slim = phba->MBslimaddr + (SLIMOFF*sizeof (uint32_t));

	for (i=0; i < phba->sli.num_rings; i++) {
		lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp));
		to_slim += sizeof (struct lpfc_hgp);
	}

	/* Setup Port Group ring pointer */
	offset = (uint8_t *)&phba->slim2p->mbx.us.s2.port -
+3 −3
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ lpfc_sli_submit_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
	 * driver will put a command into.
	 */
	pring->cmdidx = pring->next_cmdidx;
	writeb(pring->cmdidx, phba->MBslimaddr
	writel(pring->cmdidx, phba->MBslimaddr
	       + (SLIMOFF + (pring->ringno * 2)) * 4);
}

@@ -1033,7 +1033,7 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba,

		to_slim = phba->MBslimaddr +
			(SLIMOFF + (pring->ringno * 2) + 1) * 4;
		writeb(pring->rspidx, to_slim);
		writel(pring->rspidx, to_slim);

		if (pring->rspidx == portRspPut)
			portRspPut = le32_to_cpu(pgp->rspPutInx);
@@ -1147,7 +1147,7 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba * phba,

		to_slim = phba->MBslimaddr + (SLIMOFF + (pring->ringno * 2)
					      + 1) * 4;
		writeb(pring->rspidx, to_slim);
		writel(pring->rspidx, to_slim);

		if (list_empty(&(pring->iocb_continueq))) {
			list_add(&rspiocbp->list, &(pring->iocb_continueq));
+2 −2
Original line number Diff line number Diff line
@@ -125,10 +125,10 @@ struct lpfc_sli_ring {

	uint32_t local_getidx;   /* last available cmd index (from cmdGetInx) */
	uint32_t next_cmdidx;    /* next_cmd index */
	uint32_t rspidx;	/* current index in response ring */
	uint32_t cmdidx;	/* current index in command ring */
	uint8_t rsvd;
	uint8_t ringno;		/* ring number */
	uint8_t rspidx;		/* current index in response ring */
	uint8_t cmdidx;		/* current index in command ring */
	uint16_t numCiocb;	/* number of command iocb's per ring */
	uint16_t numRiocb;	/* number of rsp iocb's per ring */