From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Christoph Hellwig <hch@lst.de>,
Ulf Hansson <ulf.hansson@linaro.org>,
"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: core Drop BLK_BOUNCE_HIGH
Date: Fri, 9 Feb 2024 23:35:13 +0100 [thread overview]
Message-ID: <Zcaooa0bTKo3OdvV@qmqm.qmqm.pl> (raw)
In-Reply-To: <8ca6a46e-551a-4400-965f-f4ad60bff072@app.fastmail.com>
On Thu, Jan 25, 2024 at 10:47:26AM +0100, Arnd Bergmann wrote:
> On Thu, Jan 25, 2024, at 09:50, Linus Walleij wrote:
> > The MMC core sets BLK_BOUNCE_HIGH for devices where dma_mask
> > is unassigned.
> >
> > For the majority of MMC hosts this path is never taken: the
> > OF core will unconditionally assign a 32-bit mask to any
> > OF device, and most MMC hosts are probed from device tree,
> > see drivers/of/platform.c:
> >
> > of_platform_device_create_pdata()
> > dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > if (!dev->dev.dma_mask)
> > dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> >
> > of_amba_device_create()
> > dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> >
> > MMC devices that are probed from ACPI or PCI will likewise
> > have a proper dma_mask assigned.
> >
> > The only remaining devices that could have a blank dma_mask
> > are platform devices instantiated from board files.
> >
> > These are mostly used on systems without CONFIG_HIGHMEM
> > enabled which means the block layer will not bounce, and in
> > the few cases where it is enabled it is not used anyway:
> > for example some OMAP2 systems such as Nokia n800/n810 will
> > create a platform_device and not assign a dma_mask, however
> > they do not have any highmem, so no bouncing will happen
> > anyway: the block core checks if max_low_pfn >= max_pfn
> > and this will always be false.
> >
> > Should it turn out there is a platform_device with blank
> > DMA mask actually using CONFIG_HIGHMEM somewhere out there
> > we should set dma_mask for it, not do this trickery.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> I think it's worth mentioning the cb710 example here, which
> uses a platform device as a child of a PCI device and
> does not assign a DMA mask nor use DMA.
>
> This one will see a change in behavior, meaning that the
> blockdev buffers are no longer bounced. As far as I can
> tell, this is fine because the driver appears to correctly
> use the sg_iter infrastructure for mapping data pages,
> but it would be good to have this confirmed by
> Michał Mirosław because this code path has probably never
> been tested without BLK_BOUNCE_HIGH.
Hi, this driver doesn't do DMA at all, so having DMA mask set or not
it should be good as long as the CPU can read/write the buffers.
Best Regards
Michał Mirosław
next prev parent reply other threads:[~2024-02-09 22:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 8:50 [PATCH] mmc: core Drop BLK_BOUNCE_HIGH Linus Walleij
2024-01-25 9:47 ` Arnd Bergmann
2024-02-09 22:35 ` Michał Mirosław [this message]
2024-02-09 23:41 ` Linus Walleij
2024-02-10 11:58 ` Arnd Bergmann
2024-02-10 19:38 ` Linus Walleij
2024-02-10 21:34 ` Arnd Bergmann
2024-01-25 14:38 ` Christoph Hellwig
2024-01-30 12:06 ` Ulf Hansson
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=Zcaooa0bTKo3OdvV@qmqm.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--cc=arnd@arndb.de \
--cc=hch@lst.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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