[PATCH v3 05/11] scsi: mpt3sas: Restore unblock retry in _scsih_ublock_io_device_wait()

From: Jeff Layton

Date: Wed Nov 18 2026 - 18:11:06 EST


When the firmware reports that a device responds again, the event
worker unblocks the sdevs of the device. Previously, the worker used
_scsih_ublock_io_device() for this, which uses
_scsih_internal_device_unblock(). The unblock can fail with -EINVAL, if
the SD layer set the device to SDEV_RUNNING while our block still
stopped its queue. Then that helper blocks the device again and
unblocks it, to restart the queue.

_scsih_ublock_io_device_wait(), which does a TUR check, replaced
_scsih_ublock_io_device(). It open-codes the unblock without that
retry, so such a device can stay stalled. Use
_scsih_internal_device_unblock() in _scsih_ublock_io_device_wait() too.

Fixes: aee682fad6cd ("scsi: mpt3sas: Improve device discovery and readiness handling for slow devices")
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 45419f0ebedc..5d494ad12c54 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -4247,10 +4247,9 @@ _scsih_ublock_io_device_wait(struct MPT3SAS_ADAPTER *ioc, u64 sas_address,
rc == DEVICE_STOP_UNIT || rc == DEVICE_RETRY_UA)
&& count++ <= command_retry_count);

- sas_device_priv_data->block = 0;
if (rc != DEVICE_READY)
sas_device_priv_data->deleted = 1;
- scsi_internal_device_unblock_nowait(sdev, SDEV_RUNNING);
+ _scsih_internal_device_unblock(sdev, sas_device_priv_data);

if (rc != DEVICE_READY) {
sdev_printk(KERN_WARNING, sdev,

--
2.56.1