aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-08-18 10:24:53 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-04 20:51:45 -0400
commitc6678e0cfb41b029c3600c54b5bb65954de1230a (patch)
treeca3ac267e56bd481956a503e9595b4bfc52d174a /drivers
parent637fa99b86a00a0b5767a982b83a512ff48ad6d2 (diff)
[SCSI] fusion: whitespace fixes
Acked by: Moore, Eric Dean <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptbase.c225
-rw-r--r--drivers/message/fusion/mptscsih.c98
-rw-r--r--drivers/message/fusion/mptspi.c6
3 files changed, 174 insertions, 155 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 35444ba4e78a..f517d0692d5f 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -218,8 +218,7 @@ pci_enable_io_access(struct pci_dev *pdev)
218 * (also referred to as a IO Controller or IOC). 218 * (also referred to as a IO Controller or IOC).
219 * This routine must clear the interrupt from the adapter and does 219 * This routine must clear the interrupt from the adapter and does
220 * so by reading the reply FIFO. Multiple replies may be processed 220 * so by reading the reply FIFO. Multiple replies may be processed
221 * per single call to this routine; up to MPT_MAX_REPLIES_PER_ISR 221 * per single call to this routine.
222 * which is currently set to 32 in mptbase.h.
223 * 222 *
224 * This routine handles register-level access of the adapter but 223 * This routine handles register-level access of the adapter but
225 * dispatches (calls) a protocol-specific callback routine to handle 224 * dispatches (calls) a protocol-specific callback routine to handle
@@ -279,11 +278,11 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
279 cb_idx = mr->u.frame.hwhdr.msgctxu.fld.cb_idx; 278 cb_idx = mr->u.frame.hwhdr.msgctxu.fld.cb_idx;
280 mf = MPT_INDEX_2_MFPTR(ioc, req_idx); 279 mf = MPT_INDEX_2_MFPTR(ioc, req_idx);
281 280
282 dmfprintk((MYIOC_s_INFO_FMT "Got non-TURBO reply=%p req_idx=%x\n", 281 dmfprintk((MYIOC_s_INFO_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n",
283 ioc->name, mr, req_idx)); 282 ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function));
284 DBG_DUMP_REPLY_FRAME(mr) 283 DBG_DUMP_REPLY_FRAME(mr)
285 284
286 /* Check/log IOC log info 285 /* Check/log IOC log info
287 */ 286 */
288 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus); 287 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus);
289 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { 288 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
@@ -345,7 +344,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
345 if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth)) 344 if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))
346 || (mf < ioc->req_frames)) ) { 345 || (mf < ioc->req_frames)) ) {
347 printk(MYIOC_s_WARN_FMT 346 printk(MYIOC_s_WARN_FMT
348 "mpt_interrupt: Invalid mf (%p) req_idx (%d)!\n", ioc->name, (void *)mf, req_idx); 347 "mpt_interrupt: Invalid mf (%p)!\n", ioc->name, (void *)mf);
349 cb_idx = 0; 348 cb_idx = 0;
350 pa = 0; 349 pa = 0;
351 freeme = 0; 350 freeme = 0;
@@ -399,7 +398,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
399 * @mf: Pointer to original MPT request frame 398 * @mf: Pointer to original MPT request frame
400 * @reply: Pointer to MPT reply frame (NULL if TurboReply) 399 * @reply: Pointer to MPT reply frame (NULL if TurboReply)
401 * 400 *
402 * Returns 1 indicating original alloc'd request frame ptr 401 * Returns 1 indicating original alloc'd request frame ptr
403 * should be freed, or 0 if it shouldn't. 402 * should be freed, or 0 if it shouldn't.
404 */ 403 */
405static int 404static int
@@ -408,28 +407,17 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
408 int freereq = 1; 407 int freereq = 1;
409 u8 func; 408 u8 func;
410 409
411 dprintk((MYIOC_s_INFO_FMT "mpt_base_reply() called\n", ioc->name)); 410 dmfprintk((MYIOC_s_INFO_FMT "mpt_base_reply() called\n", ioc->name));
412
413 if ((mf == NULL) ||
414 (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) {
415 printk(MYIOC_s_ERR_FMT "NULL or BAD request frame ptr! (=%p)\n",
416 ioc->name, (void *)mf);
417 return 1;
418 }
419
420 if (reply == NULL) {
421 dprintk((MYIOC_s_ERR_FMT "Unexpected NULL Event (turbo?) reply!\n",
422 ioc->name));
423 return 1;
424 }
425 411
412#if defined(MPT_DEBUG_MSG_FRAME)
426 if (!(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) { 413 if (!(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) {
427 dmfprintk((KERN_INFO MYNAM ": Original request frame (@%p) header\n", mf)); 414 dmfprintk((KERN_INFO MYNAM ": Original request frame (@%p) header\n", mf));
428 DBG_DUMP_REQUEST_FRAME_HDR(mf) 415 DBG_DUMP_REQUEST_FRAME_HDR(mf)
429 } 416 }
417#endif
430 418
431 func = reply->u.hdr.Function; 419 func = reply->u.hdr.Function;
432 dprintk((MYIOC_s_INFO_FMT "mpt_base_reply, Function=%02Xh\n", 420 dmfprintk((MYIOC_s_INFO_FMT "mpt_base_reply, Function=%02Xh\n",
433 ioc->name, func)); 421 ioc->name, func));
434 422
435 if (func == MPI_FUNCTION_EVENT_NOTIFICATION) { 423 if (func == MPI_FUNCTION_EVENT_NOTIFICATION) {
@@ -448,8 +436,14 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
448 * Hmmm... It seems that EventNotificationReply is an exception 436 * Hmmm... It seems that EventNotificationReply is an exception
449 * to the rule of one reply per request. 437 * to the rule of one reply per request.
450 */ 438 */
451 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) 439 if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) {
452 freereq = 0; 440 freereq = 0;
441 devtprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p does not return Request frame\n",
442 ioc->name, pEvReply));
443 } else {
444 devtprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n",
445 ioc->name, pEvReply));
446 }
453 447
454#ifdef CONFIG_PROC_FS 448#ifdef CONFIG_PROC_FS
455// LogEvent(ioc, pEvReply); 449// LogEvent(ioc, pEvReply);
@@ -716,7 +710,7 @@ mpt_device_driver_deregister(int cb_idx)
716 if (dd_cbfunc->remove) 710 if (dd_cbfunc->remove)
717 dd_cbfunc->remove(ioc->pcidev); 711 dd_cbfunc->remove(ioc->pcidev);
718 } 712 }
719 713
720 MptDeviceDriverHandlers[cb_idx] = NULL; 714 MptDeviceDriverHandlers[cb_idx] = NULL;
721} 715}
722 716
@@ -829,7 +823,7 @@ mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
829 } 823 }
830#endif 824#endif
831 825
832 mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx]; 826 mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx];
833 dsgprintk((MYIOC_s_INFO_FMT "mf_dma_addr=%x req_idx=%d RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, ioc->RequestNB[req_idx])); 827 dsgprintk((MYIOC_s_INFO_FMT "mf_dma_addr=%x req_idx=%d RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, ioc->RequestNB[req_idx]));
834 CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); 828 CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr);
835} 829}
@@ -931,7 +925,7 @@ mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req,
931 925
932 /* Make sure there are no doorbells */ 926 /* Make sure there are no doorbells */
933 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 927 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
934 928
935 CHIPREG_WRITE32(&ioc->chip->Doorbell, 929 CHIPREG_WRITE32(&ioc->chip->Doorbell,
936 ((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) | 930 ((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) |
937 ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT))); 931 ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT)));
@@ -946,14 +940,14 @@ mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req,
946 return -5; 940 return -5;
947 941
948 dhsprintk((KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n", 942 dhsprintk((KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n",
949 ioc->name, ii)); 943 ioc->name, ii));
950 944
951 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 945 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
952 946
953 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) { 947 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) {
954 return -2; 948 return -2;
955 } 949 }
956 950
957 /* Send request via doorbell handshake */ 951 /* Send request via doorbell handshake */
958 req_as_bytes = (u8 *) req; 952 req_as_bytes = (u8 *) req;
959 for (ii = 0; ii < reqBytes/4; ii++) { 953 for (ii = 0; ii < reqBytes/4; ii++) {
@@ -999,9 +993,9 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
999 if (ioc->id == iocid) { 993 if (ioc->id == iocid) {
1000 *iocpp =ioc; 994 *iocpp =ioc;
1001 return iocid; 995 return iocid;
1002 } 996 }
1003 } 997 }
1004 998
1005 *iocpp = NULL; 999 *iocpp = NULL;
1006 return -1; 1000 return -1;
1007} 1001}
@@ -1043,9 +1037,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1043 1037
1044 if (pci_enable_device(pdev)) 1038 if (pci_enable_device(pdev))
1045 return r; 1039 return r;
1046 1040
1047 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n")); 1041 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n"));
1048 1042
1049 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { 1043 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
1050 dprintk((KERN_INFO MYNAM 1044 dprintk((KERN_INFO MYNAM
1051 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); 1045 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n"));
@@ -1070,7 +1064,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1070 ioc->alloc_total = sizeof(MPT_ADAPTER); 1064 ioc->alloc_total = sizeof(MPT_ADAPTER);
1071 ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ 1065 ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */
1072 ioc->reply_sz = MPT_REPLY_FRAME_SIZE; 1066 ioc->reply_sz = MPT_REPLY_FRAME_SIZE;
1073 1067
1074 ioc->pcidev = pdev; 1068 ioc->pcidev = pdev;
1075 ioc->diagPending = 0; 1069 ioc->diagPending = 0;
1076 spin_lock_init(&ioc->diagLock); 1070 spin_lock_init(&ioc->diagLock);
@@ -1099,7 +1093,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1099 /* Find lookup slot. */ 1093 /* Find lookup slot. */
1100 INIT_LIST_HEAD(&ioc->list); 1094 INIT_LIST_HEAD(&ioc->list);
1101 ioc->id = mpt_ids++; 1095 ioc->id = mpt_ids++;
1102 1096
1103 mem_phys = msize = 0; 1097 mem_phys = msize = 0;
1104 port = psize = 0; 1098 port = psize = 0;
1105 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { 1099 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
@@ -1154,7 +1148,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1154 ioc->prod_name = "LSIFC909"; 1148 ioc->prod_name = "LSIFC909";
1155 ioc->bus_type = FC; 1149 ioc->bus_type = FC;
1156 } 1150 }
1157 if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) { 1151 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) {
1158 ioc->prod_name = "LSIFC929"; 1152 ioc->prod_name = "LSIFC929";
1159 ioc->bus_type = FC; 1153 ioc->bus_type = FC;
1160 } 1154 }
@@ -1333,7 +1327,7 @@ mpt_detach(struct pci_dev *pdev)
1333 remove_proc_entry(pname, NULL); 1327 remove_proc_entry(pname, NULL);
1334 sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); 1328 sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name);
1335 remove_proc_entry(pname, NULL); 1329 remove_proc_entry(pname, NULL);
1336 1330
1337 /* call per device driver remove entry point */ 1331 /* call per device driver remove entry point */
1338 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) { 1332 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1339 if(MptDeviceDriverHandlers[ii] && 1333 if(MptDeviceDriverHandlers[ii] &&
@@ -1341,7 +1335,7 @@ mpt_detach(struct pci_dev *pdev)
1341 MptDeviceDriverHandlers[ii]->remove(pdev); 1335 MptDeviceDriverHandlers[ii]->remove(pdev);
1342 } 1336 }
1343 } 1337 }
1344 1338
1345 /* Disable interrupts! */ 1339 /* Disable interrupts! */
1346 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); 1340 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
1347 1341
@@ -1414,7 +1408,7 @@ mpt_resume(struct pci_dev *pdev)
1414 u32 device_state = pdev->current_state; 1408 u32 device_state = pdev->current_state;
1415 int recovery_state; 1409 int recovery_state;
1416 int ii; 1410 int ii;
1417 1411
1418 printk(MYIOC_s_INFO_FMT 1412 printk(MYIOC_s_INFO_FMT
1419 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", 1413 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
1420 ioc->name, pdev, pci_name(pdev), device_state); 1414 ioc->name, pdev, pci_name(pdev), device_state);
@@ -1545,7 +1539,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1545 if ((rc = GetIocFacts(ioc, sleepFlag, reason)) == 0) 1539 if ((rc = GetIocFacts(ioc, sleepFlag, reason)) == 0)
1546 break; 1540 break;
1547 } 1541 }
1548 1542
1549 1543
1550 if (ii == 5) { 1544 if (ii == 5) {
1551 dinitprintk((MYIOC_s_INFO_FMT "Retry IocFacts failed rc=%x\n", ioc->name, rc)); 1545 dinitprintk((MYIOC_s_INFO_FMT "Retry IocFacts failed rc=%x\n", ioc->name, rc));
@@ -1553,7 +1547,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1553 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { 1547 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
1554 MptDisplayIocCapabilities(ioc); 1548 MptDisplayIocCapabilities(ioc);
1555 } 1549 }
1556 1550
1557 if (alt_ioc_ready) { 1551 if (alt_ioc_ready) {
1558 if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { 1552 if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) {
1559 dinitprintk((MYIOC_s_INFO_FMT "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc)); 1553 dinitprintk((MYIOC_s_INFO_FMT "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc));
@@ -1624,7 +1618,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1624 1618
1625 if (reset_alt_ioc_active && ioc->alt_ioc) { 1619 if (reset_alt_ioc_active && ioc->alt_ioc) {
1626 /* (re)Enable alt-IOC! (reply interrupt) */ 1620 /* (re)Enable alt-IOC! (reply interrupt) */
1627 dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 1621 dinitprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n",
1628 ioc->alt_ioc->name)); 1622 ioc->alt_ioc->name));
1629 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); 1623 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM));
1630 ioc->alt_ioc->active = 1; 1624 ioc->alt_ioc->active = 1;
@@ -1681,7 +1675,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1681 1675
1682 /* Find IM volumes 1676 /* Find IM volumes
1683 */ 1677 */
1684 if (ioc->facts.MsgVersion >= 0x0102) 1678 if (ioc->facts.MsgVersion >= MPI_VERSION_01_02)
1685 mpt_findImVolumes(ioc); 1679 mpt_findImVolumes(ioc);
1686 1680
1687 /* Check, and possibly reset, the coalescing value 1681 /* Check, and possibly reset, the coalescing value
@@ -1711,7 +1705,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1711 } 1705 }
1712 1706
1713 if (alt_ioc_ready && MptResetHandlers[ii]) { 1707 if (alt_ioc_ready && MptResetHandlers[ii]) {
1714 dprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", 1708 drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n",
1715 ioc->name, ioc->alt_ioc->name, ii)); 1709 ioc->name, ioc->alt_ioc->name, ii));
1716 rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); 1710 rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET);
1717 handlers++; 1711 handlers++;
@@ -1744,8 +1738,8 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
1744 1738
1745 dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x," 1739 dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x,"
1746 " searching for devfn match on %x or %x\n", 1740 " searching for devfn match on %x or %x\n",
1747 ioc->name, pci_name(pdev), pdev->devfn, 1741 ioc->name, pci_name(pdev), pdev->bus->number,
1748 func-1, func+1)); 1742 pdev->devfn, func-1, func+1));
1749 1743
1750 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); 1744 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
1751 if (!peer) { 1745 if (!peer) {
@@ -1872,36 +1866,39 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
1872static void 1866static void
1873mpt_adapter_dispose(MPT_ADAPTER *ioc) 1867mpt_adapter_dispose(MPT_ADAPTER *ioc)
1874{ 1868{
1875 if (ioc != NULL) { 1869 int sz_first, sz_last;
1876 int sz_first, sz_last;
1877 1870
1878 sz_first = ioc->alloc_total; 1871 if (ioc == NULL)
1872 return;
1879 1873
1880 mpt_adapter_disable(ioc); 1874 sz_first = ioc->alloc_total;
1881 1875
1882 if (ioc->pci_irq != -1) { 1876 mpt_adapter_disable(ioc);
1883 free_irq(ioc->pci_irq, ioc);
1884 ioc->pci_irq = -1;
1885 }
1886 1877
1887 if (ioc->memmap != NULL) 1878 if (ioc->pci_irq != -1) {
1888 iounmap(ioc->memmap); 1879 free_irq(ioc->pci_irq, ioc);
1880 ioc->pci_irq = -1;
1881 }
1882
1883 if (ioc->memmap != NULL) {
1884 iounmap(ioc->memmap);
1885 ioc->memmap = NULL;
1886 }
1889 1887
1890#if defined(CONFIG_MTRR) && 0 1888#if defined(CONFIG_MTRR) && 0
1891 if (ioc->mtrr_reg > 0) { 1889 if (ioc->mtrr_reg > 0) {
1892 mtrr_del(ioc->mtrr_reg, 0, 0); 1890 mtrr_del(ioc->mtrr_reg, 0, 0);
1893 dprintk((KERN_INFO MYNAM ": %s: MTRR region de-registered\n", ioc->name)); 1891 dprintk((KERN_INFO MYNAM ": %s: MTRR region de-registered\n", ioc->name));
1894 } 1892 }
1895#endif 1893#endif
1896 1894
1897 /* Zap the adapter lookup ptr! */ 1895 /* Zap the adapter lookup ptr! */
1898 list_del(&ioc->list); 1896 list_del(&ioc->list);
1899 1897
1900 sz_last = ioc->alloc_total; 1898 sz_last = ioc->alloc_total;
1901 dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", 1899 dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n",
1902 ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); 1900 ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first));
1903 kfree(ioc); 1901 kfree(ioc);
1904 }
1905} 1902}
1906 1903
1907/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1904/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1988,7 +1985,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
1988 } 1985 }
1989 1986
1990 /* Is it already READY? */ 1987 /* Is it already READY? */
1991 if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY) 1988 if (!statefault && (ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_READY)
1992 return 0; 1989 return 0;
1993 1990
1994 /* 1991 /*
@@ -2006,7 +2003,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
2006 * Hmmm... Did it get left operational? 2003 * Hmmm... Did it get left operational?
2007 */ 2004 */
2008 if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) { 2005 if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) {
2009 dinitprintk((MYIOC_s_WARN_FMT "IOC operational unexpected\n", 2006 dinitprintk((MYIOC_s_INFO_FMT "IOC operational unexpected\n",
2010 ioc->name)); 2007 ioc->name));
2011 2008
2012 /* Check WhoInit. 2009 /* Check WhoInit.
@@ -2015,8 +2012,8 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
2015 * Else, fall through to KickStart case 2012 * Else, fall through to KickStart case
2016 */ 2013 */
2017 whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT; 2014 whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT;
2018 dprintk((KERN_WARNING MYNAM 2015 dinitprintk((KERN_INFO MYNAM
2019 ": whoinit 0x%x\n statefault %d force %d\n", 2016 ": whoinit 0x%x statefault %d force %d\n",
2020 whoinit, statefault, force)); 2017 whoinit, statefault, force));
2021 if (whoinit == MPI_WHOINIT_PCI_PEER) 2018 if (whoinit == MPI_WHOINIT_PCI_PEER)
2022 return -4; 2019 return -4;
@@ -2151,8 +2148,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2151 get_facts.Function = MPI_FUNCTION_IOC_FACTS; 2148 get_facts.Function = MPI_FUNCTION_IOC_FACTS;
2152 /* Assert: All other get_facts fields are zero! */ 2149 /* Assert: All other get_facts fields are zero! */
2153 2150
2154 dinitprintk((MYIOC_s_INFO_FMT 2151 dinitprintk((MYIOC_s_INFO_FMT
2155 "Sending get IocFacts request req_sz=%d reply_sz=%d\n", 2152 "Sending get IocFacts request req_sz=%d reply_sz=%d\n",
2156 ioc->name, req_sz, reply_sz)); 2153 ioc->name, req_sz, reply_sz));
2157 2154
2158 /* No non-zero fields in the get_facts request are greater than 2155 /* No non-zero fields in the get_facts request are greater than
@@ -2232,7 +2229,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2232 if ( sz & 0x02 ) 2229 if ( sz & 0x02 )
2233 sz += 2; 2230 sz += 2;
2234 facts->FWImageSize = sz; 2231 facts->FWImageSize = sz;
2235 2232
2236 if (!facts->RequestFrameSize) { 2233 if (!facts->RequestFrameSize) {
2237 /* Something is wrong! */ 2234 /* Something is wrong! */
2238 printk(MYIOC_s_ERR_FMT "IOC reported invalid 0 request size!\n", 2235 printk(MYIOC_s_ERR_FMT "IOC reported invalid 0 request size!\n",
@@ -2251,7 +2248,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2251 ioc->NBShiftFactor = shiftFactor; 2248 ioc->NBShiftFactor = shiftFactor;
2252 dinitprintk((MYIOC_s_INFO_FMT "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n", 2249 dinitprintk((MYIOC_s_INFO_FMT "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n",
2253 ioc->name, vv, shiftFactor, r)); 2250 ioc->name, vv, shiftFactor, r));
2254 2251
2255 if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { 2252 if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
2256 /* 2253 /*
2257 * Set values for this IOC's request & reply frame sizes, 2254 * Set values for this IOC's request & reply frame sizes,
@@ -2272,7 +2269,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2272 return r; 2269 return r;
2273 } 2270 }
2274 } else { 2271 } else {
2275 printk(MYIOC_s_ERR_FMT 2272 printk(MYIOC_s_ERR_FMT
2276 "Invalid IOC facts reply, msgLength=%d offsetof=%zd!\n", 2273 "Invalid IOC facts reply, msgLength=%d offsetof=%zd!\n",
2277 ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t, 2274 ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t,
2278 RequestFrameSize)/sizeof(u32))); 2275 RequestFrameSize)/sizeof(u32)));
@@ -2424,9 +2421,11 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
2424 2421
2425 dhsprintk((MYIOC_s_INFO_FMT "Sending PortEnable (req @ %p)\n", 2422 dhsprintk((MYIOC_s_INFO_FMT "Sending PortEnable (req @ %p)\n",
2426 ioc->name, &ioc_init)); 2423 ioc->name, &ioc_init));
2427 2424
2428 if ((r = SendPortEnable(ioc, 0, sleepFlag)) != 0) 2425 if ((r = SendPortEnable(ioc, 0, sleepFlag)) != 0) {
2426 printk(MYIOC_s_ERR_FMT "Sending PortEnable failed(%d)!\n",ioc->name, r);
2429 return r; 2427 return r;
2428 }
2430 2429
2431 /* YIKES! SUPER IMPORTANT!!! 2430 /* YIKES! SUPER IMPORTANT!!!
2432 * Poll IocState until _OPERATIONAL while IOC is doing 2431 * Poll IocState until _OPERATIONAL while IOC is doing
@@ -2451,7 +2450,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
2451 state = mpt_GetIocState(ioc, 1); 2450 state = mpt_GetIocState(ioc, 1);
2452 count++; 2451 count++;
2453 } 2452 }
2454 dhsprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", 2453 dinitprintk((MYIOC_s_INFO_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n",
2455 ioc->name, count)); 2454 ioc->name, count));
2456 2455
2457 return r; 2456 return r;
@@ -2540,7 +2539,7 @@ mpt_free_fw_memory(MPT_ADAPTER *ioc)
2540 int sz; 2539 int sz;
2541 2540
2542 sz = ioc->facts.FWImageSize; 2541 sz = ioc->facts.FWImageSize;
2543 dinitprintk((KERN_WARNING MYNAM "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n", 2542 dinitprintk((KERN_INFO MYNAM "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n",
2544 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); 2543 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
2545 pci_free_consistent(ioc->pcidev, sz, 2544 pci_free_consistent(ioc->pcidev, sz,
2546 ioc->cached_fw, ioc->cached_fw_dma); 2545 ioc->cached_fw, ioc->cached_fw_dma);
@@ -2584,9 +2583,9 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
2584 2583
2585 mpt_alloc_fw_memory(ioc, sz); 2584 mpt_alloc_fw_memory(ioc, sz);
2586 2585
2587 dinitprintk((KERN_WARNING MYNAM ": FW Image @ %p[%p], sz=%d[%x] bytes\n", 2586 dinitprintk((KERN_INFO MYNAM ": FW Image @ %p[%p], sz=%d[%x] bytes\n",
2588 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); 2587 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
2589 2588
2590 if (ioc->cached_fw == NULL) { 2589 if (ioc->cached_fw == NULL) {
2591 /* Major Failure. 2590 /* Major Failure.
2592 */ 2591 */
@@ -2616,14 +2615,14 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
2616 mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); 2615 mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma);
2617 2616
2618 sgeoffset += sizeof(u32) + sizeof(dma_addr_t); 2617 sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
2619 dinitprintk((KERN_WARNING MYNAM "Sending FW Upload (req @ %p) sgeoffset=%d \n", 2618 dinitprintk((KERN_INFO MYNAM ": Sending FW Upload (req @ %p) sgeoffset=%d \n",
2620 prequest, sgeoffset)); 2619 prequest, sgeoffset));
2621 DBG_DUMP_FW_REQUEST_FRAME(prequest) 2620 DBG_DUMP_FW_REQUEST_FRAME(prequest)
2622 2621
2623 ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, 2622 ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest,
2624 reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); 2623 reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag);
2625 2624
2626 dinitprintk((KERN_WARNING MYNAM "FW Upload completed rc=%x \n", ii)); 2625 dinitprintk((KERN_INFO MYNAM ": FW Upload completed rc=%x \n", ii));
2627 2626
2628 cmdStatus = -EFAULT; 2627 cmdStatus = -EFAULT;
2629 if (ii == 0) { 2628 if (ii == 0) {
@@ -2638,10 +2637,10 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
2638 cmdStatus = 0; 2637 cmdStatus = 0;
2639 } 2638 }
2640 } 2639 }
2641 dinitprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n", 2640 dinitprintk((MYIOC_s_INFO_FMT ": do_upload cmdStatus=%d \n",
2642 ioc->name, cmdStatus)); 2641 ioc->name, cmdStatus));
2643 2642
2644 2643
2645 if (cmdStatus) { 2644 if (cmdStatus) {
2646 2645
2647 ddlprintk((MYIOC_s_INFO_FMT ": fw upload failed, freeing image \n", 2646 ddlprintk((MYIOC_s_INFO_FMT ": fw upload failed, freeing image \n",
@@ -2772,8 +2771,8 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2772 fwSize = (pExtImage->ImageSize + 3) >> 2; 2771 fwSize = (pExtImage->ImageSize + 3) >> 2;
2773 ptrFw = (u32 *)pExtImage; 2772 ptrFw = (u32 *)pExtImage;
2774 2773
2775 ddlprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x bytes @ %p load_addr=%x\n", 2774 ddlprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x (%d) bytes @ %p load_addr=%x\n",
2776 ioc->name, fwSize*4, ptrFw, load_addr)); 2775 ioc->name, fwSize*4, fwSize*4, ptrFw, load_addr));
2777 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr); 2776 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr);
2778 2777
2779 while (fwSize--) { 2778 while (fwSize--) {
@@ -2856,9 +2855,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2856 * 0 else 2855 * 0 else
2857 * 2856 *
2858 * Returns: 2857 * Returns:
2859 * 1 - hard reset, READY 2858 * 1 - hard reset, READY
2860 * 0 - no reset due to History bit, READY 2859 * 0 - no reset due to History bit, READY
2861 * -1 - no reset due to History bit but not READY 2860 * -1 - no reset due to History bit but not READY
2862 * OR reset but failed to come READY 2861 * OR reset but failed to come READY
2863 * -2 - no reset, could not enter DIAG mode 2862 * -2 - no reset, could not enter DIAG mode
2864 * -3 - reset but bad FW bit 2863 * -3 - reset but bad FW bit
@@ -3001,7 +3000,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3001 * 3000 *
3002 */ 3001 */
3003 CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM); 3002 CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM);
3004 mdelay (1); 3003 mdelay(1);
3005 3004
3006 /* 3005 /*
3007 * Now hit the reset bit in the Diagnostic register 3006 * Now hit the reset bit in the Diagnostic register
@@ -3181,7 +3180,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
3181 u32 state; 3180 u32 state;
3182 int cntdn, count; 3181 int cntdn, count;
3183 3182
3184 drsprintk((KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n", 3183 drsprintk((KERN_INFO MYNAM ": %s: Sending IOC reset(0x%02x)!\n",
3185 ioc->name, reset_type)); 3184 ioc->name, reset_type));
3186 CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<<MPI_DOORBELL_FUNCTION_SHIFT); 3185 CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<<MPI_DOORBELL_FUNCTION_SHIFT);
3187 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) 3186 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0)
@@ -3385,6 +3384,9 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
3385 ioc->reply_frames = (MPT_FRAME_HDR *) mem; 3384 ioc->reply_frames = (MPT_FRAME_HDR *) mem;
3386 ioc->reply_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); 3385 ioc->reply_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF);
3387 3386
3387 dinitprintk((KERN_INFO MYNAM ": %s ReplyBuffers @ %p[%p]\n",
3388 ioc->name, ioc->reply_frames, (void *)(ulong)alloc_dma));
3389
3388 alloc_dma += reply_sz; 3390 alloc_dma += reply_sz;
3389 mem += reply_sz; 3391 mem += reply_sz;
3390 3392
@@ -3393,7 +3395,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
3393 ioc->req_frames = (MPT_FRAME_HDR *) mem; 3395 ioc->req_frames = (MPT_FRAME_HDR *) mem;
3394 ioc->req_frames_dma = alloc_dma; 3396 ioc->req_frames_dma = alloc_dma;
3395 3397
3396 dinitprintk((KERN_INFO MYNAM ": %s.RequestBuffers @ %p[%p]\n", 3398 dinitprintk((KERN_INFO MYNAM ": %s RequestBuffers @ %p[%p]\n",
3397 ioc->name, mem, (void *)(ulong)alloc_dma)); 3399 ioc->name, mem, (void *)(ulong)alloc_dma));
3398 3400
3399 ioc->req_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); 3401 ioc->req_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF);
@@ -3419,7 +3421,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
3419 ioc->ChainBuffer = mem; 3421 ioc->ChainBuffer = mem;
3420 ioc->ChainBufferDMA = alloc_dma; 3422 ioc->ChainBufferDMA = alloc_dma;
3421 3423
3422 dinitprintk((KERN_INFO MYNAM " :%s.ChainBuffers @ %p(%p)\n", 3424 dinitprintk((KERN_INFO MYNAM " :%s ChainBuffers @ %p(%p)\n",
3423 ioc->name, ioc->ChainBuffer, (void *)(ulong)ioc->ChainBufferDMA)); 3425 ioc->name, ioc->ChainBuffer, (void *)(ulong)ioc->ChainBufferDMA));
3424 3426
3425 /* Initialize the free chain Q. 3427 /* Initialize the free chain Q.
@@ -3524,7 +3526,7 @@ out_fail:
3524 */ 3526 */
3525static int 3527static int
3526mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, 3528mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req,
3527 int replyBytes, u16 *u16reply, int maxwait, int sleepFlag) 3529 int replyBytes, u16 *u16reply, int maxwait, int sleepFlag)
3528{ 3530{
3529 MPIDefaultReply_t *mptReply; 3531 MPIDefaultReply_t *mptReply;
3530 int failcnt = 0; 3532 int failcnt = 0;
@@ -3599,7 +3601,7 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req,
3599 */ 3601 */
3600 if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0) 3602 if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0)
3601 failcnt++; 3603 failcnt++;
3602 3604
3603 dhsprintk((MYIOC_s_INFO_FMT "HandShake reply count=%d%s\n", 3605 dhsprintk((MYIOC_s_INFO_FMT "HandShake reply count=%d%s\n",
3604 ioc->name, t, failcnt ? " - MISSING DOORBELL REPLY!" : "")); 3606 ioc->name, t, failcnt ? " - MISSING DOORBELL REPLY!" : ""));
3605 3607
@@ -3758,7 +3760,7 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
3758 } 3760 }
3759 3761
3760 dhsprintk((MYIOC_s_INFO_FMT "WaitCnt=%d First handshake reply word=%08x%s\n", 3762 dhsprintk((MYIOC_s_INFO_FMT "WaitCnt=%d First handshake reply word=%08x%s\n",
3761 ioc->name, t, le32_to_cpu(*(u32 *)hs_reply), 3763 ioc->name, t, le32_to_cpu(*(u32 *)hs_reply),
3762 failcnt ? " - MISSING DOORBELL HANDSHAKE!" : "")); 3764 failcnt ? " - MISSING DOORBELL HANDSHAKE!" : ""));
3763 3765
3764 /* 3766 /*
@@ -4133,6 +4135,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4133 ioc->spi_data.minSyncFactor = MPT_ASYNC; 4135 ioc->spi_data.minSyncFactor = MPT_ASYNC;
4134 ioc->spi_data.busType = MPT_HOST_BUS_UNKNOWN; 4136 ioc->spi_data.busType = MPT_HOST_BUS_UNKNOWN;
4135 rc = 1; 4137 rc = 1;
4138 ddvprintk((MYIOC_s_INFO_FMT "Unable to read PortPage0 minSyncFactor=%x\n",
4139 ioc->name, ioc->spi_data.minSyncFactor));
4136 } else { 4140 } else {
4137 /* Save the Port Page 0 data 4141 /* Save the Port Page 0 data
4138 */ 4142 */
@@ -4142,7 +4146,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4142 4146
4143 if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { 4147 if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) {
4144 ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; 4148 ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS;
4145 dinitprintk((KERN_INFO MYNAM " :%s noQas due to Capabilities=%x\n", 4149 ddvprintk((KERN_INFO MYNAM " :%s noQas due to Capabilities=%x\n",
4146 ioc->name, pPP0->Capabilities)); 4150 ioc->name, pPP0->Capabilities));
4147 } 4151 }
4148 ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; 4152 ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0;
@@ -4151,6 +4155,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4151 ioc->spi_data.maxSyncOffset = (u8) (data >> 16); 4155 ioc->spi_data.maxSyncOffset = (u8) (data >> 16);
4152 data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK; 4156 data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK;
4153 ioc->spi_data.minSyncFactor = (u8) (data >> 8); 4157 ioc->spi_data.minSyncFactor = (u8) (data >> 8);
4158 ddvprintk((MYIOC_s_INFO_FMT "PortPage0 minSyncFactor=%x\n",
4159 ioc->name, ioc->spi_data.minSyncFactor));
4154 } else { 4160 } else {
4155 ioc->spi_data.maxSyncOffset = 0; 4161 ioc->spi_data.maxSyncOffset = 0;
4156 ioc->spi_data.minSyncFactor = MPT_ASYNC; 4162 ioc->spi_data.minSyncFactor = MPT_ASYNC;
@@ -4163,8 +4169,11 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4163 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || 4169 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) ||
4164 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { 4170 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) {
4165 4171
4166 if (ioc->spi_data.minSyncFactor < MPT_ULTRA) 4172 if (ioc->spi_data.minSyncFactor < MPT_ULTRA) {
4167 ioc->spi_data.minSyncFactor = MPT_ULTRA; 4173 ioc->spi_data.minSyncFactor = MPT_ULTRA;
4174 ddvprintk((MYIOC_s_INFO_FMT "HVD or SE detected, minSyncFactor=%x\n",
4175 ioc->name, ioc->spi_data.minSyncFactor));
4176 }
4168 } 4177 }
4169 } 4178 }
4170 if (pbuf) { 4179 if (pbuf) {
@@ -4591,13 +4600,13 @@ SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch)
4591 4600
4592 evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc); 4601 evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc);
4593 if (evnp == NULL) { 4602 if (evnp == NULL) {
4594 dprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n", 4603 devtprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n",
4595 ioc->name)); 4604 ioc->name));
4596 return 0; 4605 return 0;
4597 } 4606 }
4598 memset(evnp, 0, sizeof(*evnp)); 4607 memset(evnp, 0, sizeof(*evnp));
4599 4608
4600 dprintk((MYIOC_s_INFO_FMT "Sending EventNotification(%d)\n", ioc->name, EvSwitch)); 4609 devtprintk((MYIOC_s_INFO_FMT "Sending EventNotification (%d) request %p\n", ioc->name, EvSwitch, evnp));
4601 4610
4602 evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; 4611 evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION;
4603 evnp->ChainOffset = 0; 4612 evnp->ChainOffset = 0;
@@ -4621,8 +4630,10 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp)
4621 EventAck_t *pAck; 4630 EventAck_t *pAck;
4622 4631
4623 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) { 4632 if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
4624 printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK request frame!\n", 4633 printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK "
4625 ioc->name); 4634 "request frame for Event=%x EventContext=%x EventData=%x!\n",
4635 ioc->name, evnp->Event, le32_to_cpu(evnp->EventContext),
4636 le32_to_cpu(evnp->Data[0]));
4626 return -1; 4637 return -1;
4627 } 4638 }
4628 memset(pAck, 0, sizeof(*pAck)); 4639 memset(pAck, 0, sizeof(*pAck));
@@ -5538,6 +5549,8 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
5538 * If needed, send (a single) EventAck. 5549 * If needed, send (a single) EventAck.
5539 */ 5550 */
5540 if (pEventReply->AckRequired == MPI_EVENT_NOTIFICATION_ACK_REQUIRED) { 5551 if (pEventReply->AckRequired == MPI_EVENT_NOTIFICATION_ACK_REQUIRED) {
5552 devtprintk((MYIOC_s_WARN_FMT
5553 "EventAck required\n",ioc->name));
5541 if ((ii = SendEventAck(ioc, pEventReply)) != 0) { 5554 if ((ii = SendEventAck(ioc, pEventReply)) != 0) {
5542 devtprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n", 5555 devtprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n",
5543 ioc->name, ii)); 5556 ioc->name, ii));
@@ -5618,7 +5631,7 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
5618 case 0x00080000: 5631 case 0x00080000:
5619 desc = "Outbound DMA Overrun"; 5632 desc = "Outbound DMA Overrun";
5620 break; 5633 break;
5621 5634
5622 case 0x00090000: 5635 case 0x00090000:
5623 desc = "Task Management"; 5636 desc = "Task Management";
5624 break; 5637 break;
@@ -5634,7 +5647,7 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
5634 case 0x000C0000: 5647 case 0x000C0000:
5635 desc = "Untagged Table Size"; 5648 desc = "Untagged Table Size";
5636 break; 5649 break;
5637 5650
5638 } 5651 }
5639 5652
5640 printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): F/W: %s\n", ioc->name, log_info, desc); 5653 printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): F/W: %s\n", ioc->name, log_info, desc);
@@ -5726,7 +5739,7 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
5726 break; 5739 break;
5727 5740
5728 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ 5741 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
5729 /* This error is checked in scsi_io_done(). Skip. 5742 /* This error is checked in scsi_io_done(). Skip.
5730 desc = "SCSI Data Underrun"; 5743 desc = "SCSI Data Underrun";
5731 */ 5744 */
5732 break; 5745 break;
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index cd4e8c0853d0..4a003dc5fde8 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -281,12 +281,12 @@ mptscsih_getFreeChainBuffer(MPT_ADAPTER *ioc, int *retIndex)
281 offset = (u8 *)chainBuf - (u8 *)ioc->ChainBuffer; 281 offset = (u8 *)chainBuf - (u8 *)ioc->ChainBuffer;
282 chain_idx = offset / ioc->req_sz; 282 chain_idx = offset / ioc->req_sz;
283 rc = SUCCESS; 283 rc = SUCCESS;
284 dsgprintk((MYIOC_s_INFO_FMT "getFreeChainBuffer (index %d), got buf=%p\n", 284 dsgprintk((MYIOC_s_ERR_FMT "getFreeChainBuffer chainBuf=%p ChainBuffer=%p offset=%d chain_idx=%d\n",
285 ioc->name, *retIndex, chainBuf)); 285 ioc->name, chainBuf, ioc->ChainBuffer, offset, chain_idx));
286 } else { 286 } else {
287 rc = FAILED; 287 rc = FAILED;
288 chain_idx = MPT_HOST_NO_CHAIN; 288 chain_idx = MPT_HOST_NO_CHAIN;
289 dfailprintk((MYIOC_s_ERR_FMT "getFreeChainBuffer failed\n", 289 dfailprintk((MYIOC_s_INFO_FMT "getFreeChainBuffer failed\n",
290 ioc->name)); 290 ioc->name));
291 } 291 }
292 spin_unlock_irqrestore(&ioc->FreeQlock, flags); 292 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
@@ -432,7 +432,7 @@ nextSGEset:
432 */ 432 */
433 pReq->ChainOffset = 0; 433 pReq->ChainOffset = 0;
434 RequestNB = (((sgeOffset - 1) >> ioc->NBShiftFactor) + 1) & 0x03; 434 RequestNB = (((sgeOffset - 1) >> ioc->NBShiftFactor) + 1) & 0x03;
435 dsgprintk((MYIOC_s_ERR_FMT 435 dsgprintk((MYIOC_s_INFO_FMT
436 "Single Buffer RequestNB=%x, sgeOffset=%d\n", ioc->name, RequestNB, sgeOffset)); 436 "Single Buffer RequestNB=%x, sgeOffset=%d\n", ioc->name, RequestNB, sgeOffset));
437 ioc->RequestNB[req_idx] = RequestNB; 437 ioc->RequestNB[req_idx] = RequestNB;
438 } 438 }
@@ -491,11 +491,12 @@ nextSGEset:
491 /* NOTE: psge points to the beginning of the chain element 491 /* NOTE: psge points to the beginning of the chain element
492 * in current buffer. Get a chain buffer. 492 * in current buffer. Get a chain buffer.
493 */ 493 */
494 dsgprintk((MYIOC_s_INFO_FMT 494 if ((mptscsih_getFreeChainBuffer(ioc, &newIndex)) == FAILED) {
495 "calling getFreeChainBuffer SCSI cmd=%02x (%p)\n", 495 dfailprintk((MYIOC_s_INFO_FMT
496 ioc->name, pReq->CDB[0], SCpnt)); 496 "getFreeChainBuffer FAILED SCSI cmd=%02x (%p)\n",
497 if ((mptscsih_getFreeChainBuffer(ioc, &newIndex)) == FAILED) 497 ioc->name, pReq->CDB[0], SCpnt));
498 return FAILED; 498 return FAILED;
499 }
499 500
500 /* Update the tracking arrays. 501 /* Update the tracking arrays.
501 * If chainSge == NULL, update ReqToChain, else ChainToChain 502 * If chainSge == NULL, update ReqToChain, else ChainToChain
@@ -577,14 +578,20 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
577 return 1; 578 return 1;
578 } 579 }
579 580
580 dmfprintk((MYIOC_s_INFO_FMT
581 "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d)\n",
582 ioc->name, mf, mr, sc, req_idx));
583
584 sc->result = DID_OK << 16; /* Set default reply as OK */ 581 sc->result = DID_OK << 16; /* Set default reply as OK */
585 pScsiReq = (SCSIIORequest_t *) mf; 582 pScsiReq = (SCSIIORequest_t *) mf;
586 pScsiReply = (SCSIIOReply_t *) mr; 583 pScsiReply = (SCSIIOReply_t *) mr;
587 584
585 if((ioc->facts.MsgVersion >= MPI_VERSION_01_05) && pScsiReply){
586 dmfprintk((MYIOC_s_INFO_FMT
587 "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d,task-tag=%d)\n",
588 ioc->name, mf, mr, sc, req_idx, pScsiReply->TaskTag));
589 }else{
590 dmfprintk((MYIOC_s_INFO_FMT
591 "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d)\n",
592 ioc->name, mf, mr, sc, req_idx));
593 }
594
588 if (pScsiReply == NULL) { 595 if (pScsiReply == NULL) {
589 /* special context reply handling */ 596 /* special context reply handling */
590 ; 597 ;
@@ -658,8 +665,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
658 /* Sufficient data transfer occurred */ 665 /* Sufficient data transfer occurred */
659 sc->result = (DID_OK << 16) | scsi_status; 666 sc->result = (DID_OK << 16) | scsi_status;
660 } else if ( xfer_cnt == 0 ) { 667 } else if ( xfer_cnt == 0 ) {
661 /* A CRC Error causes this condition; retry */ 668 /* A CRC Error causes this condition; retry */
662 sc->result = (DRIVER_SENSE << 24) | (DID_OK << 16) | 669 sc->result = (DRIVER_SENSE << 24) | (DID_OK << 16) |
663 (CHECK_CONDITION << 1); 670 (CHECK_CONDITION << 1);
664 sc->sense_buffer[0] = 0x70; 671 sc->sense_buffer[0] = 0x70;
665 sc->sense_buffer[2] = NO_SENSE; 672 sc->sense_buffer[2] = NO_SENSE;
@@ -668,7 +675,9 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
668 } else { 675 } else {
669 sc->result = DID_SOFT_ERROR << 16; 676 sc->result = DID_SOFT_ERROR << 16;
670 } 677 }
671 dreplyprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target)); 678 dreplyprintk((KERN_NOTICE
679 "RESIDUAL_MISMATCH: result=%x on id=%d\n",
680 sc->result, sc->device->id));
672 break; 681 break;
673 682
674 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ 683 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
@@ -796,7 +805,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
796 return 1; 805 return 1;
797} 806}
798 807
799
800/* 808/*
801 * mptscsih_flush_running_cmds - For each command found, search 809 * mptscsih_flush_running_cmds - For each command found, search
802 * Scsi_Host instance taskQ and reply to OS. 810 * Scsi_Host instance taskQ and reply to OS.
@@ -1017,7 +1025,7 @@ mptscsih_remove(struct pci_dev *pdev)
1017 scsi_host_put(host); 1025 scsi_host_put(host);
1018 1026
1019 mpt_detach(pdev); 1027 mpt_detach(pdev);
1020 1028
1021} 1029}
1022 1030
1023/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1031/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1072,7 +1080,7 @@ mptscsih_resume(struct pci_dev *pdev)
1072 MPT_SCSI_HOST *hd; 1080 MPT_SCSI_HOST *hd;
1073 1081
1074 mpt_resume(pdev); 1082 mpt_resume(pdev);
1075 1083
1076 if(!host) 1084 if(!host)
1077 return 0; 1085 return 0;
1078 1086
@@ -1214,8 +1222,8 @@ mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t off
1214 int size = 0; 1222 int size = 0;
1215 1223
1216 if (func) { 1224 if (func) {
1217 /* 1225 /*
1218 * write is not supported 1226 * write is not supported
1219 */ 1227 */
1220 } else { 1228 } else {
1221 if (start) 1229 if (start)
@@ -1535,17 +1543,17 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, in
1535 */ 1543 */
1536 if (mptscsih_tm_pending_wait(hd) == FAILED) { 1544 if (mptscsih_tm_pending_wait(hd) == FAILED) {
1537 if (type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { 1545 if (type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
1538 dtmprintk((KERN_WARNING MYNAM ": %s: TMHandler abort: " 1546 dtmprintk((KERN_INFO MYNAM ": %s: TMHandler abort: "
1539 "Timed out waiting for last TM (%d) to complete! \n", 1547 "Timed out waiting for last TM (%d) to complete! \n",
1540 hd->ioc->name, hd->tmPending)); 1548 hd->ioc->name, hd->tmPending));
1541 return FAILED; 1549 return FAILED;
1542 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { 1550 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) {
1543 dtmprintk((KERN_WARNING MYNAM ": %s: TMHandler target reset: " 1551 dtmprintk((KERN_INFO MYNAM ": %s: TMHandler target reset: "
1544 "Timed out waiting for last TM (%d) to complete! \n", 1552 "Timed out waiting for last TM (%d) to complete! \n",
1545 hd->ioc->name, hd->tmPending)); 1553 hd->ioc->name, hd->tmPending));
1546 return FAILED; 1554 return FAILED;
1547 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) { 1555 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) {
1548 dtmprintk((KERN_WARNING MYNAM ": %s: TMHandler bus reset: " 1556 dtmprintk((KERN_INFO MYNAM ": %s: TMHandler bus reset: "
1549 "Timed out waiting for last TM (%d) to complete! \n", 1557 "Timed out waiting for last TM (%d) to complete! \n",
1550 hd->ioc->name, hd->tmPending)); 1558 hd->ioc->name, hd->tmPending));
1551 if (hd->tmPending & (1 << MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS)) 1559 if (hd->tmPending & (1 << MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS))
@@ -1631,8 +1639,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
1631 if ((mf = mpt_get_msg_frame(hd->ioc->TaskCtx, hd->ioc)) == NULL) { 1639 if ((mf = mpt_get_msg_frame(hd->ioc->TaskCtx, hd->ioc)) == NULL) {
1632 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n", 1640 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n",
1633 hd->ioc->name)); 1641 hd->ioc->name));
1634 //return FAILED; 1642 return FAILED;
1635 return -999;
1636 } 1643 }
1637 dtmprintk((MYIOC_s_INFO_FMT "IssueTaskMgmt request @ %p\n", 1644 dtmprintk((MYIOC_s_INFO_FMT "IssueTaskMgmt request @ %p\n",
1638 hd->ioc->name, mf)); 1645 hd->ioc->name, mf));
@@ -1661,9 +1668,8 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
1661 1668
1662 pScsiTm->TaskMsgContext = ctx2abort; 1669 pScsiTm->TaskMsgContext = ctx2abort;
1663 1670
1664 dtmprintk((MYIOC_s_INFO_FMT 1671 dtmprintk((MYIOC_s_INFO_FMT "IssueTaskMgmt: ctx2abort (0x%08x) type=%d\n",
1665 "IssueTaskMgmt: ctx2abort (0x%08x) type=%d\n", 1672 hd->ioc->name, ctx2abort, type));
1666 hd->ioc->name, ctx2abort, type));
1667 1673
1668 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm); 1674 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm);
1669 1675
@@ -1902,13 +1908,13 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
1902 1908
1903 /* If we can't locate the host to reset, then we failed. */ 1909 /* If we can't locate the host to reset, then we failed. */
1904 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 1910 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
1905 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: " 1911 dtmprintk( ( KERN_INFO MYNAM ": mptscsih_host_reset: "
1906 "Can't locate host! (sc=%p)\n", 1912 "Can't locate host! (sc=%p)\n",
1907 SCpnt ) ); 1913 SCpnt ) );
1908 return FAILED; 1914 return FAILED;
1909 } 1915 }
1910 1916
1911 printk(KERN_WARNING MYNAM ": %s: >> Attempting host reset! (sc=%p)\n", 1917 printk(KERN_WARNING MYNAM ": %s: Attempting host reset! (sc=%p)\n",
1912 hd->ioc->name, SCpnt); 1918 hd->ioc->name, SCpnt);
1913 1919
1914 /* If our attempts to reset the host failed, then return a failed 1920 /* If our attempts to reset the host failed, then return a failed
@@ -1924,7 +1930,7 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
1924 hd->tmState = TM_STATE_NONE; 1930 hd->tmState = TM_STATE_NONE;
1925 } 1931 }
1926 1932
1927 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: " 1933 dtmprintk( ( KERN_INFO MYNAM ": mptscsih_host_reset: "
1928 "Status = %s\n", 1934 "Status = %s\n",
1929 (status == SUCCESS) ? "SUCCESS" : "FAILED" ) ); 1935 (status == SUCCESS) ? "SUCCESS" : "FAILED" ) );
1930 1936
@@ -1951,8 +1957,8 @@ mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd)
1951 if (hd->tmState == TM_STATE_NONE) { 1957 if (hd->tmState == TM_STATE_NONE) {
1952 hd->tmState = TM_STATE_IN_PROGRESS; 1958 hd->tmState = TM_STATE_IN_PROGRESS;
1953 hd->tmPending = 1; 1959 hd->tmPending = 1;
1954 status = SUCCESS;
1955 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); 1960 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
1961 status = SUCCESS;
1956 break; 1962 break;
1957 } 1963 }
1958 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); 1964 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
@@ -1980,7 +1986,7 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout )
1980 spin_lock_irqsave(&hd->ioc->FreeQlock, flags); 1986 spin_lock_irqsave(&hd->ioc->FreeQlock, flags);
1981 if(hd->tmPending == 0) { 1987 if(hd->tmPending == 0) {
1982 status = SUCCESS; 1988 status = SUCCESS;
1983 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); 1989 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
1984 break; 1990 break;
1985 } 1991 }
1986 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); 1992 spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
@@ -2318,10 +2324,10 @@ mptscsih_slave_configure(struct scsi_device *device)
2318 if (pTarget == NULL) { 2324 if (pTarget == NULL) {
2319 /* Driver doesn't know about this device. 2325 /* Driver doesn't know about this device.
2320 * Kernel may generate a "Dummy Lun 0" which 2326 * Kernel may generate a "Dummy Lun 0" which
2321 * may become a real Lun if a 2327 * may become a real Lun if a
2322 * "scsi add-single-device" command is executed 2328 * "scsi add-single-device" command is executed
2323 * while the driver is active (hot-plug a 2329 * while the driver is active (hot-plug a
2324 * device). LSI Raid controllers need 2330 * device). LSI Raid controllers need
2325 * queue_depth set to DEV_HIGH for this reason. 2331 * queue_depth set to DEV_HIGH for this reason.
2326 */ 2332 */
2327 scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG, 2333 scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG,
@@ -2691,7 +2697,7 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
2691 * If the peripheral qualifier filter is enabled then if the target reports a 0x1 2697 * If the peripheral qualifier filter is enabled then if the target reports a 0x1
2692 * (i.e. The targer is capable of supporting the specified peripheral device type 2698 * (i.e. The targer is capable of supporting the specified peripheral device type
2693 * on this logical unit; however, the physical device is not currently connected 2699 * on this logical unit; however, the physical device is not currently connected
2694 * to this logical unit) it will be converted to a 0x3 (i.e. The target is not 2700 * to this logical unit) it will be converted to a 0x3 (i.e. The target is not
2695 * capable of supporting a physical device on this logical unit). This is to work 2701 * capable of supporting a physical device on this logical unit). This is to work
2696 * around a bug in th emid-layer in some distributions in which the mid-layer will 2702 * around a bug in th emid-layer in some distributions in which the mid-layer will
2697 * continue to try to communicate to the LUN and evntually create a dummy LUN. 2703 * continue to try to communicate to the LUN and evntually create a dummy LUN.
@@ -3194,8 +3200,8 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3194 /* Get a MF for this command. 3200 /* Get a MF for this command.
3195 */ 3201 */
3196 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) { 3202 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3197 dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n", 3203 dfailprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n",
3198 ioc->name)); 3204 ioc->name));
3199 return -EAGAIN; 3205 return -EAGAIN;
3200 } 3206 }
3201 3207
@@ -3289,7 +3295,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3289 /* Get a MF for this command. 3295 /* Get a MF for this command.
3290 */ 3296 */
3291 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) { 3297 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3292 dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n", 3298 dfailprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n",
3293 ioc->name)); 3299 ioc->name));
3294 return -EAGAIN; 3300 return -EAGAIN;
3295 } 3301 }
@@ -4596,8 +4602,8 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id)
4596 if ((pbuf1[56] & 0x02) == 0) { 4602 if ((pbuf1[56] & 0x02) == 0) {
4597 pTarget->negoFlags |= MPT_TARGET_NO_NEGO_QAS; 4603 pTarget->negoFlags |= MPT_TARGET_NO_NEGO_QAS;
4598 hd->ioc->spi_data.noQas = MPT_TARGET_NO_NEGO_QAS; 4604 hd->ioc->spi_data.noQas = MPT_TARGET_NO_NEGO_QAS;
4599 ddvprintk((MYIOC_s_NOTE_FMT 4605 ddvprintk((MYIOC_s_NOTE_FMT
4600 "DV: Start Basic noQas on id=%d due to pbuf1[56]=%x\n", 4606 "DV: Start Basic noQas on id=%d due to pbuf1[56]=%x\n",
4601 ioc->name, id, pbuf1[56])); 4607 ioc->name, id, pbuf1[56]));
4602 } 4608 }
4603 } 4609 }
@@ -4673,7 +4679,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id)
4673 if (!firstPass) 4679 if (!firstPass)
4674 doFallback = 1; 4680 doFallback = 1;
4675 } else { 4681 } else {
4676 ddvprintk((MYIOC_s_NOTE_FMT 4682 ddvprintk((MYIOC_s_NOTE_FMT
4677 "DV:Inquiry compared id=%d, calling initTarget\n", ioc->name, id)); 4683 "DV:Inquiry compared id=%d, calling initTarget\n", ioc->name, id));
4678 hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_NOT_DONE; 4684 hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_NOT_DONE;
4679 mptscsih_initTarget(hd, 4685 mptscsih_initTarget(hd,
@@ -4689,8 +4695,8 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id)
4689 4695
4690 } else if (rc == MPT_SCANDV_ISSUE_SENSE) 4696 } else if (rc == MPT_SCANDV_ISSUE_SENSE)
4691 doFallback = 1; /* set fallback flag */ 4697 doFallback = 1; /* set fallback flag */
4692 else if ((rc == MPT_SCANDV_DID_RESET) || 4698 else if ((rc == MPT_SCANDV_DID_RESET) ||
4693 (rc == MPT_SCANDV_SENSE) || 4699 (rc == MPT_SCANDV_SENSE) ||
4694 (rc == MPT_SCANDV_FALLBACK)) 4700 (rc == MPT_SCANDV_FALLBACK))
4695 doFallback = 1; /* set fallback flag */ 4701 doFallback = 1; /* set fallback flag */
4696 else 4702 else
@@ -5126,7 +5132,7 @@ target_done:
5126 */ 5132 */
5127 if ((inq0 == 0) && (dv.now.factor > MPT_ULTRA320)) { 5133 if ((inq0 == 0) && (dv.now.factor > MPT_ULTRA320)) {
5128 hd->ioc->spi_data.noQas = MPT_TARGET_NO_NEGO_QAS; 5134 hd->ioc->spi_data.noQas = MPT_TARGET_NO_NEGO_QAS;
5129 ddvprintk((MYIOC_s_NOTE_FMT 5135 ddvprintk((MYIOC_s_NOTE_FMT
5130 "noQas set due to id=%d has factor=%x\n", ioc->name, id, dv.now.factor)); 5136 "noQas set due to id=%d has factor=%x\n", ioc->name, id, dv.now.factor));
5131 } 5137 }
5132 5138
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index dfa8806b1e13..587d1274fd74 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -162,15 +162,15 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
162 u8 *mem; 162 u8 *mem;
163 int error=0; 163 int error=0;
164 int r; 164 int r;
165 165
166 if ((r = mpt_attach(pdev,id)) != 0) 166 if ((r = mpt_attach(pdev,id)) != 0)
167 return r; 167 return r;
168 168
169 ioc = pci_get_drvdata(pdev); 169 ioc = pci_get_drvdata(pdev);
170 ioc->DoneCtx = mptspiDoneCtx; 170 ioc->DoneCtx = mptspiDoneCtx;
171 ioc->TaskCtx = mptspiTaskCtx; 171 ioc->TaskCtx = mptspiTaskCtx;
172 ioc->InternalCtx = mptspiInternalCtx; 172 ioc->InternalCtx = mptspiInternalCtx;
173 173
174 /* Added sanity check on readiness of the MPT adapter. 174 /* Added sanity check on readiness of the MPT adapter.
175 */ 175 */
176 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) { 176 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {