Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E75D6606A31A for ; Mon, 26 Oct 2026 03:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=T0xif4Cn Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C57610E5E1; Mon, 26 Oct 2026 03:21:24 +0000 (UTC) Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012039.outbound.protection.outlook.com [52.101.43.39]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8650610E5E1 for ; Mon, 26 Oct 2026 03:21:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MaseAyvUiKpHiFT3YelNfz/rP2XpUlmIPWrYxHe1YdcP1d5bOq61OKS0C2Od5qPKiIISkvU42areJaQ60o96MijeUFMujsBEqw6axnKZ6wLhgCiNr1ScMcDMdiHWkH2fsl4wc5d5CcKgAscLZZvGJBpJ4BWOGyXWZvCsDwDTbx/iwCAor9vhqAfu30zIYezF828B71HcXU0D5sQ8EbWyIc+8URk33WTqsd3A8MmLHpXZZHu8OkFVafTLYnl4MngrOswOu5lSyIKOHwJCFDTXDecILaeCGXKRZUvkF/k3rWV+pYGjYdfdSxXsCEhEarR+glk5P+LgxLXqP/AcnmdvHg== 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=lS2KWt0U6P47Hw0Tw2lgE4pTKt7hyuLuD+rqhqeGYVg=; b=c5f6dcxryGKvREjfAqsIsHlgwS/QM0vtvg6GuhVNqsXhCdbz/vW4wJdAxdL4hjp8lUFx7vPt+uX+E8y2O+1qzt592Jmy0XUmov9IOuFZJjm/IQCnmhCkG86j8oV/QAaHr3Qd2+/075vB5y905BZABqF7D1RBQbC1zaqH9uDUDa46mFAzHm512/oVwbIGtUJ2/eW8zzaFD2tNvxbNARo0nh48xZxOc6ZYF2q69R+Zdl89tBILKk4mwQ3/WRwQJfiwli183WNo//uFrAu3FQHoGz6svGPf76OuD/YnQiNKW7n4Avk12v6J/bGkhhhD/h0HZ88rpAJYPLt4/4K7oKaTyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=lS2KWt0U6P47Hw0Tw2lgE4pTKt7hyuLuD+rqhqeGYVg=; b=T0xif4Cnam40gSjDFN/u3KcsNjAltxrj38acW4jpXMOFe1DKPhSIXUFu14X97wQ4VlvTB+I/8jdHo9OZVUEKJQa5Uu0ZrjSH3UzvIGphy9PbtR2In1hf/lWN7iHNRQpQMOncalGesTI/p1+W+C5ykmNI+Xh/d5X1hHBHLbcGynw= Received: from BN0PR07CA0001.namprd07.prod.outlook.com (2603:10b6:408:141::12) by CY8PR12MB7290.namprd12.prod.outlook.com (2603:10b6:930:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Mon, 26 Oct 2026 03:21:14 +0000 Received: from BL6PEPF00022571.namprd02.prod.outlook.com (2603:10b6:408:141:cafe::a5) by BN0PR07CA0001.outlook.office365.com (2603:10b6:408:141::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.21 via Frontend Transport; Mon, 26 Oct 2026 03:21:13 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by BL6PEPF00022571.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Mon, 26 Oct 2026 03:21:13 +0000 Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.53; Sun, 25 Oct 2026 22:21:12 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.53; Sun, 25 Oct 2026 22:21:12 -0500 Received: from JesseDEV.amd.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.53 via Frontend Transport; Sun, 25 Oct 2026 22:21:05 -0500 From: Jesse Zhang To: CC: , Christian Koenig , , , , "Jesse Zhang" , Alex Deucher Subject: [PATCH v2 4/7] drm/amdgpu/gfx9: flush the scratch register write in the ring test Date: Mon, 26 Oct 2026 11:20:20 +0800 Message-ID: <20261026032042.2266892-4-Jesse.Zhang@amd.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261026032042.2266892-1-Jesse.Zhang@amd.com> References: <20261026032042.2266892-1-Jesse.Zhang@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022571:EE_|CY8PR12MB7290:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b2ab9e1-f271-434a-e979-08df33103054 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|23010399003|1800799024|82310400026|36860700016|261009223027099003|261022105027099003|261021121427099003|10067099003|56012099006|6133799003|18002099003|22082099003|11063799006|5023799004; X-Microsoft-Antispam-Message-Info: 1Na2oErCU/S5KKJRHCEJhc8AGUgN5Sdbw1ovFssx1sTitKvNBRWR8IsUedxDPSDmU+xUZZx5IbvQrtqhPK+VjwNYuji8FFAJeFv4uHUwqOkxyUOuqf9oHImtyk6NbGiHhL6h9uGvBaGnwjSJCaWsjj5T6J4fyR8aqiJ0udaHpBrd3yh6wHHSzZ3axYvt4fq7MJiJOmQO6RYLVat7KVumo/rBDkbFh2uUNsPjMz6tEA/X+btjohJqPY1LVbJ6ipF+INmYYYug51pqRA233KfQxHUsh5Et5avEGLkONOFEj7ou9eHAXLJ+ivwOrDOxoeSlJCK8f5vtY8OxnWba3f48WwRzyrmwMaJzBhzrwktcAqrlqovGKFHZ0JfWIoVH1PNsSETDdfY6hGAu0lijVdxS+SAv4OhVM5+VL+1Pn4QgO5onYxe0EgxheQgHi/fa6wYYO21sYhSOL4gN2EClTwHK17vAuAZ3r3uWWclo9iwu5MG7orkjeXvTHQ/NZGRSFSW8lmpTWEMIoI62eQLPY1Nhi+GYpyHo0eOq7aUxdVUtAKxWhNUQMOUBOBlL9yulwuuTGHeyFeq7DfUQTjiiq9kpRTXGTWBKcZPDTYuJVrsxIpalsGix+AImPP2ze6w5VhwTKZOAWAt0P0pvKNhwdg7PIIVcJM0nPcGojXfHaup8QiHPpxbp3u1TPYUwPIC35lpGo9AMqVlx5JVOV2ZDQW7U2A== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb08.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(23010399003)(1800799024)(82310400026)(36860700016)(261009223027099003)(261022105027099003)(261021121427099003)(10067099003)(56012099006)(6133799003)(18002099003)(22082099003)(11063799006)(5023799004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QqhdoVMMo0/XmbZdy5vsVxIHZXWUR/bzcnGHemJu55DbHTSYUxbjrCwDI+SpKoY2dh5dP1i1vrdfecb2tOG1K0O7XIRr/8cFxgAdTP1MSeKSZTR0TQoozxKnHR7tJqyN/AbESStZFsyVk6OrCL3RxcSuxduGRdRHaijpwqhfnS9aRWspoXmIQ6Qx6hHc7RM5Etd+YDiiOpHg1klx5wp8QapEAfRdY+EuplVJdzxpkeZO4TfENdQCP/RfoYEuvmtZaiBJoTKRfaLDnf3KAz3nb0OTRPxmGGo3Hyxqq70BH/MeLwcuFyt+27vGF7vSCT4t5D90zX4BPxJi0FqtKG2ZydAi+LnSmwrKd+1ZLuTpcZlQqBWNNy6YZOs8vCDLO7FTW91ZT7N51PbbxVFxFj3DS4D51xlo6qC+o3VziKDZPhpXISxCYTXAhj860Lv6JyFj X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2026 03:21:13.2809 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b2ab9e1-f271-434a-e979-08df33103054 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00022571.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7290 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The ring test writes 0xCAFEDEAD to SCRATCH_REG0 through MMIO, then has the CP write 0xDEADBEEF to it and polls for the new value. Nothing orders the posted MMIO write against the CP's write, so it can land after it. The test then reads 0xCAFEDEAD forever and fails, although the CP executed the packet. A false ring test failure in a queue or pipe reset escalates the recovery to a full GPU reset. Read the scratch register back before submitting the packet. Suggested-by: Alex Deucher Signed-off-by: Jesse Zhang --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 75d1bbdb421f..2e2673a6dbbf 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -1200,6 +1200,8 @@ static int gfx_v9_0_ring_test_ring(struct amdgpu_ring *ring) int r; WREG32(scratch, 0xCAFEDEAD); + /* Flush the posted write before the CP writes the test value. */ + RREG32(scratch); r = amdgpu_ring_alloc(ring, 3); if (r) return r; -- 2.50.1