Archived
14
0
Fork 0

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>
This commit is contained in:
Jeff Skirvin 2012-03-08 22:41:59 -08:00 committed by Dan Williams
parent e3c84dfdb8
commit 447bfbcee0
4 changed files with 12 additions and 18 deletions

View file

@ -75,10 +75,8 @@ const char *dev_state_name(enum sci_remote_device_states state)
static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev, static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev,
enum sci_remote_node_suspension_reasons reason) enum sci_remote_node_suspension_reasons reason)
{ {
return sci_remote_node_context_suspend(&idev->rnc, return sci_remote_node_context_suspend(&idev->rnc, reason,
reason, SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT);
SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT,
NULL, NULL);
} }
/** /**

View file

@ -315,8 +315,8 @@ static void sci_remote_node_context_ready_state_enter(struct sci_base_state_mach
if ((dest_select == RNC_DEST_SUSPENDED) || if ((dest_select == RNC_DEST_SUSPENDED) ||
(dest_select == RNC_DEST_SUSPENDED_RESUME)) { (dest_select == RNC_DEST_SUSPENDED_RESUME)) {
sci_remote_node_context_suspend( sci_remote_node_context_suspend(
rnc, SCI_SW_SUSPEND_NORMAL, rnc, rnc->suspend_reason,
SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, NULL, NULL); SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT);
if (dest_select == RNC_DEST_SUSPENDED_RESUME) { if (dest_select == RNC_DEST_SUSPENDED_RESUME) {
sci_remote_node_context_resume(rnc, usr_cb, usr_param); 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
enum sci_status sci_remote_node_context_suspend( enum sci_status sci_remote_node_context_suspend(
struct sci_remote_node_context *sci_rnc, struct sci_remote_node_context *sci_rnc,
enum sci_remote_node_suspension_reasons suspend_reason, enum sci_remote_node_suspension_reasons suspend_reason,
u32 suspend_type, u32 suspend_type)
scics_sds_remote_node_context_callback cb_fn,
void *cb_p)
{ {
enum scis_sds_remote_node_context_states state enum scis_sds_remote_node_context_states state
= sci_rnc->sm.current_state_id; = sci_rnc->sm.current_state_id;
@ -581,6 +579,8 @@ enum sci_status sci_remote_node_context_suspend(
* needs to be done immediately. * needs to be done immediately.
*/ */
sci_rnc->destination_state = RNC_DEST_SUSPENDED; sci_rnc->destination_state = RNC_DEST_SUSPENDED;
sci_rnc->suspend_type = suspend_type;
sci_rnc->suspend_reason = suspend_reason;
return SCI_SUCCESS; return SCI_SUCCESS;
case SCI_RNC_TX_SUSPENDED: case SCI_RNC_TX_SUSPENDED:
@ -603,14 +603,12 @@ enum sci_status sci_remote_node_context_suspend(
return SCI_FAILURE_INVALID_STATE; return SCI_FAILURE_INVALID_STATE;
} }
sci_rnc->destination_state = dest_param; sci_rnc->destination_state = dest_param;
sci_rnc->user_callback = cb_fn;
sci_rnc->user_cookie = cb_p;
sci_rnc->suspend_type = suspend_type; sci_rnc->suspend_type = suspend_type;
sci_rnc->suspend_reason = suspend_reason;
if (status == SCI_SUCCESS) { /* Already in the destination state? */ if (status == SCI_SUCCESS) { /* Already in the destination state? */
struct isci_host *ihost = idev->owning_port->owning_controller; struct isci_host *ihost = idev->owning_port->owning_controller;
sci_remote_node_context_notify_user(sci_rnc);
wake_up_all(&ihost->eventq); /* Let observers look. */ wake_up_all(&ihost->eventq); /* Let observers look. */
return SCI_SUCCESS; return SCI_SUCCESS;
} }

View file

@ -169,6 +169,7 @@ struct sci_remote_node_context {
* context suspension. * context suspension.
*/ */
u32 suspend_type; u32 suspend_type;
enum sci_remote_node_suspension_reasons suspend_reason;
/** /**
* This field is true if the remote node context is resuming from its current * 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
void *callback_parameter); void *callback_parameter);
enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc,
u32 suspend_type, u32 suspend_type,
u32 suspension_code, u32 suspension_code);
scics_sds_remote_node_context_callback cb_fn,
void *cb_p);
enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc,
scics_sds_remote_node_context_callback cb_fn, scics_sds_remote_node_context_callback cb_fn,
void *cb_p); void *cb_p);

View file

@ -2382,8 +2382,7 @@ static void sci_request_handle_suspending_completions(
&ireq->target_device->rnc, &ireq->target_device->rnc,
SCI_HW_SUSPEND, SCI_HW_SUSPEND,
(is_tx_rx) ? SCU_EVENT_TL_RNC_SUSPEND_TX_RX (is_tx_rx) ? SCU_EVENT_TL_RNC_SUSPEND_TX_RX
: SCU_EVENT_TL_RNC_SUSPEND_TX, : SCU_EVENT_TL_RNC_SUSPEND_TX);
NULL, NULL);
} }
} }