[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea56ce2f-c86a-4a87-ba37-19079713cc2d@amd.com>
Date: Wed, 17 Jan 2024 09:39:42 +0100
From: Christian König <christian.koenig@....com>
To: Yangyu Chen <cyy@...self.name>, dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, Huang Rui <ray.huang@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Jiuyang Liu <liu@...yang.me>, Yichuan Gao <i@...is.me>,
Icenowy Zheng <uwu@...nowy.me>
Subject: Re: [PATCH v2 1/1] drm/ttm: allocate dummy_read_page without DMA32 on
fail
Am 16.01.24 um 19:50 schrieb Yangyu Chen:
> Some platforms may not have any memory in ZONE_DMA32 and use IOMMU to allow
> 32-bit-DMA-only device to work. Forcing GFP_DMA32 on dummy_read_page will
> fail on such platforms. Retry after fail will get this works on such
> platforms.
>
> Signed-off-by: Yangyu Chen <cyy@...self.name>
Reviewed and pushed to drm-misc-fixes. That patch should show up in the
next rc and stable kernels next week or so.
Thanks,
Christian.
> ---
> drivers/gpu/drm/ttm/ttm_device.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index d48b39132b32..c9fa8561f71f 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -95,11 +95,17 @@ static int ttm_global_init(void)
> ttm_pool_mgr_init(num_pages);
> ttm_tt_mgr_init(num_pages, num_dma32);
>
> - glob->dummy_read_page = alloc_page(__GFP_ZERO | GFP_DMA32);
> + glob->dummy_read_page = alloc_page(__GFP_ZERO | GFP_DMA32 |
> + __GFP_NOWARN);
>
> + /* Retry without GFP_DMA32 for platforms DMA32 is not available */
> if (unlikely(glob->dummy_read_page == NULL)) {
> - ret = -ENOMEM;
> - goto out;
> + glob->dummy_read_page = alloc_page(__GFP_ZERO);
> + if (unlikely(glob->dummy_read_page == NULL)) {
> + ret = -ENOMEM;
> + goto out;
> + }
> + pr_warn("Using GFP_DMA32 fallback for dummy_read_page\n");
> }
>
> INIT_LIST_HEAD(&glob->device_list);
Powered by blists - more mailing lists