diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2012-03-09 01:41:59 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-05-17 17:33:40 -0400 |
commit | 447bfbcee070a0b43dd6abc743063d7a02fe65ca (patch) | |
tree | 7431e8eaadc2112795fcc7e3ba6a355bc1fafad9 /drivers/scsi | |
parent | e3c84dfdb8f4c675b0ba5cf3fa252dc4056b7ddd (diff) |
isci: Save the suspension hint for upcoming suspensions.
In the case of a suspend call while in SCI_RNC_POSTING or INVALIDATING
states, the LLHANG detect needed to be saved so the upcoming suspension
would enable it correctly. The unused suspend callback parameters were
removed.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 6 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_node_context.c | 16 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_node_context.h | 5 | ||||
-rw-r--r-- | drivers/scsi/isci/request.c | 3 |
4 files changed, 12 insertions, 18 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index cc8ab69a2022..1a85e9edef6a 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -75,10 +75,8 @@ const char *dev_state_name(enum sci_remote_device_states state) | |||
75 | static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev, | 75 | static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev, |
76 | enum sci_remote_node_suspension_reasons reason) | 76 | enum sci_remote_node_suspension_reasons reason) |
77 | { | 77 | { |
78 | return sci_remote_node_context_suspend(&idev->rnc, | 78 | return sci_remote_node_context_suspend(&idev->rnc, reason, |
79 | reason, | 79 | SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT); |
80 | SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, | ||
81 | NULL, NULL); | ||
82 | } | 80 | } |
83 | 81 | ||
84 | /** | 82 | /** |
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c index 85bf5ec26417..2ac92608cc2d 100644 --- a/drivers/scsi/isci/remote_node_context.c +++ b/drivers/scsi/isci/remote_node_context.c | |||
@@ -315,8 +315,8 @@ static void sci_remote_node_context_ready_state_enter(struct sci_base_state_mach | |||
315 | if ((dest_select == RNC_DEST_SUSPENDED) || | 315 | if ((dest_select == RNC_DEST_SUSPENDED) || |
316 | (dest_select == RNC_DEST_SUSPENDED_RESUME)) { | 316 | (dest_select == RNC_DEST_SUSPENDED_RESUME)) { |
317 | sci_remote_node_context_suspend( | 317 | sci_remote_node_context_suspend( |
318 | rnc, SCI_SW_SUSPEND_NORMAL, | 318 | rnc, rnc->suspend_reason, |
319 | SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, NULL, NULL); | 319 | SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT); |
320 | 320 | ||
321 | if (dest_select == RNC_DEST_SUSPENDED_RESUME) { | 321 | if (dest_select == RNC_DEST_SUSPENDED_RESUME) { |
322 | sci_remote_node_context_resume(rnc, usr_cb, usr_param); | 322 | sci_remote_node_context_resume(rnc, usr_cb, usr_param); |
@@ -539,9 +539,7 @@ enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context | |||
539 | enum sci_status sci_remote_node_context_suspend( | 539 | enum sci_status sci_remote_node_context_suspend( |
540 | struct sci_remote_node_context *sci_rnc, | 540 | struct sci_remote_node_context *sci_rnc, |
541 | enum sci_remote_node_suspension_reasons suspend_reason, | 541 | enum sci_remote_node_suspension_reasons suspend_reason, |
542 | u32 suspend_type, | 542 | u32 suspend_type) |
543 | scics_sds_remote_node_context_callback cb_fn, | ||
544 | void *cb_p) | ||
545 | { | 543 | { |
546 | enum scis_sds_remote_node_context_states state | 544 | enum scis_sds_remote_node_context_states state |
547 | = sci_rnc->sm.current_state_id; | 545 | = sci_rnc->sm.current_state_id; |
@@ -581,6 +579,8 @@ enum sci_status sci_remote_node_context_suspend( | |||
581 | * needs to be done immediately. | 579 | * needs to be done immediately. |
582 | */ | 580 | */ |
583 | sci_rnc->destination_state = RNC_DEST_SUSPENDED; | 581 | sci_rnc->destination_state = RNC_DEST_SUSPENDED; |
582 | sci_rnc->suspend_type = suspend_type; | ||
583 | sci_rnc->suspend_reason = suspend_reason; | ||
584 | return SCI_SUCCESS; | 584 | return SCI_SUCCESS; |
585 | 585 | ||
586 | case SCI_RNC_TX_SUSPENDED: | 586 | case SCI_RNC_TX_SUSPENDED: |
@@ -603,14 +603,12 @@ enum sci_status sci_remote_node_context_suspend( | |||
603 | return SCI_FAILURE_INVALID_STATE; | 603 | return SCI_FAILURE_INVALID_STATE; |
604 | } | 604 | } |
605 | sci_rnc->destination_state = dest_param; | 605 | sci_rnc->destination_state = dest_param; |
606 | sci_rnc->user_callback = cb_fn; | 606 | sci_rnc->suspend_type = suspend_type; |
607 | sci_rnc->user_cookie = cb_p; | 607 | sci_rnc->suspend_reason = suspend_reason; |
608 | sci_rnc->suspend_type = suspend_type; | ||
609 | 608 | ||
610 | if (status == SCI_SUCCESS) { /* Already in the destination state? */ | 609 | if (status == SCI_SUCCESS) { /* Already in the destination state? */ |
611 | struct isci_host *ihost = idev->owning_port->owning_controller; | 610 | struct isci_host *ihost = idev->owning_port->owning_controller; |
612 | 611 | ||
613 | sci_remote_node_context_notify_user(sci_rnc); | ||
614 | wake_up_all(&ihost->eventq); /* Let observers look. */ | 612 | wake_up_all(&ihost->eventq); /* Let observers look. */ |
615 | return SCI_SUCCESS; | 613 | return SCI_SUCCESS; |
616 | } | 614 | } |
diff --git a/drivers/scsi/isci/remote_node_context.h b/drivers/scsi/isci/remote_node_context.h index 364da3722aa4..9eee304fdf9a 100644 --- a/drivers/scsi/isci/remote_node_context.h +++ b/drivers/scsi/isci/remote_node_context.h | |||
@@ -169,6 +169,7 @@ struct sci_remote_node_context { | |||
169 | * context suspension. | 169 | * context suspension. |
170 | */ | 170 | */ |
171 | u32 suspend_type; | 171 | u32 suspend_type; |
172 | enum sci_remote_node_suspension_reasons suspend_reason; | ||
172 | 173 | ||
173 | /** | 174 | /** |
174 | * This field is true if the remote node context is resuming from its current | 175 | * This field is true if the remote node context is resuming from its current |
@@ -209,9 +210,7 @@ enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context | |||
209 | void *callback_parameter); | 210 | void *callback_parameter); |
210 | enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, | 211 | enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, |
211 | u32 suspend_type, | 212 | u32 suspend_type, |
212 | u32 suspension_code, | 213 | u32 suspension_code); |
213 | scics_sds_remote_node_context_callback cb_fn, | ||
214 | void *cb_p); | ||
215 | enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, | 214 | enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, |
216 | scics_sds_remote_node_context_callback cb_fn, | 215 | scics_sds_remote_node_context_callback cb_fn, |
217 | void *cb_p); | 216 | void *cb_p); |
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index 809d3683d0c9..432585b04dc2 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
@@ -2382,8 +2382,7 @@ static void sci_request_handle_suspending_completions( | |||
2382 | &ireq->target_device->rnc, | 2382 | &ireq->target_device->rnc, |
2383 | SCI_HW_SUSPEND, | 2383 | SCI_HW_SUSPEND, |
2384 | (is_tx_rx) ? SCU_EVENT_TL_RNC_SUSPEND_TX_RX | 2384 | (is_tx_rx) ? SCU_EVENT_TL_RNC_SUSPEND_TX_RX |
2385 | : SCU_EVENT_TL_RNC_SUSPEND_TX, | 2385 | : SCU_EVENT_TL_RNC_SUSPEND_TX); |
2386 | NULL, NULL); | ||
2387 | } | 2386 | } |
2388 | } | 2387 | } |
2389 | 2388 | ||