aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPiotr Sawicki <piotr.sawicki@intel.com>2011-02-23 03:09:14 -0500
committerDan Williams <dan.j.williams@intel.com>2011-07-03 06:55:28 -0400
commitb3824292cb93d4e45b87fe76d8774cbde9e43200 (patch)
tree5a77449b770e2a5fb35164298ea4dc702e456852 /drivers
parent52b957c80c3be9bab2748b0ac59ed3c3e8ffe196 (diff)
isci: fix for asserts during aborts/resets to SAS/SATA in APC mode
Sending aborts/resets to SAS/SATA targets in APC mode eventually causes an assert in scic_sds_apc_agent_link_up(). We need to handle the hard reset case for apc mode ports. Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/isci/core/scic_sds_port_configuration_agent.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
index dd2cdd4a6fe1..001472e75b8c 100644
--- a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
+++ b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
@@ -676,28 +676,40 @@ static void scic_sds_apc_agent_configure_ports(
676} 676}
677 677
678/** 678/**
679 * 679 * scic_sds_apc_agent_link_up - handle apc link up events
680 * @controller: This is the controller object that receives the link up 680 * @scic: This is the controller object that receives the link up
681 * notification. 681 * notification.
682 * @port: This is the port object associated with the phy. If the is no 682 * @sci_port: This is the port object associated with the phy. If the is no
683 * associated port this is an NULL. 683 * associated port this is an NULL.
684 * @phy: This is the phy object which has gone link up. 684 * @sci_phy: This is the phy object which has gone link up.
685 * 685 *
686 * This method handles the automatic port configuration for link up 686 * This method handles the automatic port configuration for link up
687 * notifications. Is it possible to get a link down notification from a phy 687 * notifications. Is it possible to get a link down notification from a phy
688 * that has no assocoated port? 688 * that has no assocoated port?
689 */ 689 */
690static void scic_sds_apc_agent_link_up( 690static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
691 struct scic_sds_controller *controller, 691 struct scic_sds_port_configuration_agent *port_agent,
692 struct scic_sds_port_configuration_agent *port_agent, 692 struct scic_sds_port *sci_port,
693 struct scic_sds_port *port, 693 struct scic_sds_phy *sci_phy)
694 struct scic_sds_phy *phy)
695{ 694{
696 BUG_ON(port != NULL); 695 u8 phy_index = sci_phy->phy_index;
697
698 port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(phy));
699 696
700 scic_sds_apc_agent_configure_ports(controller, port_agent, phy, true); 697 if (!sci_port) {
698 /* the phy is not the part of this port */
699 port_agent->phy_ready_mask |= 1 << phy_index;
700 scic_sds_apc_agent_configure_ports(scic, port_agent, sci_phy, true);
701 } else {
702 /* the phy is already the part of the port */
703 u32 port_state = sci_port->parent.state_machine.current_state_id;
704
705 /* if the PORT'S state is resetting then the link up is from
706 * port hard reset in this case, we need to tell the port
707 * that link up is recieved
708 */
709 BUG_ON(port_state != SCI_BASE_PORT_STATE_RESETTING);
710 port_agent->phy_ready_mask |= 1 << phy_index;
711 scic_sds_port_link_up(sci_port, sci_phy);
712 }
701} 713}
702 714
703/** 715/**