commit 0fc91e802801819a0c51d30b6eecac63ab4f85d2 Author: Shao Mingyin Date: Thu Nov 5 19:33:53 2026 +0800 scsi: target: core: Drop the dead kmap_local_page() NULL check kmap_local_page() never returns NULL; drop the wrapper and always zero the segment. No functional change. Signed-off-by: Shao Mingyin Link: https://patch.msgid.link/20261105193353023NXQ1VSNCIijJ53XmDJc1y@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) commit 63d67440dc9f103aad38b14f409d6d6e54396746 Author: Shao Mingyin Date: Thu Nov 5 19:33:51 2026 +0800 scsi: target: iblock: Drop the dead kmap() NULL check kmap() never returns NULL, so the check after it is dead code. No functional change. Signed-off-by: Shao Mingyin Reviewed-by: Laurence Oberman Link: https://patch.msgid.link/20261105193351820CRZfBnzFE8zZm2DrNx0T_@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) commit db1fe578b7eabc7f218b84fc18a626d07f377a69 Author: Shao Mingyin Date: Sat Oct 31 22:22:43 2026 +0800 scsi: scsi_transport_fc: Reject truncated FPIN payloads fc_host_fpin_rcv() computes the length of the TLV area as: bytes_remain = fpin_len - offsetof(struct fc_els_fpin, fpin_desc); without checking that the payload is at least as large as the fixed FC-ELS header. For fpin_len smaller than the header size the subtraction underflows to a huge u32, and the min_t() on the next line also reads fpin->desc_len at offset 4, which is outside the payload when fpin_len is 4 or less. The TLV walker then parses memory that is not part of the FPIN. Reject payloads that cannot hold the header: there is no descriptor list to parse and no statistics to update. This is not only defensive: qla2xxx forwards the firmware-provided frame size minus the 24-byte PURX ELS header, so a frame of exactly that size reaches this helper with a zero length. fpin_len is supplied by the LLDD and the helper is exported, so it should not assume a minimum. Fixes: 3dcfe0de5a97 ("scsi: fc: Parse FPIN packets and update statistics") Signed-off-by: Shao Mingyin Link: https://patch.msgid.link/20261031222243820vSs-SXTIpNSHpWeC2dJ38@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) commit 787fd1429b3603fdc69ebba864165478c4e73544 Author: Shao Mingyin Date: Sat Oct 31 22:21:33 2026 +0800 scsi: scsi_devinfo: Return an error when the proc write fails proc_scsi_devinfo_write() calls scsi_dev_info_list_add_str() but ignores its return value, so a write to /proc/scsi/device_info always reports success, even when the string is malformed and no entry was added. Users and scripts then believe that the quirk is in effect. scsi_init_devinfo() already checks the return value of the same function and fails the initialization. Return the parser error, but keep returning the number of bytes written on success: a proc write handler that returns zero for a non-empty write would look like a short write to the caller. Signed-off-by: Shao Mingyin Reviewed-by: Laurence Oberman Link: https://patch.msgid.link/20261031222133489hI-BEIDpFMxrtlntnLiFb@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) commit dd86dc1d86c892c75592d45e000499dfb20d2c62 Author: Jesse Taube Date: Thu Oct 29 12:04:43 2026 -0400 scsi: qedf: Remove unesseary function call The result of `skb_transport_header()` was unused. Calling this function warned when `skb_transport_header_was_set()` returned false causing a panic on debug kernels. Signed-off-by: Jesse Taube Reviewed-by: Laurence Oberman Reviewed-by: John Meneghini Reviewed-by: Nilesh Javali Link: https://patch.msgid.link/20261029160443.904468-1-jtaubepe@redhat.com Signed-off-by: Martin K. Petersen (Oracle) commit dc7ba60d45b105b91d4e2e9567b355fb4a043def Author: Brian Bunker Date: Fri Oct 30 10:57:20 2026 -0700 scsi: core: Restart the queue when unblocking a device set running A device that its transport blocks has its queue stopped. If the SCSI error handler then gives up on the device, it moves it from SDEV_BLOCK to SDEV_OFFLINE and leaves the queue stopped. When userspace later writes "running" to the device's state attribute, store_state_field() moves it to SDEV_RUNNING, still with the queue stopped, and rescans it. The rescan takes the device lock and waits for I/O that can never be dispatched. When the transport then unblocks the device, scsi_internal_device_unblock_nowait() rejects a device in SDEV_RUNNING with -EINVAL before it reaches scsi_start_queue(), so nothing ever restarts the queue. The task that wrote "running" hangs forever holding the device lock, and anything else that takes it hangs behind it. The -EINVAL also makes scsi_host_unblock() stop at this device and leave the rest of the host blocked, and keeps the device in SDEV_RUNNING when the transport asked for SDEV_TRANSPORT_OFFLINE. This shows up with iSCSI when a session drops again just after recovering. iscsid onlines the session's devices after a relogin by writing "running" to every device it finds offline: 1. The session is blocked, which blocks the device and stops its queue. 2. The error handler cannot recover the device and moves it from SDEV_BLOCK to SDEV_OFFLINE. The queue stays stopped. 3. iscsid writes "running": SDEV_OFFLINE -> SDEV_RUNNING with the queue still stopped, then the rescan sends an INQUIRY that sits unsent while holding the device lock. 4. The session recovery timeout calls scsi_target_unblock(). The other devices go from SDEV_BLOCK to SDEV_TRANSPORT_OFFLINE and get their queues restarted, but this one is skipped because it is already running. A vmcore from such a hang shows the device in SDEV_RUNNING with queue_stopped set and the queue's quiesce_depth at 1, the rescan's INQUIRY never started (MQ_RQ_IDLE, no start time or deadline), and iscsid owning the device lock while other tasks wait for it. Handle this in scsi_internal_device_unblock_nowait(), which already restarts the queue of an SDEV_OFFLINE device: accept an SDEV_RUNNING device whose queue is still stopped, move it to the requested state and restart the queue. A running device whose queue is not stopped was never blocked and is still rejected. Do not restart the queue from store_state_field() instead. The device is still blocked by its transport at that point, and some transports and drivers rely on the stopped queue to keep commands away while they reconnect or reset the adapter. Fixes: f0f82e2476f6 ("scsi: core: Fix capacity set to zero after offlinining device") Signed-off-by: Brian Bunker Link: https://patch.msgid.link/20261030175721.24379-2-brian@purestorage.com Signed-off-by: Martin K. Petersen (Oracle) commit 6054ce4233dbc692f50da5517ad459fae1b14ac6 Author: Brian Bunker Date: Wed Oct 28 17:25:31 2026 -0700 scsi: core: Match ULDs to logical units in the ALUA unavailable state scsi_bus_match() only matches devices with peripheral qualifier 000b, so a LU that is in the ALUA unavailable state on a target port when the host scans it never gets an upper-level driver on that path. When the target port becomes available again, nothing binds sd and the path stays unusable until the device is deleted and rescanned. A host that was already running when the path became unavailable keeps sd bound, so the result depends on when the host scanned. Peripheral qualifier 001b cannot be matched on its own: an unmapped LUN reports it as well, and some targets report every possible LUN in REPORT LUNS. Binding sd to all of those would create disks with no backing LU. The SCSI core now reads the access state of a device that supports target port groups with REPORT TARGET PORT GROUPS before the device is registered, and an unmapped LUN fails that command. SPC-4 requires a LU in the unavailable state to report PQ 001b, and the command shows that the LU is mapped, so record in the device whether it reported PQ 001b and its access state could be read, and match such a device. sd then binds to the unavailable path like it does to a standby path, the path stays in the multipath map as a failed path, and the existing UNIT ATTENTION handling brings it back when the target port becomes available. The decision is made once, at scan time, and not from access_state when the match is made. access_state follows the ALUA state, but the peripheral qualifier it relates to does not change after the scan. If the match depended on access_state, a device scanned in the unavailable state would stop matching as soon as its path became available, e.g. when the upper-level driver module is loaded later, or the driver is rebound, or the ALUA device handler updates access_state before the driver is probed. It also does not depend on the state that the command returns, which can already be available if the path recovered between the INQUIRY and the command. This is the same situation as a path in the standby state, to which sd already binds: SPC-4 requires READ CAPACITY in neither state. The unavailable state does not require MODE SENSE either, which the standby state does. The cached INQUIRY data in sysfs keeps the peripheral qualifier reported at scan time, like the rest of the INQUIRY data; access_state shows the current ALUA state. Co-developed-by: Krishna Kant Signed-off-by: Krishna Kant Signed-off-by: Brian Bunker Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20261029002531.82824-4-brian@purestorage.com Signed-off-by: Martin K. Petersen (Oracle) commit e085b1d6b6aabd6a7dcd9f02135f9376ff39e95a Author: Brian Bunker Date: Wed Oct 28 17:25:30 2026 -0700 scsi: core: Read the ALUA access state when a device is scanned sdev->access_state is only set by a device handler, and the ALUA device handler reads the state with an RTPG that runs after the device has been registered and matched to a driver. The SCSI core therefore has no ALUA state for a device while it decides whether to bind an upper-level driver to it. For a device that reports TPGS support, send REPORT TARGET PORT GROUPS from scsi_add_lun(), after the VPD pages have been read, and set sdev->access_state from the descriptor of the target port group of this path. UNIT ATTENTIONs, which a target typically reports first after a login or an ALUA state change, are retried, and the command is resent without the extended header if the target rejects it. If the command fails, e.g. with LOGICAL UNIT NOT SUPPORTED because no LU is mapped at the LUN, sdev->access_state is left as it is. The command uses the same timeout as the INQUIRY of the scan. The ALUA device handler keeps updating sdev->access_state afterwards as before. Suggested-by: Hannes Reinecke Co-developed-by: Krishna Kant Signed-off-by: Krishna Kant Signed-off-by: Brian Bunker Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20261029002531.82824-3-brian@purestorage.com Signed-off-by: Martin K. Petersen (Oracle) commit 746aa1d936b17679361e8d787c6480ccb7c21240 Author: Brian Bunker Date: Wed Oct 28 17:25:29 2026 -0700 scsi: core: Move REPORT TARGET PORT GROUPS into the SCSI core ALUA is a standard SCSI feature, independent of multipathing, but only the ALUA device handler can currently send REPORT TARGET PORT GROUPS. Move submit_rtpg() into the SCSI core as scsi_report_tpgs(), together with the resubmission with a larger buffer that alua_rtpg() did when the parameter data did not fit, so that the core can read the ALUA state of a device itself. The parameter data format definitions move to scsi_proto.h with it. scsi_dh_alua calls scsi_report_tpgs() with the same timeout, retries and parameter data format as before. No functional change. Suggested-by: Hannes Reinecke Co-developed-by: Krishna Kant Signed-off-by: Krishna Kant Signed-off-by: Brian Bunker Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20261029002531.82824-2-brian@purestorage.com Signed-off-by: Martin K. Petersen (Oracle) commit e1a17bf98f513a77e5e6903315c49f56ee009886 Author: Denis Ahrens Date: Mon Oct 26 10:51:54 2026 +0100 scsi: mvme16x: Enable 53c710 burst-8 hardware transfer mode The shared 53c700.c backend runs the 53c710 with burst mode disabled when hostdata->burst_length is left unset: NCR_700_chip_setup() falls through to BURST_DISABLE in CTEST7 and a 1-byte burst length in DMODE_710_REG, so the chip delivers one byte per transfer period. The other 53c710 hosts in-tree already use it: sim710 and lasi700 pick burst 8, sni_53c710 burst 4. A/B verified on an MVME177 (53c710 rev 2, ZuluSCSI drives): raw reads 16 MiB @64k 4.7/4.8/5.1 -> 5.8/6.1/6.7 MB/s (+23..26%) 4 MiB @16k 3.4 -> 4.4 MB/s 4 MiB @4k 3.2 -> 3.9 MB/s 4 MiB @512B 2.1 -> 2.2 MB/s (small-buffer case is SCSI command-count bound; burst only raises bytes per command, not commands) writes unchanged (filesystem-bound, not ASIC-bound) Integrity: a 16 MiB /dev/urandom payload round-trips bit-exact on a cold read (sync + drop_caches, md5 verified write vs read); dmesg clean with no timeouts, sense errors, retries or resets. Signed-off-by: Denis Ahrens Link: https://patch.msgid.link/733CA975-51A9-4687-BBD5-1FB4171FA3FE@h3q.com Signed-off-by: Martin K. Petersen (Oracle) commit ae8ecbc1e28633bdb23cfb61d8048c4e8f52052d Author: Torra Sowmya Date: Sun Nov 8 12:16:26 2026 +0530 scsi: sd: Remove unused zone append tracepoints Commit 1846f308d66f ("scsi: sd: Use the block layer zone append emulation") removed the calls to scsi_prepare_zone_append and scsi_zone_wp_update, but left their definitions in sd_trace.h. Consequently, sd_zbc.c still generates code and data for events that have no remaining callers. Remove sd_trace.h, which contains only these two events, and remove its include and CREATE_TRACE_POINTS definition from sd_zbc.c. Fixes: 1846f308d66f ("scsi: sd: Use the block layer zone append emulation") Signed-off-by: Torra Sowmya Link: https://patch.msgid.link/20261108064626.5539-1-sowmyatorra@gmail.com Signed-off-by: Martin K. Petersen (Oracle) 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)