From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux.dev
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org,
linux-mmc@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] scsi: check that busses support the DMA API before setting dma parameters
Date: Tue, 27 Aug 2024 13:19:13 +0100 [thread overview]
Message-ID: <92ebdc16-7938-462a-bb0e-4d5d368c5eb1@arm.com> (raw)
In-Reply-To: <20240824034925.1163244-2-hch@lst.de>
On 24/08/2024 4:49 am, Christoph Hellwig wrote:
> We'll start throwing warnings soon when dma_set_seg_boundary and
> dma_set_max_seg_size are called on devices for buses that don't fully
> support the DMA API. Prepare for that by making the calls in the SCSI
> midlayer conditional.
Just thinking ahead, might it be worth a logical "are SG segment limits
relevant?" wrapper around the dev->dma_parms reference? Not a big deal
for now if we think this site is the only user, so either way,
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/scsi_lib.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 3958a6d14bf457..7f0394c4492033 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1988,8 +1988,15 @@ void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim)
> if (shost->no_highmem)
> lim->features |= BLK_FEAT_BOUNCE_HIGH;
>
> - dma_set_seg_boundary(dev, shost->dma_boundary);
> - dma_set_max_seg_size(dev, shost->max_segment_size);
> + /*
> + * Propagate the DMA formation properties to the dma-mapping layer as
> + * a courtesy service to the LLDDs. This needs to check that the buses
> + * actually support the DMA API first, though.
> + */
> + if (dev->dma_parms) {
> + dma_set_seg_boundary(dev, shost->dma_boundary);
> + dma_set_max_seg_size(dev, shost->max_segment_size);
> + }
> }
> EXPORT_SYMBOL_GPL(scsi_init_limits);
>
next prev parent reply other threads:[~2024-08-27 12:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-24 3:49 remove the dma_set_{max_seg_size,seg_boundary,min_align_mask} return value v2 Christoph Hellwig
2024-08-24 3:49 ` [PATCH 1/4] scsi: check that busses support the DMA API before setting dma parameters Christoph Hellwig
2024-08-27 12:19 ` Robin Murphy [this message]
2024-08-24 3:49 ` [PATCH 2/4] dma-mapping: don't return errors from dma_set_min_align_mask Christoph Hellwig
2024-08-24 3:49 ` [PATCH 3/4] dma-mapping: don't return errors from dma_set_seg_boundary Christoph Hellwig
2024-08-24 3:49 ` [PATCH 4/4] dma-mapping: don't return errors from dma_set_max_seg_size Christoph Hellwig
2024-08-26 11:36 ` Ulf Hansson
2024-08-29 0:57 ` remove the dma_set_{max_seg_size,seg_boundary,min_align_mask} return value v2 Martin K. Petersen
2024-08-29 4:24 ` 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=92ebdc16-7938-462a-bb0e-4d5d368c5eb1@arm.com \
--to=robin.murphy@arm.com \
--cc=dmaengine@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=m.szyprowski@samsung.com \
--cc=martin.petersen@oracle.com \
--cc=netdev@vger.kernel.org \
/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