diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 18:15:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 18:15:15 -0400 |
commit | 03da30986793385af57eeca3296253c887b742e6 (patch) | |
tree | 9c46dbe51c9d0856990649dd917ab45474b7be87 /drivers/message/fusion/mptbase.c | |
parent | 6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7 (diff) | |
parent | 339f4f4eab80caa6cf0d39fb057ad6ddb84ba91e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (276 commits)
[SCSI] zfcp: Trigger logging in the FCP channel on qdio error conditions
[SCSI] zfcp: Introduce experimental support for DIF/DIX
[SCSI] zfcp: Enable data division support for FCP devices
[SCSI] zfcp: Prevent access on uninitialized memory.
[SCSI] zfcp: Post events through FC transport class
[SCSI] zfcp: Cleanup QDIO attachment and improve processing.
[SCSI] zfcp: Cleanup function parameters for sbal value.
[SCSI] zfcp: Use correct width for timer_interval field
[SCSI] zfcp: Remove SCSI device when removing unit
[SCSI] zfcp: Use memdup_user and kstrdup
[SCSI] zfcp: Fix retry after failed "open port" erp action
[SCSI] zfcp: Fail erp after timeout
[SCSI] zfcp: Use forced_reopen in terminate_rport_io callback
[SCSI] zfcp: Register SCSI devices after successful fc_remote_port_add
[SCSI] zfcp: Do not try "forced close" when port is already closed
[SCSI] zfcp: Do not unblock rport from REOPEN_PORT_FORCED
[SCSI] sd: add support for runtime PM
[SCSI] implement runtime Power Management
[SCSI] convert to the new PM framework
[SCSI] Unify SAM_ and SAM_STAT_ macros
...
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index a6a57011ba6c..2a52559058a9 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -115,6 +115,7 @@ MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" | |||
115 | " and halt Firmware on fault - (default=0)"); | 115 | " and halt Firmware on fault - (default=0)"); |
116 | 116 | ||
117 | 117 | ||
118 | static char MptCallbacksName[MPT_MAX_PROTOCOL_DRIVERS][50]; | ||
118 | 119 | ||
119 | #ifdef MFCNT | 120 | #ifdef MFCNT |
120 | static int mfcounter = 0; | 121 | static int mfcounter = 0; |
@@ -213,7 +214,7 @@ static int ProcessEventNotification(MPT_ADAPTER *ioc, | |||
213 | static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); | 214 | static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); |
214 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); | 215 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); |
215 | static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); | 216 | static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); |
216 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); | 217 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info , u8 cb_idx); |
217 | static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); | 218 | static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); |
218 | static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc); | 219 | static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc); |
219 | 220 | ||
@@ -490,7 +491,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) | |||
490 | else if (ioc->bus_type == SPI) | 491 | else if (ioc->bus_type == SPI) |
491 | mpt_spi_log_info(ioc, log_info); | 492 | mpt_spi_log_info(ioc, log_info); |
492 | else if (ioc->bus_type == SAS) | 493 | else if (ioc->bus_type == SAS) |
493 | mpt_sas_log_info(ioc, log_info); | 494 | mpt_sas_log_info(ioc, log_info, cb_idx); |
494 | } | 495 | } |
495 | 496 | ||
496 | if (ioc_stat & MPI_IOCSTATUS_MASK) | 497 | if (ioc_stat & MPI_IOCSTATUS_MASK) |
@@ -644,7 +645,7 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply) | |||
644 | * considered an error by the caller. | 645 | * considered an error by the caller. |
645 | */ | 646 | */ |
646 | u8 | 647 | u8 |
647 | mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass) | 648 | mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass, char *func_name) |
648 | { | 649 | { |
649 | u8 cb_idx; | 650 | u8 cb_idx; |
650 | last_drv_idx = MPT_MAX_PROTOCOL_DRIVERS; | 651 | last_drv_idx = MPT_MAX_PROTOCOL_DRIVERS; |
@@ -659,6 +660,8 @@ mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass) | |||
659 | MptDriverClass[cb_idx] = dclass; | 660 | MptDriverClass[cb_idx] = dclass; |
660 | MptEvHandlers[cb_idx] = NULL; | 661 | MptEvHandlers[cb_idx] = NULL; |
661 | last_drv_idx = cb_idx; | 662 | last_drv_idx = cb_idx; |
663 | memcpy(MptCallbacksName[cb_idx], func_name, | ||
664 | strlen(func_name) > 50 ? 50 : strlen(func_name)); | ||
662 | break; | 665 | break; |
663 | } | 666 | } |
664 | } | 667 | } |
@@ -1632,6 +1635,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1632 | } else { | 1635 | } else { |
1633 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", | 1636 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", |
1634 | ioc->name, pci_name(pdev)); | 1637 | ioc->name, pci_name(pdev)); |
1638 | pci_release_selected_regions(pdev, ioc->bars); | ||
1635 | return r; | 1639 | return r; |
1636 | } | 1640 | } |
1637 | } else { | 1641 | } else { |
@@ -1645,6 +1649,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1645 | } else { | 1649 | } else { |
1646 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", | 1650 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", |
1647 | ioc->name, pci_name(pdev)); | 1651 | ioc->name, pci_name(pdev)); |
1652 | pci_release_selected_regions(pdev, ioc->bars); | ||
1648 | return r; | 1653 | return r; |
1649 | } | 1654 | } |
1650 | } | 1655 | } |
@@ -1675,6 +1680,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1675 | if (mem == NULL) { | 1680 | if (mem == NULL) { |
1676 | printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter" | 1681 | printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter" |
1677 | " memory!\n", ioc->name); | 1682 | " memory!\n", ioc->name); |
1683 | pci_release_selected_regions(pdev, ioc->bars); | ||
1678 | return -EINVAL; | 1684 | return -EINVAL; |
1679 | } | 1685 | } |
1680 | ioc->memmap = mem; | 1686 | ioc->memmap = mem; |
@@ -1770,7 +1776,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1770 | ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ | 1776 | ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */ |
1771 | ioc->reply_sz = MPT_REPLY_FRAME_SIZE; | 1777 | ioc->reply_sz = MPT_REPLY_FRAME_SIZE; |
1772 | 1778 | ||
1773 | ioc->pcidev = pdev; | ||
1774 | 1779 | ||
1775 | spin_lock_init(&ioc->taskmgmt_lock); | 1780 | spin_lock_init(&ioc->taskmgmt_lock); |
1776 | mutex_init(&ioc->internal_cmds.mutex); | 1781 | mutex_init(&ioc->internal_cmds.mutex); |
@@ -1913,6 +1918,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1913 | ioc->msi_enable = 0; | 1918 | ioc->msi_enable = 0; |
1914 | break; | 1919 | break; |
1915 | } | 1920 | } |
1921 | |||
1922 | ioc->fw_events_off = 1; | ||
1923 | |||
1916 | if (ioc->errata_flag_1064) | 1924 | if (ioc->errata_flag_1064) |
1917 | pci_disable_io_access(pdev); | 1925 | pci_disable_io_access(pdev); |
1918 | 1926 | ||
@@ -2051,7 +2059,6 @@ mpt_detach(struct pci_dev *pdev) | |||
2051 | 2059 | ||
2052 | mpt_adapter_dispose(ioc); | 2060 | mpt_adapter_dispose(ioc); |
2053 | 2061 | ||
2054 | pci_set_drvdata(pdev, NULL); | ||
2055 | } | 2062 | } |
2056 | 2063 | ||
2057 | /************************************************************************** | 2064 | /************************************************************************** |
@@ -5062,8 +5069,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode) | |||
5062 | if (ioc->mptbase_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) | 5069 | if (ioc->mptbase_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) |
5063 | goto out; | 5070 | goto out; |
5064 | if (!timeleft) { | 5071 | if (!timeleft) { |
5065 | printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n", | 5072 | printk(MYIOC_s_WARN_FMT |
5066 | ioc->name, __func__); | 5073 | "Issuing Reset from %s!!, doorbell=0x%08x\n", |
5074 | ioc->name, __func__, mpt_GetIocState(ioc, 0)); | ||
5067 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); | 5075 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); |
5068 | mpt_free_msg_frame(ioc, mf); | 5076 | mpt_free_msg_frame(ioc, mf); |
5069 | } | 5077 | } |
@@ -6454,8 +6462,9 @@ out: | |||
6454 | mutex_unlock(&ioc->mptbase_cmds.mutex); | 6462 | mutex_unlock(&ioc->mptbase_cmds.mutex); |
6455 | if (issue_hard_reset) { | 6463 | if (issue_hard_reset) { |
6456 | issue_hard_reset = 0; | 6464 | issue_hard_reset = 0; |
6457 | printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n", | 6465 | printk(MYIOC_s_WARN_FMT |
6458 | ioc->name, __func__); | 6466 | "Issuing Reset from %s!!, doorbell=0x%08x\n", |
6467 | ioc->name, __func__, mpt_GetIocState(ioc, 0)); | ||
6459 | if (retry_count == 0) { | 6468 | if (retry_count == 0) { |
6460 | if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0) | 6469 | if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0) |
6461 | retry_count++; | 6470 | retry_count++; |
@@ -6971,6 +6980,7 @@ mpt_SoftResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
6971 | 6980 | ||
6972 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); | 6981 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
6973 | if (ioc->taskmgmt_in_progress) { | 6982 | if (ioc->taskmgmt_in_progress) { |
6983 | ioc->ioc_reset_in_progress = 0; | ||
6974 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); | 6984 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
6975 | return -1; | 6985 | return -1; |
6976 | } | 6986 | } |
@@ -7144,7 +7154,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
7144 | rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag); | 7154 | rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag); |
7145 | if (rc != 0) { | 7155 | if (rc != 0) { |
7146 | printk(KERN_WARNING MYNAM | 7156 | printk(KERN_WARNING MYNAM |
7147 | ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name); | 7157 | ": WARNING - (%d) Cannot recover %s, doorbell=0x%08x\n", |
7158 | rc, ioc->name, mpt_GetIocState(ioc, 0)); | ||
7148 | } else { | 7159 | } else { |
7149 | if (ioc->hard_resets < -1) | 7160 | if (ioc->hard_resets < -1) |
7150 | ioc->hard_resets++; | 7161 | ioc->hard_resets++; |
@@ -7997,7 +8008,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
7997 | * Refer to lsi/mpi_log_sas.h. | 8008 | * Refer to lsi/mpi_log_sas.h. |
7998 | **/ | 8009 | **/ |
7999 | static void | 8010 | static void |
8000 | mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info) | 8011 | mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info, u8 cb_idx) |
8001 | { | 8012 | { |
8002 | union loginfo_type { | 8013 | union loginfo_type { |
8003 | u32 loginfo; | 8014 | u32 loginfo; |
@@ -8051,21 +8062,22 @@ union loginfo_type { | |||
8051 | if (sub_code_desc != NULL) | 8062 | if (sub_code_desc != NULL) |
8052 | printk(MYIOC_s_INFO_FMT | 8063 | printk(MYIOC_s_INFO_FMT |
8053 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," | 8064 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," |
8054 | " SubCode={%s}\n", | 8065 | " SubCode={%s} cb_idx %s\n", |
8055 | ioc->name, log_info, originator_desc, code_desc, | 8066 | ioc->name, log_info, originator_desc, code_desc, |
8056 | sub_code_desc); | 8067 | sub_code_desc, MptCallbacksName[cb_idx]); |
8057 | else if (code_desc != NULL) | 8068 | else if (code_desc != NULL) |
8058 | printk(MYIOC_s_INFO_FMT | 8069 | printk(MYIOC_s_INFO_FMT |
8059 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," | 8070 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," |
8060 | " SubCode(0x%04x)\n", | 8071 | " SubCode(0x%04x) cb_idx %s\n", |
8061 | ioc->name, log_info, originator_desc, code_desc, | 8072 | ioc->name, log_info, originator_desc, code_desc, |
8062 | sas_loginfo.dw.subcode); | 8073 | sas_loginfo.dw.subcode, MptCallbacksName[cb_idx]); |
8063 | else | 8074 | else |
8064 | printk(MYIOC_s_INFO_FMT | 8075 | printk(MYIOC_s_INFO_FMT |
8065 | "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," | 8076 | "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," |
8066 | " SubCode(0x%04x)\n", | 8077 | " SubCode(0x%04x) cb_idx %s\n", |
8067 | ioc->name, log_info, originator_desc, | 8078 | ioc->name, log_info, originator_desc, |
8068 | sas_loginfo.dw.code, sas_loginfo.dw.subcode); | 8079 | sas_loginfo.dw.code, sas_loginfo.dw.subcode, |
8080 | MptCallbacksName[cb_idx]); | ||
8069 | } | 8081 | } |
8070 | 8082 | ||
8071 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 8083 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -8430,7 +8442,8 @@ fusion_init(void) | |||
8430 | /* Register ourselves (mptbase) in order to facilitate | 8442 | /* Register ourselves (mptbase) in order to facilitate |
8431 | * EventNotification handling. | 8443 | * EventNotification handling. |
8432 | */ | 8444 | */ |
8433 | mpt_base_index = mpt_register(mptbase_reply, MPTBASE_DRIVER); | 8445 | mpt_base_index = mpt_register(mptbase_reply, MPTBASE_DRIVER, |
8446 | "mptbase_reply"); | ||
8434 | 8447 | ||
8435 | /* Register for hard reset handling callbacks. | 8448 | /* Register for hard reset handling callbacks. |
8436 | */ | 8449 | */ |