diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2012-03-09 01:42:06 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-05-17 17:33:42 -0400 |
commit | 8c731888bf1be8d15d587ab1b4da80553302e653 (patch) | |
tree | 0f5cba0195d75ae7a4b5c1ecf19bf6b1ced36ea5 /drivers | |
parent | 28de92bef0fb0c3953aa73d31a961422ef900e6a (diff) |
isci: Added timeouts to RNC suspensions in the abort path.
This change adds timeouts to the RNC suspension wait. It makes the
suspend and resume timeouts the same.
The previous resume timeout of 5 ms was too short, and timeouts were
seen in resumptions of devices in the abort task/LUN reset path - which
would receive an RNC resumed message within a tenth of a second later.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 58 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_node_context.c | 8 |
2 files changed, 55 insertions, 11 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index 37e9bdead6f6..be9f0e0be4ff 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -207,23 +207,67 @@ enum sci_status isci_remote_device_terminate_requests( | |||
207 | "about to wait\n", | 207 | "about to wait\n", |
208 | __func__, idev, ireq, idev->started_request_count, | 208 | __func__, idev, ireq, idev->started_request_count, |
209 | rnc_suspend_count, idev->rnc.suspend_count); | 209 | rnc_suspend_count, idev->rnc.suspend_count); |
210 | |||
211 | #define MAX_SUSPEND_MSECS 10000 | ||
210 | if (ireq) { | 212 | if (ireq) { |
211 | /* Terminate a specific TC. */ | 213 | /* Terminate a specific TC. */ |
212 | set_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags); | 214 | set_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags); |
213 | sci_remote_device_terminate_req(ihost, idev, 0, ireq); | 215 | sci_remote_device_terminate_req(ihost, idev, 0, ireq); |
214 | spin_unlock_irqrestore(&ihost->scic_lock, flags); | 216 | spin_unlock_irqrestore(&ihost->scic_lock, flags); |
215 | wait_event(ihost->eventq, | 217 | if (!wait_event_timeout(ihost->eventq, |
216 | isci_check_reqterm(ihost, idev, ireq, | 218 | isci_check_reqterm(ihost, idev, ireq, |
217 | rnc_suspend_count)); | 219 | rnc_suspend_count), |
220 | msecs_to_jiffies(MAX_SUSPEND_MSECS))) { | ||
221 | |||
222 | dev_warn(&ihost->pdev->dev, "%s host%d timeout single\n", | ||
223 | __func__, ihost->id); | ||
224 | dev_dbg(&ihost->pdev->dev, | ||
225 | "%s: ******* Timeout waiting for " | ||
226 | "suspend; idev=%p, current state %s; " | ||
227 | "started_request_count=%d, flags=%lx\n\t" | ||
228 | "rnc_suspend_count=%d, rnc.suspend_count=%d " | ||
229 | "RNC: current state %s, current " | ||
230 | "suspend_type %x dest state %d;\n" | ||
231 | "ireq=%p, ireq->flags = %lx\n", | ||
232 | __func__, idev, | ||
233 | dev_state_name(idev->sm.current_state_id), | ||
234 | idev->started_request_count, idev->flags, | ||
235 | rnc_suspend_count, idev->rnc.suspend_count, | ||
236 | rnc_state_name(idev->rnc.sm.current_state_id), | ||
237 | idev->rnc.suspend_type, | ||
238 | idev->rnc.destination_state, | ||
239 | ireq, ireq->flags); | ||
240 | } | ||
218 | clear_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags); | 241 | clear_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags); |
219 | isci_free_tag(ihost, ireq->io_tag); | 242 | isci_free_tag(ihost, ireq->io_tag); |
220 | } else { | 243 | } else { |
221 | /* Terminate all TCs. */ | 244 | /* Terminate all TCs. */ |
222 | sci_remote_device_terminate_requests(idev); | 245 | sci_remote_device_terminate_requests(idev); |
223 | spin_unlock_irqrestore(&ihost->scic_lock, flags); | 246 | spin_unlock_irqrestore(&ihost->scic_lock, flags); |
224 | wait_event(ihost->eventq, | 247 | if (!wait_event_timeout(ihost->eventq, |
225 | isci_check_devempty(ihost, idev, | 248 | isci_check_devempty(ihost, idev, |
226 | rnc_suspend_count)); | 249 | rnc_suspend_count), |
250 | msecs_to_jiffies(MAX_SUSPEND_MSECS))) { | ||
251 | |||
252 | dev_warn(&ihost->pdev->dev, "%s host%d timeout all\n", | ||
253 | __func__, ihost->id); | ||
254 | dev_dbg(&ihost->pdev->dev, | ||
255 | "%s: ******* Timeout waiting for " | ||
256 | "suspend; idev=%p, current state %s; " | ||
257 | "started_request_count=%d, flags=%lx\n\t" | ||
258 | "rnc_suspend_count=%d, " | ||
259 | "RNC: current state %s, " | ||
260 | "rnc.suspend_count=%d, current " | ||
261 | "suspend_type %x dest state %d\n", | ||
262 | __func__, idev, | ||
263 | dev_state_name(idev->sm.current_state_id), | ||
264 | idev->started_request_count, idev->flags, | ||
265 | rnc_suspend_count, | ||
266 | rnc_state_name(idev->rnc.sm.current_state_id), | ||
267 | idev->rnc.suspend_count, | ||
268 | idev->rnc.suspend_type, | ||
269 | idev->rnc.destination_state); | ||
270 | } | ||
227 | } | 271 | } |
228 | dev_dbg(&ihost->pdev->dev, "%s: idev=%p, wait done\n", | 272 | dev_dbg(&ihost->pdev->dev, "%s: idev=%p, wait done\n", |
229 | __func__, idev); | 273 | __func__, idev); |
@@ -1315,7 +1359,7 @@ void isci_remote_device_wait_for_resume_from_abort( | |||
1315 | dev_dbg(scirdev_to_dev(idev), "%s: starting resume wait: %p\n", | 1359 | dev_dbg(scirdev_to_dev(idev), "%s: starting resume wait: %p\n", |
1316 | __func__, idev); | 1360 | __func__, idev); |
1317 | 1361 | ||
1318 | #define MAX_RESUME_MSECS 5 | 1362 | #define MAX_RESUME_MSECS 10000 |
1319 | if (!wait_event_timeout(ihost->eventq, | 1363 | if (!wait_event_timeout(ihost->eventq, |
1320 | (!test_bit(IDEV_ABORT_PATH_RESUME_PENDING, | 1364 | (!test_bit(IDEV_ABORT_PATH_RESUME_PENDING, |
1321 | &idev->flags) | 1365 | &idev->flags) |
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c index b698081ce2dd..a0a62e3a500d 100644 --- a/drivers/scsi/isci/remote_node_context.c +++ b/drivers/scsi/isci/remote_node_context.c | |||
@@ -445,7 +445,7 @@ enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_con | |||
445 | case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: | 445 | case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: |
446 | /* We really dont care if the hardware is going to suspend | 446 | /* We really dont care if the hardware is going to suspend |
447 | * the device since it's being invalidated anyway */ | 447 | * the device since it's being invalidated anyway */ |
448 | dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), | 448 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
449 | "%s: SCIC Remote Node Context 0x%p was " | 449 | "%s: SCIC Remote Node Context 0x%p was " |
450 | "suspeneded by hardware while being " | 450 | "suspeneded by hardware while being " |
451 | "invalidated.\n", __func__, sci_rnc); | 451 | "invalidated.\n", __func__, sci_rnc); |
@@ -464,7 +464,7 @@ enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_con | |||
464 | case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: | 464 | case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: |
465 | /* We really dont care if the hardware is going to suspend | 465 | /* We really dont care if the hardware is going to suspend |
466 | * the device since it's being resumed anyway */ | 466 | * the device since it's being resumed anyway */ |
467 | dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), | 467 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
468 | "%s: SCIC Remote Node Context 0x%p was " | 468 | "%s: SCIC Remote Node Context 0x%p was " |
469 | "suspeneded by hardware while being resumed.\n", | 469 | "suspeneded by hardware while being resumed.\n", |
470 | __func__, sci_rnc); | 470 | __func__, sci_rnc); |
@@ -568,9 +568,9 @@ enum sci_status sci_remote_node_context_suspend( | |||
568 | RNC_DEST_UNSPECIFIED; | 568 | RNC_DEST_UNSPECIFIED; |
569 | 569 | ||
570 | dev_dbg(scirdev_to_dev(idev), | 570 | dev_dbg(scirdev_to_dev(idev), |
571 | "%s: current state %d, current suspend_type %x dest state %d," | 571 | "%s: current state %s, current suspend_type %x dest state %d," |
572 | " arg suspend_reason %d, arg suspend_type %x", | 572 | " arg suspend_reason %d, arg suspend_type %x", |
573 | __func__, state, sci_rnc->suspend_type, | 573 | __func__, rnc_state_name(state), sci_rnc->suspend_type, |
574 | sci_rnc->destination_state, suspend_reason, | 574 | sci_rnc->destination_state, suspend_reason, |
575 | suspend_type); | 575 | suspend_type); |
576 | 576 | ||