]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] lpfc: Fix for "Unknown IOCB command Data: x0 x3 x0 x0"
authorJames.Smart@Emulex.Com <James.Smart@Emulex.Com>
Sat, 29 Oct 2005 00:29:28 +0000 (20:29 -0400)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 29 Oct 2005 15:19:52 +0000 (10:19 -0500)
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: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h

index ba4573912c02d85654851bbef0aee4cc0d39332a..e591611f98e21a490e8701ad1a61bf6ebda4ac0a 100644 (file)
@@ -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);
index 73eb89f91593e79dcbd9a9bf8f123a87d45e4957..31c20cc00609cda49a41ec52c144c548fb87b6f7 100644 (file)
@@ -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));
-       lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp));
+
+       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 -
index e74e224fd77c2ddb7323fcc57796918a826fda9b..71ff2b6a642f4d458cd2adec2368f3c961191a65 100644 (file)
@@ -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));
index 6c74f3c85ff76cefcdb150a603109a1b9c3667c6..2d5b0670415c4d5e08d81a6d84367137b19befac 100644 (file)
@@ -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 */