Skip to content

Commit a0bbe3b

Browse files
djbwkamalmostafa
authored andcommitted
[SCSI] isci: fix reset timeout handling
commit ddfadd7 upstream. Remove an erroneous BUG_ON() in the case of a hard reset timeout. The reset timeout handler puts the port into the "awaiting link-up" state. The timeout causes the device to be disconnected and we need to be in the awaiting link-up state to re-connect the port. The BUG_ON() made the incorrect assumption that resets never timeout and we always complete the reset in the "resetting" state. Testing this patch also uncovered that libata continues to attempt to reset the port long after the driver has torn down the context. Once the driver has committed to abandoning the link it must indicate to libata that recovery ends by returning -ENODEV from ->lldd_I_T_nexus_reset(). Acked-by: Lukasz Dorau <lukasz.dorau@intel.com> Reported-by: David Milburn <dmilburn@redhat.com> Reported-by: Xun Ni <xun.ni@intel.com> Tested-by: Xun Ni <xun.ni@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
1 parent 2f552ce commit a0bbe3b

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

drivers/scsi/isci/port_config.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,6 @@ static void sci_apc_agent_link_up(struct isci_host *ihost,
615615
SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION);
616616
} else {
617617
/* the phy is already the part of the port */
618-
u32 port_state = iport->sm.current_state_id;
619-
620-
/* if the PORT'S state is resetting then the link up is from
621-
* port hard reset in this case, we need to tell the port
622-
* that link up is recieved
623-
*/
624-
BUG_ON(port_state != SCI_PORT_RESETTING);
625618
port_agent->phy_ready_mask |= 1 << phy_index;
626619
sci_port_link_up(iport, iphy);
627620
}

drivers/scsi/isci/task.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ int isci_task_I_T_nexus_reset(struct domain_device *dev)
801801
/* XXX: need to cleanup any ireqs targeting this
802802
* domain_device
803803
*/
804-
ret = TMF_RESP_FUNC_COMPLETE;
804+
ret = -ENODEV;
805805
goto out;
806806
}
807807

0 commit comments

Comments
 (0)