scsi: pm8001: do not wait for port reset timeout after link down
Subsystems (3)
PATCH 1/1 scsi: pm8001: do not wait for port reset timeout after link down
From: Kumar Meiyappan <[email protected]>
During SATA hot removal with I/O in flight, commands may time out and enter the abort path. As part of abort handling, the driver issues a local PHY reset and then waits for the PORT_RESET_TMO event from firmware.
However, once the link is already down, firmware does not generate that event. The abort path then waits for a completion that will never arrive, which can lead to a call trace or stalled recovery during device removal.
Avoid waiting for port reset completion when the PHY link is already down.
--- drivers/scsi/pm8001/pm8001_sas.c | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-)
drivers/scsi/pm8001/pm8001_sas.c +19 -17
@@ -1148,24 +1148,26 @@ int pm8001_abort_task(struct sas_task *task) phy->reset_completion =NULL ; }else {/* 3. Wait for Port Reset complete or -* Port reset TMO +* Port reset TMO, if Phy Link is still up */ -pm8001_dbg (pm8001_ha,MSG , -"Waiting for Port reset\n" ); - ret =wait_for_completion_timeout ( - &completion_reset, -PM8001_TASK_TIMEOUT *HZ ); -if (!ret) - phy->reset_completion =NULL ; -WARN_ON (phy->port_reset_status == -PORT_RESET_TMO ); -if (phy->port_reset_status ==PORT_RESET_TMO ) { -pm8001_dev_gone_notify (dev); -PM8001_CHIP_DISP ->hw_event_ack_req ( - pm8001_ha,0 , -0x07 ,/*HW_EVENT_PHY_DOWN ack*/ - port_id, phy_id,0 ,0 ); - goto out; +if (phy->phy_state !=PHY_LINK_DISABLE ) { +pm8001_dbg (pm8001_ha,MSG , +"Waiting for Port reset\n" ); + ret =wait_for_completion_timeout ( + &completion_reset, +PM8001_TASK_TIMEOUT *HZ ); +if (!ret) + phy->reset_completion =NULL ; +WARN_ON (phy->port_reset_status == +PORT_RESET_TMO ); +if (phy->port_reset_status ==PORT_RESET_TMO ) { +pm8001_dev_gone_notify (dev); +PM8001_CHIP_DISP ->hw_event_ack_req ( + pm8001_ha,0 , +0x07 ,/*HW_EVENT_PHY_DOWN ack*/ + port_id, phy_id,0 ,0 ); + goto out; + } } }
Signature · 1 line
2.43.0
Sagar,
Quoted 4 lines
During SATA hot removal with I/O in flight, commands may time out and enter the abort path. As part of abort handling, the driver issues a local PHY reset and then waits for the
PORT_RESET_TMOevent from firmware.
https://sashiko.dev/#/patchset/20260416155403.416374-1-sagar.biradar%40microchip.com
Signature · 1 line
Martin K. Petersen