diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 321 |
1 files changed, 184 insertions, 137 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index ffbe6f4720e1..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 | */ |
405 | static int | 404 | static 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); |
@@ -491,10 +485,21 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) | |||
491 | 485 | ||
492 | pCfg->status = status; | 486 | pCfg->status = status; |
493 | if (status == MPI_IOCSTATUS_SUCCESS) { | 487 | if (status == MPI_IOCSTATUS_SUCCESS) { |
494 | pCfg->hdr->PageVersion = pReply->Header.PageVersion; | 488 | if ((pReply->Header.PageType & |
495 | pCfg->hdr->PageLength = pReply->Header.PageLength; | 489 | MPI_CONFIG_PAGETYPE_MASK) == |
496 | pCfg->hdr->PageNumber = pReply->Header.PageNumber; | 490 | MPI_CONFIG_PAGETYPE_EXTENDED) { |
497 | pCfg->hdr->PageType = pReply->Header.PageType; | 491 | pCfg->cfghdr.ehdr->ExtPageLength = |
492 | le16_to_cpu(pReply->ExtPageLength); | ||
493 | pCfg->cfghdr.ehdr->ExtPageType = | ||
494 | pReply->ExtPageType; | ||
495 | } | ||
496 | pCfg->cfghdr.hdr->PageVersion = pReply->Header.PageVersion; | ||
497 | |||
498 | /* If this is a regular header, save PageLength. */ | ||
499 | /* LMP Do this better so not using a reserved field! */ | ||
500 | pCfg->cfghdr.hdr->PageLength = pReply->Header.PageLength; | ||
501 | pCfg->cfghdr.hdr->PageNumber = pReply->Header.PageNumber; | ||
502 | pCfg->cfghdr.hdr->PageType = pReply->Header.PageType; | ||
498 | } | 503 | } |
499 | } | 504 | } |
500 | 505 | ||
@@ -705,7 +710,7 @@ mpt_device_driver_deregister(int cb_idx) | |||
705 | if (dd_cbfunc->remove) | 710 | if (dd_cbfunc->remove) |
706 | dd_cbfunc->remove(ioc->pcidev); | 711 | dd_cbfunc->remove(ioc->pcidev); |
707 | } | 712 | } |
708 | 713 | ||
709 | MptDeviceDriverHandlers[cb_idx] = NULL; | 714 | MptDeviceDriverHandlers[cb_idx] = NULL; |
710 | } | 715 | } |
711 | 716 | ||
@@ -818,7 +823,7 @@ mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf) | |||
818 | } | 823 | } |
819 | #endif | 824 | #endif |
820 | 825 | ||
821 | 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]; |
822 | 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])); |
823 | CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); | 828 | CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); |
824 | } | 829 | } |
@@ -920,7 +925,7 @@ mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, | |||
920 | 925 | ||
921 | /* Make sure there are no doorbells */ | 926 | /* Make sure there are no doorbells */ |
922 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 927 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
923 | 928 | ||
924 | CHIPREG_WRITE32(&ioc->chip->Doorbell, | 929 | CHIPREG_WRITE32(&ioc->chip->Doorbell, |
925 | ((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) | | 930 | ((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) | |
926 | ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT))); | 931 | ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT))); |
@@ -935,14 +940,14 @@ mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, | |||
935 | return -5; | 940 | return -5; |
936 | 941 | ||
937 | 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", |
938 | ioc->name, ii)); | 943 | ioc->name, ii)); |
939 | 944 | ||
940 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 945 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
941 | 946 | ||
942 | if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) { | 947 | if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) { |
943 | return -2; | 948 | return -2; |
944 | } | 949 | } |
945 | 950 | ||
946 | /* Send request via doorbell handshake */ | 951 | /* Send request via doorbell handshake */ |
947 | req_as_bytes = (u8 *) req; | 952 | req_as_bytes = (u8 *) req; |
948 | for (ii = 0; ii < reqBytes/4; ii++) { | 953 | for (ii = 0; ii < reqBytes/4; ii++) { |
@@ -988,9 +993,9 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp) | |||
988 | if (ioc->id == iocid) { | 993 | if (ioc->id == iocid) { |
989 | *iocpp =ioc; | 994 | *iocpp =ioc; |
990 | return iocid; | 995 | return iocid; |
991 | } | 996 | } |
992 | } | 997 | } |
993 | 998 | ||
994 | *iocpp = NULL; | 999 | *iocpp = NULL; |
995 | return -1; | 1000 | return -1; |
996 | } | 1001 | } |
@@ -1032,9 +1037,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1032 | 1037 | ||
1033 | if (pci_enable_device(pdev)) | 1038 | if (pci_enable_device(pdev)) |
1034 | return r; | 1039 | return r; |
1035 | 1040 | ||
1036 | dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n")); | 1041 | dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n")); |
1037 | 1042 | ||
1038 | if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { | 1043 | if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { |
1039 | dprintk((KERN_INFO MYNAM | 1044 | dprintk((KERN_INFO MYNAM |
1040 | ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); | 1045 | ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); |
@@ -1059,7 +1064,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1059 | ioc->alloc_total = sizeof(MPT_ADAPTER); | 1064 | ioc->alloc_total = sizeof(MPT_ADAPTER); |
1060 | ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ | 1065 | ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ |
1061 | ioc->reply_sz = MPT_REPLY_FRAME_SIZE; | 1066 | ioc->reply_sz = MPT_REPLY_FRAME_SIZE; |
1062 | 1067 | ||
1063 | ioc->pcidev = pdev; | 1068 | ioc->pcidev = pdev; |
1064 | ioc->diagPending = 0; | 1069 | ioc->diagPending = 0; |
1065 | spin_lock_init(&ioc->diagLock); | 1070 | spin_lock_init(&ioc->diagLock); |
@@ -1088,7 +1093,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1088 | /* Find lookup slot. */ | 1093 | /* Find lookup slot. */ |
1089 | INIT_LIST_HEAD(&ioc->list); | 1094 | INIT_LIST_HEAD(&ioc->list); |
1090 | ioc->id = mpt_ids++; | 1095 | ioc->id = mpt_ids++; |
1091 | 1096 | ||
1092 | mem_phys = msize = 0; | 1097 | mem_phys = msize = 0; |
1093 | port = psize = 0; | 1098 | port = psize = 0; |
1094 | for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { | 1099 | for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { |
@@ -1143,7 +1148,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1143 | ioc->prod_name = "LSIFC909"; | 1148 | ioc->prod_name = "LSIFC909"; |
1144 | ioc->bus_type = FC; | 1149 | ioc->bus_type = FC; |
1145 | } | 1150 | } |
1146 | if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) { | 1151 | else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) { |
1147 | ioc->prod_name = "LSIFC929"; | 1152 | ioc->prod_name = "LSIFC929"; |
1148 | ioc->bus_type = FC; | 1153 | ioc->bus_type = FC; |
1149 | } | 1154 | } |
@@ -1322,7 +1327,7 @@ mpt_detach(struct pci_dev *pdev) | |||
1322 | remove_proc_entry(pname, NULL); | 1327 | remove_proc_entry(pname, NULL); |
1323 | sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); | 1328 | sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name); |
1324 | remove_proc_entry(pname, NULL); | 1329 | remove_proc_entry(pname, NULL); |
1325 | 1330 | ||
1326 | /* call per device driver remove entry point */ | 1331 | /* call per device driver remove entry point */ |
1327 | for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) { | 1332 | for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) { |
1328 | if(MptDeviceDriverHandlers[ii] && | 1333 | if(MptDeviceDriverHandlers[ii] && |
@@ -1330,7 +1335,7 @@ mpt_detach(struct pci_dev *pdev) | |||
1330 | MptDeviceDriverHandlers[ii]->remove(pdev); | 1335 | MptDeviceDriverHandlers[ii]->remove(pdev); |
1331 | } | 1336 | } |
1332 | } | 1337 | } |
1333 | 1338 | ||
1334 | /* Disable interrupts! */ | 1339 | /* Disable interrupts! */ |
1335 | CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); | 1340 | CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); |
1336 | 1341 | ||
@@ -1403,7 +1408,7 @@ mpt_resume(struct pci_dev *pdev) | |||
1403 | u32 device_state = pdev->current_state; | 1408 | u32 device_state = pdev->current_state; |
1404 | int recovery_state; | 1409 | int recovery_state; |
1405 | int ii; | 1410 | int ii; |
1406 | 1411 | ||
1407 | printk(MYIOC_s_INFO_FMT | 1412 | printk(MYIOC_s_INFO_FMT |
1408 | "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", |
1409 | ioc->name, pdev, pci_name(pdev), device_state); | 1414 | ioc->name, pdev, pci_name(pdev), device_state); |
@@ -1534,7 +1539,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1534 | if ((rc = GetIocFacts(ioc, sleepFlag, reason)) == 0) | 1539 | if ((rc = GetIocFacts(ioc, sleepFlag, reason)) == 0) |
1535 | break; | 1540 | break; |
1536 | } | 1541 | } |
1537 | 1542 | ||
1538 | 1543 | ||
1539 | if (ii == 5) { | 1544 | if (ii == 5) { |
1540 | 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)); |
@@ -1542,7 +1547,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1542 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { | 1547 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { |
1543 | MptDisplayIocCapabilities(ioc); | 1548 | MptDisplayIocCapabilities(ioc); |
1544 | } | 1549 | } |
1545 | 1550 | ||
1546 | if (alt_ioc_ready) { | 1551 | if (alt_ioc_ready) { |
1547 | if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { | 1552 | if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { |
1548 | 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)); |
@@ -1613,7 +1618,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1613 | 1618 | ||
1614 | if (reset_alt_ioc_active && ioc->alt_ioc) { | 1619 | if (reset_alt_ioc_active && ioc->alt_ioc) { |
1615 | /* (re)Enable alt-IOC! (reply interrupt) */ | 1620 | /* (re)Enable alt-IOC! (reply interrupt) */ |
1616 | dprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", | 1621 | dinitprintk((KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", |
1617 | ioc->alt_ioc->name)); | 1622 | ioc->alt_ioc->name)); |
1618 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); | 1623 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, ~(MPI_HIM_RIM)); |
1619 | ioc->alt_ioc->active = 1; | 1624 | ioc->alt_ioc->active = 1; |
@@ -1670,7 +1675,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1670 | 1675 | ||
1671 | /* Find IM volumes | 1676 | /* Find IM volumes |
1672 | */ | 1677 | */ |
1673 | if (ioc->facts.MsgVersion >= 0x0102) | 1678 | if (ioc->facts.MsgVersion >= MPI_VERSION_01_02) |
1674 | mpt_findImVolumes(ioc); | 1679 | mpt_findImVolumes(ioc); |
1675 | 1680 | ||
1676 | /* Check, and possibly reset, the coalescing value | 1681 | /* Check, and possibly reset, the coalescing value |
@@ -1700,7 +1705,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1700 | } | 1705 | } |
1701 | 1706 | ||
1702 | if (alt_ioc_ready && MptResetHandlers[ii]) { | 1707 | if (alt_ioc_ready && MptResetHandlers[ii]) { |
1703 | 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", |
1704 | ioc->name, ioc->alt_ioc->name, ii)); | 1709 | ioc->name, ioc->alt_ioc->name, ii)); |
1705 | rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); | 1710 | rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); |
1706 | handlers++; | 1711 | handlers++; |
@@ -1733,8 +1738,8 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) | |||
1733 | 1738 | ||
1734 | dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x," | 1739 | dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x," |
1735 | " searching for devfn match on %x or %x\n", | 1740 | " searching for devfn match on %x or %x\n", |
1736 | ioc->name, pci_name(pdev), pdev->devfn, | 1741 | ioc->name, pci_name(pdev), pdev->bus->number, |
1737 | func-1, func+1)); | 1742 | pdev->devfn, func-1, func+1)); |
1738 | 1743 | ||
1739 | peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); | 1744 | peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); |
1740 | if (!peer) { | 1745 | if (!peer) { |
@@ -1861,36 +1866,39 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) | |||
1861 | static void | 1866 | static void |
1862 | mpt_adapter_dispose(MPT_ADAPTER *ioc) | 1867 | mpt_adapter_dispose(MPT_ADAPTER *ioc) |
1863 | { | 1868 | { |
1864 | if (ioc != NULL) { | 1869 | int sz_first, sz_last; |
1865 | int sz_first, sz_last; | ||
1866 | 1870 | ||
1867 | sz_first = ioc->alloc_total; | 1871 | if (ioc == NULL) |
1872 | return; | ||
1868 | 1873 | ||
1869 | mpt_adapter_disable(ioc); | 1874 | sz_first = ioc->alloc_total; |
1870 | 1875 | ||
1871 | if (ioc->pci_irq != -1) { | 1876 | mpt_adapter_disable(ioc); |
1872 | free_irq(ioc->pci_irq, ioc); | ||
1873 | ioc->pci_irq = -1; | ||
1874 | } | ||
1875 | 1877 | ||
1876 | if (ioc->memmap != NULL) | 1878 | if (ioc->pci_irq != -1) { |
1877 | 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 | } | ||
1878 | 1887 | ||
1879 | #if defined(CONFIG_MTRR) && 0 | 1888 | #if defined(CONFIG_MTRR) && 0 |
1880 | if (ioc->mtrr_reg > 0) { | 1889 | if (ioc->mtrr_reg > 0) { |
1881 | mtrr_del(ioc->mtrr_reg, 0, 0); | 1890 | mtrr_del(ioc->mtrr_reg, 0, 0); |
1882 | 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)); |
1883 | } | 1892 | } |
1884 | #endif | 1893 | #endif |
1885 | 1894 | ||
1886 | /* Zap the adapter lookup ptr! */ | 1895 | /* Zap the adapter lookup ptr! */ |
1887 | list_del(&ioc->list); | 1896 | list_del(&ioc->list); |
1888 | 1897 | ||
1889 | sz_last = ioc->alloc_total; | 1898 | sz_last = ioc->alloc_total; |
1890 | 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", |
1891 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); | 1900 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); |
1892 | kfree(ioc); | 1901 | kfree(ioc); |
1893 | } | ||
1894 | } | 1902 | } |
1895 | 1903 | ||
1896 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1904 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -1977,7 +1985,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
1977 | } | 1985 | } |
1978 | 1986 | ||
1979 | /* Is it already READY? */ | 1987 | /* Is it already READY? */ |
1980 | 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) |
1981 | return 0; | 1989 | return 0; |
1982 | 1990 | ||
1983 | /* | 1991 | /* |
@@ -1995,7 +2003,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
1995 | * Hmmm... Did it get left operational? | 2003 | * Hmmm... Did it get left operational? |
1996 | */ | 2004 | */ |
1997 | if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) { | 2005 | if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) { |
1998 | dinitprintk((MYIOC_s_WARN_FMT "IOC operational unexpected\n", | 2006 | dinitprintk((MYIOC_s_INFO_FMT "IOC operational unexpected\n", |
1999 | ioc->name)); | 2007 | ioc->name)); |
2000 | 2008 | ||
2001 | /* Check WhoInit. | 2009 | /* Check WhoInit. |
@@ -2004,8 +2012,8 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
2004 | * Else, fall through to KickStart case | 2012 | * Else, fall through to KickStart case |
2005 | */ | 2013 | */ |
2006 | 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; |
2007 | dprintk((KERN_WARNING MYNAM | 2015 | dinitprintk((KERN_INFO MYNAM |
2008 | ": whoinit 0x%x\n statefault %d force %d\n", | 2016 | ": whoinit 0x%x statefault %d force %d\n", |
2009 | whoinit, statefault, force)); | 2017 | whoinit, statefault, force)); |
2010 | if (whoinit == MPI_WHOINIT_PCI_PEER) | 2018 | if (whoinit == MPI_WHOINIT_PCI_PEER) |
2011 | return -4; | 2019 | return -4; |
@@ -2140,8 +2148,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2140 | get_facts.Function = MPI_FUNCTION_IOC_FACTS; | 2148 | get_facts.Function = MPI_FUNCTION_IOC_FACTS; |
2141 | /* Assert: All other get_facts fields are zero! */ | 2149 | /* Assert: All other get_facts fields are zero! */ |
2142 | 2150 | ||
2143 | dinitprintk((MYIOC_s_INFO_FMT | 2151 | dinitprintk((MYIOC_s_INFO_FMT |
2144 | "Sending get IocFacts request req_sz=%d reply_sz=%d\n", | 2152 | "Sending get IocFacts request req_sz=%d reply_sz=%d\n", |
2145 | ioc->name, req_sz, reply_sz)); | 2153 | ioc->name, req_sz, reply_sz)); |
2146 | 2154 | ||
2147 | /* 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 |
@@ -2174,7 +2182,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2174 | facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions); | 2182 | facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions); |
2175 | facts->IOCStatus = le16_to_cpu(facts->IOCStatus); | 2183 | facts->IOCStatus = le16_to_cpu(facts->IOCStatus); |
2176 | facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo); | 2184 | facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo); |
2177 | status = facts->IOCStatus & MPI_IOCSTATUS_MASK; | 2185 | status = le16_to_cpu(facts->IOCStatus) & MPI_IOCSTATUS_MASK; |
2178 | /* CHECKME! IOCStatus, IOCLogInfo */ | 2186 | /* CHECKME! IOCStatus, IOCLogInfo */ |
2179 | 2187 | ||
2180 | facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth); | 2188 | facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth); |
@@ -2221,7 +2229,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2221 | if ( sz & 0x02 ) | 2229 | if ( sz & 0x02 ) |
2222 | sz += 2; | 2230 | sz += 2; |
2223 | facts->FWImageSize = sz; | 2231 | facts->FWImageSize = sz; |
2224 | 2232 | ||
2225 | if (!facts->RequestFrameSize) { | 2233 | if (!facts->RequestFrameSize) { |
2226 | /* Something is wrong! */ | 2234 | /* Something is wrong! */ |
2227 | 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", |
@@ -2240,7 +2248,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2240 | ioc->NBShiftFactor = shiftFactor; | 2248 | ioc->NBShiftFactor = shiftFactor; |
2241 | 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", |
2242 | ioc->name, vv, shiftFactor, r)); | 2250 | ioc->name, vv, shiftFactor, r)); |
2243 | 2251 | ||
2244 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { | 2252 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { |
2245 | /* | 2253 | /* |
2246 | * Set values for this IOC's request & reply frame sizes, | 2254 | * Set values for this IOC's request & reply frame sizes, |
@@ -2261,7 +2269,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2261 | return r; | 2269 | return r; |
2262 | } | 2270 | } |
2263 | } else { | 2271 | } else { |
2264 | printk(MYIOC_s_ERR_FMT | 2272 | printk(MYIOC_s_ERR_FMT |
2265 | "Invalid IOC facts reply, msgLength=%d offsetof=%zd!\n", | 2273 | "Invalid IOC facts reply, msgLength=%d offsetof=%zd!\n", |
2266 | ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t, | 2274 | ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t, |
2267 | RequestFrameSize)/sizeof(u32))); | 2275 | RequestFrameSize)/sizeof(u32))); |
@@ -2413,9 +2421,11 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) | |||
2413 | 2421 | ||
2414 | dhsprintk((MYIOC_s_INFO_FMT "Sending PortEnable (req @ %p)\n", | 2422 | dhsprintk((MYIOC_s_INFO_FMT "Sending PortEnable (req @ %p)\n", |
2415 | ioc->name, &ioc_init)); | 2423 | ioc->name, &ioc_init)); |
2416 | 2424 | ||
2417 | 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); | ||
2418 | return r; | 2427 | return r; |
2428 | } | ||
2419 | 2429 | ||
2420 | /* YIKES! SUPER IMPORTANT!!! | 2430 | /* YIKES! SUPER IMPORTANT!!! |
2421 | * Poll IocState until _OPERATIONAL while IOC is doing | 2431 | * Poll IocState until _OPERATIONAL while IOC is doing |
@@ -2440,7 +2450,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) | |||
2440 | state = mpt_GetIocState(ioc, 1); | 2450 | state = mpt_GetIocState(ioc, 1); |
2441 | count++; | 2451 | count++; |
2442 | } | 2452 | } |
2443 | 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", |
2444 | ioc->name, count)); | 2454 | ioc->name, count)); |
2445 | 2455 | ||
2446 | return r; | 2456 | return r; |
@@ -2529,7 +2539,7 @@ mpt_free_fw_memory(MPT_ADAPTER *ioc) | |||
2529 | int sz; | 2539 | int sz; |
2530 | 2540 | ||
2531 | sz = ioc->facts.FWImageSize; | 2541 | sz = ioc->facts.FWImageSize; |
2532 | 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", |
2533 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); | 2543 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); |
2534 | pci_free_consistent(ioc->pcidev, sz, | 2544 | pci_free_consistent(ioc->pcidev, sz, |
2535 | ioc->cached_fw, ioc->cached_fw_dma); | 2545 | ioc->cached_fw, ioc->cached_fw_dma); |
@@ -2573,9 +2583,9 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) | |||
2573 | 2583 | ||
2574 | mpt_alloc_fw_memory(ioc, sz); | 2584 | mpt_alloc_fw_memory(ioc, sz); |
2575 | 2585 | ||
2576 | 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", |
2577 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); | 2587 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); |
2578 | 2588 | ||
2579 | if (ioc->cached_fw == NULL) { | 2589 | if (ioc->cached_fw == NULL) { |
2580 | /* Major Failure. | 2590 | /* Major Failure. |
2581 | */ | 2591 | */ |
@@ -2605,14 +2615,14 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) | |||
2605 | mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); | 2615 | mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); |
2606 | 2616 | ||
2607 | sgeoffset += sizeof(u32) + sizeof(dma_addr_t); | 2617 | sgeoffset += sizeof(u32) + sizeof(dma_addr_t); |
2608 | 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", |
2609 | prequest, sgeoffset)); | 2619 | prequest, sgeoffset)); |
2610 | DBG_DUMP_FW_REQUEST_FRAME(prequest) | 2620 | DBG_DUMP_FW_REQUEST_FRAME(prequest) |
2611 | 2621 | ||
2612 | ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, | 2622 | ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, |
2613 | reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); | 2623 | reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); |
2614 | 2624 | ||
2615 | dinitprintk((KERN_WARNING MYNAM "FW Upload completed rc=%x \n", ii)); | 2625 | dinitprintk((KERN_INFO MYNAM ": FW Upload completed rc=%x \n", ii)); |
2616 | 2626 | ||
2617 | cmdStatus = -EFAULT; | 2627 | cmdStatus = -EFAULT; |
2618 | if (ii == 0) { | 2628 | if (ii == 0) { |
@@ -2627,10 +2637,10 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) | |||
2627 | cmdStatus = 0; | 2637 | cmdStatus = 0; |
2628 | } | 2638 | } |
2629 | } | 2639 | } |
2630 | dinitprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n", | 2640 | dinitprintk((MYIOC_s_INFO_FMT ": do_upload cmdStatus=%d \n", |
2631 | ioc->name, cmdStatus)); | 2641 | ioc->name, cmdStatus)); |
2632 | 2642 | ||
2633 | 2643 | ||
2634 | if (cmdStatus) { | 2644 | if (cmdStatus) { |
2635 | 2645 | ||
2636 | ddlprintk((MYIOC_s_INFO_FMT ": fw upload failed, freeing image \n", | 2646 | ddlprintk((MYIOC_s_INFO_FMT ": fw upload failed, freeing image \n", |
@@ -2761,8 +2771,8 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) | |||
2761 | fwSize = (pExtImage->ImageSize + 3) >> 2; | 2771 | fwSize = (pExtImage->ImageSize + 3) >> 2; |
2762 | ptrFw = (u32 *)pExtImage; | 2772 | ptrFw = (u32 *)pExtImage; |
2763 | 2773 | ||
2764 | 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", |
2765 | ioc->name, fwSize*4, ptrFw, load_addr)); | 2775 | ioc->name, fwSize*4, fwSize*4, ptrFw, load_addr)); |
2766 | CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr); | 2776 | CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr); |
2767 | 2777 | ||
2768 | while (fwSize--) { | 2778 | while (fwSize--) { |
@@ -2845,9 +2855,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag) | |||
2845 | * 0 else | 2855 | * 0 else |
2846 | * | 2856 | * |
2847 | * Returns: | 2857 | * Returns: |
2848 | * 1 - hard reset, READY | 2858 | * 1 - hard reset, READY |
2849 | * 0 - no reset due to History bit, READY | 2859 | * 0 - no reset due to History bit, READY |
2850 | * -1 - no reset due to History bit but not READY | 2860 | * -1 - no reset due to History bit but not READY |
2851 | * OR reset but failed to come READY | 2861 | * OR reset but failed to come READY |
2852 | * -2 - no reset, could not enter DIAG mode | 2862 | * -2 - no reset, could not enter DIAG mode |
2853 | * -3 - reset but bad FW bit | 2863 | * -3 - reset but bad FW bit |
@@ -2990,7 +3000,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
2990 | * | 3000 | * |
2991 | */ | 3001 | */ |
2992 | CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM); | 3002 | CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM); |
2993 | mdelay (1); | 3003 | mdelay(1); |
2994 | 3004 | ||
2995 | /* | 3005 | /* |
2996 | * Now hit the reset bit in the Diagnostic register | 3006 | * Now hit the reset bit in the Diagnostic register |
@@ -3170,7 +3180,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) | |||
3170 | u32 state; | 3180 | u32 state; |
3171 | int cntdn, count; | 3181 | int cntdn, count; |
3172 | 3182 | ||
3173 | drsprintk((KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n", | 3183 | drsprintk((KERN_INFO MYNAM ": %s: Sending IOC reset(0x%02x)!\n", |
3174 | ioc->name, reset_type)); | 3184 | ioc->name, reset_type)); |
3175 | CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<<MPI_DOORBELL_FUNCTION_SHIFT); | 3185 | CHIPREG_WRITE32(&ioc->chip->Doorbell, reset_type<<MPI_DOORBELL_FUNCTION_SHIFT); |
3176 | if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) | 3186 | if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) |
@@ -3374,6 +3384,9 @@ PrimeIocFifos(MPT_ADAPTER *ioc) | |||
3374 | ioc->reply_frames = (MPT_FRAME_HDR *) mem; | 3384 | ioc->reply_frames = (MPT_FRAME_HDR *) mem; |
3375 | ioc->reply_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); | 3385 | ioc->reply_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); |
3376 | 3386 | ||
3387 | dinitprintk((KERN_INFO MYNAM ": %s ReplyBuffers @ %p[%p]\n", | ||
3388 | ioc->name, ioc->reply_frames, (void *)(ulong)alloc_dma)); | ||
3389 | |||
3377 | alloc_dma += reply_sz; | 3390 | alloc_dma += reply_sz; |
3378 | mem += reply_sz; | 3391 | mem += reply_sz; |
3379 | 3392 | ||
@@ -3382,7 +3395,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc) | |||
3382 | ioc->req_frames = (MPT_FRAME_HDR *) mem; | 3395 | ioc->req_frames = (MPT_FRAME_HDR *) mem; |
3383 | ioc->req_frames_dma = alloc_dma; | 3396 | ioc->req_frames_dma = alloc_dma; |
3384 | 3397 | ||
3385 | dinitprintk((KERN_INFO MYNAM ": %s.RequestBuffers @ %p[%p]\n", | 3398 | dinitprintk((KERN_INFO MYNAM ": %s RequestBuffers @ %p[%p]\n", |
3386 | ioc->name, mem, (void *)(ulong)alloc_dma)); | 3399 | ioc->name, mem, (void *)(ulong)alloc_dma)); |
3387 | 3400 | ||
3388 | ioc->req_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); | 3401 | ioc->req_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); |
@@ -3408,7 +3421,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc) | |||
3408 | ioc->ChainBuffer = mem; | 3421 | ioc->ChainBuffer = mem; |
3409 | ioc->ChainBufferDMA = alloc_dma; | 3422 | ioc->ChainBufferDMA = alloc_dma; |
3410 | 3423 | ||
3411 | dinitprintk((KERN_INFO MYNAM " :%s.ChainBuffers @ %p(%p)\n", | 3424 | dinitprintk((KERN_INFO MYNAM " :%s ChainBuffers @ %p(%p)\n", |
3412 | ioc->name, ioc->ChainBuffer, (void *)(ulong)ioc->ChainBufferDMA)); | 3425 | ioc->name, ioc->ChainBuffer, (void *)(ulong)ioc->ChainBufferDMA)); |
3413 | 3426 | ||
3414 | /* Initialize the free chain Q. | 3427 | /* Initialize the free chain Q. |
@@ -3513,7 +3526,7 @@ out_fail: | |||
3513 | */ | 3526 | */ |
3514 | static int | 3527 | static int |
3515 | mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, | 3528 | mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, |
3516 | int replyBytes, u16 *u16reply, int maxwait, int sleepFlag) | 3529 | int replyBytes, u16 *u16reply, int maxwait, int sleepFlag) |
3517 | { | 3530 | { |
3518 | MPIDefaultReply_t *mptReply; | 3531 | MPIDefaultReply_t *mptReply; |
3519 | int failcnt = 0; | 3532 | int failcnt = 0; |
@@ -3588,7 +3601,7 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, | |||
3588 | */ | 3601 | */ |
3589 | if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0) | 3602 | if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0) |
3590 | failcnt++; | 3603 | failcnt++; |
3591 | 3604 | ||
3592 | dhsprintk((MYIOC_s_INFO_FMT "HandShake reply count=%d%s\n", | 3605 | dhsprintk((MYIOC_s_INFO_FMT "HandShake reply count=%d%s\n", |
3593 | ioc->name, t, failcnt ? " - MISSING DOORBELL REPLY!" : "")); | 3606 | ioc->name, t, failcnt ? " - MISSING DOORBELL REPLY!" : "")); |
3594 | 3607 | ||
@@ -3747,7 +3760,7 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag) | |||
3747 | } | 3760 | } |
3748 | 3761 | ||
3749 | 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", |
3750 | ioc->name, t, le32_to_cpu(*(u32 *)hs_reply), | 3763 | ioc->name, t, le32_to_cpu(*(u32 *)hs_reply), |
3751 | failcnt ? " - MISSING DOORBELL HANDSHAKE!" : "")); | 3764 | failcnt ? " - MISSING DOORBELL HANDSHAKE!" : "")); |
3752 | 3765 | ||
3753 | /* | 3766 | /* |
@@ -3819,7 +3832,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc) | |||
3819 | hdr.PageLength = 0; | 3832 | hdr.PageLength = 0; |
3820 | hdr.PageNumber = 0; | 3833 | hdr.PageNumber = 0; |
3821 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; | 3834 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; |
3822 | cfg.hdr = &hdr; | 3835 | cfg.cfghdr.hdr = &hdr; |
3823 | cfg.physAddr = -1; | 3836 | cfg.physAddr = -1; |
3824 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3837 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3825 | cfg.dir = 0; | 3838 | cfg.dir = 0; |
@@ -3863,7 +3876,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc) | |||
3863 | hdr.PageLength = 0; | 3876 | hdr.PageLength = 0; |
3864 | hdr.PageNumber = 1; | 3877 | hdr.PageNumber = 1; |
3865 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; | 3878 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; |
3866 | cfg.hdr = &hdr; | 3879 | cfg.cfghdr.hdr = &hdr; |
3867 | cfg.physAddr = -1; | 3880 | cfg.physAddr = -1; |
3868 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3881 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3869 | cfg.dir = 0; | 3882 | cfg.dir = 0; |
@@ -3930,7 +3943,7 @@ GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) | |||
3930 | hdr.PageLength = 0; | 3943 | hdr.PageLength = 0; |
3931 | hdr.PageNumber = 0; | 3944 | hdr.PageNumber = 0; |
3932 | hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; | 3945 | hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; |
3933 | cfg.hdr = &hdr; | 3946 | cfg.cfghdr.hdr = &hdr; |
3934 | cfg.physAddr = -1; | 3947 | cfg.physAddr = -1; |
3935 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3948 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3936 | cfg.dir = 0; | 3949 | cfg.dir = 0; |
@@ -4012,7 +4025,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc) | |||
4012 | hdr.PageLength = 0; | 4025 | hdr.PageLength = 0; |
4013 | hdr.PageNumber = 2; | 4026 | hdr.PageNumber = 2; |
4014 | hdr.PageType = MPI_CONFIG_PAGETYPE_IO_UNIT; | 4027 | hdr.PageType = MPI_CONFIG_PAGETYPE_IO_UNIT; |
4015 | cfg.hdr = &hdr; | 4028 | cfg.cfghdr.hdr = &hdr; |
4016 | cfg.physAddr = -1; | 4029 | cfg.physAddr = -1; |
4017 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4030 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
4018 | cfg.dir = 0; | 4031 | cfg.dir = 0; |
@@ -4102,7 +4115,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4102 | header.PageLength = 0; | 4115 | header.PageLength = 0; |
4103 | header.PageNumber = 0; | 4116 | header.PageNumber = 0; |
4104 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; | 4117 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; |
4105 | cfg.hdr = &header; | 4118 | cfg.cfghdr.hdr = &header; |
4106 | cfg.physAddr = -1; | 4119 | cfg.physAddr = -1; |
4107 | cfg.pageAddr = portnum; | 4120 | cfg.pageAddr = portnum; |
4108 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4121 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4122,6 +4135,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4122 | ioc->spi_data.minSyncFactor = MPT_ASYNC; | 4135 | ioc->spi_data.minSyncFactor = MPT_ASYNC; |
4123 | ioc->spi_data.busType = MPT_HOST_BUS_UNKNOWN; | 4136 | ioc->spi_data.busType = MPT_HOST_BUS_UNKNOWN; |
4124 | 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)); | ||
4125 | } else { | 4140 | } else { |
4126 | /* Save the Port Page 0 data | 4141 | /* Save the Port Page 0 data |
4127 | */ | 4142 | */ |
@@ -4131,7 +4146,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4131 | 4146 | ||
4132 | if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { | 4147 | if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { |
4133 | ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; | 4148 | ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; |
4134 | dinitprintk((KERN_INFO MYNAM " :%s noQas due to Capabilities=%x\n", | 4149 | ddvprintk((KERN_INFO MYNAM " :%s noQas due to Capabilities=%x\n", |
4135 | ioc->name, pPP0->Capabilities)); | 4150 | ioc->name, pPP0->Capabilities)); |
4136 | } | 4151 | } |
4137 | 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; |
@@ -4140,6 +4155,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4140 | ioc->spi_data.maxSyncOffset = (u8) (data >> 16); | 4155 | ioc->spi_data.maxSyncOffset = (u8) (data >> 16); |
4141 | data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK; | 4156 | data = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK; |
4142 | 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)); | ||
4143 | } else { | 4160 | } else { |
4144 | ioc->spi_data.maxSyncOffset = 0; | 4161 | ioc->spi_data.maxSyncOffset = 0; |
4145 | ioc->spi_data.minSyncFactor = MPT_ASYNC; | 4162 | ioc->spi_data.minSyncFactor = MPT_ASYNC; |
@@ -4152,8 +4169,11 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4152 | if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || | 4169 | if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || |
4153 | (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { | 4170 | (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { |
4154 | 4171 | ||
4155 | if (ioc->spi_data.minSyncFactor < MPT_ULTRA) | 4172 | if (ioc->spi_data.minSyncFactor < MPT_ULTRA) { |
4156 | 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 | } | ||
4157 | } | 4177 | } |
4158 | } | 4178 | } |
4159 | if (pbuf) { | 4179 | if (pbuf) { |
@@ -4168,7 +4188,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4168 | header.PageLength = 0; | 4188 | header.PageLength = 0; |
4169 | header.PageNumber = 2; | 4189 | header.PageNumber = 2; |
4170 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; | 4190 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; |
4171 | cfg.hdr = &header; | 4191 | cfg.cfghdr.hdr = &header; |
4172 | cfg.physAddr = -1; | 4192 | cfg.physAddr = -1; |
4173 | cfg.pageAddr = portnum; | 4193 | cfg.pageAddr = portnum; |
4174 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4194 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4236,7 +4256,7 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4236 | header.PageLength = 0; | 4256 | header.PageLength = 0; |
4237 | header.PageNumber = 1; | 4257 | header.PageNumber = 1; |
4238 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; | 4258 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; |
4239 | cfg.hdr = &header; | 4259 | cfg.cfghdr.hdr = &header; |
4240 | cfg.physAddr = -1; | 4260 | cfg.physAddr = -1; |
4241 | cfg.pageAddr = portnum; | 4261 | cfg.pageAddr = portnum; |
4242 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4262 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4245,8 +4265,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4245 | if (mpt_config(ioc, &cfg) != 0) | 4265 | if (mpt_config(ioc, &cfg) != 0) |
4246 | return -EFAULT; | 4266 | return -EFAULT; |
4247 | 4267 | ||
4248 | ioc->spi_data.sdp1version = cfg.hdr->PageVersion; | 4268 | ioc->spi_data.sdp1version = cfg.cfghdr.hdr->PageVersion; |
4249 | ioc->spi_data.sdp1length = cfg.hdr->PageLength; | 4269 | ioc->spi_data.sdp1length = cfg.cfghdr.hdr->PageLength; |
4250 | 4270 | ||
4251 | header.PageVersion = 0; | 4271 | header.PageVersion = 0; |
4252 | header.PageLength = 0; | 4272 | header.PageLength = 0; |
@@ -4255,8 +4275,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4255 | if (mpt_config(ioc, &cfg) != 0) | 4275 | if (mpt_config(ioc, &cfg) != 0) |
4256 | return -EFAULT; | 4276 | return -EFAULT; |
4257 | 4277 | ||
4258 | ioc->spi_data.sdp0version = cfg.hdr->PageVersion; | 4278 | ioc->spi_data.sdp0version = cfg.cfghdr.hdr->PageVersion; |
4259 | ioc->spi_data.sdp0length = cfg.hdr->PageLength; | 4279 | ioc->spi_data.sdp0length = cfg.cfghdr.hdr->PageLength; |
4260 | 4280 | ||
4261 | dcprintk((MYIOC_s_INFO_FMT "Headers: 0: version %d length %d\n", | 4281 | dcprintk((MYIOC_s_INFO_FMT "Headers: 0: version %d length %d\n", |
4262 | ioc->name, ioc->spi_data.sdp0version, ioc->spi_data.sdp0length)); | 4282 | ioc->name, ioc->spi_data.sdp0version, ioc->spi_data.sdp0length)); |
@@ -4298,7 +4318,7 @@ mpt_findImVolumes(MPT_ADAPTER *ioc) | |||
4298 | header.PageLength = 0; | 4318 | header.PageLength = 0; |
4299 | header.PageNumber = 2; | 4319 | header.PageNumber = 2; |
4300 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4320 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4301 | cfg.hdr = &header; | 4321 | cfg.cfghdr.hdr = &header; |
4302 | cfg.physAddr = -1; | 4322 | cfg.physAddr = -1; |
4303 | cfg.pageAddr = 0; | 4323 | cfg.pageAddr = 0; |
4304 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4324 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4394,7 +4414,7 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc) | |||
4394 | header.PageLength = 0; | 4414 | header.PageLength = 0; |
4395 | header.PageNumber = 3; | 4415 | header.PageNumber = 3; |
4396 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4416 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4397 | cfg.hdr = &header; | 4417 | cfg.cfghdr.hdr = &header; |
4398 | cfg.physAddr = -1; | 4418 | cfg.physAddr = -1; |
4399 | cfg.pageAddr = 0; | 4419 | cfg.pageAddr = 0; |
4400 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4420 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4446,7 +4466,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc) | |||
4446 | header.PageLength = 0; | 4466 | header.PageLength = 0; |
4447 | header.PageNumber = 4; | 4467 | header.PageNumber = 4; |
4448 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4468 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4449 | cfg.hdr = &header; | 4469 | cfg.cfghdr.hdr = &header; |
4450 | cfg.physAddr = -1; | 4470 | cfg.physAddr = -1; |
4451 | cfg.pageAddr = 0; | 4471 | cfg.pageAddr = 0; |
4452 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4472 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4498,7 +4518,7 @@ mpt_read_ioc_pg_1(MPT_ADAPTER *ioc) | |||
4498 | header.PageLength = 0; | 4518 | header.PageLength = 0; |
4499 | header.PageNumber = 1; | 4519 | header.PageNumber = 1; |
4500 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4520 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4501 | cfg.hdr = &header; | 4521 | cfg.cfghdr.hdr = &header; |
4502 | cfg.physAddr = -1; | 4522 | cfg.physAddr = -1; |
4503 | cfg.pageAddr = 0; | 4523 | cfg.pageAddr = 0; |
4504 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4524 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4580,13 +4600,13 @@ SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch) | |||
4580 | 4600 | ||
4581 | evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc); | 4601 | evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc); |
4582 | if (evnp == NULL) { | 4602 | if (evnp == NULL) { |
4583 | 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", |
4584 | ioc->name)); | 4604 | ioc->name)); |
4585 | return 0; | 4605 | return 0; |
4586 | } | 4606 | } |
4587 | memset(evnp, 0, sizeof(*evnp)); | 4607 | memset(evnp, 0, sizeof(*evnp)); |
4588 | 4608 | ||
4589 | 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)); |
4590 | 4610 | ||
4591 | evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; | 4611 | evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; |
4592 | evnp->ChainOffset = 0; | 4612 | evnp->ChainOffset = 0; |
@@ -4610,8 +4630,10 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp) | |||
4610 | EventAck_t *pAck; | 4630 | EventAck_t *pAck; |
4611 | 4631 | ||
4612 | 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) { |
4613 | printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK request frame!\n", | 4633 | printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK " |
4614 | 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])); | ||
4615 | return -1; | 4637 | return -1; |
4616 | } | 4638 | } |
4617 | memset(pAck, 0, sizeof(*pAck)); | 4639 | memset(pAck, 0, sizeof(*pAck)); |
@@ -4647,10 +4669,11 @@ int | |||
4647 | mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | 4669 | mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) |
4648 | { | 4670 | { |
4649 | Config_t *pReq; | 4671 | Config_t *pReq; |
4672 | ConfigExtendedPageHeader_t *pExtHdr = NULL; | ||
4650 | MPT_FRAME_HDR *mf; | 4673 | MPT_FRAME_HDR *mf; |
4651 | unsigned long flags; | 4674 | unsigned long flags; |
4652 | int ii, rc; | 4675 | int ii, rc; |
4653 | u32 flagsLength; | 4676 | int flagsLength; |
4654 | int in_isr; | 4677 | int in_isr; |
4655 | 4678 | ||
4656 | /* Prevent calling wait_event() (below), if caller happens | 4679 | /* Prevent calling wait_event() (below), if caller happens |
@@ -4675,16 +4698,30 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | |||
4675 | pReq->Reserved = 0; | 4698 | pReq->Reserved = 0; |
4676 | pReq->ChainOffset = 0; | 4699 | pReq->ChainOffset = 0; |
4677 | pReq->Function = MPI_FUNCTION_CONFIG; | 4700 | pReq->Function = MPI_FUNCTION_CONFIG; |
4701 | |||
4702 | /* Assume page type is not extended and clear "reserved" fields. */ | ||
4678 | pReq->ExtPageLength = 0; | 4703 | pReq->ExtPageLength = 0; |
4679 | pReq->ExtPageType = 0; | 4704 | pReq->ExtPageType = 0; |
4680 | pReq->MsgFlags = 0; | 4705 | pReq->MsgFlags = 0; |
4706 | |||
4681 | for (ii=0; ii < 8; ii++) | 4707 | for (ii=0; ii < 8; ii++) |
4682 | pReq->Reserved2[ii] = 0; | 4708 | pReq->Reserved2[ii] = 0; |
4683 | 4709 | ||
4684 | pReq->Header.PageVersion = pCfg->hdr->PageVersion; | 4710 | pReq->Header.PageVersion = pCfg->cfghdr.hdr->PageVersion; |
4685 | pReq->Header.PageLength = pCfg->hdr->PageLength; | 4711 | pReq->Header.PageLength = pCfg->cfghdr.hdr->PageLength; |
4686 | pReq->Header.PageNumber = pCfg->hdr->PageNumber; | 4712 | pReq->Header.PageNumber = pCfg->cfghdr.hdr->PageNumber; |
4687 | pReq->Header.PageType = (pCfg->hdr->PageType & MPI_CONFIG_PAGETYPE_MASK); | 4713 | pReq->Header.PageType = (pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK); |
4714 | |||
4715 | if ((pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK) == MPI_CONFIG_PAGETYPE_EXTENDED) { | ||
4716 | pExtHdr = (ConfigExtendedPageHeader_t *)pCfg->cfghdr.ehdr; | ||
4717 | pReq->ExtPageLength = cpu_to_le16(pExtHdr->ExtPageLength); | ||
4718 | pReq->ExtPageType = pExtHdr->ExtPageType; | ||
4719 | pReq->Header.PageType = MPI_CONFIG_PAGETYPE_EXTENDED; | ||
4720 | |||
4721 | /* Page Length must be treated as a reserved field for the extended header. */ | ||
4722 | pReq->Header.PageLength = 0; | ||
4723 | } | ||
4724 | |||
4688 | pReq->PageAddress = cpu_to_le32(pCfg->pageAddr); | 4725 | pReq->PageAddress = cpu_to_le32(pCfg->pageAddr); |
4689 | 4726 | ||
4690 | /* Add a SGE to the config request. | 4727 | /* Add a SGE to the config request. |
@@ -4694,12 +4731,20 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | |||
4694 | else | 4731 | else |
4695 | flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; | 4732 | flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; |
4696 | 4733 | ||
4697 | flagsLength |= pCfg->hdr->PageLength * 4; | 4734 | if ((pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK) == MPI_CONFIG_PAGETYPE_EXTENDED) { |
4735 | flagsLength |= pExtHdr->ExtPageLength * 4; | ||
4698 | 4736 | ||
4699 | mpt_add_sge((char *)&pReq->PageBufferSGE, flagsLength, pCfg->physAddr); | 4737 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", |
4738 | ioc->name, pReq->ExtPageType, pReq->Header.PageNumber, pReq->Action)); | ||
4739 | } | ||
4740 | else { | ||
4741 | flagsLength |= pCfg->cfghdr.hdr->PageLength * 4; | ||
4742 | |||
4743 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", | ||
4744 | ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action)); | ||
4745 | } | ||
4700 | 4746 | ||
4701 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", | 4747 | mpt_add_sge((char *)&pReq->PageBufferSGE, flagsLength, pCfg->physAddr); |
4702 | ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action)); | ||
4703 | 4748 | ||
4704 | /* Append pCfg pointer to end of mf | 4749 | /* Append pCfg pointer to end of mf |
4705 | */ | 4750 | */ |
@@ -4789,8 +4834,8 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | |||
4789 | pReq->Reserved3 = 0; | 4834 | pReq->Reserved3 = 0; |
4790 | pReq->NumAddressBytes = 0x01; | 4835 | pReq->NumAddressBytes = 0x01; |
4791 | pReq->Reserved4 = 0; | 4836 | pReq->Reserved4 = 0; |
4792 | pReq->DataLength = 0x04; | 4837 | pReq->DataLength = cpu_to_le16(0x04); |
4793 | pdev = (struct pci_dev *) ioc->pcidev; | 4838 | pdev = ioc->pcidev; |
4794 | if (pdev->devfn & 1) | 4839 | if (pdev->devfn & 1) |
4795 | pReq->DeviceAddr = 0xB2; | 4840 | pReq->DeviceAddr = 0xB2; |
4796 | else | 4841 | else |
@@ -5504,6 +5549,8 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply | |||
5504 | * If needed, send (a single) EventAck. | 5549 | * If needed, send (a single) EventAck. |
5505 | */ | 5550 | */ |
5506 | 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)); | ||
5507 | if ((ii = SendEventAck(ioc, pEventReply)) != 0) { | 5554 | if ((ii = SendEventAck(ioc, pEventReply)) != 0) { |
5508 | devtprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n", | 5555 | devtprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n", |
5509 | ioc->name, ii)); | 5556 | ioc->name, ii)); |
@@ -5584,7 +5631,7 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
5584 | case 0x00080000: | 5631 | case 0x00080000: |
5585 | desc = "Outbound DMA Overrun"; | 5632 | desc = "Outbound DMA Overrun"; |
5586 | break; | 5633 | break; |
5587 | 5634 | ||
5588 | case 0x00090000: | 5635 | case 0x00090000: |
5589 | desc = "Task Management"; | 5636 | desc = "Task Management"; |
5590 | break; | 5637 | break; |
@@ -5600,7 +5647,7 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
5600 | case 0x000C0000: | 5647 | case 0x000C0000: |
5601 | desc = "Untagged Table Size"; | 5648 | desc = "Untagged Table Size"; |
5602 | break; | 5649 | break; |
5603 | 5650 | ||
5604 | } | 5651 | } |
5605 | 5652 | ||
5606 | 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); |
@@ -5692,7 +5739,7 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | |||
5692 | break; | 5739 | break; |
5693 | 5740 | ||
5694 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ | 5741 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ |
5695 | /* This error is checked in scsi_io_done(). Skip. | 5742 | /* This error is checked in scsi_io_done(). Skip. |
5696 | desc = "SCSI Data Underrun"; | 5743 | desc = "SCSI Data Underrun"; |
5697 | */ | 5744 | */ |
5698 | break; | 5745 | break; |