commit c14818f4d2b46a67fa0d2fd8fd5ef3532245f07a Author: Bart Van Assche Date: Fri Oct 30 15:42:39 2026 -0700 scsi: core: Limit retries of commands that receive UNIT ATTENTION Fail non-removable commands in scsi_io_completion_action() on UNIT ATTENTION if retries exceed max(cmd->allowed, 3). This bounds the number of retries of commands for which scsi_decide_disposition() exhausted the retries or that have been finished by the error handler, e.g. because a target keeps reporting UNIT ATTENTION after recovery. Since scmd->retries is not incremented for failfast commands on this code path, failfast commands are retried until the command runtime limit is exceeded, as before. Signed-off-by: Bart Van Assche Tested-by: Alexey Charkov Link: https://patch.msgid.link/959f1c7628af83cd184ac51f35e38d654b261069.1793400000.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) commit 49da33f609929db6f6c3b8567d0e0cca6f9ae182 Author: Bart Van Assche Date: Fri Oct 30 15:42:38 2026 -0700 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 Closes: https://lore.kernel.org/linux-scsi/20261028-biwin-tua-quirk-v1-1-767a12c9b9cc@flipper.net/ Signed-off-by: Bart Van Assche Tested-by: Alexey Charkov Link: https://patch.msgid.link/5c34851674a67879e175251b9bfe6ccf091e390a.1793400000.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) commit d54e68b5c31cbfb108c1f22ec21bdf43c5133e0e Author: Bart Van Assche Date: Fri Oct 30 15:42:37 2026 -0700 scsi: core: Clear UNIT ATTENTION conditions with TEST UNIT READY Some targets, e.g. BIWIN BWU2A05* UFS devices, fail to clear power-on or reset UNIT ATTENTION conditions on WRITE commands while clearing these on commands like TEST UNIT READY, READ, and SYNCHRONIZE CACHE. Add scsi_eh_clear_ua() to scsi_eh_ready_devs() ahead of device reset so that the error handler sends TEST UNIT READY to consume a stuck UNIT ATTENTION and verifies with a follow-up TEST UNIT READY that the condition cleared before requeueing affected commands. Allow a few additional TEST UNIT READY attempts for queued UNIT ATTENTION conditions and busy devices, delay retries, and honor the error handler deadline. Save and restore scmd->sense_buffer across scsi_send_eh_cmnd() so that the original sense data remains intact while filtering work_q and if retries are later exhausted. Log a rate-limited message when a persistent UNIT ATTENTION is cleared to make it possible to identify misbehaving devices. Signed-off-by: Bart Van Assche Link: https://patch.msgid.link/444e78b0fa892e8854bee89f341824d67000d968.1793400000.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) commit 099fb3376bb73c29457782d917a3b68d846a9e87 Author: Bart Van Assche Date: Fri Oct 30 15:42:36 2026 -0700 scsi: core: Simplify scsi_eh_ready_devs() Replace the nested if-statements in scsi_eh_ready_devs() with a single if-statement that combines the conditions with the && operator. This reduces the indentation level and makes it easier to insert additional recovery steps. No functionality has been changed. Signed-off-by: Bart Van Assche Link: https://patch.msgid.link/de1a210fb52adaefd818ed68eb5e7678a004762e.1793400000.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) commit b7545895b1c97b8fd0201ee6eac9cbeb57f1e3c5 Author: Bart Van Assche Date: Fri Oct 30 15:42:35 2026 -0700 scsi: core: Introduce scsi_cmd_needs_stu() Introduce scsi_cmd_needs_stu() and use it in scsi_eh_stu() instead of testing scsi_check_sense(scmd) == FAILED. This makes it explicit that START UNIT is only sent for LU_NOT_READY_INITIALIZING_COMMAND_REQUIRED and prevents that the error handler reports sense data a second time. This patch prepares for making scsi_decide_disposition() escalate persistent UNIT ATTENTION conditions to the error handler. Signed-off-by: Bart Van Assche Link: https://patch.msgid.link/c35a3b27958cb93c26c1ccecccd572c54da448e4.1793400000.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) commit c78b78166c55ebd6ae0b378499abd519aee7a966 Author: Matt Wang Date: Mon Oct 19 14:29:58 2026 +0800 scsi: vmw_pvscsi: Add support for ARM64 architecture This change adds PVSCSI support for the ARM64 architecture, restricted to little endian and 4K memory page size. Barrier usage is updated from compiler barriers, which were sufficient on x86, to the appropriate DMA barriers. Signed-off-by: Matt Wang Reviewed-by: Vishal Bhakta Link: https://patch.msgid.link/20261019062959.426900-1-matt.wang@broadcom.com Signed-off-by: Martin K. Petersen (Oracle) commit a3d959d2778f22b44c2df52cb70e78811c0e739e Author: Matt Wang Date: Wed Sep 30 07:15:39 2026 +0800 scsi: vmw_pvscsi: Clamp on e->dataLen in pvscsi_complete_request() When calculating the residual bytes, clamp dataLen to the buffer length before the subtraction. This prevents an overflow if the device sends a larger value than expected. Signed-off-by: Matt Wang Link: https://patch.msgid.link/20260929231539.630963-1-matt.wang@broadcom.com Fixes: 851b164231d1 ("[SCSI] vmw_pvscsi: SCSI driver for VMware's virtual HBA.") Signed-off-by: Martin K. Petersen (Oracle) commit 6e862335a8d3a3c8bfc8488dc1c6fa81b83a83ee Author: Matt Wang Date: Wed Sep 30 07:14:59 2026 +0800 scsi: vmw_pvscsi: Add boundary check for cmd_map access The context value provided by the device in a completion is used to index into cmd_map to find the command that was completed. To prevent out of bounds access or completion of an inactive context, check that the context value is in-bounds and that it maps to an active context. Signed-off-by: Matt Wang Link: https://patch.msgid.link/20260929231459.630938-1-matt.wang@broadcom.com Fixes: 851b164231d1 ("[SCSI] vmw_pvscsi: SCSI driver for VMware's virtual HBA.") Signed-off-by: Martin K. Petersen (Oracle)