diff options
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 711fcb5cec87..0707fa2c701b 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -990,11 +990,10 @@ mptsas_queue_device_delete(MPT_ADAPTER *ioc, | |||
990 | MpiEventDataSasDeviceStatusChange_t *sas_event_data) | 990 | MpiEventDataSasDeviceStatusChange_t *sas_event_data) |
991 | { | 991 | { |
992 | struct fw_event_work *fw_event; | 992 | struct fw_event_work *fw_event; |
993 | int sz; | ||
994 | 993 | ||
995 | sz = offsetof(struct fw_event_work, event_data) + | 994 | fw_event = kzalloc(sizeof(*fw_event) + |
996 | sizeof(MpiEventDataSasDeviceStatusChange_t); | 995 | sizeof(MpiEventDataSasDeviceStatusChange_t), |
997 | fw_event = kzalloc(sz, GFP_ATOMIC); | 996 | GFP_ATOMIC); |
998 | if (!fw_event) { | 997 | if (!fw_event) { |
999 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", | 998 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", |
1000 | ioc->name, __func__, __LINE__); | 999 | ioc->name, __func__, __LINE__); |
@@ -1011,10 +1010,8 @@ static void | |||
1011 | mptsas_queue_rescan(MPT_ADAPTER *ioc) | 1010 | mptsas_queue_rescan(MPT_ADAPTER *ioc) |
1012 | { | 1011 | { |
1013 | struct fw_event_work *fw_event; | 1012 | struct fw_event_work *fw_event; |
1014 | int sz; | ||
1015 | 1013 | ||
1016 | sz = offsetof(struct fw_event_work, event_data); | 1014 | fw_event = kzalloc(sizeof(*fw_event), GFP_ATOMIC); |
1017 | fw_event = kzalloc(sz, GFP_ATOMIC); | ||
1018 | if (!fw_event) { | 1015 | if (!fw_event) { |
1019 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", | 1016 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", |
1020 | ioc->name, __func__, __LINE__); | 1017 | ioc->name, __func__, __LINE__); |
@@ -1206,27 +1203,28 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
1206 | "(mf = %p, mr = %p)\n", ioc->name, mf, mr)); | 1203 | "(mf = %p, mr = %p)\n", ioc->name, mf, mr)); |
1207 | 1204 | ||
1208 | pScsiTmReply = (SCSITaskMgmtReply_t *)mr; | 1205 | pScsiTmReply = (SCSITaskMgmtReply_t *)mr; |
1209 | if (pScsiTmReply) { | 1206 | if (!pScsiTmReply) |
1210 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 1207 | return 0; |
1211 | "\tTaskMgmt completed: fw_channel = %d, fw_id = %d,\n" | 1208 | |
1212 | "\ttask_type = 0x%02X, iocstatus = 0x%04X " | 1209 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
1213 | "loginfo = 0x%08X,\n\tresponse_code = 0x%02X, " | 1210 | "\tTaskMgmt completed: fw_channel = %d, fw_id = %d,\n" |
1214 | "term_cmnds = %d\n", ioc->name, | 1211 | "\ttask_type = 0x%02X, iocstatus = 0x%04X " |
1215 | pScsiTmReply->Bus, pScsiTmReply->TargetID, | 1212 | "loginfo = 0x%08X,\n\tresponse_code = 0x%02X, " |
1216 | pScsiTmReply->TaskType, | 1213 | "term_cmnds = %d\n", ioc->name, |
1217 | le16_to_cpu(pScsiTmReply->IOCStatus), | 1214 | pScsiTmReply->Bus, pScsiTmReply->TargetID, |
1218 | le32_to_cpu(pScsiTmReply->IOCLogInfo), | 1215 | pScsiTmReply->TaskType, |
1219 | pScsiTmReply->ResponseCode, | 1216 | le16_to_cpu(pScsiTmReply->IOCStatus), |
1220 | le32_to_cpu(pScsiTmReply->TerminationCount))); | 1217 | le32_to_cpu(pScsiTmReply->IOCLogInfo), |
1221 | 1218 | pScsiTmReply->ResponseCode, | |
1222 | if (pScsiTmReply->ResponseCode) | 1219 | le32_to_cpu(pScsiTmReply->TerminationCount))); |
1223 | mptscsih_taskmgmt_response_code(ioc, | 1220 | |
1224 | pScsiTmReply->ResponseCode); | 1221 | if (pScsiTmReply->ResponseCode) |
1225 | } | 1222 | mptscsih_taskmgmt_response_code(ioc, |
1226 | 1223 | pScsiTmReply->ResponseCode); | |
1227 | if (pScsiTmReply && (pScsiTmReply->TaskType == | 1224 | |
1225 | if (pScsiTmReply->TaskType == | ||
1228 | MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK || pScsiTmReply->TaskType == | 1226 | MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK || pScsiTmReply->TaskType == |
1229 | MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET)) { | 1227 | MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET) { |
1230 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_COMMAND_GOOD; | 1228 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_COMMAND_GOOD; |
1231 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_RF_VALID; | 1229 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_RF_VALID; |
1232 | memcpy(ioc->taskmgmt_cmds.reply, mr, | 1230 | memcpy(ioc->taskmgmt_cmds.reply, mr, |
@@ -1575,7 +1573,7 @@ mptsas_del_end_device(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info) | |||
1575 | mptsas_port_delete(ioc, phy_info->port_details); | 1573 | mptsas_port_delete(ioc, phy_info->port_details); |
1576 | } | 1574 | } |
1577 | 1575 | ||
1578 | struct mptsas_phyinfo * | 1576 | static struct mptsas_phyinfo * |
1579 | mptsas_refreshing_device_handles(MPT_ADAPTER *ioc, | 1577 | mptsas_refreshing_device_handles(MPT_ADAPTER *ioc, |
1580 | struct mptsas_devinfo *sas_device) | 1578 | struct mptsas_devinfo *sas_device) |
1581 | { | 1579 | { |
@@ -3648,7 +3646,7 @@ mptsas_send_expander_event(struct fw_event_work *fw_event) | |||
3648 | * @handle: | 3646 | * @handle: |
3649 | * | 3647 | * |
3650 | */ | 3648 | */ |
3651 | struct mptsas_portinfo * | 3649 | static struct mptsas_portinfo * |
3652 | mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle) | 3650 | mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle) |
3653 | { | 3651 | { |
3654 | struct mptsas_portinfo buffer, *port_info; | 3652 | struct mptsas_portinfo buffer, *port_info; |
@@ -3763,7 +3761,7 @@ mptsas_send_link_status_event(struct fw_event_work *fw_event) | |||
3763 | printk(MYIOC_s_DEBUG_FMT | 3761 | printk(MYIOC_s_DEBUG_FMT |
3764 | "SDEV OUTSTANDING CMDS" | 3762 | "SDEV OUTSTANDING CMDS" |
3765 | "%d\n", ioc->name, | 3763 | "%d\n", ioc->name, |
3766 | sdev->device_busy)); | 3764 | atomic_read(&sdev->device_busy))); |
3767 | } | 3765 | } |
3768 | 3766 | ||
3769 | } | 3767 | } |
@@ -3856,10 +3854,8 @@ retry_page: | |||
3856 | phy_info = mptsas_find_phyinfo_by_sas_address(ioc, | 3854 | phy_info = mptsas_find_phyinfo_by_sas_address(ioc, |
3857 | sas_info->sas_address); | 3855 | sas_info->sas_address); |
3858 | 3856 | ||
3859 | if (phy_info) { | 3857 | mptsas_del_end_device(ioc, phy_info); |
3860 | mptsas_del_end_device(ioc, phy_info); | 3858 | goto redo_device_scan; |
3861 | goto redo_device_scan; | ||
3862 | } | ||
3863 | } else | 3859 | } else |
3864 | mptsas_volume_delete(ioc, sas_info->fw.id); | 3860 | mptsas_volume_delete(ioc, sas_info->fw.id); |
3865 | } | 3861 | } |
@@ -3870,9 +3866,8 @@ retry_page: | |||
3870 | redo_expander_scan: | 3866 | redo_expander_scan: |
3871 | list_for_each_entry(port_info, &ioc->sas_topology, list) { | 3867 | list_for_each_entry(port_info, &ioc->sas_topology, list) { |
3872 | 3868 | ||
3873 | if (port_info->phy_info && | 3869 | if (!(port_info->phy_info[0].identify.device_info & |
3874 | (!(port_info->phy_info[0].identify.device_info & | 3870 | MPI_SAS_DEVICE_INFO_SMP_TARGET)) |
3875 | MPI_SAS_DEVICE_INFO_SMP_TARGET))) | ||
3876 | continue; | 3871 | continue; |
3877 | found_expander = 0; | 3872 | found_expander = 0; |
3878 | handle = 0xFFFF; | 3873 | handle = 0xFFFF; |
@@ -4983,7 +4978,7 @@ static int | |||
4983 | mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) | 4978 | mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) |
4984 | { | 4979 | { |
4985 | u32 event = le32_to_cpu(reply->Event); | 4980 | u32 event = le32_to_cpu(reply->Event); |
4986 | int sz, event_data_sz; | 4981 | int event_data_sz; |
4987 | struct fw_event_work *fw_event; | 4982 | struct fw_event_work *fw_event; |
4988 | unsigned long delay; | 4983 | unsigned long delay; |
4989 | 4984 | ||
@@ -5093,8 +5088,7 @@ mptsas_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *reply) | |||
5093 | 5088 | ||
5094 | event_data_sz = ((reply->MsgLength * 4) - | 5089 | event_data_sz = ((reply->MsgLength * 4) - |
5095 | offsetof(EventNotificationReply_t, Data)); | 5090 | offsetof(EventNotificationReply_t, Data)); |
5096 | sz = offsetof(struct fw_event_work, event_data) + event_data_sz; | 5091 | fw_event = kzalloc(sizeof(*fw_event) + event_data_sz, GFP_ATOMIC); |
5097 | fw_event = kzalloc(sz, GFP_ATOMIC); | ||
5098 | if (!fw_event) { | 5092 | if (!fw_event) { |
5099 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", ioc->name, | 5093 | printk(MYIOC_s_WARN_FMT "%s: failed at (line=%d)\n", ioc->name, |
5100 | __func__, __LINE__); | 5094 | __func__, __LINE__); |
@@ -5321,7 +5315,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
5321 | return error; | 5315 | return error; |
5322 | } | 5316 | } |
5323 | 5317 | ||
5324 | void | 5318 | static void |
5325 | mptsas_shutdown(struct pci_dev *pdev) | 5319 | mptsas_shutdown(struct pci_dev *pdev) |
5326 | { | 5320 | { |
5327 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); | 5321 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); |