Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7a0ccdd authored by Dan Williams's avatar Dan Williams Committed by James Bottomley
Browse files

[SCSI] isci: debug, provide state-enum-to-string conversions



Debugging the driver requires tracing the state transtions and tracing
state names is less work than decoding numbers.

Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 16d3db1b
Loading
Loading
Loading
Loading
+22 −12
Original line number Original line Diff line number Diff line
@@ -59,6 +59,16 @@
#include "scu_event_codes.h"
#include "scu_event_codes.h"
#include "probe_roms.h"
#include "probe_roms.h"


#undef C
#define C(a) (#a)
static const char *phy_state_name(enum sci_phy_states state)
{
	static const char * const strings[] = PHY_STATES;

	return strings[state];
}
#undef C

/* Maximum arbitration wait time in micro-seconds */
/* Maximum arbitration wait time in micro-seconds */
#define SCIC_SDS_PHY_MAX_ARBITRATION_WAIT_TIME  (700)
#define SCIC_SDS_PHY_MAX_ARBITRATION_WAIT_TIME  (700)


@@ -454,8 +464,8 @@ enum sci_status sci_phy_start(struct isci_phy *iphy)
	enum sci_phy_states state = iphy->sm.current_state_id;
	enum sci_phy_states state = iphy->sm.current_state_id;


	if (state != SCI_PHY_STOPPED) {
	if (state != SCI_PHY_STOPPED) {
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -480,8 +490,8 @@ enum sci_status sci_phy_stop(struct isci_phy *iphy)
	case SCI_PHY_READY:
	case SCI_PHY_READY:
		break;
		break;
	default:
	default:
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			"%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -494,8 +504,8 @@ enum sci_status sci_phy_reset(struct isci_phy *iphy)
	enum sci_phy_states state = iphy->sm.current_state_id;
	enum sci_phy_states state = iphy->sm.current_state_id;


	if (state != SCI_PHY_READY) {
	if (state != SCI_PHY_READY) {
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			"%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -544,8 +554,8 @@ enum sci_status sci_phy_consume_power_handler(struct isci_phy *iphy)
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	}
	}
	default:
	default:
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			"%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -870,8 +880,8 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
		}
		}
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			"%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -964,8 +974,8 @@ enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index)
		return result;
		return result;
	}
	}
	default:
	default:
		dev_dbg(sciphy_to_dev(iphy),
		dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n",
			"%s: in wrong state: %d\n", __func__, state);
			__func__, phy_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


+59 −95
Original line number Original line Diff line number Diff line
@@ -343,101 +343,65 @@ enum sci_phy_counter_id {
	SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
	SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
};
};


enum sci_phy_states {
/**
/**
	 * Simply the initial state for the base domain state machine.
 * enum sci_phy_states - phy state machine states
	 */
 * @SCI_PHY_INITIAL: Simply the initial state for the base domain state
	SCI_PHY_INITIAL,
 *		     machine.

 * @SCI_PHY_STOPPED: phy has successfully been stopped.  In this state
	/**
 *		     no new IO operations are permitted on this phy.
	 * This state indicates that the phy has successfully been stopped.
 * @SCI_PHY_STARTING: the phy is in the process of becomming ready.  In
	 * In this state no new IO operations are permitted on this phy.
 *		      this state no new IO operations are permitted on
	 * This state is entered from the INITIAL state.
 *		      this phy.
	 * This state is entered from the STARTING state.
 * @SCI_PHY_SUB_INITIAL: Initial state
	 * This state is entered from the READY state.
 * @SCI_PHY_SUB_AWAIT_OSSP_EN: Wait state for the hardware OSSP event
	 * This state is entered from the RESETTING state.
 *			       type notification
	 */
 * @SCI_PHY_SUB_AWAIT_SAS_SPEED_EN: Wait state for the PHY speed
	SCI_PHY_STOPPED,
 *				    notification

 * @SCI_PHY_SUB_AWAIT_IAF_UF: Wait state for the IAF Unsolicited frame
	/**
 *			      notification
	 * This state indicates that the phy is in the process of becomming
 * @SCI_PHY_SUB_AWAIT_SAS_POWER: Wait state for the request to consume
	 * ready.  In this state no new IO operations are permitted on this phy.
 *				 power
	 * This state is entered from the STOPPED state.
 * @SCI_PHY_SUB_AWAIT_SATA_POWER: Wait state for request to consume
	 * This state is entered from the READY state.
 *				  power
	 * This state is entered from the RESETTING state.
 * @SCI_PHY_SUB_AWAIT_SATA_PHY_EN: Wait state for the SATA PHY
	 */
 *				   notification
	SCI_PHY_STARTING,
 * @SCI_PHY_SUB_AWAIT_SATA_SPEED_EN: Wait for the SATA PHY speed

 *				     notification
	/**
 * @SCI_PHY_SUB_AWAIT_SIG_FIS_UF: Wait state for the SIGNATURE FIS
	 * Initial state
 *				  unsolicited frame notification
	 */
 * @SCI_PHY_SUB_FINAL: Exit state for this state machine
	SCI_PHY_SUB_INITIAL,
 * @SCI_PHY_READY: phy is now ready.  Thus, the user is able to perform

 *		   IO operations utilizing this phy as long as it is
	/**
 *		   currently part of a valid port.  This state is
	 * Wait state for the hardware OSSP event type notification
 *		   entered from the STARTING state.
	 */
 * @SCI_PHY_RESETTING: phy is in the process of being reset.  In this
	SCI_PHY_SUB_AWAIT_OSSP_EN,
 *		       state no new IO operations are permitted on this

 *		       phy.  This state is entered from the READY state.
	/**
 * @SCI_PHY_FINAL: Simply the final state for the base phy state
	 * Wait state for the PHY speed notification
 *		   machine.
	 */
	SCI_PHY_SUB_AWAIT_SAS_SPEED_EN,

	/**
	 * Wait state for the IAF Unsolicited frame notification
	 */
	SCI_PHY_SUB_AWAIT_IAF_UF,

	/**
	 * Wait state for the request to consume power
	 */
	SCI_PHY_SUB_AWAIT_SAS_POWER,

	/**
	 * Wait state for request to consume power
	 */
	SCI_PHY_SUB_AWAIT_SATA_POWER,

	/**
	 * Wait state for the SATA PHY notification
	 */
	SCI_PHY_SUB_AWAIT_SATA_PHY_EN,

	/**
	 * Wait for the SATA PHY speed notification
	 */
	SCI_PHY_SUB_AWAIT_SATA_SPEED_EN,

	/**
	 * Wait state for the SIGNATURE FIS unsolicited frame notification
	 */
	SCI_PHY_SUB_AWAIT_SIG_FIS_UF,

	/**
	 * Exit state for this state machine
	 */
	SCI_PHY_SUB_FINAL,

	/**
	 * This state indicates the the phy is now ready.  Thus, the user
	 * is able to perform IO operations utilizing this phy as long as it
	 * is currently part of a valid port.
	 * This state is entered from the STARTING state.
	 */
	SCI_PHY_READY,

	/**
	 * This state indicates that the phy is in the process of being reset.
	 * In this state no new IO operations are permitted on this phy.
	 * This state is entered from the READY state.
	 */
	SCI_PHY_RESETTING,

	/**
	 * Simply the final state for the base phy state machine.
 */
 */
	SCI_PHY_FINAL,
#define PHY_STATES {\
};
	C(PHY_INITIAL),\
	C(PHY_STOPPED),\
	C(PHY_STARTING),\
	C(PHY_SUB_INITIAL),\
	C(PHY_SUB_AWAIT_OSSP_EN),\
	C(PHY_SUB_AWAIT_SAS_SPEED_EN),\
	C(PHY_SUB_AWAIT_IAF_UF),\
	C(PHY_SUB_AWAIT_SAS_POWER),\
	C(PHY_SUB_AWAIT_SATA_POWER),\
	C(PHY_SUB_AWAIT_SATA_PHY_EN),\
	C(PHY_SUB_AWAIT_SATA_SPEED_EN),\
	C(PHY_SUB_AWAIT_SIG_FIS_UF),\
	C(PHY_SUB_FINAL),\
	C(PHY_READY),\
	C(PHY_RESETTING),\
	C(PHY_FINAL),\
	}
#undef C
#define C(a) SCI_##a
enum sci_phy_states PHY_STATES;
#undef C


void sci_phy_construct(
void sci_phy_construct(
	struct isci_phy *iphy,
	struct isci_phy *iphy,
+28 −18
Original line number Original line Diff line number Diff line
@@ -60,6 +60,16 @@
#define SCIC_SDS_PORT_HARD_RESET_TIMEOUT  (1000)
#define SCIC_SDS_PORT_HARD_RESET_TIMEOUT  (1000)
#define SCU_DUMMY_INDEX    (0xFFFF)
#define SCU_DUMMY_INDEX    (0xFFFF)


#undef C
#define C(a) (#a)
const char *port_state_name(enum sci_port_states state)
{
	static const char * const strings[] = PORT_STATES;

	return strings[state];
}
#undef C

static struct device *sciport_to_dev(struct isci_port *iport)
static struct device *sciport_to_dev(struct isci_port *iport)
{
{
	int i = iport->physical_port_index;
	int i = iport->physical_port_index;
@@ -1054,8 +1064,8 @@ enum sci_status sci_port_start(struct isci_port *iport)


	state = iport->sm.current_state_id;
	state = iport->sm.current_state_id;
	if (state != SCI_PORT_STOPPED) {
	if (state != SCI_PORT_STOPPED) {
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -1129,8 +1139,8 @@ enum sci_status sci_port_stop(struct isci_port *iport)
					  SCI_PORT_STOPPING);
					  SCI_PORT_STOPPING);
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1144,8 +1154,8 @@ static enum sci_status sci_port_hard_reset(struct isci_port *iport, u32 timeout)


	state = iport->sm.current_state_id;
	state = iport->sm.current_state_id;
	if (state != SCI_PORT_SUB_OPERATIONAL) {
	if (state != SCI_PORT_SUB_OPERATIONAL) {
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -1239,8 +1249,8 @@ enum sci_status sci_port_add_phy(struct isci_port *iport,
					  SCI_PORT_SUB_CONFIGURING);
					  SCI_PORT_SUB_CONFIGURING);
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1289,8 +1299,8 @@ enum sci_status sci_port_remove_phy(struct isci_port *iport,
					  SCI_PORT_SUB_CONFIGURING);
					  SCI_PORT_SUB_CONFIGURING);
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1332,8 +1342,8 @@ enum sci_status sci_port_link_up(struct isci_port *iport,
		sci_port_general_link_up_handler(iport, iphy, PF_RESUME);
		sci_port_general_link_up_handler(iport, iphy, PF_RESUME);
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1362,8 +1372,8 @@ enum sci_status sci_port_link_down(struct isci_port *iport,
		sci_port_deactivate_phy(iport, iphy, false);
		sci_port_deactivate_phy(iport, iphy, false);
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1382,8 +1392,8 @@ enum sci_status sci_port_start_io(struct isci_port *iport,
		iport->started_request_count++;
		iport->started_request_count++;
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	default:
	default:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}
}
}
@@ -1397,8 +1407,8 @@ enum sci_status sci_port_complete_io(struct isci_port *iport,
	state = iport->sm.current_state_id;
	state = iport->sm.current_state_id;
	switch (state) {
	switch (state) {
	case SCI_PORT_STOPPED:
	case SCI_PORT_STOPPED:
		dev_warn(sciport_to_dev(iport),
		dev_warn(sciport_to_dev(iport), "%s: in wrong state: %s\n",
			 "%s: in wrong state: %d\n", __func__, state);
			 __func__, port_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_PORT_STOPPING:
	case SCI_PORT_STOPPING:
		sci_port_decrement_request_count(iport);
		sci_port_decrement_request_count(iport);
+40 −63
Original line number Original line Diff line number Diff line
@@ -144,70 +144,47 @@ struct sci_port_properties {
};
};


/**
/**
 * enum sci_port_states - This enumeration depicts all the states for the
 * enum sci_port_states - port state machine states
 *    common port state machine.
 * @SCI_PORT_STOPPED: port has successfully been stopped.  In this state
 *
 *		      no new IO operations are permitted.  This state is
 *
 *		      entered from the STOPPING state.
 */
 * @SCI_PORT_STOPPING: port is in the process of stopping.  In this
enum sci_port_states {
 *		       state no new IO operations are permitted, but
	/**
 *		       existing IO operations are allowed to complete.
	 * This state indicates that the port has successfully been stopped.
	 * In this state no new IO operations are permitted.
	 * This state is entered from the STOPPING state.
	 */
	SCI_PORT_STOPPED,

	/**
	 * This state indicates that the port is in the process of stopping.
	 * In this state no new IO operations are permitted, but existing IO
	 * operations are allowed to complete.
	 * This state is entered from the READY state.
	 */
	SCI_PORT_STOPPING,

	/**
	 * This state indicates the port is now ready.  Thus, the user is
	 * able to perform IO operations on this port.
	 * This state is entered from the STARTING state.
	 */
	SCI_PORT_READY,

	/**
	 * The substate where the port is started and ready but has no
	 * active phys.
	 */
	SCI_PORT_SUB_WAITING,

	/**
	 * The substate where the port is started and ready and there is
	 * at least one phy operational.
	 */
	SCI_PORT_SUB_OPERATIONAL,

	/**
	 * The substate where the port is started and there was an
	 * add/remove phy event.  This state is only used in Automatic
	 * Port Configuration Mode (APC)
	 */
	SCI_PORT_SUB_CONFIGURING,

	/**
	 * This state indicates the port is in the process of performing a hard
	 * reset.  Thus, the user is unable to perform IO operations on this
	 * port.
 *		       This state is entered from the READY state.
 *		       This state is entered from the READY state.
 * @SCI_PORT_READY: port is now ready.  Thus, the user is able to
 *		    perform IO operations on this port. This state is
 *		    entered from the STARTING state.
 * @SCI_PORT_SUB_WAITING: port is started and ready but has no active
 *			  phys.
 * @SCI_PORT_SUB_OPERATIONAL: port is started and ready and there is at
 *			      least one phy operational.
 * @SCI_PORT_SUB_CONFIGURING: port is started and there was an
 *			      add/remove phy event.  This state is only
 *			      used in Automatic Port Configuration Mode
 *			      (APC)
 * @SCI_PORT_RESETTING: port is in the process of performing a hard
 *			reset.  Thus, the user is unable to perform IO
 *			operations on this port.  This state is entered
 *			from the READY state.
 * @SCI_PORT_FAILED: port has failed a reset request.  This state is
 *		     entered when a port reset request times out. This
 *		     state is entered from the RESETTING state.
 */
 */
	SCI_PORT_RESETTING,
#define PORT_STATES {\

	C(PORT_STOPPED),\
	/**
	C(PORT_STOPPING),\
	 * This state indicates the port has failed a reset request.  This state
	C(PORT_READY),\
	 * is entered when a port reset request times out.
	C(PORT_SUB_WAITING),\
	 * This state is entered from the RESETTING state.
	C(PORT_SUB_OPERATIONAL),\
	 */
	C(PORT_SUB_CONFIGURING),\
	SCI_PORT_FAILED,
	C(PORT_RESETTING),\

	C(PORT_FAILED),\

	}
};
#undef C
#define C(a) SCI_##a
enum sci_port_states PORT_STATES;
#undef C


static inline void sci_port_decrement_request_count(struct isci_port *iport)
static inline void sci_port_decrement_request_count(struct isci_port *iport)
{
{
+30 −20
Original line number Original line Diff line number Diff line
@@ -62,6 +62,16 @@
#include "scu_event_codes.h"
#include "scu_event_codes.h"
#include "task.h"
#include "task.h"


#undef C
#define C(a) (#a)
const char *dev_state_name(enum sci_remote_device_states state)
{
	static const char * const strings[] = REMOTE_DEV_STATES;

	return strings[state];
}
#undef C

/**
/**
 * isci_remote_device_not_ready() - This function is called by the ihost when
 * isci_remote_device_not_ready() - This function is called by the ihost when
 *    the remote device is not ready. We mark the isci device as ready (not
 *    the remote device is not ready. We mark the isci device as ready (not
@@ -167,8 +177,8 @@ enum sci_status sci_remote_device_stop(struct isci_remote_device *idev,
	case SCI_DEV_FAILED:
	case SCI_DEV_FAILED:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_DEV_STOPPED:
	case SCI_DEV_STOPPED:
		return SCI_SUCCESS;
		return SCI_SUCCESS;
@@ -226,8 +236,8 @@ enum sci_status sci_remote_device_reset(struct isci_remote_device *idev)
	case SCI_DEV_RESETTING:
	case SCI_DEV_RESETTING:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_DEV_READY:
	case SCI_DEV_READY:
	case SCI_STP_DEV_IDLE:
	case SCI_STP_DEV_IDLE:
@@ -246,8 +256,8 @@ enum sci_status sci_remote_device_reset_complete(struct isci_remote_device *idev
	enum sci_remote_device_states state = sm->current_state_id;
	enum sci_remote_device_states state = sm->current_state_id;


	if (state != SCI_DEV_RESETTING) {
	if (state != SCI_DEV_RESETTING) {
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -262,8 +272,8 @@ enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev,
	enum sci_remote_device_states state = sm->current_state_id;
	enum sci_remote_device_states state = sm->current_state_id;


	if (state != SCI_STP_DEV_CMD) {
	if (state != SCI_STP_DEV_CMD) {
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -287,8 +297,8 @@ enum sci_status sci_remote_device_frame_handler(struct isci_remote_device *idev,
	case SCI_SMP_DEV_IDLE:
	case SCI_SMP_DEV_IDLE:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		/* Return the frame back to the controller */
		/* Return the frame back to the controller */
		sci_controller_release_frame(ihost, frame_index);
		sci_controller_release_frame(ihost, frame_index);
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
@@ -502,8 +512,8 @@ enum sci_status sci_remote_device_start_io(struct isci_host *ihost,
	case SCI_DEV_RESETTING:
	case SCI_DEV_RESETTING:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_DEV_READY:
	case SCI_DEV_READY:
		/* attempt to start an io request for this device object. The remote
		/* attempt to start an io request for this device object. The remote
@@ -637,8 +647,8 @@ enum sci_status sci_remote_device_complete_io(struct isci_host *ihost,
	case SCI_DEV_FAILED:
	case SCI_DEV_FAILED:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_DEV_READY:
	case SCI_DEV_READY:
	case SCI_STP_DEV_AWAIT_RESET:
	case SCI_STP_DEV_AWAIT_RESET:
@@ -721,8 +731,8 @@ enum sci_status sci_remote_device_start_task(struct isci_host *ihost,
	case SCI_DEV_RESETTING:
	case SCI_DEV_RESETTING:
	case SCI_DEV_FINAL:
	case SCI_DEV_FINAL:
	default:
	default:
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	case SCI_STP_DEV_IDLE:
	case SCI_STP_DEV_IDLE:
	case SCI_STP_DEV_CMD:
	case SCI_STP_DEV_CMD:
@@ -853,8 +863,8 @@ static enum sci_status sci_remote_device_destruct(struct isci_remote_device *ide
	struct isci_host *ihost;
	struct isci_host *ihost;


	if (state != SCI_DEV_STOPPED) {
	if (state != SCI_DEV_STOPPED) {
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


@@ -1204,8 +1214,8 @@ static enum sci_status sci_remote_device_start(struct isci_remote_device *idev,
	enum sci_status status;
	enum sci_status status;


	if (state != SCI_DEV_STOPPED) {
	if (state != SCI_DEV_STOPPED) {
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
		dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %s\n",
			 __func__, state);
			 __func__, dev_state_name(state));
		return SCI_FAILURE_INVALID_STATE;
		return SCI_FAILURE_INVALID_STATE;
	}
	}


Loading