|
@@ -349,7 +349,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa)
|
|
|
|
|
|
dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n",
|
|
dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n",
|
|
ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function));
|
|
ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function));
|
|
- DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr)
|
|
|
|
|
|
+ DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr);
|
|
|
|
|
|
/* Check/log IOC log info
|
|
/* Check/log IOC log info
|
|
*/
|
|
*/
|
|
@@ -451,8 +451,9 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
|
|
#ifdef CONFIG_FUSION_LOGGING
|
|
#ifdef CONFIG_FUSION_LOGGING
|
|
if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) &&
|
|
if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) &&
|
|
!(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) {
|
|
!(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) {
|
|
- dmfprintk(ioc, printk(KERN_INFO MYNAM ": Original request frame (@%p) header\n", mf));
|
|
|
|
- DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf)
|
|
|
|
|
|
+ dmfprintk(ioc, printk(MYIOC_s_INFO_FMT ": Original request frame (@%p) header\n",
|
|
|
|
+ ioc->name, mf));
|
|
|
|
+ DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -517,8 +518,8 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
|
|
u16 status;
|
|
u16 status;
|
|
|
|
|
|
status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK;
|
|
status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK;
|
|
- dcprintk(ioc, printk(KERN_NOTICE " IOCStatus=%04xh, IOCLogInfo=%08xh\n",
|
|
|
|
- status, le32_to_cpu(pReply->IOCLogInfo)));
|
|
|
|
|
|
+ dcprintk(ioc, printk(MYIOC_s_NOTE_FMT " IOCStatus=%04xh, IOCLogInfo=%08xh\n",
|
|
|
|
+ ioc->name, status, le32_to_cpu(pReply->IOCLogInfo)));
|
|
|
|
|
|
pCfg->status = status;
|
|
pCfg->status = status;
|
|
if (status == MPI_IOCSTATUS_SUCCESS) {
|
|
if (status == MPI_IOCSTATUS_SUCCESS) {
|
|
@@ -783,7 +784,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
|
|
|
|
|
|
#ifdef MFCNT
|
|
#ifdef MFCNT
|
|
if (!ioc->active)
|
|
if (!ioc->active)
|
|
- printk(KERN_WARNING "IOC Not Active! mpt_get_msg_frame returning NULL!\n");
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "IOC Not Active! mpt_get_msg_frame "
|
|
|
|
+ "returning NULL!\n", ioc->name);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* If interrupts are not attached, do not return a request frame */
|
|
/* If interrupts are not attached, do not return a request frame */
|
|
@@ -804,7 +806,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
|
|
req_idx = req_offset / ioc->req_sz;
|
|
req_idx = req_offset / ioc->req_sz;
|
|
mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
|
|
mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
|
|
mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
|
|
mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
|
|
- ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */
|
|
|
|
|
|
+ /* Default, will be changed if necessary in SG generation */
|
|
|
|
+ ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame;
|
|
#ifdef MFCNT
|
|
#ifdef MFCNT
|
|
ioc->mfcnt++;
|
|
ioc->mfcnt++;
|
|
#endif
|
|
#endif
|
|
@@ -815,14 +818,17 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
|
|
|
|
|
|
#ifdef MFCNT
|
|
#ifdef MFCNT
|
|
if (mf == NULL)
|
|
if (mf == NULL)
|
|
- printk(KERN_WARNING "IOC Active. No free Msg Frames! Count 0x%x Max 0x%x\n", ioc->mfcnt, ioc->req_depth);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "IOC Active. No free Msg Frames! "
|
|
|
|
+ "Count 0x%x Max 0x%x\n", ioc->name, ioc->mfcnt,
|
|
|
|
+ ioc->req_depth);
|
|
mfcounter++;
|
|
mfcounter++;
|
|
if (mfcounter == PRINT_MF_COUNT)
|
|
if (mfcounter == PRINT_MF_COUNT)
|
|
- printk(KERN_INFO "MF Count 0x%x Max 0x%x \n", ioc->mfcnt, ioc->req_depth);
|
|
|
|
|
|
+ printk(MYIOC_s_INFO_FMT "MF Count 0x%x Max 0x%x \n", ioc->name,
|
|
|
|
+ ioc->mfcnt, ioc->req_depth);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- dmfprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_get_msg_frame(%d,%d), got mf=%p\n",
|
|
|
|
- ioc->name, cb_idx, ioc->id, mf));
|
|
|
|
|
|
+ dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_get_msg_frame(%d,%d), got mf=%p\n",
|
|
|
|
+ ioc->name, cb_idx, ioc->id, mf));
|
|
return mf;
|
|
return mf;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -855,7 +861,9 @@ mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
|
|
DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf);
|
|
DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf);
|
|
|
|
|
|
mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx];
|
|
mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx];
|
|
- dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, ioc->RequestNB[req_idx]));
|
|
|
|
|
|
+ dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d "
|
|
|
|
+ "RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx,
|
|
|
|
+ ioc->RequestNB[req_idx]));
|
|
CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr);
|
|
CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1002,7 +1010,7 @@ mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req,
|
|
if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE))
|
|
if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE))
|
|
return -5;
|
|
return -5;
|
|
|
|
|
|
- dhsprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n",
|
|
|
|
|
|
+ dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_send_handshake_request start, WaitCnt=%d\n",
|
|
ioc->name, ii));
|
|
ioc->name, ii));
|
|
|
|
|
|
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
|
|
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
|
|
@@ -1470,24 +1478,27 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
ioc->debug_level = mpt_debug_level;
|
|
ioc->debug_level = mpt_debug_level;
|
|
|
|
+ ioc->id = mpt_ids++;
|
|
|
|
+ sprintf(ioc->name, "ioc%d", ioc->id);
|
|
|
|
|
|
- dinitprintk(ioc, printk(KERN_WARNING MYNAM ": mpt_adapter_install\n"));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": mpt_adapter_install\n", ioc->name));
|
|
|
|
|
|
if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
|
|
if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n"));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n", ioc->name));
|
|
} else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
|
|
} else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
|
|
- printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n");
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n",
|
|
|
|
+ ioc->name);
|
|
kfree(ioc);
|
|
kfree(ioc);
|
|
return r;
|
|
return r;
|
|
}
|
|
}
|
|
|
|
|
|
if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
|
|
if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- ": Using 64 bit consistent mask\n"));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ ": Using 64 bit consistent mask\n", ioc->name));
|
|
} else {
|
|
} else {
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- ": Not using 64 bit consistent mask\n"));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ ": Not using 64 bit consistent mask\n", ioc->name));
|
|
}
|
|
}
|
|
|
|
|
|
ioc->alloc_total = sizeof(MPT_ADAPTER);
|
|
ioc->alloc_total = sizeof(MPT_ADAPTER);
|
|
@@ -1526,7 +1537,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
|
|
|
|
/* Find lookup slot. */
|
|
/* Find lookup slot. */
|
|
INIT_LIST_HEAD(&ioc->list);
|
|
INIT_LIST_HEAD(&ioc->list);
|
|
- ioc->id = mpt_ids++;
|
|
|
|
|
|
|
|
mem_phys = msize = 0;
|
|
mem_phys = msize = 0;
|
|
port = psize = 0;
|
|
port = psize = 0;
|
|
@@ -1552,15 +1562,15 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
/*mem = ioremap(mem_phys, msize);*/
|
|
/*mem = ioremap(mem_phys, msize);*/
|
|
mem = ioremap(mem_phys, msize);
|
|
mem = ioremap(mem_phys, msize);
|
|
if (mem == NULL) {
|
|
if (mem == NULL) {
|
|
- printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT "Unable to map adapter memory!\n", ioc->name);
|
|
kfree(ioc);
|
|
kfree(ioc);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
ioc->memmap = mem;
|
|
ioc->memmap = mem;
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": mem = %p, mem_phys = %lx\n", mem, mem_phys));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n", ioc->name, mem, mem_phys));
|
|
|
|
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": facts @ %p, pfacts[0] @ %p\n",
|
|
|
|
- &ioc->facts, &ioc->pfacts[0]));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n",
|
|
|
|
+ ioc->name, &ioc->facts, &ioc->pfacts[0]));
|
|
|
|
|
|
ioc->mem_phys = mem_phys;
|
|
ioc->mem_phys = mem_phys;
|
|
ioc->chip = (SYSIF_REGS __iomem *)mem;
|
|
ioc->chip = (SYSIF_REGS __iomem *)mem;
|
|
@@ -1642,8 +1652,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
if (ioc->errata_flag_1064)
|
|
if (ioc->errata_flag_1064)
|
|
pci_disable_io_access(pdev);
|
|
pci_disable_io_access(pdev);
|
|
|
|
|
|
- sprintf(ioc->name, "ioc%d", ioc->id);
|
|
|
|
-
|
|
|
|
spin_lock_init(&ioc->FreeQlock);
|
|
spin_lock_init(&ioc->FreeQlock);
|
|
|
|
|
|
/* Disable all! */
|
|
/* Disable all! */
|
|
@@ -1660,9 +1668,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
|
|
|
|
if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
|
|
if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
|
|
CAN_SLEEP)) != 0){
|
|
CAN_SLEEP)) != 0){
|
|
- printk(KERN_WARNING MYNAM
|
|
|
|
- ": WARNING - %s did not initialize properly! (%d)\n",
|
|
|
|
- ioc->name, r);
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT "didn't initialize properly! (%d)\n",
|
|
|
|
+ ioc->name, r);
|
|
|
|
|
|
list_del(&ioc->list);
|
|
list_del(&ioc->list);
|
|
if (ioc->alt_ioc)
|
|
if (ioc->alt_ioc)
|
|
@@ -1888,8 +1895,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
int irq_allocated = 0;
|
|
int irq_allocated = 0;
|
|
u8 *a;
|
|
u8 *a;
|
|
|
|
|
|
- printk(KERN_INFO MYNAM ": Initiating %s %s\n",
|
|
|
|
- ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
|
|
|
|
|
|
+ printk(MYIOC_s_INFO_FMT "Initiating %s\n", ioc->name,
|
|
|
|
+ reason == MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
|
|
|
|
|
|
/* Disable reply interrupts (also blocks FreeQ) */
|
|
/* Disable reply interrupts (also blocks FreeQ) */
|
|
CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
|
|
CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
|
|
@@ -1910,21 +1917,19 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
|
|
|
|
if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) {
|
|
if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) {
|
|
if (hard_reset_done == -4) {
|
|
if (hard_reset_done == -4) {
|
|
- printk(KERN_WARNING MYNAM ": %s Owned by PEER..skipping!\n",
|
|
|
|
- ioc->name);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "Owned by PEER..skipping!\n",
|
|
|
|
+ ioc->name);
|
|
|
|
|
|
if (reset_alt_ioc_active && ioc->alt_ioc) {
|
|
if (reset_alt_ioc_active && ioc->alt_ioc) {
|
|
/* (re)Enable alt-IOC! (reply interrupt, FreeQ) */
|
|
/* (re)Enable alt-IOC! (reply interrupt, FreeQ) */
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- ": alt-%s reply irq re-enabled\n",
|
|
|
|
- ioc->alt_ioc->name));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ "alt_ioc reply irq re-enabled\n", ioc->alt_ioc->name));
|
|
CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
|
|
CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
|
|
ioc->alt_ioc->active = 1;
|
|
ioc->alt_ioc->active = 1;
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- printk(KERN_WARNING MYNAM ": %s NOT READY WARNING!\n",
|
|
|
|
- ioc->name);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "NOT READY!\n", ioc->name);
|
|
}
|
|
}
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
@@ -1936,9 +1941,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0)
|
|
if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0)
|
|
alt_ioc_ready = 1;
|
|
alt_ioc_ready = 1;
|
|
else
|
|
else
|
|
- printk(KERN_WARNING MYNAM
|
|
|
|
- ": alt-%s: Not ready WARNING!\n",
|
|
|
|
- ioc->alt_ioc->name);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "alt_ioc not ready!\n", ioc->alt_ioc->name);
|
|
}
|
|
}
|
|
|
|
|
|
for (ii=0; ii<5; ii++) {
|
|
for (ii=0; ii<5; ii++) {
|
|
@@ -1949,7 +1952,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
|
|
|
|
|
|
|
|
if (ii == 5) {
|
|
if (ii == 5) {
|
|
- dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Retry IocFacts failed rc=%x\n", ioc->name, rc));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
|
|
+ "Retry IocFacts failed rc=%x\n", ioc->name, rc));
|
|
ret = -2;
|
|
ret = -2;
|
|
} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
MptDisplayIocCapabilities(ioc);
|
|
MptDisplayIocCapabilities(ioc);
|
|
@@ -1958,14 +1962,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
if (alt_ioc_ready) {
|
|
if (alt_ioc_ready) {
|
|
if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) {
|
|
if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) {
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc));
|
|
|
|
|
|
+ "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc));
|
|
/* Retry - alt IOC was initialized once
|
|
/* Retry - alt IOC was initialized once
|
|
*/
|
|
*/
|
|
rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason);
|
|
rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason);
|
|
}
|
|
}
|
|
if (rc) {
|
|
if (rc) {
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc));
|
|
|
|
|
|
+ "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc));
|
|
alt_ioc_ready = 0;
|
|
alt_ioc_ready = 0;
|
|
reset_alt_ioc_active = 0;
|
|
reset_alt_ioc_active = 0;
|
|
} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
@@ -1983,13 +1987,12 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
if (ioc->pcidev->irq) {
|
|
if (ioc->pcidev->irq) {
|
|
if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
|
|
if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
|
|
printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
|
|
printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
|
|
- ioc->name);
|
|
|
|
|
|
+ ioc->name);
|
|
rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
|
|
rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
|
|
- IRQF_SHARED, ioc->name, ioc);
|
|
|
|
|
|
+ IRQF_SHARED, ioc->name, ioc);
|
|
if (rc < 0) {
|
|
if (rc < 0) {
|
|
printk(MYIOC_s_ERR_FMT "Unable to allocate "
|
|
printk(MYIOC_s_ERR_FMT "Unable to allocate "
|
|
- "interrupt %d!\n", ioc->name,
|
|
|
|
- ioc->pcidev->irq);
|
|
|
|
|
|
+ "interrupt %d!\n", ioc->name, ioc->pcidev->irq);
|
|
if (mpt_msi_enable)
|
|
if (mpt_msi_enable)
|
|
pci_disable_msi(ioc->pcidev);
|
|
pci_disable_msi(ioc->pcidev);
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
@@ -1998,8 +2001,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
ioc->pci_irq = ioc->pcidev->irq;
|
|
ioc->pci_irq = ioc->pcidev->irq;
|
|
pci_set_master(ioc->pcidev); /* ?? */
|
|
pci_set_master(ioc->pcidev); /* ?? */
|
|
pci_set_drvdata(ioc->pcidev, ioc);
|
|
pci_set_drvdata(ioc->pcidev, ioc);
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM ": %s installed at interrupt "
|
|
|
|
- "%d\n", ioc->name, ioc->pcidev->irq));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt "
|
|
|
|
+ "%d\n", ioc->name, ioc->pcidev->irq));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2018,8 +2021,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
ret = -4;
|
|
ret = -4;
|
|
// NEW!
|
|
// NEW!
|
|
if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) {
|
|
if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) {
|
|
- printk(KERN_WARNING MYNAM ": alt-%s: (%d) FIFO mgmt alloc WARNING!\n",
|
|
|
|
- ioc->alt_ioc->name, rc);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT ": alt_ioc (%d) FIFO mgmt alloc!\n",
|
|
|
|
+ ioc->alt_ioc->name, rc);
|
|
alt_ioc_ready = 0;
|
|
alt_ioc_ready = 0;
|
|
reset_alt_ioc_active = 0;
|
|
reset_alt_ioc_active = 0;
|
|
}
|
|
}
|
|
@@ -2028,16 +2031,15 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) {
|
|
if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) {
|
|
alt_ioc_ready = 0;
|
|
alt_ioc_ready = 0;
|
|
reset_alt_ioc_active = 0;
|
|
reset_alt_ioc_active = 0;
|
|
- printk(KERN_WARNING MYNAM
|
|
|
|
- ": alt-%s: (%d) init failure WARNING!\n",
|
|
|
|
- ioc->alt_ioc->name, rc);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "alt_ioc (%d) init failure!\n",
|
|
|
|
+ ioc->alt_ioc->name, rc);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (reason == MPT_HOSTEVENT_IOC_BRINGUP){
|
|
if (reason == MPT_HOSTEVENT_IOC_BRINGUP){
|
|
if (ioc->upload_fw) {
|
|
if (ioc->upload_fw) {
|
|
ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "firmware upload required!\n", ioc->name));
|
|
|
|
|
|
+ "firmware upload required!\n", ioc->name));
|
|
|
|
|
|
/* Controller is not operational, cannot do upload
|
|
/* Controller is not operational, cannot do upload
|
|
*/
|
|
*/
|
|
@@ -2053,12 +2055,13 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
* mpt_diag_reset)
|
|
* mpt_diag_reset)
|
|
*/
|
|
*/
|
|
ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- ": mpt_upload: alt_%s has cached_fw=%p \n",
|
|
|
|
- ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
|
|
|
|
|
|
+ "mpt_upload: alt_%s has cached_fw=%p \n",
|
|
|
|
+ ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
|
|
ioc->alt_ioc->cached_fw = NULL;
|
|
ioc->alt_ioc->cached_fw = NULL;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- printk(KERN_WARNING MYNAM ": firmware upload failure!\n");
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT
|
|
|
|
+ "firmware upload failure!\n", ioc->name);
|
|
ret = -5;
|
|
ret = -5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2073,8 +2076,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
|
|
|
|
if (reset_alt_ioc_active && ioc->alt_ioc) {
|
|
if (reset_alt_ioc_active && ioc->alt_ioc) {
|
|
/* (re)Enable alt-IOC! (reply interrupt) */
|
|
/* (re)Enable alt-IOC! (reply interrupt) */
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n",
|
|
|
|
- ioc->alt_ioc->name));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "alt_ioc reply irq re-enabled\n",
|
|
|
|
+ ioc->alt_ioc->name));
|
|
CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
|
|
CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
|
|
ioc->alt_ioc->active = 1;
|
|
ioc->alt_ioc->active = 1;
|
|
}
|
|
}
|
|
@@ -2127,10 +2130,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
(void) GetLanConfigPages(ioc);
|
|
(void) GetLanConfigPages(ioc);
|
|
a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
|
|
a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "LanAddr = %02X:%02X:%02X:"
|
|
|
|
- "%02X:%02X:%02X\n",
|
|
|
|
- ioc->name, a[5], a[4],
|
|
|
|
- a[3], a[2], a[1], a[0] ));
|
|
|
|
|
|
+ "LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
|
|
|
|
+ ioc->name, a[5], a[4], a[3], a[2], a[1], a[0]));
|
|
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -2169,16 +2170,16 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|
for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) {
|
|
for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) {
|
|
if ((ret == 0) && MptResetHandlers[cb_idx]) {
|
|
if ((ret == 0) && MptResetHandlers[cb_idx]) {
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "Calling IOC post_reset handler #%d\n",
|
|
|
|
- ioc->name, cb_idx));
|
|
|
|
|
|
+ "Calling IOC post_reset handler #%d\n",
|
|
|
|
+ ioc->name, cb_idx));
|
|
rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET);
|
|
rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET);
|
|
handlers++;
|
|
handlers++;
|
|
}
|
|
}
|
|
|
|
|
|
if (alt_ioc_ready && MptResetHandlers[cb_idx]) {
|
|
if (alt_ioc_ready && MptResetHandlers[cb_idx]) {
|
|
drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "Calling alt-%s post_reset handler #%d\n",
|
|
|
|
- ioc->name, ioc->alt_ioc->name, cb_idx));
|
|
|
|
|
|
+ "Calling IOC post_reset handler #%d\n",
|
|
|
|
+ ioc->alt_ioc->name, cb_idx));
|
|
rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET);
|
|
rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET);
|
|
handlers++;
|
|
handlers++;
|
|
}
|
|
}
|
|
@@ -2218,8 +2219,8 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
|
|
|
|
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x,"
|
|
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x,"
|
|
" searching for devfn match on %x or %x\n",
|
|
" searching for devfn match on %x or %x\n",
|
|
- ioc->name, pci_name(pdev), pdev->bus->number,
|
|
|
|
- pdev->devfn, func-1, func+1));
|
|
|
|
|
|
+ ioc->name, pci_name(pdev), pdev->bus->number,
|
|
|
|
+ pdev->devfn, func-1, func+1));
|
|
|
|
|
|
peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
|
|
peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
|
|
if (!peer) {
|
|
if (!peer) {
|
|
@@ -2233,15 +2234,15 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
|
|
if (_pcidev == peer) {
|
|
if (_pcidev == peer) {
|
|
/* Paranoia checks */
|
|
/* Paranoia checks */
|
|
if (ioc->alt_ioc != NULL) {
|
|
if (ioc->alt_ioc != NULL) {
|
|
- printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n",
|
|
ioc->name, ioc->alt_ioc->name);
|
|
ioc->name, ioc->alt_ioc->name);
|
|
break;
|
|
break;
|
|
} else if (ioc_srch->alt_ioc != NULL) {
|
|
} else if (ioc_srch->alt_ioc != NULL) {
|
|
- printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n",
|
|
ioc_srch->name, ioc_srch->alt_ioc->name);
|
|
ioc_srch->name, ioc_srch->alt_ioc->name);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n",
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT "FOUND! binding to %s\n",
|
|
ioc->name, ioc_srch->name));
|
|
ioc->name, ioc_srch->name));
|
|
ioc_srch->alt_ioc = ioc;
|
|
ioc_srch->alt_ioc = ioc;
|
|
ioc->alt_ioc = ioc_srch;
|
|
ioc->alt_ioc = ioc_srch;
|
|
@@ -2262,10 +2263,11 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
if (ioc->cached_fw != NULL) {
|
|
if (ioc->cached_fw != NULL) {
|
|
- ddlprintk(ioc, printk(KERN_INFO MYNAM ": mpt_adapter_disable: Pushing FW onto adapter\n"));
|
|
|
|
|
|
+ ddlprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ "mpt_adapter_disable: Pushing FW onto adapter\n", ioc->name));
|
|
if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) {
|
|
if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) {
|
|
- printk(KERN_WARNING MYNAM
|
|
|
|
- ": firmware downloadboot failure (%d)!\n", ret);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "firmware downloadboot failure (%d)!\n",
|
|
|
|
+ ioc->name, ret);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2277,8 +2279,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
|
|
|
|
|
|
if (ioc->alloc != NULL) {
|
|
if (ioc->alloc != NULL) {
|
|
sz = ioc->alloc_sz;
|
|
sz = ioc->alloc_sz;
|
|
- dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s.free @ %p, sz=%d bytes\n",
|
|
|
|
- ioc->name, ioc->alloc, ioc->alloc_sz));
|
|
|
|
|
|
+ dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n",
|
|
|
|
+ ioc->name, ioc->alloc, ioc->alloc_sz));
|
|
pci_free_consistent(ioc->pcidev, sz,
|
|
pci_free_consistent(ioc->pcidev, sz,
|
|
ioc->alloc, ioc->alloc_dma);
|
|
ioc->alloc, ioc->alloc_dma);
|
|
ioc->reply_frames = NULL;
|
|
ioc->reply_frames = NULL;
|
|
@@ -2338,15 +2340,14 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
|
|
if (ioc->HostPageBuffer != NULL) {
|
|
if (ioc->HostPageBuffer != NULL) {
|
|
if((ret = mpt_host_page_access_control(ioc,
|
|
if((ret = mpt_host_page_access_control(ioc,
|
|
MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) {
|
|
MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) {
|
|
- printk(KERN_ERR MYNAM
|
|
|
|
- ": %s: host page buffers free failed (%d)!\n",
|
|
|
|
- __FUNCTION__, ret);
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT
|
|
|
|
+ "host page buffers free failed (%d)!\n",
|
|
|
|
+ ioc->name, ret);
|
|
}
|
|
}
|
|
- dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s HostPageBuffer free @ %p, sz=%d bytes\n",
|
|
|
|
|
|
+ dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "HostPageBuffer free @ %p, sz=%d bytes\n",
|
|
ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz));
|
|
ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz));
|
|
pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz,
|
|
pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz,
|
|
- ioc->HostPageBuffer,
|
|
|
|
- ioc->HostPageBuffer_dma);
|
|
|
|
|
|
+ ioc->HostPageBuffer, ioc->HostPageBuffer_dma);
|
|
ioc->HostPageBuffer = NULL;
|
|
ioc->HostPageBuffer = NULL;
|
|
ioc->HostPageBuffer_sz = 0;
|
|
ioc->HostPageBuffer_sz = 0;
|
|
ioc->alloc_total -= ioc->HostPageBuffer_sz;
|
|
ioc->alloc_total -= ioc->HostPageBuffer_sz;
|
|
@@ -2388,7 +2389,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
|
|
#if defined(CONFIG_MTRR) && 0
|
|
#if defined(CONFIG_MTRR) && 0
|
|
if (ioc->mtrr_reg > 0) {
|
|
if (ioc->mtrr_reg > 0) {
|
|
mtrr_del(ioc->mtrr_reg, 0, 0);
|
|
mtrr_del(ioc->mtrr_reg, 0, 0);
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM ": %s: MTRR region de-registered\n", ioc->name));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT "MTRR region de-registered\n", ioc->name));
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -2396,8 +2397,8 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
|
|
list_del(&ioc->list);
|
|
list_del(&ioc->list);
|
|
|
|
|
|
sz_last = ioc->alloc_total;
|
|
sz_last = ioc->alloc_total;
|
|
- dprintk(ioc, printk(KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n",
|
|
|
|
- ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_INFO_FMT "free'd %d of %d bytes\n",
|
|
|
|
+ ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first));
|
|
|
|
|
|
if (ioc->alt_ioc)
|
|
if (ioc->alt_ioc)
|
|
ioc->alt_ioc->alt_ioc = NULL;
|
|
ioc->alt_ioc->alt_ioc = NULL;
|
|
@@ -2476,7 +2477,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
|
|
|
|
/* Get current [raw] IOC state */
|
|
/* Get current [raw] IOC state */
|
|
ioc_state = mpt_GetIocState(ioc, 0);
|
|
ioc_state = mpt_GetIocState(ioc, 0);
|
|
- dhsprintk(ioc, printk(KERN_INFO MYNAM "::MakeIocReady, %s [raw] state=%08x\n", ioc->name, ioc_state));
|
|
|
|
|
|
+ dhsprintk(ioc, printk(MYIOC_s_INFO_FMT "MakeIocReady [raw] state=%08x\n", ioc->name, ioc_state));
|
|
|
|
|
|
/*
|
|
/*
|
|
* Check to see if IOC got left/stuck in doorbell handshake
|
|
* Check to see if IOC got left/stuck in doorbell handshake
|
|
@@ -2498,9 +2499,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
|
|
if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
|
|
statefault = 2;
|
|
statefault = 2;
|
|
printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n",
|
|
printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n",
|
|
- ioc->name);
|
|
|
|
- printk(KERN_WARNING " FAULT code = %04xh\n",
|
|
|
|
- ioc_state & MPI_DOORBELL_DATA_MASK);
|
|
|
|
|
|
+ ioc->name);
|
|
|
|
+ printk(MYIOC_s_WARN_FMT " FAULT code = %04xh\n",
|
|
|
|
+ ioc->name, ioc_state & MPI_DOORBELL_DATA_MASK);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -2516,9 +2517,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
* Else, fall through to KickStart case
|
|
* Else, fall through to KickStart case
|
|
*/
|
|
*/
|
|
whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT;
|
|
whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT;
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- ": whoinit 0x%x statefault %d force %d\n",
|
|
|
|
- whoinit, statefault, force));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT
|
|
|
|
+ "whoinit 0x%x statefault %d force %d\n",
|
|
|
|
+ ioc->name, whoinit, statefault, force));
|
|
if (whoinit == MPI_WHOINIT_PCI_PEER)
|
|
if (whoinit == MPI_WHOINIT_PCI_PEER)
|
|
return -4;
|
|
return -4;
|
|
else {
|
|
else {
|
|
@@ -2601,7 +2602,6 @@ mpt_GetIocState(MPT_ADAPTER *ioc, int cooked)
|
|
|
|
|
|
/* Get! */
|
|
/* Get! */
|
|
s = CHIPREG_READ32(&ioc->chip->Doorbell);
|
|
s = CHIPREG_READ32(&ioc->chip->Doorbell);
|
|
-// dprintk((MYIOC_s_INFO_FMT "raw state = %08x\n", ioc->name, s));
|
|
|
|
sc = s & MPI_IOC_STATE_MASK;
|
|
sc = s & MPI_IOC_STATE_MASK;
|
|
|
|
|
|
/* Save! */
|
|
/* Save! */
|
|
@@ -2633,9 +2633,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
|
|
|
|
|
|
/* IOC *must* NOT be in RESET state! */
|
|
/* IOC *must* NOT be in RESET state! */
|
|
if (ioc->last_state == MPI_IOC_STATE_RESET) {
|
|
if (ioc->last_state == MPI_IOC_STATE_RESET) {
|
|
- printk(KERN_ERR MYNAM ": ERROR - Can't get IOCFacts, %s NOT READY! (%08x)\n",
|
|
|
|
- ioc->name,
|
|
|
|
- ioc->last_state );
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT "Can't get IOCFacts NOT READY! (%08x)\n",
|
|
|
|
+ ioc->name, ioc->last_state );
|
|
return -44;
|
|
return -44;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2755,8 +2754,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
|
|
}
|
|
}
|
|
ioc->NBShiftFactor = shiftFactor;
|
|
ioc->NBShiftFactor = shiftFactor;
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
- "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n",
|
|
|
|
- ioc->name, vv, shiftFactor, r));
|
|
|
|
|
|
+ "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n",
|
|
|
|
+ ioc->name, vv, shiftFactor, r));
|
|
|
|
|
|
if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
|
|
/*
|
|
/*
|
|
@@ -2809,9 +2808,8 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag)
|
|
|
|
|
|
/* IOC *must* NOT be in RESET state! */
|
|
/* IOC *must* NOT be in RESET state! */
|
|
if (ioc->last_state == MPI_IOC_STATE_RESET) {
|
|
if (ioc->last_state == MPI_IOC_STATE_RESET) {
|
|
- printk(KERN_ERR MYNAM ": ERROR - Can't get PortFacts, %s NOT READY! (%08x)\n",
|
|
|
|
- ioc->name,
|
|
|
|
- ioc->last_state );
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT "Can't get PortFacts NOT READY! (%08x)\n",
|
|
|
|
+ ioc->name, ioc->last_state );
|
|
return -4;
|
|
return -4;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2986,7 +2984,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
|
|
state = mpt_GetIocState(ioc, 1);
|
|
state = mpt_GetIocState(ioc, 1);
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
- dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n",
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Wait IOC_OPERATIONAL state (cnt=%d)\n",
|
|
ioc->name, count));
|
|
ioc->name, count));
|
|
|
|
|
|
ioc->aen_event_read_flag=0;
|
|
ioc->aen_event_read_flag=0;
|
|
@@ -3079,10 +3077,9 @@ mpt_free_fw_memory(MPT_ADAPTER *ioc)
|
|
int sz;
|
|
int sz;
|
|
|
|
|
|
sz = ioc->facts.FWImageSize;
|
|
sz = ioc->facts.FWImageSize;
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n",
|
|
|
|
- ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
|
|
|
|
- pci_free_consistent(ioc->pcidev, sz,
|
|
|
|
- ioc->cached_fw, ioc->cached_fw_dma);
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n",
|
|
|
|
+ ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
|
|
|
|
+ pci_free_consistent(ioc->pcidev, sz, ioc->cached_fw, ioc->cached_fw_dma);
|
|
ioc->cached_fw = NULL;
|
|
ioc->cached_fw = NULL;
|
|
|
|
|
|
return;
|
|
return;
|
|
@@ -3123,8 +3120,8 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
|
|
|
|
|
|
mpt_alloc_fw_memory(ioc, sz);
|
|
mpt_alloc_fw_memory(ioc, sz);
|
|
|
|
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Image @ %p[%p], sz=%d[%x] bytes\n",
|
|
|
|
- ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Image @ %p[%p], sz=%d[%x] bytes\n",
|
|
|
|
+ ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
|
|
|
|
|
|
if (ioc->cached_fw == NULL) {
|
|
if (ioc->cached_fw == NULL) {
|
|
/* Major Failure.
|
|
/* Major Failure.
|
|
@@ -3155,14 +3152,14 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
|
|
mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma);
|
|
mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma);
|
|
|
|
|
|
sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
|
|
sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": Sending FW Upload (req @ %p) sgeoffset=%d \n",
|
|
|
|
- prequest, sgeoffset));
|
|
|
|
- DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest)
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": Sending FW Upload (req @ %p) sgeoffset=%d \n",
|
|
|
|
+ ioc->name, prequest, sgeoffset));
|
|
|
|
+ DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest);
|
|
|
|
|
|
ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest,
|
|
ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest,
|
|
reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag);
|
|
reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag);
|
|
|
|
|
|
- dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Upload completed rc=%x \n", ii));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Upload completed rc=%x \n", ioc->name, ii));
|
|
|
|
|
|
cmdStatus = -EFAULT;
|
|
cmdStatus = -EFAULT;
|
|
if (ii == 0) {
|
|
if (ii == 0) {
|
|
@@ -3433,7 +3430,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
u32 ioc_state=0;
|
|
u32 ioc_state=0;
|
|
int cnt,cntdn;
|
|
int cnt,cntdn;
|
|
|
|
|
|
- dinitprintk(ioc, printk(KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name));
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "KickStarting!\n", ioc->name));
|
|
if (ioc->bus_type == SPI) {
|
|
if (ioc->bus_type == SPI) {
|
|
/* Always issue a Msg Unit Reset first. This will clear some
|
|
/* Always issue a Msg Unit Reset first. This will clear some
|
|
* SCSI bus hang conditions.
|
|
* SCSI bus hang conditions.
|
|
@@ -3452,7 +3449,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
return hard_reset_done;
|
|
return hard_reset_done;
|
|
|
|
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n",
|
|
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n",
|
|
- ioc->name));
|
|
|
|
|
|
+ ioc->name));
|
|
|
|
|
|
cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */
|
|
cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */
|
|
for (cnt=0; cnt<cntdn; cnt++) {
|
|
for (cnt=0; cnt<cntdn; cnt++) {
|
|
@@ -3469,8 +3466,8 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n",
|
|
|
|
- ioc->name, ioc_state);
|
|
|
|
|
|
+ dinitprintk(ioc, printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n",
|
|
|
|
+ ioc->name, mpt_GetIocState(ioc, 0)));
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3658,8 +3655,8 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
|
|
}
|
|
}
|
|
if ((count = mpt_downloadboot(ioc,
|
|
if ((count = mpt_downloadboot(ioc,
|
|
(MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
|
|
(MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
|
|
- printk(KERN_WARNING MYNAM
|
|
|
|
- ": firmware downloadboot failure (%d)!\n", count);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT
|
|
|
|
+ "firmware downloadboot failure (%d)!\n", ioc->name, count);
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -3802,8 +3799,8 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
|
|
if (sleepFlag != CAN_SLEEP)
|
|
if (sleepFlag != CAN_SLEEP)
|
|
count *= 10;
|
|
count *= 10;
|
|
|
|
|
|
- printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY state timeout(%d)!\n",
|
|
|
|
- ioc->name, (int)((count+5)/HZ));
|
|
|
|
|
|
+ printk(MYIOC_s_ERR_FMT "Wait IOC_READY state timeout(%d)!\n",
|
|
|
|
+ ioc->name, (int)((count+5)/HZ));
|
|
return -ETIME;
|
|
return -ETIME;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4196,7 +4193,7 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req,
|
|
}
|
|
}
|
|
|
|
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req));
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req));
|
|
- DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req)
|
|
|
|
|
|
+ DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req);
|
|
|
|
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n",
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n",
|
|
ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : ""));
|
|
ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : ""));
|
|
@@ -4401,7 +4398,7 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
|
|
#endif
|
|
#endif
|
|
|
|
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name));
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name));
|
|
- DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply)
|
|
|
|
|
|
+ DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply);
|
|
|
|
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n",
|
|
dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n",
|
|
ioc->name, t, u16cnt/2));
|
|
ioc->name, t, u16cnt/2));
|
|
@@ -4876,8 +4873,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
|
|
|
|
|
|
if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) {
|
|
if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) {
|
|
ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS;
|
|
ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS;
|
|
- ddvprintk(ioc, printk(KERN_INFO MYNAM
|
|
|
|
- " :%s noQas due to Capabilities=%x\n",
|
|
|
|
|
|
+ ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
|
|
+ "noQas due to Capabilities=%x\n",
|
|
ioc->name, pPP0->Capabilities));
|
|
ioc->name, pPP0->Capabilities));
|
|
}
|
|
}
|
|
ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0;
|
|
ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0;
|
|
@@ -5785,10 +5782,10 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
|
|
CONFIGPARMS *pCfg;
|
|
CONFIGPARMS *pCfg;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
- dprintk(ioc, printk(KERN_DEBUG MYNAM
|
|
|
|
- ": IOC %s_reset routed to MPT base driver!\n",
|
|
|
|
- reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
|
|
|
|
- reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
|
|
|
|
|
|
+ dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
|
|
+ ": IOC %s_reset routed to MPT base driver!\n",
|
|
|
|
+ ioc->name, reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
|
|
|
|
+ reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
|
|
|
|
|
|
if (reset_phase == MPT_IOC_SETUP_RESET) {
|
|
if (reset_phase == MPT_IOC_SETUP_RESET) {
|
|
;
|
|
;
|
|
@@ -6201,8 +6198,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
|
|
}
|
|
}
|
|
|
|
|
|
if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) {
|
|
if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) {
|
|
- printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n",
|
|
|
|
- rc, ioc->name);
|
|
|
|
|
|
+ printk(MYIOC_s_WARN_FMT "Cannot recover rc = %d!\n", ioc->name, rc);
|
|
}
|
|
}
|
|
ioc->reload_fw = 0;
|
|
ioc->reload_fw = 0;
|
|
if (ioc->alt_ioc)
|
|
if (ioc->alt_ioc)
|
|
@@ -6622,12 +6618,12 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
|
|
evStr));
|
|
evStr));
|
|
|
|
|
|
#ifdef CONFIG_FUSION_LOGGING
|
|
#ifdef CONFIG_FUSION_LOGGING
|
|
- devtverboseprintk(ioc, printk(KERN_DEBUG MYNAM
|
|
|
|
- ": Event data:\n"));
|
|
|
|
|
|
+ devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT
|
|
|
|
+ ": Event data:\n", ioc->name));
|
|
for (ii = 0; ii < evDataLen; ii++)
|
|
for (ii = 0; ii < evDataLen; ii++)
|
|
devtverboseprintk(ioc, printk(" %08x",
|
|
devtverboseprintk(ioc, printk(" %08x",
|
|
le32_to_cpu(pEventReply->Data[ii])));
|
|
le32_to_cpu(pEventReply->Data[ii])));
|
|
- devtverboseprintk(ioc, printk(KERN_DEBUG "\n"));
|
|
|
|
|
|
+ devtverboseprintk(ioc, printk("\n"));
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -7119,8 +7115,8 @@ mpt_iocstatus_info_config(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
|
|
if (!desc)
|
|
if (!desc)
|
|
return;
|
|
return;
|
|
|
|
|
|
- printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s: %s\n",
|
|
|
|
- ioc->name, ioc_status, desc, extend_desc);
|
|
|
|
|
|
+ dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s: %s\n",
|
|
|
|
+ ioc->name, ioc_status, desc, extend_desc));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -7346,7 +7342,8 @@ mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
|
|
if (!desc)
|
|
if (!desc)
|
|
return;
|
|
return;
|
|
|
|
|
|
- printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s\n", ioc->name, status, desc);
|
|
|
|
|
|
+ dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s\n",
|
|
|
|
+ ioc->name, status, desc));
|
|
}
|
|
}
|
|
|
|
|
|
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
|
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|