diff options
author | Adam Gruchala <adam.gruchala@intel.com> | 2011-05-10 23:54:23 +0000 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:04:48 -0700 |
commit | 4a33c525f0e94b57602abd1e43644cbf6f5418f4 (patch) | |
tree | 4f42dccac26c36af150322c6b7e152d31efe4aa1 /drivers/scsi/isci/host.c | |
parent | 79e2b6b27699c916e3c7cda18a26d47fea6017fb (diff) | |
download | kernel_goldelico_gta04-4a33c525f0e94b57602abd1e43644cbf6f5418f4.zip kernel_goldelico_gta04-4a33c525f0e94b57602abd1e43644cbf6f5418f4.tar.gz kernel_goldelico_gta04-4a33c525f0e94b57602abd1e43644cbf6f5418f4.tar.bz2 |
isci: merge phy substates
Merged states and substates into one state machine, as we always
unconditionally transitioned to the substate machine it was straightforward to
enter that substate from the starting state.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Adam Gruchala <adam.gruchala@intel.com>
[fixed construction, starting_state_enter, and starting check]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r-- | drivers/scsi/isci/host.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 2bb9f10..675eddd 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c @@ -932,6 +932,28 @@ static void scic_sds_controller_phy_timer_start(struct scic_sds_controller *scic scic->phy_startup_timer_pending = true; } +static bool is_phy_starting(struct scic_sds_phy *sci_phy) +{ + enum scic_sds_phy_states state; + + state = sci_phy->state_machine.current_state_id; + switch (state) { + case SCI_BASE_PHY_STATE_STARTING: + case SCIC_SDS_PHY_STARTING_SUBSTATE_INITIAL: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_POWER: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN: + case SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF: + case SCIC_SDS_PHY_STARTING_SUBSTATE_FINAL: + return true; + default: + return false; + } +} + /** * scic_sds_controller_start_next_phy - start phy * @scic: controller @@ -975,7 +997,7 @@ static enum sci_status scic_sds_controller_start_next_phy(struct scic_sds_contro (sci_phy->is_in_link_training == false && state == SCI_BASE_PHY_STATE_STOPPED) || (sci_phy->is_in_link_training == true && - state == SCI_BASE_PHY_STATE_STARTING)) { + is_phy_starting(sci_phy))) { is_controller_start_complete = false; break; } |