All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Drop SCSI core dev->dma_mask check
@ 2026-06-29  8:53 John Garry
  2026-06-29  8:53 ` [PATCH 1/2] dma-mapping: make dma_max_mapping_size() return 0 for no DMA capability John Garry
  2026-06-29  8:53 ` [PATCH 2/2] scsi: core: Drop dev->dma_mask check in evaluating max_sectors John Garry
  0 siblings, 2 replies; 7+ messages in thread
From: John Garry @ 2026-06-29  8:53 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen, m.szyprowski, robin.murphy, hch
  Cc: linux-scsi, iommu, ionut.nechita, John Garry

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(-)

-- 
2.43.7


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-29 11:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29  8:53 [PATCH 0/2] Drop SCSI core dev->dma_mask check John Garry
2026-06-29  8:53 ` [PATCH 1/2] dma-mapping: make dma_max_mapping_size() return 0 for no DMA capability John Garry
2026-06-29  9:10   ` sashiko-bot
2026-06-29 10:11   ` Robin Murphy
2026-06-29 10:46     ` John Garry
2026-06-29 11:09       ` Robin Murphy
2026-06-29  8:53 ` [PATCH 2/2] scsi: core: Drop dev->dma_mask check in evaluating max_sectors John Garry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.