Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254433
b: refs/heads/master
c: e1e72a0
h: refs/heads/master
i:
  254431: 2b50bbc
v: v3
  • Loading branch information
Maciej Patelczyk authored and Dan Williams committed Jul 3, 2011
1 parent a1f81bf commit ed76aec
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 69 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: d3757c3aeb75259e0b86a872e98841a2ea4cb5e8
refs/heads/master: e1e72a00dd9db0cd2b7d106916645626f53c0382
83 changes: 24 additions & 59 deletions trunk/drivers/scsi/isci/core/scic_sds_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,9 +1565,7 @@ static const struct scic_sds_phy_state_handler scic_sds_phy_starting_substate_ha
*/
static void scic_sds_phy_starting_initial_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_INITIAL);
Expand All @@ -1587,9 +1585,7 @@ static void scic_sds_phy_starting_initial_substate_enter(void *object)
*/
static void scic_sds_phy_starting_await_ossp_en_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_OSSP_EN
Expand All @@ -1607,9 +1603,7 @@ static void scic_sds_phy_starting_await_ossp_en_substate_enter(void *object)
static void scic_sds_phy_starting_await_sas_speed_en_substate_enter(
void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN
Expand All @@ -1626,9 +1620,7 @@ static void scic_sds_phy_starting_await_sas_speed_en_substate_enter(
*/
static void scic_sds_phy_starting_await_iaf_uf_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
Expand All @@ -1646,9 +1638,7 @@ static void scic_sds_phy_starting_await_iaf_uf_substate_enter(void *object)
*/
static void scic_sds_phy_starting_await_sas_power_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_POWER
Expand All @@ -1670,9 +1660,7 @@ static void scic_sds_phy_starting_await_sas_power_substate_enter(void *object)
*/
static void scic_sds_phy_starting_await_sas_power_substate_exit(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_controller_power_control_queue_remove(
scic_sds_phy_get_controller(sci_phy), sci_phy
Expand All @@ -1690,9 +1678,7 @@ static void scic_sds_phy_starting_await_sas_power_substate_exit(void *object)
*/
static void scic_sds_phy_starting_await_sata_power_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER
Expand All @@ -1714,9 +1700,7 @@ static void scic_sds_phy_starting_await_sata_power_substate_enter(void *object)
*/
static void scic_sds_phy_starting_await_sata_power_substate_exit(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_controller_power_control_queue_remove(
scic_sds_phy_get_controller(sci_phy),
Expand All @@ -1734,7 +1718,7 @@ static void scic_sds_phy_starting_await_sata_power_substate_exit(void *object)
*/
static void scic_sds_phy_starting_await_sata_phy_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy,
Expand All @@ -1756,7 +1740,7 @@ static void scic_sds_phy_starting_await_sata_phy_substate_enter(void *object)
static inline void scic_sds_phy_starting_await_sata_phy_substate_exit(
void *object)
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

isci_timer_stop(sci_phy->sata_timeout_timer);
}
Expand All @@ -1771,7 +1755,7 @@ static inline void scic_sds_phy_starting_await_sata_phy_substate_exit(
*/
static void scic_sds_phy_starting_await_sata_speed_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy,
Expand All @@ -1793,7 +1777,7 @@ static void scic_sds_phy_starting_await_sata_speed_substate_enter(void *object)
static inline void scic_sds_phy_starting_await_sata_speed_substate_exit(
void *object)
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

isci_timer_stop(sci_phy->sata_timeout_timer);
}
Expand All @@ -1811,7 +1795,7 @@ static inline void scic_sds_phy_starting_await_sata_speed_substate_exit(
static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(void *object)
{
bool continue_to_ready_state;
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(
sci_phy,
Expand Down Expand Up @@ -1848,9 +1832,7 @@ static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(void *object)
static inline void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(
void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

isci_timer_stop(sci_phy->sata_timeout_timer);
}
Expand All @@ -1866,9 +1848,7 @@ static inline void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(
*/
static void scic_sds_phy_starting_final_substate_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = container_of(object, typeof(*sci_phy), parent);
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_starting_substate_handlers(sci_phy,
SCIC_SDS_PHY_STARTING_SUBSTATE_FINAL);
Expand Down Expand Up @@ -2200,9 +2180,7 @@ static void scu_link_layer_tx_hard_reset(
*/
static void scic_sds_phy_initial_state_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_INITIAL);
}
Expand All @@ -2218,12 +2196,10 @@ static void scic_sds_phy_initial_state_enter(void *object)
*/
static void scic_sds_phy_stopped_state_enter(void *object)
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
struct isci_host *ihost = scic->ihost;

sci_phy = (struct scic_sds_phy *)object;

/*
* @todo We need to get to the controller to place this PE in a
* reset state
Expand Down Expand Up @@ -2262,9 +2238,7 @@ static void scic_sds_phy_stopped_state_enter(void *object)
*/
static void scic_sds_phy_starting_state_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_STARTING);

Expand Down Expand Up @@ -2300,9 +2274,7 @@ static void scic_sds_phy_starting_state_enter(void *object)
*/
static void scic_sds_phy_ready_state_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_READY);

Expand All @@ -2323,9 +2295,7 @@ static void scic_sds_phy_ready_state_enter(void *object)
*/
static void scic_sds_phy_ready_state_exit(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_suspend(sci_phy);
}
Expand All @@ -2340,9 +2310,7 @@ static void scic_sds_phy_ready_state_exit(void *object)
*/
static void scic_sds_phy_resetting_state_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_RESETTING);

Expand Down Expand Up @@ -2375,9 +2343,7 @@ static void scic_sds_phy_resetting_state_enter(void *object)
*/
static void scic_sds_phy_final_state_enter(void *object)
{
struct scic_sds_phy *sci_phy;

sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_phy *sci_phy = object;

scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_FINAL);

Expand Down Expand Up @@ -2412,9 +2378,8 @@ void scic_sds_phy_construct(struct scic_sds_phy *sci_phy,
struct scic_sds_port *owning_port, u8 phy_index)
{

sci_phy->parent.private = NULL;
sci_base_state_machine_construct(&sci_phy->state_machine,
&sci_phy->parent,
sci_phy,
scic_sds_phy_state_table,
SCI_BASE_PHY_STATE_INITIAL);

Expand All @@ -2434,7 +2399,7 @@ void scic_sds_phy_construct(struct scic_sds_phy *sci_phy,

/* Initialize the the substate machines */
sci_base_state_machine_construct(&sci_phy->starting_substate_machine,
&sci_phy->parent,
sci_phy,
scic_sds_phy_starting_substates,
SCIC_SDS_PHY_STARTING_SUBSTATE_INITIAL);
}
5 changes: 3 additions & 2 deletions trunk/drivers/scsi/isci/core/scic_sds_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ enum scic_sds_phy_protocol {
SCIC_SDS_MAX_PHY_PROTOCOLS
};

struct isci_phy;
/**
* struct scic_sds_phy - This structure contains or references all of the data
* necessary to represent the core phy object and SCU harware protocol
Expand All @@ -226,9 +227,9 @@ enum scic_sds_phy_protocol {
*/
struct scic_sds_phy {
/**
* This field depicts the parent object (struct sci_base_object) for the phy.
* This field depicts the peer object for the phy.
*/
struct sci_base_object parent;
struct isci_phy *iphy;

/**
* This field contains the information for the base phy state machine.
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/isci/core/scic_sds_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
struct isci_port *iport = sci_object_get_association(sci_port);
struct isci_host *ihost = scic->ihost;
struct isci_phy *iphy = sci_object_get_association(sci_phy);
struct isci_phy *iphy = sci_phy->iphy;

sci_port->active_phy_mask &= ~(1 << sci_phy->phy_index);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/isci/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "phy.h"
#include "scic_port.h"
#include "scic_config_parameters.h"
#include "core/scic_sds_phy.h"

struct scic_sds_phy;
extern enum sci_status scic_sds_phy_start(struct scic_sds_phy *sci_phy);
Expand Down Expand Up @@ -88,8 +89,8 @@ void isci_phy_init(

status = scic_controller_get_phy_handle(scic, index, &scic_phy);
if (status == SCI_SUCCESS) {
sci_object_set_association(scic_phy, (void *)phy);
phy->sci_phy_handle = scic_phy;
scic_phy->iphy = phy;
} else
dev_err(&isci_host->pdev->dev,
"failed scic_controller_get_phy_handle\n");
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/scsi/isci/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ void isci_port_bc_change_received(
struct scic_sds_port *port,
struct scic_sds_phy *phy)
{
struct isci_phy *isci_phy =
(struct isci_phy *)sci_object_get_association(phy);
struct isci_phy *isci_phy = phy->iphy;

dev_dbg(&isci_host->pdev->dev,
"%s: isci_phy = %p, sas_phy = %p\n",
Expand Down Expand Up @@ -170,10 +169,9 @@ void isci_port_link_up(
{
unsigned long flags;
struct scic_port_properties properties;
struct isci_phy *isci_phy
= (struct isci_phy *)sci_object_get_association(phy);
struct isci_port *isci_port
= (struct isci_port *)sci_object_get_association(port);
struct isci_phy *isci_phy = phy->iphy;
enum sci_status call_status;
unsigned long success = true;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/isci/sci_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static inline struct device *scic_to_dev(struct scic_sds_controller *scic)

static inline struct device *sciphy_to_dev(struct scic_sds_phy *sci_phy)
{
struct isci_phy *iphy = sci_object_get_association(sci_phy);
struct isci_phy *iphy = sci_phy->iphy;

if (!iphy || !iphy->isci_port || !iphy->isci_port->isci_host)
return NULL;
Expand Down

0 comments on commit ed76aec

Please sign in to comment.