Skip to content

Recover from persistent UNIT ATTENTION conditions

Bart Van Assche linux-scsi 1 version Applied

Status from this message: Applied to 7.5/scsi-staging, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5scsi: core: Introduce scsi_cmd_needs_stu()drivers/scsi/scsi_error.c+28 -20 replies
2/5scsi: core: Simplify scsi_eh_ready_devs()drivers/scsi/scsi_error.c+6 -70 replies
3/5scsi: core: Clear UNIT ATTENTION conditions with TEST UNIT READYdrivers/scsi/scsi_error.c+131 -00 replies
4/5scsi: core: Escalate persistent UNIT ATTENTION conditionsdrivers/scsi/scsi_error.c drivers/scsi/scsi_lib.c include/scsi/scsi_cmnd.h+81 -91 reply
5/5scsi: core: Limit retries of commands that receive UNIT ATTENTIONdrivers/scsi/scsi_lib.c+3 -01 reply

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by.

PatchAlexey Charkov
1/5
2/5
3/5
4/5T-b
5/5T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] Recover from persistent UNIT ATTENTION conditions

Hi Martin,

Some SCSI targets do not clear a power-on or reset UNIT ATTENTION condition for all commands. BIWIN BWU2A05* UFS devices, for example, keep reporting UNIT ATTENTION for WRITE commands while TEST UNIT READY, READ and SYNCHRONIZE CACHE clear the condition. Today such WRITE commands are retried until the command runtime limit is exceeded. A quirk has been proposed for these devices [1]. This patch series instead makes the SCSI core recover from persistent UNIT ATTENTION conditions, so that no per-device quirk list has to be maintained:
- Patches 1 and 2 prepare the SCSI error handler for the changes in the later patches.
- Patch 3 makes the SCSI error handler send TEST UNIT READY to clear UNIT ATTENTION conditions before it falls back to resetting the device.
- Patch 4 makes scsi_decide_disposition() invoke the error handler if a command receives the same UNIT ATTENTION repeatedly. The behavior of the exported scsi_check_sense() function, used by libata, is not changed.
- Patch 5 limits the number of retries in scsi_io_completion_action() of commands that keep receiving UNIT ATTENTION.

Please consider this patch series for the next merge window.

[1] https://lore.kernel.org/linux-scsi/[email protected]/

Thanks,

Bart.

Bart Van Assche (5):
scsi: core: Introduce scsi_cmd_needs_stu()
scsi: core: Simplify scsi_eh_ready_devs()
scsi: core: Clear UNIT ATTENTION conditions with TEST UNIT READY
scsi: core: Escalate persistent UNIT ATTENTION conditions
scsi: core: Limit retries of commands that receive UNIT ATTENTION

 drivers/scsi/scsi_error.c | 255 +++++++++++++++++++++++++++++++++++---
 drivers/scsi/scsi_lib.c   |   5 +
 include/scsi/scsi_cmnd.h  |   7 ++
 3 files changed, 249 insertions(+), 18 deletions(-)