From nobody Thu Dec 18 10:02:18 2025 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F3D21C3038 for ; Mon, 13 Jan 2025 20:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736800294; cv=none; b=iRXQ5YUI07r3ug6UVuGc11lUmgisPlYmC8fzUOHZwlhbnEltuktgBS3TGII7/Gt9g5/1M2xan9wpQ0CROn4GZ318wfZV5cLvS6JP3YjmEPMRWPcflkmZ1OFEdP3UxJXsZM47+uGqNiAjKZvp37qdU7TANbGyF8LlEp8P/VpV4cQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736800294; c=relaxed/simple; bh=r2fl+aSZQSe4Gu96IWu9ki/qiNVdSrpnUYBU3JUFi8U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pffV+arpbR2P4PZcvnmoGf53LAJxu3YOj3dwjKMgUnYKUjJ6ybGoaT3woxWm7JyYZRWeh0ctAKQFBQziMqIhWvw2MfdS1pmojrFdTair7OMF7hMagKvf7fdHCFKcdUIBVuVxrLk0cejK6fIPMeWg7/pm9/dPHpRpYDAeTrbJjr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=eGOoGNFA; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="eGOoGNFA" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2ee8aa26415so7943619a91.1 for ; Mon, 13 Jan 2025 12:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1736800292; x=1737405092; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/p3qag0MQVENrEZ+1Hv+br5ltoCbdPuVgxId6PkIedY=; b=eGOoGNFA5l9YV2i0e1kw2IuwAE6VmWS1zBFlFicpeTU1NHOVsBMqOOyZjPHQzRorVr b8I55pRxSiPE1xBG2wf/0JdF5BnmRtPJKa4RjCNFDcBcc/6RQ+zok9gYb6ag1TksCb/b JL3t9UIDdYJ5UqOyGP3U7DqpRnlu689VQR+hd7HUKjKKLB2AgE3O30ivorpkFEUBpdDY a3VPNiAraQdMT07FKFgDGUZqRW8f8oO6RiquGDbVKQyc7SlegFfwLunRYqbHkpSiGQMk f/FGLrC1NmkTmQU1TRZAWFPFmN0p6bbfGQHN2uhWsBbhasIFXrVYHcEHYeWsMYOAqPnK Xidw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736800292; x=1737405092; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/p3qag0MQVENrEZ+1Hv+br5ltoCbdPuVgxId6PkIedY=; b=odUfZ/OqtlI8tRYdCwoowC3Busa1VQXYNtI+OXivpapXoJ4i9vYYXkDsBcKhhWE5nr OPZ3ZN1buw5zdfW8MXcvzPbfmuFejK0ikICif9gNeTvhTKaUmfhQKv58RbOgjR418ita dtSzn4AaHubwa8bRC7O4b0XfnYptnGCIY4Tnn7FBWsh/PPua/CnDJVOg1RAoRZVT/lii +/FifDXvoYOwrOBgoUWw/vxy6OlulMN1OyNZ0k8Zde4rnnusQIeTC2fVR0rorDbFJMpO xZpZLRwKNnEhHnzoGYRRKyR/kszhEDb1yUw7pRDPLwUJNdyA89K5m+eeHNHtVfFF6lai n1NA== X-Forwarded-Encrypted: i=1; AJvYcCUlRLLMhQeWIcIVeFrprWVfOwooafgf93lrJ587jdUx/vXPgm46TcYn2Sv8OALn0CKaQRv7cAZA4jHqz08=@vger.kernel.org X-Gm-Message-State: AOJu0Yx380UTA9F+550y+PX6uRARXWWuk/cpnMFSXpurjFFR42s8M0R5 DaWLR4zl0y0jeRW93mSgf+B6jX4hZ/QNHfEtfDlOKqzs/tq5s4JNA0oiFTWdkAI= X-Gm-Gg: ASbGncuvmyb64+l5IiQKLaVBSy/8u4uHRcuphqI3Ge2zun/HlglR1FzMA8CBhx2Tehg 3kMBymIAyWAtcO8PBGzZ+BkaC2DF/sxURzeP//fJem7mvIQz0IoEnP0NX/0EvP0MJhNt3wlEJYy bOyTHL9hDHbj6znNW3sa+2f66Xsxiv8mYyiFmTu6zwQi0AIlwquy7GCNgKrsOsROWsia4eAECMz Lv0FRx+YU/VvhvUDdzVtyjeVnNugjTOOGmDEiNCsHpNptz40zPkp0cmxC8NR94arIuTPWFVzzD/ c8bD3unZQuIgkYvK X-Google-Smtp-Source: AGHT+IG/tMMpscU7gZH1eJnJup56GCo1pHZUlOei13gOxP0UsZsm2CL6bABRUnZN9TpfjVCLNXKKsw== X-Received: by 2002:a17:90b:2dc6:b0:2ee:53b3:3f1c with SMTP id 98e67ed59e1d1-2f548e9f9ecmr29485858a91.5.1736800292356; Mon, 13 Jan 2025 12:31:32 -0800 (PST) Received: from [127.0.1.1] (75-164-218-15.ptld.qwest.net. [75.164.218.15]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f54a2ad3b7sm10514811a91.31.2025.01.13.12.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 12:31:32 -0800 (PST) From: Drew Fustini Date: Mon, 13 Jan 2025 12:31:24 -0800 Subject: [PATCH RESEND 1/2] clk: thead: Fix clk gate registration to pass flags Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250113-th1520-clk_ignore_unused-v1-1-0b08fb813438@tenstorrent.com> References: <20250113-th1520-clk_ignore_unused-v1-0-0b08fb813438@tenstorrent.com> In-Reply-To: <20250113-th1520-clk_ignore_unused-v1-0-0b08fb813438@tenstorrent.com> To: Drew Fustini , Guo Ren , Fu Wei , Michael Turquette , Stephen Boyd , Jisheng Zhang , Yangtao Li Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.14.1 Modify the call to devm_clk_hw_register_gate_parent_data() to actually pass the clk flags from hw.init instead of just 0. This is necessary to allow individual clk gates to specify their own clk flags. Fixes: ae81b69fd2b1 ("clk: thead: Add support for T-Head TH1520 AP_SUBSYS c= locks") Signed-off-by: Drew Fustini --- drivers/clk/thead/clk-th1520-ap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th15= 20-ap.c index 1015fab95251..c95b6e26ca53 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -1048,7 +1048,8 @@ static int th1520_clk_probe(struct platform_device *p= dev) hw =3D devm_clk_hw_register_gate_parent_data(dev, cg->common.hw.init->name, cg->common.hw.init->parent_data, - 0, base + cg->common.cfg0, + cg->common.hw.init->flags, + base + cg->common.cfg0, ffs(cg->enable) - 1, 0, NULL); if (IS_ERR(hw)) return PTR_ERR(hw); --=20 2.34.1 From nobody Thu Dec 18 10:02:18 2025 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D51211CEEB8 for ; Mon, 13 Jan 2025 20:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736800295; cv=none; b=eEWauzSPkrnOrtsAVQau472Z/PQFq13PQhCb9Ez8wO9KZUEJJLtkomyr7BncVrlIKHU6doPnAp7XFbZS3IQgGZEleQf6DbtImIlMsfDQuTOb2NiKgkQfePKq8MgNjRkmGzExHxQ3d4LyzLy5B9OF05arBx2Art3/oPOneuc4/rk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736800295; c=relaxed/simple; bh=8T8t7MGnpmXJLTx/FTaUwyAyBANw3bF2QBNIkm+LiUw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y2WkE5rqbQ8oSNNP2kk4VWWtTNkQ5+zTr2lfJt69eNR0WgdlCr6t9/KKyd91QL8Ix8sGdOj6A6SqO1KRw84L/x5uU5dWGbx97x6yBVHvBr0hUlIj0HWcpxQaRAVCTLJbfFI3sMHHL12N7Wf5c2ASWNTdKzwC4ElzjabfcG8aUeU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=MQttmlT4; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="MQttmlT4" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2ee397a82f6so8287727a91.2 for ; Mon, 13 Jan 2025 12:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1736800293; x=1737405093; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oUvVoDhVxDNuu/e3h1RthOZUTTkn0l7kTPxKU03cvts=; b=MQttmlT4qc/xo2soqpRKeB1R3qRBUXDeHX4bd9BSdqGlaoNljfraolU2nBHqd0agLa 3QwuFgIQ3s2WqCQbcV5NlMRtzpJBhc6/W45MhrxDZb9mjb1K/WyIM9TMkADoKTWY+bRM Tc3MAeEItclg24vnj+LFXTO9tXc8kDroHXBosdTlaw1IYSoHEP6/SXd0Ns2F93sM2OXB uRN5TzsvxMBwaOEXjrGqrgGSFjCCI2G3CIcj3fimfBCJe8zi/VdfhfdcdAxIKuKY7SvK DGVomaSdst/8RayEQZUeKTXy45LDUI4nygk9p9dXo0YP/QNFjUqLuI5VpjJ5+oNtQFnM E/jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736800293; x=1737405093; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oUvVoDhVxDNuu/e3h1RthOZUTTkn0l7kTPxKU03cvts=; b=IHdpsdDeqHFAssGRrSCbgbRib86f7B7FYWcO7eFua18z6/kM68QFFQdv6JGZYVGX5v +setD5YlVFbx3WDMKPjXnAGlxD9CTY9pUV77ekOgFIYEA9yNcsBc6GFi3QqlNp61YhL0 UEr33VJSeFIzPEKR/mbFUXlQEfhv0Zg3WjIa96nPz7fWZs9ZFOyaMIG8bKKKrrbGD9eD fAAjPwGgVNJE+QYi/oQbbIxeIVdYJZlde1f+WhxOwPBobIumTCAAM1ZHH4sG6KTaCJHQ hjnlRkzBhV6GZuAMDS3bCmnltHiU0cLONJAIjb6wVYMue5PbMpRjHQCmyl5NVZVMb/TX JI2A== X-Forwarded-Encrypted: i=1; AJvYcCXQn5o608Mr22coJaXUD4vHjCvGbmqUtI+EaGjazSaHzs5IYo4nRzyj4WgXKdWZVD8pAopp2EdVf/glX1I=@vger.kernel.org X-Gm-Message-State: AOJu0YzxJEEtX5coIwH3jsfBX0Otjjy0XZaVmLj79XwT3NOzugl6juye wgSq3+8+tXe7+8c/h1GG/jySRMFm5yWu36NOiKkuCPbjMSC9N81bQDlrUy+clik= X-Gm-Gg: ASbGncvGOsDKGGKPGcHFDNAkJQxWh5DcC1AQite3ZdRxdckDOVcitqObA2FcEAprRWD NBCVkmeeeirVHNCTwMpioclhRTw0R/AUI3CTugwyF9Q5F8B3X45gp/Png4hQisUEQxt5KzMOQw2 ATrTsQVJnDhz3a/gqas1lc4Wp/kjXUPVB6lmlytmOBM0UqkikZH8rN//xjIWFBKaDP3IRZj84tW tojzvu5UAbLGI3Hq8DJk/a6E8gAZx/AmE6sVaOVhX0WCfSGfeUKUz8SFAPkMiEeN8Nb0U23aiq3 0EyVsvFesRqaJSIL X-Google-Smtp-Source: AGHT+IETyPk+dkPDvT+m7Nlwd8jsvTLbyizrVTdVzrO+oEChgBr7zxyycDxXOJNikGNq0OksD5a6ww== X-Received: by 2002:a17:90b:2f0b:b0:2ee:db1a:2e3c with SMTP id 98e67ed59e1d1-2f548f1738cmr29086701a91.1.1736800293053; Mon, 13 Jan 2025 12:31:33 -0800 (PST) Received: from [127.0.1.1] (75-164-218-15.ptld.qwest.net. [75.164.218.15]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f54a2ad3b7sm10514811a91.31.2025.01.13.12.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 12:31:32 -0800 (PST) From: Drew Fustini Date: Mon, 13 Jan 2025 12:31:25 -0800 Subject: [PATCH RESEND 2/2] clk: thead: Add CLK_IGNORE_UNUSED to fix TH1520 boot Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250113-th1520-clk_ignore_unused-v1-2-0b08fb813438@tenstorrent.com> References: <20250113-th1520-clk_ignore_unused-v1-0-0b08fb813438@tenstorrent.com> In-Reply-To: <20250113-th1520-clk_ignore_unused-v1-0-0b08fb813438@tenstorrent.com> To: Drew Fustini , Guo Ren , Fu Wei , Michael Turquette , Stephen Boyd , Jisheng Zhang , Yangtao Li Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.14.1 Add the CLK_IGNORE_UNUSED flag to apb_pclk, cpu2peri_x2h_clk, perisys_apb2_hclk and perisys_apb3_hclk. Without this flag, the boot hangs after "clk: Disabling unused clocks" unless clk_ignore_unused is in the kernel cmdline. Fixes: ae81b69fd2b1 ("clk: thead: Add support for T-Head TH1520 AP_SUBSYS c= locks") Signed-off-by: Drew Fustini --- drivers/clk/thead/clk-th1520-ap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th15= 20-ap.c index c95b6e26ca53..d02a18fed8a8 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -657,7 +657,7 @@ static struct ccu_div apb_pclk =3D { .hw.init =3D CLK_HW_INIT_PARENTS_DATA("apb-pclk", apb_parents, &ccu_div_ops, - 0), + CLK_IGNORE_UNUSED), }, }; =20 @@ -794,13 +794,13 @@ static CCU_GATE(CLK_X2X_CPUSYS, x2x_cpusys_clk, "x2x-= cpusys", axi4_cpusys2_aclk_ 0x134, BIT(7), 0); static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_= pd, 0x138, BIT(8), 0); static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_c= pusys2_aclk_pd, - 0x140, BIT(9), 0); + 0x140, BIT(9), CLK_IGNORE_UNUSED); static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hc= lk", perisys_ahb_hclk_pd, 0x150, BIT(9), 0); static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hc= lk", perisys_ahb_hclk_pd, - 0x150, BIT(10), 0); + 0x150, BIT(10), CLK_IGNORE_UNUSED); static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hc= lk", perisys_ahb_hclk_pd, - 0x150, BIT(11), 0); + 0x150, BIT(11), CLK_IGNORE_UNUSED); static CCU_GATE(CLK_PERISYS_APB4_HCLK, perisys_apb4_hclk, "perisys-apb4-hc= lk", perisys_ahb_hclk_pd, 0x150, BIT(12), 0); static CCU_GATE(CLK_NPU_AXI, npu_axi_clk, "npu-axi", axi_aclk_pd, 0x1c8, B= IT(5), 0); --=20 2.34.1