Skip to content

Drop SCSI core dev->dma_mask check

John Garry linux-iommu linux-scsi 1 version Applied

Status from this message: Applied to 7.3/scsi-staging, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2dma-mapping: make dma_max_mapping_size() return 0 for no DMA capabilitykernel/dma/mapping.c+3 -06 replies
2/2scsi: core: Drop dev->dma_mask check in evaluating max_sectorsdrivers/scsi/hosts.c+2 -41 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRobin MurphyChristoph Hellwig
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Drop SCSI core dev->dma_mask check

In commit be8fcd4a8217 ("scsi: sas: Skip opt_sectors when DMA reports no real optimization hint"), the check for dev->dma_mask prior to calling dma_opt_mapping_size() was dropped.

However, it is not safe to do so, as dma_opt_mapping_size() -> dma_max_mapping_size() may try to dereference dev->dma_mask.

We just don't hit such a path as no SCSI HBA driver which has dev->dma_mask unset would use the SAS transport.

Fix that issue by adding a dev->dma_mask check in
dma_max_mapping_size().

The dev->dma_mask check in scsi_add_host_with_dma() can then be also dropped.

John Garry (2):
dma-mapping: make dma_max_mapping_size() return 0 for no DMA
capability
scsi: core: Drop dev->dma_mask check in evaluating max_sectors

 drivers/scsi/hosts.c | 6 ++----
 kernel/dma/mapping.c | 3 +++
 2 files changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.7