From patchwork Thu Jan 9 19:48:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhi Hou X-Patchwork-Id: 13933167 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 2FED7E77197 for ; Thu, 9 Jan 2025 19:48:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6984E10EF14; Thu, 9 Jan 2025 19:48:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="ejc9PGq3"; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC7B110EF14 for ; Thu, 9 Jan 2025 19:48:30 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sunkYVuHaRpfdr49bcBli8tvBgiiu3InzQUX0ZB5+6ruZqUM/fZnNzLoUlWbB6FRZqrzLMLt35uEwsZuIZpUIGL8DucZfZnQ1BlOLT8xV1qK7DY8B4x09SaU7jmc2RA4ypjwk4S3RKugWTGa10HerR2H/v8V/srZHT32SFpz8JYs7/bdJJEpzTft5w9PyzL0BK2YnstkGH/p1XFdaxP9rpuQqTzRkIbvQwFFZqiCMSTdzcgZ/S21RGXsDhz13ugvtfPTXbi/IavoWFaL6qEjXqW0zTtnQkv+FFZGP9152zqBm6zMciho3n8KDQ9T1dZgYMnnEVtPMhdViFBo01aEfg== 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=w3DTsjV6suRAc1GSAuaUQvT6q4wk2jHjbDQqXpWlY0A=; b=f6a0n1OY0X96Igr3w6iY6Yp2a4Hiugt7m+SMevwH7MG2t/h6GKt2GEdKiEFCWsJ6TfRNue3UGeGgvXCIqiisog+pxwQDb/aelr1pQRMSEfleSOBPKcuyT8QfQ90qvMjjige4ItzwtYH567d3ML/yAXmFMT6CIB+wYU68AEU0WrgyHrpzcQ/G7Vgx4Fdh1Za1CVBDUhQI0MY7ymDIXQ/kwxJDcCCEbxUcLtkngwLNWzxbmXDjI9/YQEWr4rcMQUKnZUdjt0JdmBDPiYPgPbtWxKMQYAMt3F05O3Ntumqx3eCRtMaU1de6eMIlOoXD61wMblHbfDJI1uq3DRR5q8XZkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=w3DTsjV6suRAc1GSAuaUQvT6q4wk2jHjbDQqXpWlY0A=; b=ejc9PGq3rhcwQIggUs4jQDytcj7XUnTRcuAl0KkK8eq95IAr8Eb/HMtnnCy5ENg4i0A91Ov7Ze6XvWANMHCV62+pXwMy8gqaMnxsRuxwXFgpiXhr00xUI6qR/jgIxzpbehTzrWlgjBZU8Cqurz6ZbmOlbNViBcSVjaTFKjHgCcc= Received: from BLAPR03CA0135.namprd03.prod.outlook.com (2603:10b6:208:32e::20) by PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.10; Thu, 9 Jan 2025 19:48:27 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:32e:cafe::31) by BLAPR03CA0135.outlook.office365.com (2603:10b6:208:32e::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.12 via Frontend Transport; Thu, 9 Jan 2025 19:48:27 +0000 X-MS-Exchange-Authentication-Results: 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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8335.7 via Frontend Transport; Thu, 9 Jan 2025 19:48:26 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 9 Jan 2025 13:48:26 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 9 Jan 2025 13:48:26 -0600 Received: from xsjlizhih51.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 9 Jan 2025 13:48:25 -0600 From: Lizhi Hou To: , , CC: Lizhi Hou , , , , , , , Dan Carpenter Subject: [PATCH v2] accel/amdxdna: Return error when setting clock failed for npu1 Date: Thu, 9 Jan 2025 11:48:11 -0800 Message-ID: <20250109194811.499505-1-lizhi.hou@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|PH7PR12MB5685:EE_ X-MS-Office365-Filtering-Correlation-Id: 1876f902-b86b-4a1b-2050-08dd30e695c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: yAuK19Bwz3ML0VITrGy6cJav2CCFSUNfrbTq3iypdZbFjBUkGg7xn+fLOHVYQSqzre5Rk6//SFi1amIN6o6OZiqGyUqPwjzEK5PS7FOsiw6oJN8BfyBEq2IEAhQ5tgR7udRI8qLyg/lqlkjnQn2285DdtJ18qXTziChIa5SnsHRnXECSUshEGtWYbmYgs/MP/5mYuye+mDz2yYxxxgWqFBGlbwvfW5/a2QN6mBa7NktLCAjBIK/fPO1vYC/jTWchUA7yy8PmfmGj0cyJFz7vw/jAT39rTfdw0AZngK5GugL/0iscM3iIcgwVX25DpjBDQAgDSMRS8HoHvu78lA9oy3ZgXvFen+CoiPEgQPHbxKLRRCLU/VWBoTiKHzM7bfozP7oROYXTdFP2PVLObcbkX3KL6vz/DlfTdKer6xbHNGSuuEitl6nSz0b2/USQ3fCGCbc1oxs0WvMy/Pvh3GV0X+W9mAnHgXUxhgyY1IbORMagElGFt0AvXTs/UtGM8Uusn9h2TwCo1FGq895nhaOJpCl/RxtZqfsM1020ul1Fc/K42ZY/WC+glS3Afpk9Tg2gcO9xvPTQLROxOK4wyreycVAW3QfHVCjLsBZbIpSLZdpqmlDz+w0btFNFqOuW1ZkC4XYR1D5ItCQLasznpH3fg1qo/o6jEb7He64y9/m9SqNGH/7DqeDFoArS1W3OAeEpaxvfxqfxWZ0O4azMnsSMpsAvjcD2LnqeTVN9EX9dKMOZB9W8wsEiL6j4/1WIRzbMU1SMBdGtifB7nCwZrb2yZcpcPlBrGBU7gEzc5zYI+0hv5v6cHWwnhVP2+IUP7SL+e7ku/dSOqWof5VoZ131buJ+jJ0P7l5Xaqt1/cx9WUUgDMoYxzBHhrEGrA59ll0hJnsWHW0rtxm5De1OMOiYrwCCz/GwPOBJn77nzFY2vzvGxEjiu/+xsZMNz1BMn/sadbcNrdtmhmkVWVAcU1vAzp/z5ZNxhLxTZL6DvkOk2Id3tJseLM+UTeeastpB3wOd8pS0C/gv1eVj0iUFw3LH3+2SWiOREpTSE72jVnU7SF4r3KQAbEFJZjxR7b5u4X2p5X3AzolwVSnmEGcpzkUs456utThtsb8/u9PVXSzHEPyUx8L43TOBUPnIB2JTc4uW1dVzJR5AWCmdp9tNldsYo9tTI2MVADhxosTdLIFNYRf3fxKP+fBq+nzrDvc5tf38oEWgjwDuaUlzhM/Kfv4Km6OXCX0O1Z9sEYY9uMlTGdo46zTMS+sNWULQRzDps1mQjaZUxfuPoNNCYR1661K2GliFiQSz2TNl4smgNXKA7+q+1C+8/VvbpS1R5M7aPCG0nV4R/cEvtMNJCzeAzslz6nEe02Aq3hGoxFqbd/vYxno5L0ZaCMnv7oRJV85mHSipFSmF7WmGvqSvZ7C2abZUZJwmq+lC8pSIkX+1PeYXwdXH19l/6D8/OtWwTyDYx3wUPrdT847nf8poQ7eU+9QY3YdMrcpsnc5m5OVKvdFmLgZ8= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2025 19:48:26.8992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1876f902-b86b-4a1b-2050-08dd30e695c2 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5685 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Due to miss returning error when setting clock, the smatch static checker reports warning: drivers/accel/amdxdna/aie2_smu.c:68 npu1_set_dpm() error: uninitialized symbol 'freq'. Fixes: f4d7b8a6bc8c ("accel/amdxdna: Enhance power management settings") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/202267d0-882e-4593-b58d-be9274592f9b@stanley.mountain/ Signed-off-by: Lizhi Hou Reviewed-by: Mario Limonciello --- drivers/accel/amdxdna/aie2_smu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/accel/amdxdna/aie2_smu.c b/drivers/accel/amdxdna/aie2_smu.c index 73388443c676..d303701b0ded 100644 --- a/drivers/accel/amdxdna/aie2_smu.c +++ b/drivers/accel/amdxdna/aie2_smu.c @@ -64,6 +64,7 @@ int npu1_set_dpm(struct amdxdna_dev_hdl *ndev, u32 dpm_level) if (ret) { XDNA_ERR(ndev->xdna, "Set npu clock to %d failed, ret %d\n", ndev->priv->dpm_clk_tbl[dpm_level].npuclk, ret); + return ret; } ndev->npuclk_freq = freq; @@ -72,6 +73,7 @@ int npu1_set_dpm(struct amdxdna_dev_hdl *ndev, u32 dpm_level) if (ret) { XDNA_ERR(ndev->xdna, "Set h clock to %d failed, ret %d\n", ndev->priv->dpm_clk_tbl[dpm_level].hclk, ret); + return ret; } ndev->hclk_freq = freq; ndev->dpm_level = dpm_level;