diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 279 |
1 files changed, 138 insertions, 141 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 635defd25925..2c904536b8b6 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -349,7 +349,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) | |||
349 | 349 | ||
350 | dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n", | 350 | dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n", |
351 | ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function)); | 351 | ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function)); |
352 | DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr) | 352 | DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr); |
353 | 353 | ||
354 | /* Check/log IOC log info | 354 | /* Check/log IOC log info |
355 | */ | 355 | */ |
@@ -451,8 +451,9 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) | |||
451 | #ifdef CONFIG_FUSION_LOGGING | 451 | #ifdef CONFIG_FUSION_LOGGING |
452 | if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) && | 452 | if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) && |
453 | !(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) { | 453 | !(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) { |
454 | dmfprintk(ioc, printk(KERN_INFO MYNAM ": Original request frame (@%p) header\n", mf)); | 454 | dmfprintk(ioc, printk(MYIOC_s_INFO_FMT ": Original request frame (@%p) header\n", |
455 | DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf) | 455 | ioc->name, mf)); |
456 | DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf); | ||
456 | } | 457 | } |
457 | #endif | 458 | #endif |
458 | 459 | ||
@@ -517,8 +518,8 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) | |||
517 | u16 status; | 518 | u16 status; |
518 | 519 | ||
519 | status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; | 520 | status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; |
520 | dcprintk(ioc, printk(KERN_NOTICE " IOCStatus=%04xh, IOCLogInfo=%08xh\n", | 521 | dcprintk(ioc, printk(MYIOC_s_NOTE_FMT " IOCStatus=%04xh, IOCLogInfo=%08xh\n", |
521 | status, le32_to_cpu(pReply->IOCLogInfo))); | 522 | ioc->name, status, le32_to_cpu(pReply->IOCLogInfo))); |
522 | 523 | ||
523 | pCfg->status = status; | 524 | pCfg->status = status; |
524 | if (status == MPI_IOCSTATUS_SUCCESS) { | 525 | if (status == MPI_IOCSTATUS_SUCCESS) { |
@@ -783,7 +784,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc) | |||
783 | 784 | ||
784 | #ifdef MFCNT | 785 | #ifdef MFCNT |
785 | if (!ioc->active) | 786 | if (!ioc->active) |
786 | printk(KERN_WARNING "IOC Not Active! mpt_get_msg_frame returning NULL!\n"); | 787 | printk(MYIOC_s_WARN_FMT "IOC Not Active! mpt_get_msg_frame " |
788 | "returning NULL!\n", ioc->name); | ||
787 | #endif | 789 | #endif |
788 | 790 | ||
789 | /* If interrupts are not attached, do not return a request frame */ | 791 | /* If interrupts are not attached, do not return a request frame */ |
@@ -804,7 +806,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc) | |||
804 | req_idx = req_offset / ioc->req_sz; | 806 | req_idx = req_offset / ioc->req_sz; |
805 | mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx); | 807 | mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx); |
806 | mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; | 808 | mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; |
807 | ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */ | 809 | /* Default, will be changed if necessary in SG generation */ |
810 | ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; | ||
808 | #ifdef MFCNT | 811 | #ifdef MFCNT |
809 | ioc->mfcnt++; | 812 | ioc->mfcnt++; |
810 | #endif | 813 | #endif |
@@ -815,14 +818,17 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc) | |||
815 | 818 | ||
816 | #ifdef MFCNT | 819 | #ifdef MFCNT |
817 | if (mf == NULL) | 820 | if (mf == NULL) |
818 | printk(KERN_WARNING "IOC Active. No free Msg Frames! Count 0x%x Max 0x%x\n", ioc->mfcnt, ioc->req_depth); | 821 | printk(MYIOC_s_WARN_FMT "IOC Active. No free Msg Frames! " |
822 | "Count 0x%x Max 0x%x\n", ioc->name, ioc->mfcnt, | ||
823 | ioc->req_depth); | ||
819 | mfcounter++; | 824 | mfcounter++; |
820 | if (mfcounter == PRINT_MF_COUNT) | 825 | if (mfcounter == PRINT_MF_COUNT) |
821 | printk(KERN_INFO "MF Count 0x%x Max 0x%x \n", ioc->mfcnt, ioc->req_depth); | 826 | printk(MYIOC_s_INFO_FMT "MF Count 0x%x Max 0x%x \n", ioc->name, |
827 | ioc->mfcnt, ioc->req_depth); | ||
822 | #endif | 828 | #endif |
823 | 829 | ||
824 | dmfprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_get_msg_frame(%d,%d), got mf=%p\n", | 830 | dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_get_msg_frame(%d,%d), got mf=%p\n", |
825 | ioc->name, cb_idx, ioc->id, mf)); | 831 | ioc->name, cb_idx, ioc->id, mf)); |
826 | return mf; | 832 | return mf; |
827 | } | 833 | } |
828 | 834 | ||
@@ -855,7 +861,9 @@ mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf) | |||
855 | DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf); | 861 | DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf); |
856 | 862 | ||
857 | mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx]; | 863 | mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx]; |
858 | dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, ioc->RequestNB[req_idx])); | 864 | dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d " |
865 | "RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, | ||
866 | ioc->RequestNB[req_idx])); | ||
859 | CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); | 867 | CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); |
860 | } | 868 | } |
861 | 869 | ||
@@ -1002,7 +1010,7 @@ mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req, | |||
1002 | if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE)) | 1010 | if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE)) |
1003 | return -5; | 1011 | return -5; |
1004 | 1012 | ||
1005 | dhsprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n", | 1013 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_send_handshake_request start, WaitCnt=%d\n", |
1006 | ioc->name, ii)); | 1014 | ioc->name, ii)); |
1007 | 1015 | ||
1008 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 1016 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
@@ -1470,24 +1478,27 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1470 | return -ENOMEM; | 1478 | return -ENOMEM; |
1471 | } | 1479 | } |
1472 | ioc->debug_level = mpt_debug_level; | 1480 | ioc->debug_level = mpt_debug_level; |
1481 | ioc->id = mpt_ids++; | ||
1482 | sprintf(ioc->name, "ioc%d", ioc->id); | ||
1473 | 1483 | ||
1474 | dinitprintk(ioc, printk(KERN_WARNING MYNAM ": mpt_adapter_install\n")); | 1484 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": mpt_adapter_install\n", ioc->name)); |
1475 | 1485 | ||
1476 | if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { | 1486 | if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { |
1477 | dprintk(ioc, printk(KERN_INFO MYNAM | 1487 | dprintk(ioc, printk(MYIOC_s_INFO_FMT |
1478 | ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); | 1488 | ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n", ioc->name)); |
1479 | } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { | 1489 | } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { |
1480 | printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n"); | 1490 | printk(MYIOC_s_WARN_FMT ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n", |
1491 | ioc->name); | ||
1481 | kfree(ioc); | 1492 | kfree(ioc); |
1482 | return r; | 1493 | return r; |
1483 | } | 1494 | } |
1484 | 1495 | ||
1485 | if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) { | 1496 | if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) { |
1486 | dprintk(ioc, printk(KERN_INFO MYNAM | 1497 | dprintk(ioc, printk(MYIOC_s_INFO_FMT |
1487 | ": Using 64 bit consistent mask\n")); | 1498 | ": Using 64 bit consistent mask\n", ioc->name)); |
1488 | } else { | 1499 | } else { |
1489 | dprintk(ioc, printk(KERN_INFO MYNAM | 1500 | dprintk(ioc, printk(MYIOC_s_INFO_FMT |
1490 | ": Not using 64 bit consistent mask\n")); | 1501 | ": Not using 64 bit consistent mask\n", ioc->name)); |
1491 | } | 1502 | } |
1492 | 1503 | ||
1493 | ioc->alloc_total = sizeof(MPT_ADAPTER); | 1504 | ioc->alloc_total = sizeof(MPT_ADAPTER); |
@@ -1526,7 +1537,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1526 | 1537 | ||
1527 | /* Find lookup slot. */ | 1538 | /* Find lookup slot. */ |
1528 | INIT_LIST_HEAD(&ioc->list); | 1539 | INIT_LIST_HEAD(&ioc->list); |
1529 | ioc->id = mpt_ids++; | ||
1530 | 1540 | ||
1531 | mem_phys = msize = 0; | 1541 | mem_phys = msize = 0; |
1532 | port = psize = 0; | 1542 | port = psize = 0; |
@@ -1552,15 +1562,15 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1552 | /*mem = ioremap(mem_phys, msize);*/ | 1562 | /*mem = ioremap(mem_phys, msize);*/ |
1553 | mem = ioremap(mem_phys, msize); | 1563 | mem = ioremap(mem_phys, msize); |
1554 | if (mem == NULL) { | 1564 | if (mem == NULL) { |
1555 | printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); | 1565 | printk(MYIOC_s_ERR_FMT "Unable to map adapter memory!\n", ioc->name); |
1556 | kfree(ioc); | 1566 | kfree(ioc); |
1557 | return -EINVAL; | 1567 | return -EINVAL; |
1558 | } | 1568 | } |
1559 | ioc->memmap = mem; | 1569 | ioc->memmap = mem; |
1560 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": mem = %p, mem_phys = %lx\n", mem, mem_phys)); | 1570 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n", ioc->name, mem, mem_phys)); |
1561 | 1571 | ||
1562 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": facts @ %p, pfacts[0] @ %p\n", | 1572 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n", |
1563 | &ioc->facts, &ioc->pfacts[0])); | 1573 | ioc->name, &ioc->facts, &ioc->pfacts[0])); |
1564 | 1574 | ||
1565 | ioc->mem_phys = mem_phys; | 1575 | ioc->mem_phys = mem_phys; |
1566 | ioc->chip = (SYSIF_REGS __iomem *)mem; | 1576 | ioc->chip = (SYSIF_REGS __iomem *)mem; |
@@ -1642,8 +1652,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1642 | if (ioc->errata_flag_1064) | 1652 | if (ioc->errata_flag_1064) |
1643 | pci_disable_io_access(pdev); | 1653 | pci_disable_io_access(pdev); |
1644 | 1654 | ||
1645 | sprintf(ioc->name, "ioc%d", ioc->id); | ||
1646 | |||
1647 | spin_lock_init(&ioc->FreeQlock); | 1655 | spin_lock_init(&ioc->FreeQlock); |
1648 | 1656 | ||
1649 | /* Disable all! */ | 1657 | /* Disable all! */ |
@@ -1660,9 +1668,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1660 | 1668 | ||
1661 | if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP, | 1669 | if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP, |
1662 | CAN_SLEEP)) != 0){ | 1670 | CAN_SLEEP)) != 0){ |
1663 | printk(KERN_WARNING MYNAM | 1671 | printk(MYIOC_s_ERR_FMT "didn't initialize properly! (%d)\n", |
1664 | ": WARNING - %s did not initialize properly! (%d)\n", | 1672 | ioc->name, r); |
1665 | ioc->name, r); | ||
1666 | 1673 | ||
1667 | list_del(&ioc->list); | 1674 | list_del(&ioc->list); |
1668 | if (ioc->alt_ioc) | 1675 | if (ioc->alt_ioc) |
@@ -1888,8 +1895,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1888 | int irq_allocated = 0; | 1895 | int irq_allocated = 0; |
1889 | u8 *a; | 1896 | u8 *a; |
1890 | 1897 | ||
1891 | printk(KERN_INFO MYNAM ": Initiating %s %s\n", | 1898 | printk(MYIOC_s_INFO_FMT "Initiating %s\n", ioc->name, |
1892 | ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery"); | 1899 | reason == MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery"); |
1893 | 1900 | ||
1894 | /* Disable reply interrupts (also blocks FreeQ) */ | 1901 | /* Disable reply interrupts (also blocks FreeQ) */ |
1895 | CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); | 1902 | CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); |
@@ -1910,21 +1917,19 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1910 | 1917 | ||
1911 | if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) { | 1918 | if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) { |
1912 | if (hard_reset_done == -4) { | 1919 | if (hard_reset_done == -4) { |
1913 | printk(KERN_WARNING MYNAM ": %s Owned by PEER..skipping!\n", | 1920 | printk(MYIOC_s_WARN_FMT "Owned by PEER..skipping!\n", |
1914 | ioc->name); | 1921 | ioc->name); |
1915 | 1922 | ||
1916 | if (reset_alt_ioc_active && ioc->alt_ioc) { | 1923 | if (reset_alt_ioc_active && ioc->alt_ioc) { |
1917 | /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ | 1924 | /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ |
1918 | dprintk(ioc, printk(KERN_INFO MYNAM | 1925 | dprintk(ioc, printk(MYIOC_s_INFO_FMT |
1919 | ": alt-%s reply irq re-enabled\n", | 1926 | "alt_ioc reply irq re-enabled\n", ioc->alt_ioc->name)); |
1920 | ioc->alt_ioc->name)); | ||
1921 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); | 1927 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); |
1922 | ioc->alt_ioc->active = 1; | 1928 | ioc->alt_ioc->active = 1; |
1923 | } | 1929 | } |
1924 | 1930 | ||
1925 | } else { | 1931 | } else { |
1926 | printk(KERN_WARNING MYNAM ": %s NOT READY WARNING!\n", | 1932 | printk(MYIOC_s_WARN_FMT "NOT READY!\n", ioc->name); |
1927 | ioc->name); | ||
1928 | } | 1933 | } |
1929 | return -1; | 1934 | return -1; |
1930 | } | 1935 | } |
@@ -1936,9 +1941,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1936 | if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0) | 1941 | if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0) |
1937 | alt_ioc_ready = 1; | 1942 | alt_ioc_ready = 1; |
1938 | else | 1943 | else |
1939 | printk(KERN_WARNING MYNAM | 1944 | printk(MYIOC_s_WARN_FMT "alt_ioc not ready!\n", ioc->alt_ioc->name); |
1940 | ": alt-%s: Not ready WARNING!\n", | ||
1941 | ioc->alt_ioc->name); | ||
1942 | } | 1945 | } |
1943 | 1946 | ||
1944 | for (ii=0; ii<5; ii++) { | 1947 | for (ii=0; ii<5; ii++) { |
@@ -1949,7 +1952,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1949 | 1952 | ||
1950 | 1953 | ||
1951 | if (ii == 5) { | 1954 | if (ii == 5) { |
1952 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Retry IocFacts failed rc=%x\n", ioc->name, rc)); | 1955 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
1956 | "Retry IocFacts failed rc=%x\n", ioc->name, rc)); | ||
1953 | ret = -2; | 1957 | ret = -2; |
1954 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { | 1958 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { |
1955 | MptDisplayIocCapabilities(ioc); | 1959 | MptDisplayIocCapabilities(ioc); |
@@ -1958,14 +1962,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1958 | if (alt_ioc_ready) { | 1962 | if (alt_ioc_ready) { |
1959 | if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { | 1963 | if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { |
1960 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 1964 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
1961 | "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc)); | 1965 | "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc)); |
1962 | /* Retry - alt IOC was initialized once | 1966 | /* Retry - alt IOC was initialized once |
1963 | */ | 1967 | */ |
1964 | rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason); | 1968 | rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason); |
1965 | } | 1969 | } |
1966 | if (rc) { | 1970 | if (rc) { |
1967 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 1971 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
1968 | "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc)); | 1972 | "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc)); |
1969 | alt_ioc_ready = 0; | 1973 | alt_ioc_ready = 0; |
1970 | reset_alt_ioc_active = 0; | 1974 | reset_alt_ioc_active = 0; |
1971 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { | 1975 | } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { |
@@ -1983,13 +1987,12 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1983 | if (ioc->pcidev->irq) { | 1987 | if (ioc->pcidev->irq) { |
1984 | if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) | 1988 | if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) |
1985 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", | 1989 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", |
1986 | ioc->name); | 1990 | ioc->name); |
1987 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, | 1991 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, |
1988 | IRQF_SHARED, ioc->name, ioc); | 1992 | IRQF_SHARED, ioc->name, ioc); |
1989 | if (rc < 0) { | 1993 | if (rc < 0) { |
1990 | printk(MYIOC_s_ERR_FMT "Unable to allocate " | 1994 | printk(MYIOC_s_ERR_FMT "Unable to allocate " |
1991 | "interrupt %d!\n", ioc->name, | 1995 | "interrupt %d!\n", ioc->name, ioc->pcidev->irq); |
1992 | ioc->pcidev->irq); | ||
1993 | if (mpt_msi_enable) | 1996 | if (mpt_msi_enable) |
1994 | pci_disable_msi(ioc->pcidev); | 1997 | pci_disable_msi(ioc->pcidev); |
1995 | return -EBUSY; | 1998 | return -EBUSY; |
@@ -1998,8 +2001,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1998 | ioc->pci_irq = ioc->pcidev->irq; | 2001 | ioc->pci_irq = ioc->pcidev->irq; |
1999 | pci_set_master(ioc->pcidev); /* ?? */ | 2002 | pci_set_master(ioc->pcidev); /* ?? */ |
2000 | pci_set_drvdata(ioc->pcidev, ioc); | 2003 | pci_set_drvdata(ioc->pcidev, ioc); |
2001 | dprintk(ioc, printk(KERN_INFO MYNAM ": %s installed at interrupt " | 2004 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt " |
2002 | "%d\n", ioc->name, ioc->pcidev->irq)); | 2005 | "%d\n", ioc->name, ioc->pcidev->irq)); |
2003 | } | 2006 | } |
2004 | } | 2007 | } |
2005 | 2008 | ||
@@ -2018,8 +2021,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2018 | ret = -4; | 2021 | ret = -4; |
2019 | // NEW! | 2022 | // NEW! |
2020 | if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) { | 2023 | if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) { |
2021 | printk(KERN_WARNING MYNAM ": alt-%s: (%d) FIFO mgmt alloc WARNING!\n", | 2024 | printk(MYIOC_s_WARN_FMT ": alt_ioc (%d) FIFO mgmt alloc!\n", |
2022 | ioc->alt_ioc->name, rc); | 2025 | ioc->alt_ioc->name, rc); |
2023 | alt_ioc_ready = 0; | 2026 | alt_ioc_ready = 0; |
2024 | reset_alt_ioc_active = 0; | 2027 | reset_alt_ioc_active = 0; |
2025 | } | 2028 | } |
@@ -2028,16 +2031,15 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2028 | if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) { | 2031 | if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) { |
2029 | alt_ioc_ready = 0; | 2032 | alt_ioc_ready = 0; |
2030 | reset_alt_ioc_active = 0; | 2033 | reset_alt_ioc_active = 0; |
2031 | printk(KERN_WARNING MYNAM | 2034 | printk(MYIOC_s_WARN_FMT "alt_ioc (%d) init failure!\n", |
2032 | ": alt-%s: (%d) init failure WARNING!\n", | 2035 | ioc->alt_ioc->name, rc); |
2033 | ioc->alt_ioc->name, rc); | ||
2034 | } | 2036 | } |
2035 | } | 2037 | } |
2036 | 2038 | ||
2037 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP){ | 2039 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP){ |
2038 | if (ioc->upload_fw) { | 2040 | if (ioc->upload_fw) { |
2039 | ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2041 | ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2040 | "firmware upload required!\n", ioc->name)); | 2042 | "firmware upload required!\n", ioc->name)); |
2041 | 2043 | ||
2042 | /* Controller is not operational, cannot do upload | 2044 | /* Controller is not operational, cannot do upload |
2043 | */ | 2045 | */ |
@@ -2053,12 +2055,13 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2053 | * mpt_diag_reset) | 2055 | * mpt_diag_reset) |
2054 | */ | 2056 | */ |
2055 | ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2057 | ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2056 | ": mpt_upload: alt_%s has cached_fw=%p \n", | 2058 | "mpt_upload: alt_%s has cached_fw=%p \n", |
2057 | ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); | 2059 | ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); |
2058 | ioc->alt_ioc->cached_fw = NULL; | 2060 | ioc->alt_ioc->cached_fw = NULL; |
2059 | } | 2061 | } |
2060 | } else { | 2062 | } else { |
2061 | printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); | 2063 | printk(MYIOC_s_WARN_FMT |
2064 | "firmware upload failure!\n", ioc->name); | ||
2062 | ret = -5; | 2065 | ret = -5; |
2063 | } | 2066 | } |
2064 | } | 2067 | } |
@@ -2073,8 +2076,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2073 | 2076 | ||
2074 | if (reset_alt_ioc_active && ioc->alt_ioc) { | 2077 | if (reset_alt_ioc_active && ioc->alt_ioc) { |
2075 | /* (re)Enable alt-IOC! (reply interrupt) */ | 2078 | /* (re)Enable alt-IOC! (reply interrupt) */ |
2076 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", | 2079 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "alt_ioc reply irq re-enabled\n", |
2077 | ioc->alt_ioc->name)); | 2080 | ioc->alt_ioc->name)); |
2078 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); | 2081 | CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); |
2079 | ioc->alt_ioc->active = 1; | 2082 | ioc->alt_ioc->active = 1; |
2080 | } | 2083 | } |
@@ -2127,10 +2130,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2127 | (void) GetLanConfigPages(ioc); | 2130 | (void) GetLanConfigPages(ioc); |
2128 | a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; | 2131 | a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; |
2129 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2132 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2130 | "LanAddr = %02X:%02X:%02X:" | 2133 | "LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", |
2131 | "%02X:%02X:%02X\n", | 2134 | ioc->name, a[5], a[4], a[3], a[2], a[1], a[0])); |
2132 | ioc->name, a[5], a[4], | ||
2133 | a[3], a[2], a[1], a[0] )); | ||
2134 | 2135 | ||
2135 | } | 2136 | } |
2136 | } else { | 2137 | } else { |
@@ -2169,16 +2170,16 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2169 | for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { | 2170 | for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { |
2170 | if ((ret == 0) && MptResetHandlers[cb_idx]) { | 2171 | if ((ret == 0) && MptResetHandlers[cb_idx]) { |
2171 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2172 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2172 | "Calling IOC post_reset handler #%d\n", | 2173 | "Calling IOC post_reset handler #%d\n", |
2173 | ioc->name, cb_idx)); | 2174 | ioc->name, cb_idx)); |
2174 | rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET); | 2175 | rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET); |
2175 | handlers++; | 2176 | handlers++; |
2176 | } | 2177 | } |
2177 | 2178 | ||
2178 | if (alt_ioc_ready && MptResetHandlers[cb_idx]) { | 2179 | if (alt_ioc_ready && MptResetHandlers[cb_idx]) { |
2179 | drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2180 | drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2180 | "Calling alt-%s post_reset handler #%d\n", | 2181 | "Calling IOC post_reset handler #%d\n", |
2181 | ioc->name, ioc->alt_ioc->name, cb_idx)); | 2182 | ioc->alt_ioc->name, cb_idx)); |
2182 | rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET); | 2183 | rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET); |
2183 | handlers++; | 2184 | handlers++; |
2184 | } | 2185 | } |
@@ -2218,8 +2219,8 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) | |||
2218 | 2219 | ||
2219 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x," | 2220 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x," |
2220 | " searching for devfn match on %x or %x\n", | 2221 | " searching for devfn match on %x or %x\n", |
2221 | ioc->name, pci_name(pdev), pdev->bus->number, | 2222 | ioc->name, pci_name(pdev), pdev->bus->number, |
2222 | pdev->devfn, func-1, func+1)); | 2223 | pdev->devfn, func-1, func+1)); |
2223 | 2224 | ||
2224 | peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); | 2225 | peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); |
2225 | if (!peer) { | 2226 | if (!peer) { |
@@ -2233,15 +2234,15 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) | |||
2233 | if (_pcidev == peer) { | 2234 | if (_pcidev == peer) { |
2234 | /* Paranoia checks */ | 2235 | /* Paranoia checks */ |
2235 | if (ioc->alt_ioc != NULL) { | 2236 | if (ioc->alt_ioc != NULL) { |
2236 | printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", | 2237 | printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n", |
2237 | ioc->name, ioc->alt_ioc->name); | 2238 | ioc->name, ioc->alt_ioc->name); |
2238 | break; | 2239 | break; |
2239 | } else if (ioc_srch->alt_ioc != NULL) { | 2240 | } else if (ioc_srch->alt_ioc != NULL) { |
2240 | printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", | 2241 | printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n", |
2241 | ioc_srch->name, ioc_srch->alt_ioc->name); | 2242 | ioc_srch->name, ioc_srch->alt_ioc->name); |
2242 | break; | 2243 | break; |
2243 | } | 2244 | } |
2244 | dprintk(ioc, printk(KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n", | 2245 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "FOUND! binding to %s\n", |
2245 | ioc->name, ioc_srch->name)); | 2246 | ioc->name, ioc_srch->name)); |
2246 | ioc_srch->alt_ioc = ioc; | 2247 | ioc_srch->alt_ioc = ioc; |
2247 | ioc->alt_ioc = ioc_srch; | 2248 | ioc->alt_ioc = ioc_srch; |
@@ -2262,10 +2263,11 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) | |||
2262 | int ret; | 2263 | int ret; |
2263 | 2264 | ||
2264 | if (ioc->cached_fw != NULL) { | 2265 | if (ioc->cached_fw != NULL) { |
2265 | ddlprintk(ioc, printk(KERN_INFO MYNAM ": mpt_adapter_disable: Pushing FW onto adapter\n")); | 2266 | ddlprintk(ioc, printk(MYIOC_s_INFO_FMT |
2267 | "mpt_adapter_disable: Pushing FW onto adapter\n", ioc->name)); | ||
2266 | if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) { | 2268 | if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) { |
2267 | printk(KERN_WARNING MYNAM | 2269 | printk(MYIOC_s_WARN_FMT "firmware downloadboot failure (%d)!\n", |
2268 | ": firmware downloadboot failure (%d)!\n", ret); | 2270 | ioc->name, ret); |
2269 | } | 2271 | } |
2270 | } | 2272 | } |
2271 | 2273 | ||
@@ -2277,8 +2279,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) | |||
2277 | 2279 | ||
2278 | if (ioc->alloc != NULL) { | 2280 | if (ioc->alloc != NULL) { |
2279 | sz = ioc->alloc_sz; | 2281 | sz = ioc->alloc_sz; |
2280 | dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s.free @ %p, sz=%d bytes\n", | 2282 | dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n", |
2281 | ioc->name, ioc->alloc, ioc->alloc_sz)); | 2283 | ioc->name, ioc->alloc, ioc->alloc_sz)); |
2282 | pci_free_consistent(ioc->pcidev, sz, | 2284 | pci_free_consistent(ioc->pcidev, sz, |
2283 | ioc->alloc, ioc->alloc_dma); | 2285 | ioc->alloc, ioc->alloc_dma); |
2284 | ioc->reply_frames = NULL; | 2286 | ioc->reply_frames = NULL; |
@@ -2338,15 +2340,14 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) | |||
2338 | if (ioc->HostPageBuffer != NULL) { | 2340 | if (ioc->HostPageBuffer != NULL) { |
2339 | if((ret = mpt_host_page_access_control(ioc, | 2341 | if((ret = mpt_host_page_access_control(ioc, |
2340 | MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) { | 2342 | MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) { |
2341 | printk(KERN_ERR MYNAM | 2343 | printk(MYIOC_s_ERR_FMT |
2342 | ": %s: host page buffers free failed (%d)!\n", | 2344 | "host page buffers free failed (%d)!\n", |
2343 | __FUNCTION__, ret); | 2345 | ioc->name, ret); |
2344 | } | 2346 | } |
2345 | dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s HostPageBuffer free @ %p, sz=%d bytes\n", | 2347 | dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "HostPageBuffer free @ %p, sz=%d bytes\n", |
2346 | ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz)); | 2348 | ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz)); |
2347 | pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz, | 2349 | pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz, |
2348 | ioc->HostPageBuffer, | 2350 | ioc->HostPageBuffer, ioc->HostPageBuffer_dma); |
2349 | ioc->HostPageBuffer_dma); | ||
2350 | ioc->HostPageBuffer = NULL; | 2351 | ioc->HostPageBuffer = NULL; |
2351 | ioc->HostPageBuffer_sz = 0; | 2352 | ioc->HostPageBuffer_sz = 0; |
2352 | ioc->alloc_total -= ioc->HostPageBuffer_sz; | 2353 | ioc->alloc_total -= ioc->HostPageBuffer_sz; |
@@ -2388,7 +2389,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) | |||
2388 | #if defined(CONFIG_MTRR) && 0 | 2389 | #if defined(CONFIG_MTRR) && 0 |
2389 | if (ioc->mtrr_reg > 0) { | 2390 | if (ioc->mtrr_reg > 0) { |
2390 | mtrr_del(ioc->mtrr_reg, 0, 0); | 2391 | mtrr_del(ioc->mtrr_reg, 0, 0); |
2391 | dprintk(ioc, printk(KERN_INFO MYNAM ": %s: MTRR region de-registered\n", ioc->name)); | 2392 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "MTRR region de-registered\n", ioc->name)); |
2392 | } | 2393 | } |
2393 | #endif | 2394 | #endif |
2394 | 2395 | ||
@@ -2396,8 +2397,8 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) | |||
2396 | list_del(&ioc->list); | 2397 | list_del(&ioc->list); |
2397 | 2398 | ||
2398 | sz_last = ioc->alloc_total; | 2399 | sz_last = ioc->alloc_total; |
2399 | dprintk(ioc, printk(KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", | 2400 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "free'd %d of %d bytes\n", |
2400 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); | 2401 | ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); |
2401 | 2402 | ||
2402 | if (ioc->alt_ioc) | 2403 | if (ioc->alt_ioc) |
2403 | ioc->alt_ioc->alt_ioc = NULL; | 2404 | ioc->alt_ioc->alt_ioc = NULL; |
@@ -2476,7 +2477,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
2476 | 2477 | ||
2477 | /* Get current [raw] IOC state */ | 2478 | /* Get current [raw] IOC state */ |
2478 | ioc_state = mpt_GetIocState(ioc, 0); | 2479 | ioc_state = mpt_GetIocState(ioc, 0); |
2479 | dhsprintk(ioc, printk(KERN_INFO MYNAM "::MakeIocReady, %s [raw] state=%08x\n", ioc->name, ioc_state)); | 2480 | dhsprintk(ioc, printk(MYIOC_s_INFO_FMT "MakeIocReady [raw] state=%08x\n", ioc->name, ioc_state)); |
2480 | 2481 | ||
2481 | /* | 2482 | /* |
2482 | * Check to see if IOC got left/stuck in doorbell handshake | 2483 | * Check to see if IOC got left/stuck in doorbell handshake |
@@ -2498,9 +2499,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
2498 | if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { | 2499 | if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { |
2499 | statefault = 2; | 2500 | statefault = 2; |
2500 | printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n", | 2501 | printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n", |
2501 | ioc->name); | 2502 | ioc->name); |
2502 | printk(KERN_WARNING " FAULT code = %04xh\n", | 2503 | printk(MYIOC_s_WARN_FMT " FAULT code = %04xh\n", |
2503 | ioc_state & MPI_DOORBELL_DATA_MASK); | 2504 | ioc->name, ioc_state & MPI_DOORBELL_DATA_MASK); |
2504 | } | 2505 | } |
2505 | 2506 | ||
2506 | /* | 2507 | /* |
@@ -2516,9 +2517,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
2516 | * Else, fall through to KickStart case | 2517 | * Else, fall through to KickStart case |
2517 | */ | 2518 | */ |
2518 | whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT; | 2519 | whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT; |
2519 | dinitprintk(ioc, printk(KERN_INFO MYNAM | 2520 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT |
2520 | ": whoinit 0x%x statefault %d force %d\n", | 2521 | "whoinit 0x%x statefault %d force %d\n", |
2521 | whoinit, statefault, force)); | 2522 | ioc->name, whoinit, statefault, force)); |
2522 | if (whoinit == MPI_WHOINIT_PCI_PEER) | 2523 | if (whoinit == MPI_WHOINIT_PCI_PEER) |
2523 | return -4; | 2524 | return -4; |
2524 | else { | 2525 | else { |
@@ -2601,7 +2602,6 @@ mpt_GetIocState(MPT_ADAPTER *ioc, int cooked) | |||
2601 | 2602 | ||
2602 | /* Get! */ | 2603 | /* Get! */ |
2603 | s = CHIPREG_READ32(&ioc->chip->Doorbell); | 2604 | s = CHIPREG_READ32(&ioc->chip->Doorbell); |
2604 | // dprintk((MYIOC_s_INFO_FMT "raw state = %08x\n", ioc->name, s)); | ||
2605 | sc = s & MPI_IOC_STATE_MASK; | 2605 | sc = s & MPI_IOC_STATE_MASK; |
2606 | 2606 | ||
2607 | /* Save! */ | 2607 | /* Save! */ |
@@ -2633,9 +2633,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2633 | 2633 | ||
2634 | /* IOC *must* NOT be in RESET state! */ | 2634 | /* IOC *must* NOT be in RESET state! */ |
2635 | if (ioc->last_state == MPI_IOC_STATE_RESET) { | 2635 | if (ioc->last_state == MPI_IOC_STATE_RESET) { |
2636 | printk(KERN_ERR MYNAM ": ERROR - Can't get IOCFacts, %s NOT READY! (%08x)\n", | 2636 | printk(MYIOC_s_ERR_FMT "Can't get IOCFacts NOT READY! (%08x)\n", |
2637 | ioc->name, | 2637 | ioc->name, ioc->last_state ); |
2638 | ioc->last_state ); | ||
2639 | return -44; | 2638 | return -44; |
2640 | } | 2639 | } |
2641 | 2640 | ||
@@ -2755,8 +2754,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2755 | } | 2754 | } |
2756 | ioc->NBShiftFactor = shiftFactor; | 2755 | ioc->NBShiftFactor = shiftFactor; |
2757 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2756 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2758 | "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n", | 2757 | "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n", |
2759 | ioc->name, vv, shiftFactor, r)); | 2758 | ioc->name, vv, shiftFactor, r)); |
2760 | 2759 | ||
2761 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { | 2760 | if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { |
2762 | /* | 2761 | /* |
@@ -2809,9 +2808,8 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag) | |||
2809 | 2808 | ||
2810 | /* IOC *must* NOT be in RESET state! */ | 2809 | /* IOC *must* NOT be in RESET state! */ |
2811 | if (ioc->last_state == MPI_IOC_STATE_RESET) { | 2810 | if (ioc->last_state == MPI_IOC_STATE_RESET) { |
2812 | printk(KERN_ERR MYNAM ": ERROR - Can't get PortFacts, %s NOT READY! (%08x)\n", | 2811 | printk(MYIOC_s_ERR_FMT "Can't get PortFacts NOT READY! (%08x)\n", |
2813 | ioc->name, | 2812 | ioc->name, ioc->last_state ); |
2814 | ioc->last_state ); | ||
2815 | return -4; | 2813 | return -4; |
2816 | } | 2814 | } |
2817 | 2815 | ||
@@ -2986,7 +2984,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) | |||
2986 | state = mpt_GetIocState(ioc, 1); | 2984 | state = mpt_GetIocState(ioc, 1); |
2987 | count++; | 2985 | count++; |
2988 | } | 2986 | } |
2989 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", | 2987 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Wait IOC_OPERATIONAL state (cnt=%d)\n", |
2990 | ioc->name, count)); | 2988 | ioc->name, count)); |
2991 | 2989 | ||
2992 | ioc->aen_event_read_flag=0; | 2990 | ioc->aen_event_read_flag=0; |
@@ -3079,10 +3077,9 @@ mpt_free_fw_memory(MPT_ADAPTER *ioc) | |||
3079 | int sz; | 3077 | int sz; |
3080 | 3078 | ||
3081 | sz = ioc->facts.FWImageSize; | 3079 | sz = ioc->facts.FWImageSize; |
3082 | dinitprintk(ioc, printk(KERN_INFO MYNAM "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n", | 3080 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n", |
3083 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); | 3081 | ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); |
3084 | pci_free_consistent(ioc->pcidev, sz, | 3082 | pci_free_consistent(ioc->pcidev, sz, ioc->cached_fw, ioc->cached_fw_dma); |
3085 | ioc->cached_fw, ioc->cached_fw_dma); | ||
3086 | ioc->cached_fw = NULL; | 3083 | ioc->cached_fw = NULL; |
3087 | 3084 | ||
3088 | return; | 3085 | return; |
@@ -3123,8 +3120,8 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) | |||
3123 | 3120 | ||
3124 | mpt_alloc_fw_memory(ioc, sz); | 3121 | mpt_alloc_fw_memory(ioc, sz); |
3125 | 3122 | ||
3126 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Image @ %p[%p], sz=%d[%x] bytes\n", | 3123 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Image @ %p[%p], sz=%d[%x] bytes\n", |
3127 | ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); | 3124 | ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); |
3128 | 3125 | ||
3129 | if (ioc->cached_fw == NULL) { | 3126 | if (ioc->cached_fw == NULL) { |
3130 | /* Major Failure. | 3127 | /* Major Failure. |
@@ -3155,14 +3152,14 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) | |||
3155 | mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); | 3152 | mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); |
3156 | 3153 | ||
3157 | sgeoffset += sizeof(u32) + sizeof(dma_addr_t); | 3154 | sgeoffset += sizeof(u32) + sizeof(dma_addr_t); |
3158 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": Sending FW Upload (req @ %p) sgeoffset=%d \n", | 3155 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": Sending FW Upload (req @ %p) sgeoffset=%d \n", |
3159 | prequest, sgeoffset)); | 3156 | ioc->name, prequest, sgeoffset)); |
3160 | DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest) | 3157 | DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest); |
3161 | 3158 | ||
3162 | ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, | 3159 | ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, |
3163 | reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); | 3160 | reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); |
3164 | 3161 | ||
3165 | dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Upload completed rc=%x \n", ii)); | 3162 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Upload completed rc=%x \n", ioc->name, ii)); |
3166 | 3163 | ||
3167 | cmdStatus = -EFAULT; | 3164 | cmdStatus = -EFAULT; |
3168 | if (ii == 0) { | 3165 | if (ii == 0) { |
@@ -3433,7 +3430,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
3433 | u32 ioc_state=0; | 3430 | u32 ioc_state=0; |
3434 | int cnt,cntdn; | 3431 | int cnt,cntdn; |
3435 | 3432 | ||
3436 | dinitprintk(ioc, printk(KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name)); | 3433 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "KickStarting!\n", ioc->name)); |
3437 | if (ioc->bus_type == SPI) { | 3434 | if (ioc->bus_type == SPI) { |
3438 | /* Always issue a Msg Unit Reset first. This will clear some | 3435 | /* Always issue a Msg Unit Reset first. This will clear some |
3439 | * SCSI bus hang conditions. | 3436 | * SCSI bus hang conditions. |
@@ -3452,7 +3449,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
3452 | return hard_reset_done; | 3449 | return hard_reset_done; |
3453 | 3450 | ||
3454 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n", | 3451 | dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n", |
3455 | ioc->name)); | 3452 | ioc->name)); |
3456 | 3453 | ||
3457 | cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */ | 3454 | cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */ |
3458 | for (cnt=0; cnt<cntdn; cnt++) { | 3455 | for (cnt=0; cnt<cntdn; cnt++) { |
@@ -3469,8 +3466,8 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) | |||
3469 | } | 3466 | } |
3470 | } | 3467 | } |
3471 | 3468 | ||
3472 | printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n", | 3469 | dinitprintk(ioc, printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n", |
3473 | ioc->name, ioc_state); | 3470 | ioc->name, mpt_GetIocState(ioc, 0))); |
3474 | return -1; | 3471 | return -1; |
3475 | } | 3472 | } |
3476 | 3473 | ||
@@ -3658,8 +3655,8 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
3658 | } | 3655 | } |
3659 | if ((count = mpt_downloadboot(ioc, | 3656 | if ((count = mpt_downloadboot(ioc, |
3660 | (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) { | 3657 | (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) { |
3661 | printk(KERN_WARNING MYNAM | 3658 | printk(MYIOC_s_WARN_FMT |
3662 | ": firmware downloadboot failure (%d)!\n", count); | 3659 | "firmware downloadboot failure (%d)!\n", ioc->name, count); |
3663 | } | 3660 | } |
3664 | 3661 | ||
3665 | } else { | 3662 | } else { |
@@ -3802,8 +3799,8 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) | |||
3802 | if (sleepFlag != CAN_SLEEP) | 3799 | if (sleepFlag != CAN_SLEEP) |
3803 | count *= 10; | 3800 | count *= 10; |
3804 | 3801 | ||
3805 | printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY state timeout(%d)!\n", | 3802 | printk(MYIOC_s_ERR_FMT "Wait IOC_READY state timeout(%d)!\n", |
3806 | ioc->name, (int)((count+5)/HZ)); | 3803 | ioc->name, (int)((count+5)/HZ)); |
3807 | return -ETIME; | 3804 | return -ETIME; |
3808 | } | 3805 | } |
3809 | 3806 | ||
@@ -4196,7 +4193,7 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, | |||
4196 | } | 4193 | } |
4197 | 4194 | ||
4198 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req)); | 4195 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req)); |
4199 | DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req) | 4196 | DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req); |
4200 | 4197 | ||
4201 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n", | 4198 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n", |
4202 | ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : "")); | 4199 | ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : "")); |
@@ -4401,7 +4398,7 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag) | |||
4401 | #endif | 4398 | #endif |
4402 | 4399 | ||
4403 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name)); | 4400 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name)); |
4404 | DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply) | 4401 | DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply); |
4405 | 4402 | ||
4406 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n", | 4403 | dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n", |
4407 | ioc->name, t, u16cnt/2)); | 4404 | ioc->name, t, u16cnt/2)); |
@@ -4876,8 +4873,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4876 | 4873 | ||
4877 | if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { | 4874 | if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { |
4878 | ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; | 4875 | ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; |
4879 | ddvprintk(ioc, printk(KERN_INFO MYNAM | 4876 | ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
4880 | " :%s noQas due to Capabilities=%x\n", | 4877 | "noQas due to Capabilities=%x\n", |
4881 | ioc->name, pPP0->Capabilities)); | 4878 | ioc->name, pPP0->Capabilities)); |
4882 | } | 4879 | } |
4883 | ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; | 4880 | ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; |
@@ -5785,10 +5782,10 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
5785 | CONFIGPARMS *pCfg; | 5782 | CONFIGPARMS *pCfg; |
5786 | unsigned long flags; | 5783 | unsigned long flags; |
5787 | 5784 | ||
5788 | dprintk(ioc, printk(KERN_DEBUG MYNAM | 5785 | dprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
5789 | ": IOC %s_reset routed to MPT base driver!\n", | 5786 | ": IOC %s_reset routed to MPT base driver!\n", |
5790 | reset_phase==MPT_IOC_SETUP_RESET ? "setup" : ( | 5787 | ioc->name, reset_phase==MPT_IOC_SETUP_RESET ? "setup" : ( |
5791 | reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"))); | 5788 | reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"))); |
5792 | 5789 | ||
5793 | if (reset_phase == MPT_IOC_SETUP_RESET) { | 5790 | if (reset_phase == MPT_IOC_SETUP_RESET) { |
5794 | ; | 5791 | ; |
@@ -6201,8 +6198,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
6201 | } | 6198 | } |
6202 | 6199 | ||
6203 | if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) { | 6200 | if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) { |
6204 | printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n", | 6201 | printk(MYIOC_s_WARN_FMT "Cannot recover rc = %d!\n", ioc->name, rc); |
6205 | rc, ioc->name); | ||
6206 | } | 6202 | } |
6207 | ioc->reload_fw = 0; | 6203 | ioc->reload_fw = 0; |
6208 | if (ioc->alt_ioc) | 6204 | if (ioc->alt_ioc) |
@@ -6622,12 +6618,12 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply | |||
6622 | evStr)); | 6618 | evStr)); |
6623 | 6619 | ||
6624 | #ifdef CONFIG_FUSION_LOGGING | 6620 | #ifdef CONFIG_FUSION_LOGGING |
6625 | devtverboseprintk(ioc, printk(KERN_DEBUG MYNAM | 6621 | devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
6626 | ": Event data:\n")); | 6622 | ": Event data:\n", ioc->name)); |
6627 | for (ii = 0; ii < evDataLen; ii++) | 6623 | for (ii = 0; ii < evDataLen; ii++) |
6628 | devtverboseprintk(ioc, printk(" %08x", | 6624 | devtverboseprintk(ioc, printk(" %08x", |
6629 | le32_to_cpu(pEventReply->Data[ii]))); | 6625 | le32_to_cpu(pEventReply->Data[ii]))); |
6630 | devtverboseprintk(ioc, printk(KERN_DEBUG "\n")); | 6626 | devtverboseprintk(ioc, printk("\n")); |
6631 | #endif | 6627 | #endif |
6632 | 6628 | ||
6633 | /* | 6629 | /* |
@@ -7119,8 +7115,8 @@ mpt_iocstatus_info_config(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | |||
7119 | if (!desc) | 7115 | if (!desc) |
7120 | return; | 7116 | return; |
7121 | 7117 | ||
7122 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s: %s\n", | 7118 | dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s: %s\n", |
7123 | ioc->name, ioc_status, desc, extend_desc); | 7119 | ioc->name, ioc_status, desc, extend_desc)); |
7124 | } | 7120 | } |
7125 | 7121 | ||
7126 | /** | 7122 | /** |
@@ -7346,7 +7342,8 @@ mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | |||
7346 | if (!desc) | 7342 | if (!desc) |
7347 | return; | 7343 | return; |
7348 | 7344 | ||
7349 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s\n", ioc->name, status, desc); | 7345 | dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s\n", |
7346 | ioc->name, status, desc)); | ||
7350 | } | 7347 | } |
7351 | 7348 | ||
7352 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 7349 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |