Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293009
b: refs/heads/master
c: fca4ecb
h: refs/heads/master
i:
  293007: 6de19a4
v: v3
  • Loading branch information
Dan Williams authored and James Bottomley committed Feb 29, 2012
1 parent 902de1a commit e1d9692
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 88 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: c132f692085ac624d7c8123df781846c8dcb3166
refs/heads/master: fca4ecbdc440337b3c257b38c2f4cc8d0ca0286c
89 changes: 11 additions & 78 deletions trunk/drivers/scsi/isci/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ static struct device *sciport_to_dev(struct isci_port *iport)
return &ihost->pdev->dev;
}

static void isci_port_change_state(struct isci_port *iport, enum isci_status status)
{
unsigned long flags;

dev_dbg(&iport->isci_host->pdev->dev,
"%s: iport = %p, state = 0x%x\n",
__func__, iport, status);

/* XXX pointless lock */
spin_lock_irqsave(&iport->state_lock, flags);
iport->status = status;
spin_unlock_irqrestore(&iport->state_lock, flags);
}

static void sci_port_get_protocols(struct isci_port *iport, struct sci_phy_proto *proto)
{
u8 index;
Expand Down Expand Up @@ -186,8 +172,6 @@ static void isci_port_link_up(struct isci_host *isci_host,

spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags);

isci_port_change_state(iport, isci_starting);

sci_port_get_properties(iport, &properties);

if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) {
Expand Down Expand Up @@ -269,7 +253,6 @@ static void isci_port_link_down(struct isci_host *isci_host,
__func__, isci_device);
set_bit(IDEV_GONE, &isci_device->flags);
}
isci_port_change_state(isci_port, isci_stopping);
}
}

Expand All @@ -284,45 +267,6 @@ static void isci_port_link_down(struct isci_host *isci_host,
"%s: isci_port = %p - Done\n", __func__, isci_port);
}


/**
* isci_port_ready() - This function is called by the sci core when a link
* becomes ready.
* @isci_host: This parameter specifies the isci host object.
* @port: This parameter specifies the sci port with the active link.
*
*/
static void isci_port_ready(struct isci_host *isci_host, struct isci_port *isci_port)
{
dev_dbg(&isci_host->pdev->dev,
"%s: isci_port = %p\n", __func__, isci_port);

isci_port_change_state(isci_port, isci_ready);
return;
}

/**
* isci_port_not_ready() - This function is called by the sci core when a link
* is not ready. All remote devices on this link will be removed if they are
* in the stopping state.
* @isci_host: This parameter specifies the isci host object.
* @port: This parameter specifies the sci port with the active link.
*
*/
static void isci_port_not_ready(struct isci_host *isci_host, struct isci_port *isci_port)
{
dev_dbg(&isci_host->pdev->dev,
"%s: isci_port = %p\n", __func__, isci_port);
}

static void isci_port_stop_complete(struct isci_host *ihost,
struct isci_port *iport,
enum sci_status completion_status)
{
dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
}


static bool is_port_ready_state(enum sci_port_states state)
{
switch (state) {
Expand Down Expand Up @@ -843,10 +787,9 @@ static void port_timeout(unsigned long data)
__func__,
iport);
} else if (current_state == SCI_PORT_STOPPING) {
/* if the port is still stopping then the stop has not completed */
isci_port_stop_complete(iport->owning_controller,
iport,
SCI_FAILURE_TIMEOUT);
dev_dbg(sciport_to_dev(iport),
"%s: port%d: stop complete timeout\n",
__func__, iport->physical_port_index);
} else {
/* The port is in the ready state and we have a timer
* reporting a timeout this should not happen.
Expand Down Expand Up @@ -1011,7 +954,8 @@ static void sci_port_ready_substate_operational_enter(struct sci_base_state_mach
struct isci_port *iport = container_of(sm, typeof(*iport), sm);
struct isci_host *ihost = iport->owning_controller;

isci_port_ready(ihost, iport);
dev_dbg(&ihost->pdev->dev, "%s: port%d ready\n",
__func__, iport->physical_port_index);

for (index = 0; index < SCI_MAX_PHYS; index++) {
if (iport->phy_table[index]) {
Expand Down Expand Up @@ -1077,7 +1021,8 @@ static void sci_port_ready_substate_operational_exit(struct sci_base_state_machi
*/
sci_port_abort_dummy_request(iport);

isci_port_not_ready(ihost, iport);
dev_dbg(&ihost->pdev->dev, "%s: port%d !ready\n",
__func__, iport->physical_port_index);

if (iport->ready_exit)
sci_port_invalidate_dummy_remote_node(iport);
Expand All @@ -1089,7 +1034,8 @@ static void sci_port_ready_substate_configuring_enter(struct sci_base_state_mach
struct isci_host *ihost = iport->owning_controller;

if (iport->active_phy_mask == 0) {
isci_port_not_ready(ihost, iport);
dev_dbg(&ihost->pdev->dev, "%s: port%d !ready\n",
__func__, iport->physical_port_index);

port_state_machine_change(iport, SCI_PORT_SUB_WAITING);
} else
Expand Down Expand Up @@ -1555,7 +1501,8 @@ static void sci_port_ready_state_enter(struct sci_base_state_machine *sm)
if (prev_state == SCI_PORT_RESETTING)
isci_port_hard_reset_complete(iport, SCI_SUCCESS);
else
isci_port_not_ready(ihost, iport);
dev_dbg(&ihost->pdev->dev, "%s: port%d !ready\n",
__func__, iport->physical_port_index);

/* Post and suspend the dummy remote node context for this port. */
sci_port_post_dummy_remote_node(iport);
Expand Down Expand Up @@ -1652,21 +1599,7 @@ void isci_port_init(struct isci_port *iport, struct isci_host *ihost, int index)
{
INIT_LIST_HEAD(&iport->remote_dev_list);
INIT_LIST_HEAD(&iport->domain_dev_list);
spin_lock_init(&iport->state_lock);
iport->isci_host = ihost;
isci_port_change_state(iport, isci_freed);
}

/**
* isci_port_get_state() - This function gets the status of the port object.
* @isci_port: This parameter points to the isci_port object
*
* status of the object as a isci_status enum.
*/
enum isci_status isci_port_get_state(
struct isci_port *isci_port)
{
return isci_port->status;
}

void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy)
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/isci/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ enum isci_status {
* @timer: timeout start/stop operations
*/
struct isci_port {
enum isci_status status;
struct isci_host *isci_host;
struct list_head remote_dev_list;
spinlock_t state_lock;
struct list_head domain_dev_list;
struct completion hard_reset_complete;
enum sci_status hard_reset_status;
Expand Down Expand Up @@ -294,9 +292,6 @@ void sci_port_get_attached_sas_address(
struct isci_port *iport,
struct sci_sas_address *sas_address);

enum isci_status isci_port_get_state(
struct isci_port *isci_port);

void isci_port_formed(struct asd_sas_phy *);
void isci_port_deformed(struct asd_sas_phy *);

Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/scsi/isci/remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,10 +1394,6 @@ int isci_remote_device_found(struct domain_device *dev)
if (!isci_port)
return -ENODEV;

if ((isci_stopping == isci_port_get_state(isci_port)) ||
(isci_stopped == isci_port_get_state(isci_port)))
return -ENODEV;

isci_device = isci_remote_device_alloc(isci_host, isci_port);
if (!isci_device)
return -ENODEV;
Expand Down

0 comments on commit e1d9692

Please sign in to comment.