Re: [PATCH] scsi: esp_scsi: report the residual byte count

From: Martin K. Petersen (Oracle)

Date: Wed Nov 25 2026 - 22:35:30 EST


On Tue, 17 Nov 2026 19:37:46 -0500, Tim Douglas wrote:

> The ESP core tracks the number of bytes left to transfer in tot_residue
> but does not report that count to the SCSI midlayer. As a result, SG_IO
> returns a residual of zero even when a target transfers fewer bytes than
> requested, as can happen with INQUIRY and MODE SENSE.
>
> Report tot_residue with scsi_set_resid() when a command with a data
> buffer completes with DID_OK. Initialize the scatterlist DMA length
> on the identity-mapped PIO/pseudo-DMA path so the residual starts
> from the buffer length on architectures with a separate DMA length.
>
> [...]

Applied to 7.5/scsi-queue, thanks!

[1/1] scsi: esp_scsi: report the residual byte count
https://git.kernel.org/mkp/scsi/c/235a12231735

--
Martin K. Petersen