From: "Christian König" <christian.koenig@amd.com>
To: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>,
Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/radeon: allocate dummy_page without DMA32 on fail
Date: Wed, 15 Jul 2026 11:15:38 +0200 [thread overview]
Message-ID: <11218edd-ae58-4966-8172-27b2435eaa1f@amd.com> (raw)
In-Reply-To: <20260714-radeon_32bit_fix-v1-1-42a99945f6e0@oss.tenstorrent.com>
On 7/14/26 18:03, Anirudh Srinivasan wrote:
> radeon fails to probe on platforms that have all their memory above the
> 32-bit range with an -ENOMEM because dummy_page_init calls
> alloc_page(GFP_DMA32), which would fail.
Unfortunately I clearly have to reject this.
The DMA32 allocation is mandatory for radeon to work correctly on some platforms.
> Allow this driver to work on such platforms by falling back to
> ZONE_NORMAL regions. dma_map_page called subsequently would catch any
> issues with the device being unable to DMA into the mapped page.
No, it doesn't.
It's just your special case that dma_map_page() is able to use some IOMMU to remap the page below 32bits so that the driver can access it.
The problem is that we have quite a bunch of cases where this doesn't work correctly and eventually result in all kinds of trouble, including random memory corruptions.
In those cases it's better to not load the driver at all than to later deal with corrupted data.
What could be possible is to add a special quirk for your platform to not allocate the dummy page as DMA32 in the first place.
> An equivalent fix was applied to ttm in commit 0a8c1feed387 ("drm/ttm:
> allocate dummy_read_page without DMA32 on fail")
Yeah, but only after making sure that radeon still doesn't load on such platforms.
Regards,
Christian.
>
> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
> ---
> I had issues getting a R5 430 (Oland) with the radeon driver to probe on
> a spacemit K3, which has no 32-bit memory regions. With this patch, the
> driver was able to probe. The K3 supports up to 40 bit DMA and also has
> an IOMMU, so the card works with the board. I was able to reach a
> framebuffer console with this patch.
> ---
> drivers/gpu/drm/radeon/radeon_device.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 705c012fcf9e0..e8b1fa715a648 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -783,9 +783,15 @@ int radeon_dummy_page_init(struct radeon_device *rdev)
> {
> if (rdev->dummy_page.page)
> return 0;
> - rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
> - if (rdev->dummy_page.page == NULL)
> - return -ENOMEM;
> + rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO |
> + __GFP_NOWARN);
> + /* Retry without GFP_DMA32 for platforms where DMA32 is not available */
> + if (rdev->dummy_page.page == NULL) {
> + rdev->dummy_page.page = alloc_page(GFP_KERNEL | __GFP_ZERO);
> + if (rdev->dummy_page.page == NULL)
> + return -ENOMEM;
> + dev_warn(&rdev->pdev->dev, "Falling back to non-DMA32 dummy page allocation\n");
> + }
> rdev->dummy_page.addr = dma_map_page(&rdev->pdev->dev, rdev->dummy_page.page,
> 0, PAGE_SIZE, DMA_BIDIRECTIONAL);
> if (dma_mapping_error(&rdev->pdev->dev, rdev->dummy_page.addr)) {
>
> ---
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> change-id: 20260714-radeon_32bit_fix-8b1058b6d571
>
> Best regards,
> --
> Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
>
next prev parent reply other threads:[~2026-07-15 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 16:03 Anirudh Srinivasan
2026-07-15 9:15 ` Christian König [this message]
2026-07-16 2:08 ` Anirudh Srinivasan
2026-07-16 7:34 ` Christian König
2026-07-16 14:31 ` Anirudh Srinivasan
2026-07-17 7:37 ` Christian König
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=11218edd-ae58-4966-8172-27b2435eaa1f@amd.com \
--to=christian.koenig@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=asrinivasan@oss.tenstorrent.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
/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
Powered by JetHome