Re: [PATCH v7 1/1] scsi: sas: skip opt_sectors when DMA reports no real optimization hint
From: John Garry
Date: Tue Apr 28 2026 - 04:21:53 EST
On 24/04/2026 14:21, Christoph Hellwig wrote:
Responding to get things moving..
+ */Upper layers have no real busines looking at dma_dev->dma_mask. What
+static void sas_dma_setup_opt_sectors(struct Scsi_Host *shost)
+{
+ struct device *dma_dev = shost->dma_dev;
+ size_t opt, max;
+ unsigned int opt_sectors;
+
+ if (!dma_dev->dma_mask)
+ return;
is this check intended to do?
Back when that check was introduced, dma_max_mapping_size() may crash for some SCSI hosts. See https://lore.kernel.org/linux-scsi/BYAPR04MB58168CBFF8B691DF33C73DDBE7C40@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
scsi_debug would be an example of such a shost as it is not DMA capable. That crash is not an issue any longer from my limited testing. I think that it comes down to new checks in dma_addressing_limited() -> __dma_addressing_limited() for dma_mask being set. So we may be able to get rid of that dma_mask check.