From: John Garry <john.g.garry@oracle.com>
To: James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, m.szyprowski@samsung.com,
robin.murphy@arm.com, hch@lst.de
Cc: linux-scsi@vger.kernel.org, iommu@lists.linux.dev,
ionut.nechita@windriver.com, John Garry <john.g.garry@oracle.com>
Subject: [PATCH 0/2] Drop SCSI core dev->dma_mask check
Date: Mon, 29 Jun 2026 08:53:08 +0000 [thread overview]
Message-ID: <20260629085310.2298552-1-john.g.garry@oracle.com> (raw)
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
next reply other threads:[~2026-06-29 8:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 8:53 John Garry [this message]
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-07-02 14:11 ` Christoph Hellwig
2026-07-02 14:32 ` John Garry
2026-07-02 14:11 ` Christoph Hellwig
2026-06-29 8:53 ` [PATCH 2/2] scsi: core: Drop dev->dma_mask check in evaluating max_sectors John Garry
2026-07-02 14:12 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260629085310.2298552-1-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=ionut.nechita@windriver.com \
--cc=linux-scsi@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=martin.petersen@oracle.com \
--cc=robin.murphy@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox