From patchwork Thu Jan 2 17:03:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Visavalia X-Patchwork-Id: 13924663 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2064.outbound.protection.outlook.com [40.107.100.64]) (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 C54A317E01B; Thu, 2 Jan 2025 17:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837460; cv=fail; b=huIWDozUIU8xbIqEIEG3yV/DegIKUCEPwx9wFq7HBM9wzs0cl3LdTXkOBJLupxIxaw2qLDmw0llQ2dCMDaE8qX4DS75aoMj6Q5+v1048/SUUwLcrsFIb6V7xi/51WrftGA4+EQQQNuXHgFD0l2fctoHV/uUasSr1WZ2VuhF+Qfg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837460; c=relaxed/simple; bh=u8/f1g1zhrLUnUrUW5E0wB/EKjGwSB0uSsQ/CYIqevM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZWBWOQNK78xde8OlhNXWnXmJtepbkk5AEq4bnuAlD+6NAeU0pbQgFVhdZGUNjUclgVwXjT+/r9VbTdVVxI0RZk6SSGgapfA9+nUnNrm5202e16jopNDVCPmfQylEU1YmDH8eBSrEPN/5BHcM3waoPZrNwlW9y8JQDgTJosJXhFQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=NvR3jona; arc=fail smtp.client-ip=40.107.100.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NvR3jona" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RKtQg46EoIMQ62mQQ2iXF6eW7m1kFvb4/l+EQ5mYUetwQoJ56UaEAy4O3fja6sHijPU+lTGDk9DSH/gVbzpTUIpGVr/Bjwb/oE/p63OEXxAg8hke1hQIXXJvQhbH6GQajdmE21Cw6FBW6rzIPY7u4CU0pBUpch6a02yyNSGN/OspAyjuZ+w0jmFs6ztkoTSoPAOO/gs7T42+O+m8IpjNzIzQsr3eIAq1RlyXIs5t7WAh9Cdmn3sJ5hIc1drEbPOR6F9WwHL+2dHOXceq+qh2o20/mL5uAfA0GW2Vooc7JYdo468egEs/0obC25ZhYa0Zll7oZVW8Ud6uUljahkjpdw== 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=G96SmpEt54IB9Df3wvkKqTgeWYSbIG+wUCdWuEyobIo=; b=TvSBuSRLqvgH/MhztFq58Dr5ghwch9CwUdGnmscgqjgUGhLhCeM5HG3grRe66XHZMliifliBN6enk0R/Ie4EZYHt9B5x9LfEI+L93NxPvewJrEy/IQFuC67tnfNYO8yUGpLnEUtjez7JyKKsDD7isHi7zMqgy4SX4gNFmLTfJRwSAH2i72+ouqje6il3uMCVCwf1I2uRUFU1YevYDtRfwDWN8PxIN1DB3cNcYWXGBlxZCIBT5Ibzn9fr1KMbb880fkdUtqE/9XkKY+cpD/qhBzytEYJsqqqgJWDLVmqCpPfeAStjbGQAecbexQ5ZtRaHlte+koSotB8AM82XlK+PsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=baylibre.com 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=G96SmpEt54IB9Df3wvkKqTgeWYSbIG+wUCdWuEyobIo=; b=NvR3jonaByKP2+FVzfk65t6m0MzXxFKwdrselWwsCpqFAOIyomprVqjiwBNLvU0G8aAmPL8TfChbLOBikzuYKxQ5JjAZVPX1A3wT+NOBNT/B/M3saiHFNfqnpqfq7WAvnj8VQP+rmGpfJGHs/sd82/5Use8EOhWRq6QSczXh/fg= Received: from DM6PR07CA0122.namprd07.prod.outlook.com (2603:10b6:5:330::18) by IA0PR12MB9012.namprd12.prod.outlook.com (2603:10b6:208:485::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.13; Thu, 2 Jan 2025 17:04:10 +0000 Received: from DS1PEPF00017090.namprd03.prod.outlook.com (2603:10b6:5:330:cafe::d1) by DM6PR07CA0122.outlook.office365.com (2603:10b6:5:330::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8314.13 via Frontend Transport; Thu, 2 Jan 2025 17:04:10 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017090.mail.protection.outlook.com (10.167.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8314.11 via Frontend Transport; Thu, 2 Jan 2025 17:04:10 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 2 Jan 2025 11:04:09 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) 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, 2 Jan 2025 11:04:08 -0600 Received: from xsjssw-mmedia4.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 2 Jan 2025 11:04:08 -0600 From: Rohit Visavalia To: , , , CC: , , , , , , Rohit Visavalia Subject: [PATCH v2 1/3] clk: xilinx: vcu: unregister pll_post only if registered correctly Date: Thu, 2 Jan 2025 09:03:57 -0800 Message-ID: <20250102170359.761670-2-rohit.visavalia@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250102170359.761670-1-rohit.visavalia@amd.com> References: <20250102170359.761670-1-rohit.visavalia@amd.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017090:EE_|IA0PR12MB9012:EE_ X-MS-Office365-Filtering-Correlation-Id: debe44c5-6c67-4865-9cd1-08dd2b4f79e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: dnJzX/U6miWZZ7vSaoaxl6F3h6sANd7IGpIOVqOrBq7Pd3xmurZOwM+060h3u6MiBt5Q3iT2CoFKk2EMFWy4pCUvvIseVuW6ZjKfQBx6P29zB3m73zonWnBxl0R20kDL2oPdbsRdvnUYJfZvL02PKwO+tHUJ6tAlnLVJEt0frIBTmybRXd79VG1jRKPHgX7pvDjYHmCRtuv+ro+kM5WuFQrjrWCQOUJFsaUCT9ecLDcGxR/uIQ/u3LpPAAPrSH+YcuJ6X8jJSp990MHaBM/V86NlJ79OHmrXu3ZVKPCLSr7sfFQZwNK8NwX7SxRWeNgUgEw81778NCo3Rwpob0B60RDy5kxLhLM8SVPBd4+ysr4SGf4n2FJB65LiTOz26LJTY6fLN68PRfd63ksEMCArdSeMIZ9sncmmv439mhx+0fMHRgw8tzrbTiIIZgbIwVeW65wKkhvXNKdqBViZ7bH2AnKg+APT3cjRAzrk1YxitgScb27kFAiOfP3zbyFmiwuaYUmpT3B83Cpemp0BktzU5UCflnQxDDxIcHWHfjnXskiLsemzALCreQHNQCJyaLXPUI1JR2ERHBIlPnkBSKZEbHdVpeWowTGwSeevUJnR/Jgfvo1UENoeCAqbKqocuzByaeitozZz/46T1kMEvhHyUl/1dD5XPpIyCBnnZ1vFyqRrjXtrqHFKDfAbMgxtQ6SN1tjNmFKYPiARWzJt7JDXk4jpo9OfPZs6ePQw8oGEpKBC2Leg9AE/fU5Tbz0+UWXZb9lYJQ+3zoHWnFrUcqDJpum4gaa3P7RP5zT+w6vfPcGTICri7Ez03TnCRV24euCAagwIIKxCV3vtecShjyZKMZ0ufO5GmTrG6neFZ3iYeAzowHEFumoP/l4EHwlRlb1N6XFQ6haJaFLtfKtyGvF7pPH6UivbCGanm3OD1WWSjfXte60pj7WsW3VqKjRa/G8RtcbweErsP3gMMiX3VjrkvWmyQjGgtoA2UzjLJrfgkE33yUzmtFk8ooXpoEYMSq14ANuPe8rOS5BNV/zI21ttZ/20jl56dIkXkmFFK7caUkN4ymZGiNVE0OMu2cQyGkIYrvQev7miSNSF7FMDxOpdFtkiNr5vaWkfGF5V7SDJ/dLZUrf+4HoGaOiKCV2F98XcdlrU0dA4KkhzGsVHz1KRczcCiBzgW6rOI3f8QnKH1Or0o9dBkFbSknEs+phJV2WLb50g5MZoOgPB5tw5tG/aqJoje5JSJ7uP0ZynSdQxbZEuRB9JE9H4y2YdS43jZvImDWAYJ0/KUC78x57g9JfAyBOrl2JggKmcACM3XgTUO9a4V9jV8QfB6BPEaVB5BvqABAkf/xMg2oTCPqDndstjPGbdgv/9ABUsxsquOOxn6ELDjhlNLuxky/LQkZLYmGKPvw8LbqyNSbbALHWvPq+2cbQVa0R1CKvNQyH2ybTHSHlhwBKmppd7SO9LRTE5fesOCK36ErVTAJf5I0wsvEMP2GzIKgBSoEITXG+TVql2BWw= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2025 17:04:10.2846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: debe44c5-6c67-4865-9cd1-08dd2b4f79e2 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017090.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9012 If registration of pll_post is failed, it will be set to NULL or ERR, unregistering same will fail with following call trace: Unable to handle kernel NULL pointer dereference at virtual address 008 pc : clk_hw_unregister+0xc/0x20 lr : clk_hw_unregister_fixed_factor+0x18/0x30 sp : ffff800011923850 ... Call trace: clk_hw_unregister+0xc/0x20 clk_hw_unregister_fixed_factor+0x18/0x30 xvcu_unregister_clock_provider+0xcc/0xf4 [xlnx_vcu] xvcu_probe+0x2bc/0x53c [xlnx_vcu] Fixes: 4472e1849db7 ("soc: xilinx: vcu: make pll post divider explicit") Signed-off-by: Rohit Visavalia --- Changes in v2: - Changed patches sequence to have patches with "Fixes" as preceding in order - Added Fixes tag - Link to v1: https://lore.kernel.org/linux-clk/20241226122023.3439559-4-rohit.visavalia@amd.com --- drivers/clk/xilinx/xlnx_vcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c index 81501b48412e..88b3fd8250c2 100644 --- a/drivers/clk/xilinx/xlnx_vcu.c +++ b/drivers/clk/xilinx/xlnx_vcu.c @@ -587,8 +587,8 @@ static void xvcu_unregister_clock_provider(struct xvcu_device *xvcu) xvcu_clk_hw_unregister_leaf(hws[CLK_XVCU_ENC_MCU]); if (!IS_ERR_OR_NULL(hws[CLK_XVCU_ENC_CORE])) xvcu_clk_hw_unregister_leaf(hws[CLK_XVCU_ENC_CORE]); - - clk_hw_unregister_fixed_factor(xvcu->pll_post); + if (!IS_ERR_OR_NULL(xvcu->pll_post)) + clk_hw_unregister_fixed_factor(xvcu->pll_post); } /** From patchwork Thu Jan 2 17:03:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Visavalia X-Patchwork-Id: 13924665 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2080.outbound.protection.outlook.com [40.107.101.80]) (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 6E9BE187325; Thu, 2 Jan 2025 17:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837463; cv=fail; b=ism5J9UPNWc/V75xpvBQ+tVH5s0HTiOh/ydfWw76NgWxZQCufp0IBIvGT+aDGr61FCvQ+VSissqSshVt7rPvFlvsILYlDSiFL8SZaxzotUUXYMUoCL8rC1mNx+csYWNNbr7kH9jr2i+W8gGOd5gOZBKvhooGeq0E8euHhEeuNp8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837463; c=relaxed/simple; bh=+TyBsuiE1AILqRgIj34bwVmPOZxyLri9wW9hmy+wUxA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aXapGsEMIpjqOWV5La/Lb72jpZd5RMY8XDKeO1FmGYaSt49MLpKNCxfXSYkbdDEqhy+KHpabO1nvFmC8lD+WZJVnCpKHTDbEQZ6l93qhsa07TMC2/e3Tl6glNkbfu5SW+z4YRC1QtA29FlM1z/Q9Oehdbcb1p17XA2XBibcqmE4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=F8yyiwLN; arc=fail smtp.client-ip=40.107.101.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="F8yyiwLN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A7Bti8BEPgy9mxWb/ZLIpFUFVqry4oZZFQ7FeDTQI164T4sM6U5mieF9wdhQEq/3XXTPJ85nMN3QA1BvC2SonWSHhWwLQi+AxOPCrA0Srf3IybNtrBfU32P3r9Sz674KnVGj64Y0Up91DEmcPSJwSKVtiIw7nOYxdoBw/HghK6AlC9iJZkVep0Ybb7kG/0LW6H5pSKAMRukP5fCDrkGMVOlFNUsIqNpRmw94sFcVUfl5xSpUJ5uv9rIAAk88NaSbCRKBMR7XE7+qKifBJMy5YjZi4LJBsr2D9PqiN7q2KLkJq3uQDeFp2MT2FF7ugJ7WRT3k5G8vVVnTQTErvDEMwA== 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=Z22F15rGZHFba0Gpf/PxN4PXeDcKdofUUQQVfwRVmYk=; b=sThoNNtVqpaJlac54pUxn2xDC8IjwLIhPJ04ryRqjd2X6dDISuml/SypWccdacI2Z9QBQY7/x29gEpOchclq1oS7WYpMBUyEEk6Lx5aLl1Jy+B/jxBQQp2pkGsODdZOs1CQPtxiwj76Y+igNwBd7pMTWQ8qpkB8maqg2zJUq9eJmtIVVf62pYKEUahNd/HIRuTvXzuRSNyEwdJCpt3VLmX5GqRW8ny1VLyHtSMAFDCkI/Spzs2374c30MfuVA4FTw6U0d24kvMXekkuSrNfPb9MH4HsMOqRdJhE7YNCMblnU5wYs5cVmo+hrZjhiv6Q6znGI2AiUIIyjy64hJsfHmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=baylibre.com 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=Z22F15rGZHFba0Gpf/PxN4PXeDcKdofUUQQVfwRVmYk=; b=F8yyiwLNf9WEWSNzmL78msAni58m9TWldcUQvI/K7ln/JTU9oNikMwey0fYCM1z5+i1LuTtjPPykpSNjgCUUrQvdZGbvdDhLBMgw85dcgFV2VjVyFYNogUAAs2HlqlSSzZ/h8nqj3DIRDhFadQNX1YenB0v03EfsuWrzEcxc5Tk= Received: from BYAPR05CA0019.namprd05.prod.outlook.com (2603:10b6:a03:c0::32) by DM4PR12MB8451.namprd12.prod.outlook.com (2603:10b6:8:182::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Thu, 2 Jan 2025 17:04:11 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:c0:cafe::b3) by BYAPR05CA0019.outlook.office365.com (2603:10b6:a03:c0::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.14 via Frontend Transport; Thu, 2 Jan 2025 17:04:11 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8314.11 via Frontend Transport; Thu, 2 Jan 2025 17:04:10 +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, 2 Jan 2025 11:04:10 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) 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, 2 Jan 2025 11:04:09 -0600 Received: from xsjssw-mmedia4.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 2 Jan 2025 11:04:09 -0600 From: Rohit Visavalia To: , , , CC: , , , , , , Rohit Visavalia Subject: [PATCH v2 2/3] clk: xilinx: vcu: don't set pll_ref as parent of VCU(enc/dec) clocks Date: Thu, 2 Jan 2025 09:03:58 -0800 Message-ID: <20250102170359.761670-3-rohit.visavalia@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250102170359.761670-1-rohit.visavalia@amd.com> References: <20250102170359.761670-1-rohit.visavalia@amd.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|DM4PR12MB8451:EE_ X-MS-Office365-Filtering-Correlation-Id: 123e6475-e369-4ecd-5388-08dd2b4f7a46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: Z9MMT7Ke5f3dzCGaZNxWt8dcmILMC4Zta4A3YOiAhgJQQM7nA4EFJRubt+HFiTD4FS//D30cQZCUVmLW/845r/8VnrylwVvVX9CtR4z40wHeF79ZotO3PBpPOz/0piO/OYiuMY1yFnS7AxoTozHgWO3Ix/RDPwFnNV9+CoUDqKwm3MDj8ZIpcEzTNer5Q0qMyLVQx89jG8Ye4piPKyi76jz5vAPQSaVma7gCjxXrLyMW5ADLwovINLcM91EEyWKbR8OB4h68Onrg1gzJl/wxlcceDWVk8oVLcIO9OaU5hMRdlD9lL2mZOqYzY8W0CUu8W8oIT9yo7tdu3gLe/Kn/0r0mUG7mCoZW2LJ7j8F6E8uTZHzheE8OMMh3NkybSS9D8+I7uGqSWla1wuj8imI3MBipBtbGSZ+tl+buZluS50wKQu0p37X7hkA/P+/+PA4ExAYibWOJn5yBmbQFIGdT+vZp9fRlyhFcqi95KSmtP2l4xv/OHt2IyYAHPqH/RuCZGyGEwz40e52Ifs3P1XPFU3Qf1jYB0EdgghgWuvkVR8M0LKMuwa/HM/ETaV+36XxdEruegwCx+38rGOUlV3jMSDZDZ/b6Nh4dZf8AmDZI9tx7upeeu7lwfkwA1ZDh93uYL8D4xG+G5aI0hoDdePjyePwd+qz0MkD3ax4IZAf8CVZTzEp3M13dNeARknJf0BW7cyUYsDsaHXiuFLVrGDabWj6CWPbCm5v8WFPOaJu3+As1Zis9pdyUDch3MlNtpyj14mAimd2x3ty/Q7lVx+5UDq9oRHjNV10jvwqbrw4aUeapT8dsWUR4blMNdQUOMvL3wghV4RhufqAmwBqMQnSRfd+Pd062UpU+OI0ANmJNHGIVQoX4ojasnKwcOxOCNf66da7aZcgEPVyR8khe5e82cFhNAea89xBdSnqpiDH4XD8/ppBSE7FnEe+stP2Y74kYboGfUUOH2KDDPxTS+AEtbD8ENA239IUbaJORXFlgVuBucC2NRIVEnxdZ2TJ/lsfulDLTvP1X/H8aDfIVykN7t/cjZr3dXy/cUqhcw47Mk2Y05yZIAIHxAa9OeQcqMMlOdTkvdfW8cbjU10pUNn9s7XeVOF+pfPYdsaU8eUA9SJkvHAlw2JyAXIpxx7yYY8kWwXKXgUitIPlCJ7ylA0L56KfrBRAQGS0UALcIcSU1tPgdHOPTm/NWV+Z5lWiuJDj3ICY00V6DvJxeKEl/2MLRSlSIHyjpXIyDL8OJVSk5e7d8+G00zksCW2yKJLwRsQL0x5VZnTjqPEjiscHLYHNCFiFU6PTT7GFuCKB2MOpwSZdHHdls55nDI6Ias5bf3PaSjgI0qgrm/yJwMQv0VPCbPM3ezfn7OIK5dk8NwPhXDdzisWy96vMh9vfJYbfAEIEwuSH+wNdHC7zAPhy0FluAakwczscLbDasUpW0dwa2EPAL+7F7UAO1YyaVDbrPVavdGCIPORoE0IjhkmN/KYM8b3LRshZcbc8JTq3FELj2Abc= 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)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2025 17:04:10.8755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 123e6475-e369-4ecd-5388-08dd2b4f7a46 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8451 CCF will try to adjust parent clock to set desire clock frequency of child clock. So if pll_ref is not a fixed-clock then while setting rate of enc/dec clocks pll_ref may get change, which may make VCU malfunction. Signed-off-by: Rohit Visavalia --- Changes in v2: - none - Link to v1: https://lore.kernel.org/linux-clk/20241226122023.3439559-3-rohit.visavalia@amd.com --- drivers/clk/xilinx/xlnx_vcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c index 88b3fd8250c2..c520ae1ba65e 100644 --- a/drivers/clk/xilinx/xlnx_vcu.c +++ b/drivers/clk/xilinx/xlnx_vcu.c @@ -547,7 +547,7 @@ static int xvcu_register_clock_provider(struct xvcu_device *xvcu) return PTR_ERR(hw); xvcu->pll_post = hw; - parent_data[0].fw_name = "pll_ref"; + parent_data[0].fw_name = "dummy_name"; parent_data[1].hw = xvcu->pll_post; hws[CLK_XVCU_ENC_CORE] = From patchwork Thu Jan 2 17:03:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Visavalia X-Patchwork-Id: 13924664 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) (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 D83EB1482E3; Thu, 2 Jan 2025 17:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837462; cv=fail; b=rinEdSaWZmkoXuaqJ6gaDmWXtOPGUgtMM3Xt5rxkXXPQAI6sAfvoV2vx06qI+zqabDOWOd1WMUQFB68gVpcA3PpPIFsNLNSQOky379mov5/0TdPZpuzwb7X0MZ6ykB17gS3PqaKQLln2Vj0P1XJTMNw6FatifNYHCm4B1C8AyEQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735837462; c=relaxed/simple; bh=406BGHCLRUywwMdHP2CxpHhltYIgAqlbXb970KgwfZo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c6A+M7QSt2nJgJk2Nur3UOTauFNMbo8ECIMCtdeIT9QZIUmSG3loxUutVS4nP2XEBf7BUHshji6ZLSxkI+KpDsfZ9ATwhLXnsryP6+mHUVxytckNpmBD+AHcudhbyR8FJ60G2dsMm9BxyOJyox3HvhJOaLbbbUYP/HhFHuSeXN4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Rt1+yES5; arc=fail smtp.client-ip=40.107.237.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Rt1+yES5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EOnpJvUUpnvMBL1SMia6BJhGEIWMaT/hal/ty0SkJW6mH/oWlWQRMBUQoOfA43V+f+pcJzy7M9m3v/UHow/p8izA8sxq1VlpD/7M/RtLPVsGZIombLJUM9BiXdBgUfkAeppXjubK3O33tnYR5A7c+2wpl07n8g9McCIXjOOtporOuqB7F0+0eotXXEfV5Ltj6Q7QDLyUE4tbNiWei93PaX/DmRSluKcG11+C4/TFDR0/LmU1NwsTeECm1ha4jbUGCykD+Gthy6W+e/nY2ucNDct+xY+WyCaNQhYHhsNO4Hp+Hufy0u590fIVdnV+JFjRQz5p5b8LLrrCS2TLhak6/w== 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=lH2b+Yw84xb8+PrnQXwbNTY4bmGa+nOWnxNHSaT1oMg=; b=RRBJk1R+gFuHuikqhn+wklDkqNHDx1noKTjGqDEHAGnk/L6ePmEH40o+B/gRhTT3JVXmHQT6rY8tCG2Xtxeyc6RzOLKIuX2tALwkJqwxk9qvT57dywCfEoK+FgpofuThCwWk3NfTsen52kNpKH8TE4DPli3HI25Xtl1zB6nPYILq2bMA863RbMHWiYeM8e8x7oSlV8yayi4T+uO64mmcf6LhQbhZUPHxOzx6VSILtQ25gw7PBwhGfAcTOc+4LACSGbwLr2b6Y9PsPONfEWZJA3ZZnclvJ2wxmYpH+hypT0G3DOoomyAesg1FlN5bZFCyvYjgrLrs3LxgeFauIx3amg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=baylibre.com 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=lH2b+Yw84xb8+PrnQXwbNTY4bmGa+nOWnxNHSaT1oMg=; b=Rt1+yES51lQF8qY6Qg4UMlOUmRZWNuf7X3PN2o4jzK6yL1PSTg9oAY4Xs0QBi3tbGiiZOpxHyYBqSRZa6Z5V/dNl99Eu2vC4FFRNKrPZj5wxCsQA0hDd/sDZqipZU8LG3/vNo3ih+JGYUBYWaOH8ZpmYBcIYIqjvivvEs4zGsqk= Received: from BYAPR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:c0::34) by LV2PR12MB5919.namprd12.prod.outlook.com (2603:10b6:408:173::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.12; Thu, 2 Jan 2025 17:04:13 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:c0:cafe::a8) by BYAPR05CA0021.outlook.office365.com (2603:10b6:a03:c0::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.6 via Frontend Transport; Thu, 2 Jan 2025 17:04:12 +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 MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8314.11 via Frontend Transport; Thu, 2 Jan 2025 17:04:12 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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, 2 Jan 2025 11:04:11 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 2 Jan 2025 11:04:10 -0600 Received: from xsjssw-mmedia4.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 2 Jan 2025 11:04:10 -0600 From: Rohit Visavalia To: , , , CC: , , , , , , Rohit Visavalia Subject: [PATCH v2 3/3] clk: xilinx: vcu: Update vcu init/reset sequence Date: Thu, 2 Jan 2025 09:03:59 -0800 Message-ID: <20250102170359.761670-4-rohit.visavalia@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250102170359.761670-1-rohit.visavalia@amd.com> References: <20250102170359.761670-1-rohit.visavalia@amd.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: rohit.visavalia@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|LV2PR12MB5919:EE_ X-MS-Office365-Filtering-Correlation-Id: c483f838-ccc7-4029-d4e0-08dd2b4f7b09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: pHCqKjg0bwdll0R6fnCK1Yu2m6PaBV6wpfo6sDyknnbvYxsp9clYsoXz8KMI3QLFwuPxPP8e+vcMwdCvmyKwMQ3nZQUlglXYOZA4TYL0qWuZ+nodW5n/Od9+Gk/WFSIdcpaIU7Hz20AIGPysXXDN5oXTW6mxq5aDw1AulAFq78/+1Buaxo0szwExs3JxG8wcDrPR9ERvqOeX1N0k4c9gBzTOOtUsFRM5Qh7qfT5sF3Xhxnt7zX4riHMGmwskmD/KIqL1LbeArjOEnE+1b7Uby8qaRMY/nzTEIbkQqC/ZQqRa/Q8ypYKVqx0lPTzOByOU/ibMRN8i/Ufr7iuZQ9xtShwGmRq0FG4tpvpKuH1E6ziKCsGczeZZ3aenkmHYNYj3XPCLSS39CpQJJuNaHIm7NJHR/dOE28YB4NVgwntsVnI1pte65vUbE212s70WLWKxtV1yN0UlNHZ6AC1o+h+kvNG/lOWBndX8JRw7EdlYjyAO3LRYOPWo+qmB686+QGitLtHMVdsedM3k0RwUJFrASSVnWnY1sBPhEPMrFaOFT7ZUsmVe2LGpjtiMr1OXir++Io7kSrCbdK2/GqO15h7mErk+0GnsckQ0VgYqsYmvfpalhlZFUAOqTNnzRTITk+b/bX/GRzD8SR9QrccGFNbIn9/UaO1ZGg9pwaU8ANAuE9Y+O1QQpiRslde1yQvAMoIBJsVaKYUMAibWv/EPr1+6ju1tMd2tzNhrzx17DhGv6L3EAVAPIiPKI7nETbNLaPpjLH5Ac9tkg6+5QPrC6RFqxLhDz2e2Fmmo0dT/8nkFhsQpryRT+qOww6dvBThc2wb72xhM1JQWz2CQc7PLC1IhZ4hDoG5FL0yKwUUK1bks2oU3gsqzS8U/Y3N9c3KYVbU5Ga4rHeaYxtn+TkDb2XtXsVS0n04Obkb6/qM8ZkFITi6XHGmnn2gzsfCx9oaYcZvnl1QhLknqZ5zsbxw4fCU2OJHqqQ4L8DUfp6yIVbe9XOKKZyNCQt3CKWJ3SKGaAubzFp3VCNpIr1TPxliNz3m0712YBikLE3Ho57+oF4PWO3K86jUeiXq2LIlDQJVoRvr8zySF7UN2W7G82St8mgLQfmZQiskMTzD3RzS1KogHw9c7bqWuSWcNr3yVkBfOBmQ2kWcQw074SIUp9kVgxINGZfq0gllCEIzFBTUK5mA17LcwdEx/y29w52cjxdCkR/QdRPikG9NnyGpg2uw1eWgHohXjsV9BCgIP963dacn1dj1qSIYqAc7wAW4HE1N46kBKRQDYk6XzrtCgHu5I61E7fShhHEtLVuYDtRu3PHBJA1kXARCwliY3e3yinHsA35WE1CHeXnqX2exDXhCHDNPT+OCP+Guki0g935uxNP2LHONP4Pu2lZeZZ+WLDmelJH3Pwx84OQsFRiTFw5yDAMLzJq6a3mn5iBTBnCtKl5fwZKeMf4pdqPeEGXxCSOzwKIJKqwiwtviKOxBmsMiwvBdorelUDv4vyAgdFk3gGPIwgJc= 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)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2025 17:04:12.1568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c483f838-ccc7-4029-d4e0-08dd2b4f7b09 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5919 Updated vcu init/reset sequence as per design changes. If VCU reset GPIO is available then do assert and de-assert it before enabling/disabling gasket isolation. This GPIO is added because gasket isolation will be removed during startup that requires access to SLCR register space. Post startup, the ownership of the register interface lies with logiCORE IP. Signed-off-by: Rohit Visavalia --- Changes in v2: - Changed patches sequence to have patches with "Fixes" as preceding in order - Used dev_err_probe() - Moved warning to dev_dbg() and updated print with more detail - Link to v1: https://lore.kernel.org/linux-clk/20241226122023.3439559-2-rohit.visavalia@amd.com/ --- drivers/clk/xilinx/xlnx_vcu.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c index c520ae1ba65e..50f7c3ecb07c 100644 --- a/drivers/clk/xilinx/xlnx_vcu.c +++ b/drivers/clk/xilinx/xlnx_vcu.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ * @dev: Platform device * @pll_ref: pll ref clock source * @aclk: axi clock source + * @reset_gpio: vcu reset gpio * @logicore_reg_ba: logicore reg base address * @vcu_slcr_ba: vcu_slcr Register base address * @pll: handle for the VCU PLL @@ -61,6 +63,7 @@ struct xvcu_device { struct device *dev; struct clk *pll_ref; struct clk *aclk; + struct gpio_desc *reset_gpio; struct regmap *logicore_reg_ba; void __iomem *vcu_slcr_ba; struct clk_hw *pll; @@ -676,6 +679,24 @@ static int xvcu_probe(struct platform_device *pdev) * Bit 0 : Gasket isolation * Bit 1 : put VCU out of reset */ + xvcu->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", + GPIOD_OUT_LOW); + if (IS_ERR(xvcu->reset_gpio)) { + ret = PTR_ERR(xvcu->reset_gpio); + dev_err_probe(&pdev->dev, ret, "failed to get reset gpio for vcu.\n"); + goto error_get_gpio; + } + + if (xvcu->reset_gpio) { + gpiod_set_value(xvcu->reset_gpio, 0); + /* min 2 clock cycle of vcu pll_ref, slowest freq is 33.33KHz */ + usleep_range(60, 120); + gpiod_set_value(xvcu->reset_gpio, 1); + usleep_range(60, 120); + } else { + dev_dbg(&pdev->dev, "No reset gpio info found in dts for VCU. This may result in incorrect functionality if VCU isolation is removed after initialization in designs where the VCU reset is driven by gpio.\n"); + } + regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, VCU_GASKET_VALUE); ret = xvcu_register_clock_provider(xvcu); @@ -690,6 +711,7 @@ static int xvcu_probe(struct platform_device *pdev) error_clk_provider: xvcu_unregister_clock_provider(xvcu); +error_get_gpio: clk_disable_unprepare(xvcu->aclk); return ret; } @@ -711,6 +733,13 @@ static void xvcu_remove(struct platform_device *pdev) xvcu_unregister_clock_provider(xvcu); /* Add the Gasket isolation and put the VCU in reset. */ + if (xvcu->reset_gpio) { + gpiod_set_value(xvcu->reset_gpio, 0); + /* min 2 clock cycle of vcu pll_ref, slowest freq is 33.33KHz */ + usleep_range(60, 120); + gpiod_set_value(xvcu->reset_gpio, 1); + usleep_range(60, 120); + } regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0); clk_disable_unprepare(xvcu->aclk);