From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E961C61DD3 for ; Mon, 31 Aug 2026 12:13:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5289B10E1EE; Mon, 31 Aug 2026 12:13:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="TF+tY/MW"; dkim-atps=neutral Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012009.outbound.protection.outlook.com [40.107.209.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F25110E1EE for ; Mon, 31 Aug 2026 12:13:55 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iNVhLHT1ScMv2fU5mk/u1I3HMsY7c4inak7bM8Q9RHZX3jgGekNP/l1Gf9QYy8qpvytPkqMDNQUg20Xi+Yo0rTW/ofCzg70XsBGhj4Gn7KPITlCZfrOqXFhQChayw3ChSWehVRoAixifd2GE1pycBwQOCbhGc4EOFS4wSlh7H9WqCAfwS16VbS4FdN3NsjJcJg39Swe1q1lpmhvBh3pXxJSeJYqzLnga/Zzel7CYuHhTWlT0juWn8XBf2GCLiTvP1TJ46Ku9s5319RQaN5W17d33dcWSDS0gQ7Fayi9pZEgo2stm8/YkJfZRpuO1lmQ9Z88Gk4+Bl8gyBuBvzpZnhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eq9sZaN/m0xUHg/P0x6sITCkpAqlmV2UiarkxlasIqQ=; b=cq66nEdFxovRSU1z3p6rmSDiVTR39GOFo5Nuxivc+aM8X+W2/9Ec0IzoCnSouUMkIuvUAcVEcFLBL0o2AYirXW/JMaEiyexJYyFfQtzHWDLeE29fGjufReceYM666bUSItn4AAXoi7PQ+aLZqgmmVU0634uI1v4Puz97UA3T91V9FigPZvO6Z5Bc+ndmpSQp2CEfmgwAM0an9IsYlb5d2rNblhPDic6wEQSh75PA2+GLeB2cM2uSaycAP3NliIR0UieEKMH1tByGL1/xhoQq3PMrZxQZfKZi8FYYItAtlFUgAcc+z9njd9cOtPiHgir+N/mq1GS2ldvC8eoReQu3kA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eq9sZaN/m0xUHg/P0x6sITCkpAqlmV2UiarkxlasIqQ=; b=TF+tY/MW/OkfsAxdWzb29hdvw3Y6vfXCzGn+kyomLUdknd1Qa95Tx+T6Zm8rk+usfj3icGo4ECGTSf+hL5RK/Wd1KRZN63Oo27SCGjjspUSVI3+jqc/fPtoMftM734yu+LShXwFIDVLWMQHCnUCBQ+UfyLcajrZIFCFTrtO8m00= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by DS7PR12MB5984.namprd12.prod.outlook.com (2603:10b6:8:7f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Mon, 31 Aug 2026 12:13:51 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c%3]) with mapi id 15.21.0339.007; Mon, 31 Aug 2026 12:13:50 +0000 Message-ID: <03347904-e0ee-42ef-a40a-478309a2ba33@amd.com> Date: Mon, 31 Aug 2026 14:13:47 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/amdgpu: skip the VMID 0 flush for VRAM clear-on-release To: =?UTF-8?Q?Timur_Krist=C3=B3f?= , alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org Cc: Arunpravin Paneer Selvam , stable@vger.kernel.org References: <20260828044734.135460-1-Arunpravin.PaneerSelvam@amd.com> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR5P281CA0014.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f2::7) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|DS7PR12MB5984:EE_ X-MS-Office365-Filtering-Correlation-Id: e64a0fbb-787d-4871-1620-08df07595133 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|23010399003|1800799024|366016|6133799003|10067099003|4143699003|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: MsHqaDcT5eGgY1aQgw/2ZtHfWYJo1lgVwSQbMcb4BmnPU4Gu7pzd/X4ohhy7Pf8vd0f6P8NRAX5f6MLjiYqw6f4Ps1wPggu3L0MDmnnsFYJ3DkMmzCRl5GPrQQV+IhRtky7GpHoZKxHeXM5AM86/KcO27dE4UrjK2JarTWgz0dUb8dfg7XZ3E6xGyjV0sWgIDKpU+OFq3ISPLaVc8PlBkFkYqmLc4c2kTFz6/xwlcjR/GEBEuT+hpEsOZ8vbYI5m+Lm/S9mpD1QTF+txo3QC9ZxnyV4bDHX95xckWPt2tpxzDk+RQ3H0QnLfMwme3V0cisrSjX0ci4xp+ZsVXt+jkFSGz7Zgz+V4oEpwvLjCNUVfwDtXYVm8VuCJk7bA7KxiK5LYp+coUVfqqpBJ5LMar9cS7V6gOnyFtd2bJ0x3d72IUyUgbtKb2IcfTo69sso+RRMoSxHViL59S69Cp6WfKO1r+LairFGTXc76G325l4nAaxR5ws1t+0wxmr42FuGOt5On5/2fOYR7w3HeOrBrYhrBbBbI+OkHlkfxpq/d5gNmuSkblVdix4PUeuNFVuTSs4r4Dt5annbxo471MvRwFLhllg1z3q9QCZCH9xSY3JDkK6eexvQccro1Kd/abvIkyXadYmX+uEGPmeCWu5JyUjAckCYu5jgMIivRW3nT0mI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB5685.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(10067099003)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U1I5ektGNkRWYWEwTzRubUQ2WW5QcmxxR0tJY2lRaVdHVGlpNkFxMHNLcXdE?= =?utf-8?B?VC9QZ1hLQmpHY21wZHZQaWdLQ2RwejByWjIvclF0amdpRHMzSDZmbWNVdXE3?= =?utf-8?B?T1F3aWVrUEZqS1ZEZlZsTHREVWxaVy9iVi91eHpKV0hhSml4aWR1aUpmTnJE?= =?utf-8?B?Mi92SVlpWHg3RFZKWUlyQzg5L2J4R04zVC90Q0t1RmloODBVbjBhbjE3KzNS?= =?utf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dqcXVkc0V4REVR?= =?utf-8?B?VDI1WWhHcHZhaEJPYWJGQitCWjhzK21uY3BzMkRKYlRreks0cXlpcE9lWHJh?= =?utf-8?B?WnZnSzI1NzVOaFVlVE9sVjlHbk03ZXI5UmIrRkd1ZnIzYS9NWjExaUxrQ2Iv?= =?utf-8?B?THNQeURlN3VEM2g5K2QyMUJrajFLVGllMlBzMy9Va1BYN3ZoTllrRS9aU1lL?= =?utf-8?B?ZXkydmk4ZGRTMGlhdzc3d3hFZk9rUFM3ZEwzRzRIRlRobnF0a2Z0elNiYTN3?= =?utf-8?Q?WV3t7Rop8V8U0QnZL8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e64a0fbb-787d-4871-1620-08df07595133 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2026 12:13:50.7205 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EP61L2JWJCFvSkq6gw4qmI0jM8vUGDQsJZx9/6qMrN2+LVgtp++cGAh9BM+UWJHh X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5984 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 8/31/26 13:39, Timur Kristóf wrote: > On 2026. augusztus 28., péntek 6:47:34 közép-európai nyári idő Arunpravin > Paneer Selvam wrote: >> Clear-on-release only runs on VRAM, which amdgpu_ttm_map_buffer() reaches >> via its direct MC address without programming a GART window, yet the wipe >> still forces a VMID 0 flush. > > Makes sense. > We don't need the VM flush when we are not changing the page tables. > > I agree with the patch, just would like to ask a few questions to better > understand the underlying problem: > >> On GFX11 (e.g. Navi33) that spurious SDMA >> flush can wedge the engine > > What is happening when the SDMA engine is wedged? As far as Arun has investigate the UTCL1 request queue (which is part of the memory interface of the SDMA) is in a deadlock, but we haven't quite figured out why yet. > Can it be recovered by an > SDMA queue reset? Most likely no. The UTCL1 is the translation and memory request queue between SDMA and the core memory hub. To reset that one you need to reset both ends and the core memory hub usually needs a full ASIC reset for that. > Is it just a hang, or can it cause other issues such as page faults? Good question we honestly don't know at this point. The HW guys need to find the root cause first. >> only flush when a GART window is actually used. > > Does that mean that there is still a risk of the wedge when the GART windows > are used? Yes, and that is actually not limited to the GART windows. It looks like every time we map something into any VM it can happen that the SDMA crashes when there are concurrent operations ongoing. It's just that the GART flushes triggered by the SDMA made that scenario much more likely than anything else. > Can you remind me when/why we need the GART windows exactly? Basically every time we want to copy something from system memory to VRAM with the kernel. Regards, Christian. > >> Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality") >> Cc: stable@vger.kernel.org >> Cc: Christian König >> Signed-off-by: Arunpravin Paneer Selvam > > Reviewed-by: Timur Kristóf > > Thanks and best regards, > Timur > >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index >> 6c07cee8e8777..2e6c98c2f1efa 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >> @@ -2578,6 +2578,7 @@ int amdgpu_ttm_clear_buffer(struct >> amdgpu_ttm_buffer_entity *entity, struct amdgpu_device *adev = >> amdgpu_ttm_adev(bo->tbo.bdev); >> struct dma_fence *fence = NULL; >> struct amdgpu_res_cursor dst; >> + bool vm_needs_flush; >> int r; >> >> if (!entity) >> @@ -2585,6 +2586,8 @@ int amdgpu_ttm_clear_buffer(struct >> amdgpu_ttm_buffer_entity *entity, >> >> amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &dst); >> >> + vm_needs_flush = bo->tbo.resource->start == > AMDGPU_BO_INVALID_OFFSET; >> + >> mutex_lock(&entity->lock); >> while (dst.remaining) { >> struct dma_fence *next; >> @@ -2605,7 +2608,7 @@ int amdgpu_ttm_clear_buffer(struct >> amdgpu_ttm_buffer_entity *entity, >> >> r = amdgpu_ttm_fill_mem(adev, entity, >> 0, to, cur_size, resv, >> - &next, true, > k_job_id); >> + &next, vm_needs_flush, > k_job_id); >> if (r) >> goto error; > > > >