diff options
| author | Bart Van Assche <bvanassche@acm.org> | 2026-10-30 15:42:38 -0700 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-11-04 22:33:44 -0500 |
| commit | 49da33f609929db6f6c3b8567d0e0cca6f9ae182 (patch) | |
| tree | 62b0d588f241b41201ae26d66c6430e8303a0ab2 /scripts/Makefile.thinlto | |
| parent | d54e68b5c31cbfb108c1f22ec21bdf43c5133e0e (diff) | |
| download | linux-next-49da33f609929db6f6c3b8567d0e0cca6f9ae182.tar.gz linux-next-49da33f609929db6f6c3b8567d0e0cca6f9ae182.zip | |
scsi: core: Escalate persistent UNIT ATTENTION conditions
Recover from persistent UNIT ATTENTION conditions in the SCSI midlayer
instead of maintaining a per-device quirk list for targets such as BIWIN
BWU2A05* UFS devices that fail to clear power-on or reset UNIT ATTENTION
on WRITE commands while clearing it on commands such as TEST UNIT READY,
READ, and SYNCHRONIZE CACHE.
If a non-removable block request that is not failfast receives the same
UNIT ATTENTION repeatedly, retry it twice and invoke the error handler
thereafter, instead of letting scsi_io_completion_action() retry
uncounted until the command runtime limit is exceeded. The error handler
clears the UNIT ATTENTION by sending TEST UNIT READY. Track this with a
dedicated per-command counter and the additional sense code of the most
recent UNIT ATTENTION instead of scmd->retries. scmd->retries is also
incremented for other retry reasons and by the error handler, and a
target may report multiple queued UNIT ATTENTION conditions with
different additional sense codes. On most architectures the new fields
occupy an existing hole in struct scsi_cmnd. Limit the number of error
handler invocations for commands with unlimited retries since
scsi_eh_flush_done_q() does not limit these.
Only apply this escalation when the sense data is evaluated by
scsi_decide_disposition() and leave the behavior of the exported
scsi_check_sense() function unchanged. libata calls scsi_check_sense()
from its own error handler, which translates FAILED into an ATA port
reset and never sends TEST UNIT READY.
Reported-by: Alexey Charkov <alchark@flipper.net>
Closes: https://lore.kernel.org/linux-scsi/20261028-biwin-tua-quirk-v1-1-767a12c9b9cc@flipper.net/
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/5c34851674a67879e175251b9bfe6ccf091e390a.1793400000.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
