From: John Garry <john.g.garry@oracle.com>
To: Christoph Hellwig <hch@lst.de>,
"Ionut Nechita (Wind River)" <ionut.nechita@windriver.com>
Cc: "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, dlemoal@kernel.org, robin.murphy@arm.com,
axboe@kernel.dk, m.szyprowski@samsung.com, ahuang12@lenovo.com,
ionut_n2001@yahoo.com, sunlightlinux@gmail.com
Subject: Re: [PATCH v7 1/1] scsi: sas: skip opt_sectors when DMA reports no real optimization hint
Date: Tue, 28 Apr 2026 09:15:13 +0100 [thread overview]
Message-ID: <2fa2c61f-5b9f-4171-b7e2-1abd23409bcd@oracle.com> (raw)
In-Reply-To: <20260424132100.GA15553@lst.de>
On 24/04/2026 14:21, Christoph Hellwig wrote:
Responding to get things moving..
>> + */
>> +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;
> Upper layers have no real busines looking at dma_dev->dma_mask. What
> 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@BYAPR04MB5816.namprd04.prod.outlook.com/
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.
prev parent reply other threads:[~2026-04-28 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 7:18 [PATCH v7 0/1] scsi: sas: fix mkfs.xfs failure due to bogus optimal_io_size Ionut Nechita (Wind River)
2026-04-15 7:18 ` [PATCH v7 1/1] scsi: sas: skip opt_sectors when DMA reports no real optimization hint Ionut Nechita (Wind River)
2026-04-24 13:21 ` Christoph Hellwig
2026-04-28 8:15 ` John Garry [this message]
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=2fa2c61f-5b9f-4171-b7e2-1abd23409bcd@oracle.com \
--to=john.g.garry@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ahuang12@lenovo.com \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hch@lst.de \
--cc=ionut.nechita@windriver.com \
--cc=ionut_n2001@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=martin.petersen@oracle.com \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--cc=sunlightlinux@gmail.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