mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
scsi: smartpqi: Fix AIO retry marker cleared by SCSI core between dispatches.
On recent Linux kernels the driver can enter a retry loop on the AIO fast
path when a request is retried, looping until timeout. A diagnostic path
that takes a physical drive offline on AIO-bypass failure is also never
entered on affected kernels.
Register a per-command initialization callback with the SCSI core. Its
presence causes the core to skip the per-dispatch clear, so the retry
marker now survives across the requeue and the AIO-to-RAID fallback
proceeds as intended. The driver takes over the marker's lifetime: it is
zeroed at tag allocation, preserved across the retry requeue so the error
path can act on it, and cleared on terminal completion so the tag starts
clean on its next use.
Fixes: dce5c4afd0 ("scsi: core: Clear driver private data when retrying request")
Co-developed-by: Mike McGowen <mike.mcgowen@microchip.com>
Signed-off-by: Mike McGowen <mike.mcgowen@microchip.com>
Acked-by: Don Brace <don.brace@microchip.com>
Signed-off-by: David Strahan <david.strahan@microchip.com>
Link: https://lore.kernel.org/linux-scsi/20260722220401.6357-1-david.strahan@microchip.com/
Link: https://patch.msgid.link/20260722220401.6357-2-david.strahan@microchip.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
dc59e4fea9
commit
225548863f
|
|
@ -66,6 +66,12 @@ static struct pqi_cmd_priv *pqi_cmd_priv(struct scsi_cmnd *cmd)
|
|||
return scsi_cmd_priv(cmd);
|
||||
}
|
||||
|
||||
static int pqi_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
|
||||
{
|
||||
memset(pqi_cmd_priv(cmd), 0, sizeof(struct pqi_cmd_priv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pqi_verify_structures(void);
|
||||
static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info,
|
||||
enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason);
|
||||
|
|
@ -5958,6 +5964,17 @@ void pqi_prep_for_scsi_done(struct scsi_cmnd *scmd)
|
|||
struct pqi_scsi_dev *device;
|
||||
struct completion *wait;
|
||||
|
||||
/*
|
||||
* Clear the AIO-retry marker on final completion so the tag
|
||||
* starts clean on its next dispatch. On DID_IMM_RETRY leave
|
||||
* it intact: pqi_aio_io_complete() sets DID_IMM_RETRY and
|
||||
* bumps the marker to steer the requeue onto the RAID path,
|
||||
* and pqi_process_raid_io_error() consumes the non-zero
|
||||
* marker to offline a misbehaving drive.
|
||||
*/
|
||||
if (host_byte(scmd->result) != DID_IMM_RETRY)
|
||||
pqi_cmd_priv(scmd)->this_residual = 0;
|
||||
|
||||
if (!scmd->device) {
|
||||
set_host_byte(scmd, DID_NO_CONNECT);
|
||||
return;
|
||||
|
|
@ -7612,6 +7629,7 @@ static const struct scsi_host_template pqi_driver_template = {
|
|||
.sdev_groups = pqi_sdev_groups,
|
||||
.shost_groups = pqi_shost_groups,
|
||||
.cmd_size = sizeof(struct pqi_cmd_priv),
|
||||
.init_cmd_priv = pqi_init_cmd_priv,
|
||||
};
|
||||
|
||||
static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user