From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: hch@lst.de, m.szyprowski@samsung.com, tony@atomide.com,
vdumpa@nvidia.com, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com,
laurent.pinchart@ideasonboard.com, sre@kernel.org,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] Revert "dma-contiguous: do not allocate a single page from CMA area"
Date: Tue, 26 Feb 2019 16:48:25 -0800 [thread overview]
Message-ID: <20190227004825.GA29112@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <1a3af95a-6e08-01fa-e4ef-07c1c1b6db69@arm.com>
On Tue, Feb 26, 2019 at 11:35:44PM +0000, Robin Murphy wrote:
> On 2019-02-26 8:23 pm, Nicolin Chen wrote:
> > This reverts commit d222e42e88168fd67e6d131984b86477af1fc256.
> >
> > The original change breaks omap dss:
> > omapdss_dispc 58001000.dispc:
> > dispc_errata_i734_wa_init: dma_alloc_writecombine failed
> >
> > Let's revert it first and then find a safer solution instead.
>
> Ah, I think I see the problem - once arch/arm's __dma_alloc() has decided to
> use CMA (because dev_get_cma_area(dev) returns the global area), it then
> won't fall back to trying a regular page allocation if
> dma_alloc_from_contiguous() returns NULL. Thus anything on 32-bit Arm trying
> to allocate a single-page buffer in blockable context with a CMA-enabled
> config is just going to fail. Similarly, it looks like none of the
> DMA_ATTR_FORCE_CONTIGUOUS cases are prepared to handle this change either
> (amd_iommu appears technically affected, but is already using
> dma_alloc_from_contiguous() backwards compared to everyone else, hmm).
Yea, I searched the tree and got the same results.
> I guess the question is whether to add alloc_page()/free_page() fallbacks to
> those call sites, or stuff them directly into the CMA helpers here.
Probably would be safer/easier to do the later one I feel.
WARNING: multiple messages have this Message-ID (diff)
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: tony@atomide.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
sre@kernel.org, tomi.valkeinen@ti.com,
laurent.pinchart@ideasonboard.com, linux-omap@vger.kernel.org,
hch@lst.de, linux-arm-kernel@lists.infradead.org,
m.szyprowski@samsung.com
Subject: Re: [PATCH] Revert "dma-contiguous: do not allocate a single page from CMA area"
Date: Tue, 26 Feb 2019 16:48:25 -0800 [thread overview]
Message-ID: <20190227004825.GA29112@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <1a3af95a-6e08-01fa-e4ef-07c1c1b6db69@arm.com>
On Tue, Feb 26, 2019 at 11:35:44PM +0000, Robin Murphy wrote:
> On 2019-02-26 8:23 pm, Nicolin Chen wrote:
> > This reverts commit d222e42e88168fd67e6d131984b86477af1fc256.
> >
> > The original change breaks omap dss:
> > omapdss_dispc 58001000.dispc:
> > dispc_errata_i734_wa_init: dma_alloc_writecombine failed
> >
> > Let's revert it first and then find a safer solution instead.
>
> Ah, I think I see the problem - once arch/arm's __dma_alloc() has decided to
> use CMA (because dev_get_cma_area(dev) returns the global area), it then
> won't fall back to trying a regular page allocation if
> dma_alloc_from_contiguous() returns NULL. Thus anything on 32-bit Arm trying
> to allocate a single-page buffer in blockable context with a CMA-enabled
> config is just going to fail. Similarly, it looks like none of the
> DMA_ATTR_FORCE_CONTIGUOUS cases are prepared to handle this change either
> (amd_iommu appears technically affected, but is already using
> dma_alloc_from_contiguous() backwards compared to everyone else, hmm).
Yea, I searched the tree and got the same results.
> I guess the question is whether to add alloc_page()/free_page() fallbacks to
> those call sites, or stuff them directly into the CMA helpers here.
Probably would be safer/easier to do the later one I feel.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-02-27 0:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 20:23 [PATCH] Revert "dma-contiguous: do not allocate a single page from CMA area" Nicolin Chen
2019-02-26 20:23 ` Nicolin Chen
2019-02-26 23:35 ` Robin Murphy
2019-02-26 23:35 ` Robin Murphy
2019-02-27 0:42 ` Tony Lindgren
2019-02-27 0:42 ` Tony Lindgren
2019-02-27 0:48 ` Nicolin Chen [this message]
2019-02-27 0:48 ` Nicolin Chen
2019-02-27 8:46 ` Krzysztof Kozlowski
2019-02-27 8:46 ` Krzysztof Kozlowski
2019-02-27 14:04 ` Jon Hunter
2019-02-27 14:04 ` Jon Hunter
2019-02-27 14:04 ` Jon Hunter
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=20190227004825.GA29112@Asurada-Nvidia.nvidia.com \
--to=nicoleotsuka@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=sre@kernel.org \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.com \
--cc=vdumpa@nvidia.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 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.