Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254399
b: refs/heads/master
c: 037afc7
h: refs/heads/master
i:
  254397: c8fdf38
  254395: 29c3d75
  254391: f880d3e
  254383: 4a2570d
  254367: 1375e7e
  254335: db73d86
v: v3
  • Loading branch information
Dan Williams committed Jul 3, 2011
1 parent cc95a55 commit 7164e59
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 141 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed8a72d108bd951909b28fa4a89aad6489f414e1
refs/heads/master: 037afc7812e2b202fbc18218e6c0eff34dad36ed
54 changes: 25 additions & 29 deletions trunk/drivers/scsi/isci/core/scic_sds_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,24 +1513,19 @@ static void scic_sds_remote_device_stopped_state_enter(
* sets the starting state handlers, sets the device not ready, and posts the
* remote node context to the hardware. none
*/
static void scic_sds_remote_device_starting_state_enter(
struct sci_base_object *object)
static void scic_sds_remote_device_starting_state_enter(struct sci_base_object *object)
{
struct scic_sds_controller *scic;
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

scic = scic_sds_remote_device_get_controller(sci_dev);

SET_STATE_HANDLER(
sci_dev,
scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STARTING);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STARTING);

isci_remote_device_not_ready(
idev,
SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
}

static void scic_sds_remote_device_starting_state_exit(struct sci_base_object *object)
Expand All @@ -1556,14 +1551,13 @@ static void scic_sds_remote_device_starting_state_exit(struct sci_base_object *o
* This is the enter function for the SCI_BASE_REMOTE_DEVICE_STATE_READY it sets
* the ready state handlers, and starts the ready substate machine. none
*/
static void scic_sds_remote_device_ready_state_enter(
struct sci_base_object *object)
static void scic_sds_remote_device_ready_state_enter(struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
struct scic_sds_controller *scic
= scic_sds_remote_device_get_controller(sci_dev);

SET_STATE_HANDLER(sci_dev,
scic_sds_remote_device_state_handler_table,
Expand All @@ -1574,7 +1568,7 @@ static void scic_sds_remote_device_ready_state_enter(
if (sci_dev->has_ready_substate_machine)
sci_base_state_machine_start(&sci_dev->ready_substate_machine);
else
isci_remote_device_ready(idev);
isci_remote_device_ready(ihost, idev);
}

/**
Expand All @@ -1588,16 +1582,18 @@ static void scic_sds_remote_device_ready_state_enter(
static void scic_sds_remote_device_ready_state_exit(
struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
if (sci_dev->has_ready_substate_machine)
sci_base_state_machine_stop(&sci_dev->ready_substate_machine);
else
isci_remote_device_not_ready(
idev,
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
else {
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
}
}

/**
Expand Down
46 changes: 22 additions & 24 deletions trunk/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,19 @@ static const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_dev
* This function sets the ready cmd substate handlers and reports the device as
* ready. none
*/
static inline void scic_sds_smp_remote_device_ready_idle_substate_enter(
struct sci_base_object *object)
static void scic_sds_smp_remote_device_ready_idle_substate_enter(struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

SET_STATE_HANDLER(sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);

SET_STATE_HANDLER(
sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);

isci_remote_device_ready(idev);
isci_remote_device_ready(ihost, idev);
}

/**
Expand All @@ -281,20 +280,20 @@ static inline void scic_sds_smp_remote_device_ready_idle_substate_enter(
static void scic_sds_smp_remote_device_ready_cmd_substate_enter(
struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

BUG_ON(sci_dev->working_request == NULL);

SET_STATE_HANDLER(
sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
SET_STATE_HANDLER(sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD);

isci_remote_device_not_ready(
idev,
SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
}

/**
Expand All @@ -304,12 +303,11 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(
*
* This is the SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_CMD exit method. none
*/
static void scic_sds_smp_remote_device_ready_cmd_substate_exit(
struct sci_base_object *object)
static void scic_sds_smp_remote_device_ready_cmd_substate_exit(struct sci_base_object *object)
{
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;

this_device->working_request = NULL;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
sci_dev->working_request = NULL;
}

/* --------------------------------------------------------------------------- */
Expand Down
101 changes: 31 additions & 70 deletions trunk/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,13 @@ static const struct scic_sds_remote_device_state_handler scic_sds_stp_remote_dev
* * STP REMOTE DEVICE READY SUBSTATE PRIVATE METHODS
* ***************************************************************************** */

static inline void
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
void *user_cookie)
static void
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *user_cookie)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)user_cookie;
struct scic_sds_remote_device *sci_dev = user_cookie;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);

/*
* For NCQ operation we do not issue a
Expand All @@ -692,7 +692,7 @@ scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
*/
if (sci_dev->ready_substate_machine.previous_state_id !=
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ)
isci_remote_device_ready(idev);
isci_remote_device_ready(ihost, idev);
}

/*
Expand Down Expand Up @@ -737,87 +737,48 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(
}
}

/*
* *****************************************************************************
* * STP REMOTE DEVICE READY CMD SUBSTATE
* ***************************************************************************** */

/**
*
* @device: This is the SCI base object which is cast into a
* struct scic_sds_remote_device object.
*
*/
static inline void scic_sds_stp_remote_device_ready_cmd_substate_enter(
struct sci_base_object *device)
static void scic_sds_stp_remote_device_ready_cmd_substate_enter(struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)device;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

BUG_ON(sci_dev->working_request == NULL);

SET_STATE_HANDLER(
sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
SET_STATE_HANDLER(sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD);

isci_remote_device_not_ready(
idev,
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
}

/*
* *****************************************************************************
* * STP REMOTE DEVICE READY NCQ SUBSTATE
* ***************************************************************************** */

/**
*
* @device: This is the SCI base object which is cast into a
* struct scic_sds_remote_device object.
*
*/
static void scic_sds_stp_remote_device_ready_ncq_substate_enter(
struct sci_base_object *device)
static void scic_sds_stp_remote_device_ready_ncq_substate_enter(struct sci_base_object *object)
{
struct scic_sds_remote_device *this_device;

this_device = (struct scic_sds_remote_device *)device;

SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ
);
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
SET_STATE_HANDLER(sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ);
}

/*
* *****************************************************************************
* * STP REMOTE DEVICE READY NCQ ERROR SUBSTATE
* ***************************************************************************** */

/**
*
* @device: This is the SCI base object which is cast into a
* struct scic_sds_remote_device object.
*
*/
static inline void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
struct sci_base_object *device)
static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_object *object)
{
struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)device;
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent.parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);

SET_STATE_HANDLER(
sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR);
SET_STATE_HANDLER(sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR);

if (sci_dev->not_ready_reason ==
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
isci_remote_device_not_ready(idev, sci_dev->not_ready_reason);
isci_remote_device_not_ready(ihost, idev, sci_dev->not_ready_reason);
}

/*
Expand Down
22 changes: 10 additions & 12 deletions trunk/drivers/scsi/isci/remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,12 @@ isci_remote_device_alloc(struct isci_host *ihost, struct isci_port *iport)
* isci_remote_device_ready() - This function is called by the scic when the
* remote device is ready. We mark the isci device as ready and signal the
* waiting proccess.
* @idev: This parameter specifies the remote device
* @ihost: our valid isci_host
* @idev: remote device
*
*/
void isci_remote_device_ready(struct isci_remote_device *idev)
void isci_remote_device_ready(struct isci_host *ihost, struct isci_remote_device *idev)
{
struct isci_host *ihost = idev->isci_port->isci_host;

dev_dbg(&ihost->pdev->dev,
"%s: idev = %p\n", __func__, idev);

Expand All @@ -304,18 +303,17 @@ void isci_remote_device_ready(struct isci_remote_device *idev)
* @isci_device: This parameter specifies the remote device
*
*/
void isci_remote_device_not_ready(
struct isci_remote_device *isci_device,
u32 reason_code)
void isci_remote_device_not_ready(struct isci_host *ihost,
struct isci_remote_device *idev, u32 reason)
{
dev_dbg(&isci_device->isci_port->isci_host->pdev->dev,
"%s: isci_device = %p\n", __func__, isci_device);
dev_dbg(&ihost->pdev->dev,
"%s: isci_device = %p\n", __func__, idev);

if (reason_code == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED)
isci_remote_device_change_state(isci_device, isci_stopping);
if (reason == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED)
isci_remote_device_change_state(idev, isci_stopping);
else
/* device ready is actually a "not ready for io" state. */
isci_remote_device_change_state(isci_device, isci_ready);
isci_remote_device_change_state(idev, isci_ready);
}

/**
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/scsi/isci/remote_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,11 @@ enum sci_status isci_remote_device_stop(struct isci_host *ihost,
void isci_remote_device_nuke_requests(
struct isci_remote_device *isci_device);

void isci_remote_device_ready(
struct isci_remote_device *);
void isci_remote_device_ready(struct isci_host *ihost,
struct isci_remote_device *idev);

void isci_remote_device_not_ready(
struct isci_remote_device *,
u32);
void isci_remote_device_not_ready(struct isci_host *ihost,
struct isci_remote_device *idev, u32 reason);

void isci_remote_device_gone(
struct domain_device *domain_dev);
Expand Down

0 comments on commit 7164e59

Please sign in to comment.