From patchwork Mon Mar 24 06:15:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?0JLQsNGC0L7RgNC+0L/QuNC9INCQ0L3QtNGA0LXQuQ==?= X-Patchwork-Id: 14026784 Received: from mail.crpt.ru (mail.crpt.ru [91.236.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28CD62A1CA; Mon, 24 Mar 2025 06:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.236.205.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742796998; cv=none; b=BA1bHO7KVOl+FCoIfF72fIlYMFZwWuvPWfhhzqkkgxKU+5zv7BCxje91pzFjZrtqo50RU2gYZ+D0idaJZwuyZbC1ckLoby0MT+aim9TTX2heXmOe9MbMpRpu1pmeQGly9db6ITD85Dj8eWF3VKhMLm33h3apwEa4lFSRxq9JmB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742796998; c=relaxed/simple; bh=9eSSfttpcw0lJBajJNCu7ORS5sYa5GsLsfivP46rMak=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=N7SdqVpFsxU0t+9+cWch6pww6EHz+5EDEBH5x5XoUxpAI81MJ7pKkL/xTjunXsk6SuZp1Rs3ZySYOo5wXLAaSPBC75YyRxPb7wOYoP5dIooQrn2ieqfQ36+yf82POWRbtVFG33OW4kznM3JaSTF5SXoj2Rg71EY9xAYZMn7uiD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crpt.ru; spf=pass smtp.mailfrom=crpt.ru; dkim=pass (2048-bit key) header.d=crpt.ru header.i=@crpt.ru header.b=ITGIpFyp; arc=none smtp.client-ip=91.236.205.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crpt.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crpt.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=crpt.ru header.i=@crpt.ru header.b="ITGIpFyp" Received: from mail.crpt.ru ([192.168.60.3]) by mail.crpt.ru with ESMTP id 52O6FoPN018457-52O6FoPP018457 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=OK); Mon, 24 Mar 2025 09:15:50 +0300 Received: from EX2.crpt.local (192.168.60.4) by ex1.crpt.local (192.168.60.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Mon, 24 Mar 2025 09:15:50 +0300 Received: from EX2.crpt.local ([192.168.60.4]) by EX2.crpt.local ([192.168.60.4]) with mapi id 15.01.2507.044; Mon, 24 Mar 2025 09:15:50 +0300 From: =?utf-8?b?0JLQsNGC0L7RgNC+0L/QuNC9INCQ0L3QtNGA0LXQuQ==?= To: Michael Turquette CC: =?utf-8?b?0JLQsNGC0L7RgNC+0L/QuNC9INCQ0L3QtNGA0LXQuQ==?= , Stephen Boyd , Michal Simek , Javier Carrasco , Geert Uytterhoeven , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: [PATCH] soc: xilinx: vcu: modify the order of devices unregistration Thread-Topic: [PATCH] soc: xilinx: vcu: modify the order of devices unregistration Thread-Index: AQHbnIQwE54gprkZdUqVTZP34SoMOg== Date: Mon, 24 Mar 2025 06:15:49 +0000 Message-ID: <20250324061543.15150-1-a.vatoropin@crpt.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-kse-serverinfo: EX1.crpt.local, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 2/17/2025 9:52:00 AM x-kse-attachment-filter-triggered-rules: Clean x-kse-attachment-filter-triggered-filters: Clean x-kse-bulkmessagesfiltering-scan-result: protection disabled Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-FEAS-Client-IP: 192.168.60.3 X-FE-Policy-ID: 2:4:0:SYSTEM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=crpt.ru; s=crpt.ru; c=relaxed/relaxed; h=from:to:cc:subject:date:message-id:content-type:mime-version; bh=9eSSfttpcw0lJBajJNCu7ORS5sYa5GsLsfivP46rMak=; b=ITGIpFypKaB6RSoCLt1/wetbTrDJMw+CmjIoqPiHBS5QO/3pp4Mcdri1sahof3hzEDt7wquw5fAR AYRSdBTgKbOoargnFt83PAPCT6GqQMCnUP/xR4vPs9qwtcy6/OTD/PkFacUgxbUdjjv4wyK7CKmA cAAMRaZsrW1WS2np15fSBSK5ENdFaxVMBROJ8spJPKbXAVHwcukg3hLj4POA+hokV1wnJsS3/EJN XF+LhWtB7gjKeO1fY2o4Q3C3ZYYEyHXBAtSRPyqjohsQARiT9YsEaAk4fo9eqkpJn18rKwMuoMnE 3W0oVQo7l55qoSkufvQwwKUQA/1Ppoc5+9yBNg== From: Andrey Vatoropin The order of registration of 'struct clk_hw' handles in xvcu_clk_hw_register_leaf() does not correspond the order of unregistration performed in xvcu_clk_hw_unregister_leaf(). Clean up the order and replace the duplicate !divider check with a more appropriate one. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Vatoropin --- drivers/clk/xilinx/xlnx_vcu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c index 81501b48412e..e4b08f501958 100644 --- a/drivers/clk/xilinx/xlnx_vcu.c +++ b/drivers/clk/xilinx/xlnx_vcu.c @@ -511,11 +511,11 @@ static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw) return; mux = clk_hw_get_parent(divider); - clk_hw_unregister_mux(mux); - if (!divider) + clk_hw_unregister_divider(divider); + if (!mux) return; - clk_hw_unregister_divider(divider); + clk_hw_unregister_mux(mux); } static int xvcu_register_clock_provider(struct xvcu_device *xvcu)