diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-06-17 05:10:56 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:02:34 -0400 |
commit | b68bf096d4211bb6490955f86842d8291e8ae218 (patch) | |
tree | c512c93f8effded33b4318e3d7e25217a86897a5 /drivers/message/fusion/mptsas.c | |
parent | 51106ab5306b752cd53d40626f78774276bb1368 (diff) |
[SCSI] mptfusion: schedule_target_reset from all Reset context
Issue:
target reset will be queued to driver's internal queue to get schedule
later. When driver add target into internal target_reset queue we will block IOs
on those target using scsi midlayer API. Now due to some cause driver is not
executing those target_reset list and it is always in block state.
Changes:
now we are clearing target_reset queue from all other Callback context
instead of only DeviceReset context.Now wherever driver is clearing
taskmgmt_in_progress flag it is considering target_reset queue cleanup
also.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 59 |
1 files changed, 41 insertions, 18 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 8963f5c44c23..a94655162347 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -126,6 +126,7 @@ static void mptsas_scan_sas_topology(MPT_ADAPTER *ioc); | |||
126 | static void mptsas_broadcast_primative_work(struct fw_event_work *fw_event); | 126 | static void mptsas_broadcast_primative_work(struct fw_event_work *fw_event); |
127 | static void mptsas_handle_queue_full_event(struct fw_event_work *fw_event); | 127 | static void mptsas_handle_queue_full_event(struct fw_event_work *fw_event); |
128 | static void mptsas_volume_delete(MPT_ADAPTER *ioc, u8 id); | 128 | static void mptsas_volume_delete(MPT_ADAPTER *ioc, u8 id); |
129 | void mptsas_schedule_target_reset(void *ioc); | ||
129 | 130 | ||
130 | static void mptsas_print_phy_data(MPT_ADAPTER *ioc, | 131 | static void mptsas_print_phy_data(MPT_ADAPTER *ioc, |
131 | MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) | 132 | MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) |
@@ -1139,6 +1140,44 @@ mptsas_target_reset_queue(MPT_ADAPTER *ioc, | |||
1139 | } | 1140 | } |
1140 | 1141 | ||
1141 | /** | 1142 | /** |
1143 | * mptsas_schedule_target_reset- send pending target reset | ||
1144 | * @iocp: per adapter object | ||
1145 | * | ||
1146 | * This function will delete scheduled target reset from the list and | ||
1147 | * try to send next target reset. This will be called from completion | ||
1148 | * context of any Task managment command. | ||
1149 | */ | ||
1150 | |||
1151 | void | ||
1152 | mptsas_schedule_target_reset(void *iocp) | ||
1153 | { | ||
1154 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)(iocp); | ||
1155 | MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | ||
1156 | struct list_head *head = &hd->target_reset_list; | ||
1157 | struct mptsas_target_reset_event *target_reset_list; | ||
1158 | u8 id, channel; | ||
1159 | /* | ||
1160 | * issue target reset to next device in the queue | ||
1161 | */ | ||
1162 | |||
1163 | head = &hd->target_reset_list; | ||
1164 | if (list_empty(head)) | ||
1165 | return; | ||
1166 | |||
1167 | target_reset_list = list_entry(head->next, | ||
1168 | struct mptsas_target_reset_event, list); | ||
1169 | |||
1170 | id = target_reset_list->sas_event_data.TargetID; | ||
1171 | channel = target_reset_list->sas_event_data.Bus; | ||
1172 | target_reset_list->time_count = jiffies; | ||
1173 | |||
1174 | if (mptsas_target_reset(ioc, channel, id)) | ||
1175 | target_reset_list->target_reset_issued = 1; | ||
1176 | return; | ||
1177 | } | ||
1178 | |||
1179 | |||
1180 | /** | ||
1142 | * mptsas_taskmgmt_complete - complete SAS task management function | 1181 | * mptsas_taskmgmt_complete - complete SAS task management function |
1143 | * @ioc: Pointer to MPT_ADAPTER structure | 1182 | * @ioc: Pointer to MPT_ADAPTER structure |
1144 | * | 1183 | * |
@@ -1227,23 +1266,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
1227 | &target_reset_list->sas_event_data); | 1266 | &target_reset_list->sas_event_data); |
1228 | 1267 | ||
1229 | 1268 | ||
1230 | /* | 1269 | ioc->schedule_target_reset(ioc); |
1231 | * issue target reset to next device in the queue | ||
1232 | */ | ||
1233 | |||
1234 | head = &hd->target_reset_list; | ||
1235 | if (list_empty(head)) | ||
1236 | return 1; | ||
1237 | |||
1238 | target_reset_list = list_entry(head->next, struct mptsas_target_reset_event, | ||
1239 | list); | ||
1240 | |||
1241 | id = target_reset_list->sas_event_data.TargetID; | ||
1242 | channel = target_reset_list->sas_event_data.Bus; | ||
1243 | target_reset_list->time_count = jiffies; | ||
1244 | |||
1245 | if (mptsas_target_reset(ioc, channel, id)) | ||
1246 | target_reset_list->target_reset_issued = 1; | ||
1247 | 1270 | ||
1248 | return 1; | 1271 | return 1; |
1249 | } | 1272 | } |
@@ -4961,7 +4984,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
4961 | ioc->DoneCtx = mptsasDoneCtx; | 4984 | ioc->DoneCtx = mptsasDoneCtx; |
4962 | ioc->TaskCtx = mptsasTaskCtx; | 4985 | ioc->TaskCtx = mptsasTaskCtx; |
4963 | ioc->InternalCtx = mptsasInternalCtx; | 4986 | ioc->InternalCtx = mptsasInternalCtx; |
4964 | 4987 | ioc->schedule_target_reset = &mptsas_schedule_target_reset; | |
4965 | /* Added sanity check on readiness of the MPT adapter. | 4988 | /* Added sanity check on readiness of the MPT adapter. |
4966 | */ | 4989 | */ |
4967 | if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) { | 4990 | if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) { |