From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 3AD4A199B9 for ; Wed, 14 Feb 2024 11:46:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707911167; cv=none; b=JQLdzt26DWH32V9BKK5h3TxhLrrStQZo1B8OT0aoYfQzJ1nFuR56O42Q4CDRR9ajJLnFq03KfcZE2VnGWcqylVK13/geg0zUg1J55HboaNa+GElt/ZgtcoBtIGtmCW3EdoO7qDOQw7knHlpnc5TMr/ZdrBDt/wLJy6SICTx/FBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707911167; c=relaxed/simple; bh=5cBCTJmIkuZecSiGwWsCCZ+RQXy4vsGvUq70KIHkdRM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NI4i83mhSXgJ/Ns1YR7panUKeeurXOMYMQY6hN0VNrqbMNHCz0QL8KCGab0Npiz0gva7bWPYuxA3ZjKGgyS5nTkKzPjKbASOatarnlA5feheOV8qn8SyfVGwDBW2at1T7Mw22g0n6Wep/tKeZTdcIbkmqHEDFX9amN/9nbvlIhQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Jz85hSk8; arc=none smtp.client-ip=209.85.128.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jz85hSk8" Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-607ba8a8219so291907b3.2 for ; Wed, 14 Feb 2024 03:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707911165; x=1708515965; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XMm6H1+3sxiadbeuUfjignaOEewFpqqASgu/afNzhas=; b=Jz85hSk8sJ3tV1YSHJgKQYN3avRkFwAkYHyFkfdkR5bGnkuHFUIL3Yxipq8W7CqHN+ hF4lv1jpqa8Z7Rr6zUFjf+/JtdP93kROVM6KhxO5LhR0KWU4ryCRA1FErAHk8OECtgNh /5px+6vagjYxMf4+bfnGA3/1dP8fA3+6AG/l5IazpqEu7C7jYIL3VDzdIvE2SczX2NEJ WbJsK7X+MIDtrFU/9ZBLJBbUEJ7aNb90nExFsjedrQk4+CDo8k8UgS9r2fDK790FeZej u+ZL6TvA/ogi/AkX3MMnmCqsfA6PdVSz7ZqJGHJlQXPpXeAcIWAr7YdmVBa4fss4yMmC kaqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707911165; x=1708515965; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XMm6H1+3sxiadbeuUfjignaOEewFpqqASgu/afNzhas=; b=nrUIW/1QT4H0FtDyOU17C6A1bROkFWD0kgJp4Zpte8STcgPa0UcFmiPY4xrwCBfykf yO997CB26MqKtibQ9T/hhzqcGm5obV7IRNo8V7EW1pmuAO1wp7dUxZD+Tr/6cIXWyzd3 2oP1+Q1xBWvGQmnPFQ2UqzeoHrnwVAUpFTu3clBLySkAhf34J/KpsSPRPoZRnRaXRMGQ 6FbcQpg32X0qIAB8B2S3cpD2G9yMFIk/hX7Gu/U08+PfEAGHZTrkxVWhWG3cGjJ2MLrw ilGpuzfiSUWJi9e8y5qFjffSeedcLlb9G1DYk6p2A6zg4+3Ljr1MxlPE+3ZviVUqP/CW 7Ciw== X-Forwarded-Encrypted: i=1; AJvYcCXq4T1zk1gYdjZ6xDyfinHFAB05kmqQyL1QqGqF7o8CzdNcHspJ4eeZuuyIz//Fq0JD7tMeK/Qpm8CUDWNrHGdDo9AkdT5bf/DfYz10dw== X-Gm-Message-State: AOJu0Yy8XzVbEEECvVwIkNLNY7iBfVGnnOf50d9NpTiXvPfeqQxm900B dhFP/wBtOLegPejIDwzHFldW90LOj4wf4G5/vr4Gt6dFDQlLcV3RS7oBZKVsp98QrPo7q8RHGWK Xn+VeQvDHggymsHTA3dp1nsj4CFhtCeC2LfWdWA== X-Google-Smtp-Source: AGHT+IFTWaiUO0/FDR6+92ostMkJC/ZQk2A+9uMYuYsQostIt3tNe1w41GyxBHI4EGWLZGEFOqxCNQkKG0weW2iyQng= X-Received: by 2002:a25:854d:0:b0:dcd:5e0f:19c7 with SMTP id f13-20020a25854d000000b00dcd5e0f19c7mr1595156ybn.54.1707911164746; Wed, 14 Feb 2024 03:46:04 -0800 (PST) Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122-ipq5332-nsscc-v4-0-19fa30019770@quicinc.com> <20240122-ipq5332-nsscc-v4-2-19fa30019770@quicinc.com> <7a69a68d-44c2-4589-b286-466d2f2a0809@lunn.ch> <11fda059-3d8d-4030-922a-8fef16349a65@quicinc.com> In-Reply-To: <11fda059-3d8d-4030-922a-8fef16349a65@quicinc.com> From: Dmitry Baryshkov Date: Wed, 14 Feb 2024 13:45:53 +0200 Message-ID: Subject: Re: [PATCH v4 2/8] clk: qcom: ipq5332: enable few nssnoc clocks in driver probe To: Kathiravan Thirumoorthy Cc: Andrew Lunn , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Catalin Marinas , Will Deacon , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" On Wed, 14 Feb 2024 at 11:20, Kathiravan Thirumoorthy wrote: > > > > On 1/26/2024 1:35 AM, Andrew Lunn wrote: > > On Mon, Jan 22, 2024 at 11:26:58AM +0530, Kathiravan Thirumoorthy wrote: > >> gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk are > >> enabled by default and it's RCG is properly configured by bootloader. > > > > Which bootloader? Mainline barebox? > > > Thanks for taking time to review the patches. I couldn't get time to > respond back, sorry for the delay. > > I was referring to the U-boot which is delivered as part of the QSDK. I > will call it out explicitly in the next patch. > > > > >> Some of the NSS clocks needs these clocks to be enabled. To avoid > >> these clocks being disabled by clock framework, drop these entries > >> from the clock table and enable it in the driver probe itself. > > > > If they are critical clocks, i would expect a device to reference > > them. The CCF only disabled unused clocks in late_initcall_sync(), > > which means all drivers should of probed and taken a reference on any > > clocks they require. > > > Some of the NSSCC clocks are enabled by bootloaders and CCF disables the > same (because currently there are no consumers for these clocks > available in the tree. These clocks are consumed by the Networking > drivers which are being upstreamed). To access the NSSCC clocks, > gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk clocks > needs to be enabled, else system is going to reboot. To prevent this, I > enabled it in probe. > > However looking back, gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, > gcc_nssnoc_nsscc_clk are consumed by the networking drivers only. So is > it okay to drop these clocks from the GCC driver and add it back once > the actual consumer needs it? So that we don't have to enable it in probe. > > Please let me know your thoughts. If there are no in-kernel consumers, there is no need to worry about them at all, nobody is going to access corresponding hardware. If you have out-of-tree modules, you also probably have your out-of-tree overlays. So you can make use of these clocks in your overlay. I don't see a point in dropping the clock if it is going to be readded later. -- With best wishes Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1A6DEC48BC4 for ; Wed, 14 Feb 2024 11:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yHJUbNjOll8sKJds4UHh7WG8ZJ4Re6OcoejO3ZVqNek=; b=2VyZofWa8YlAeP wJXMtVA349Eu59syhQty6OaXRZzjsCggBQNGME3lyh3oDjdsdu1buWesiVEjt+cmLpnVSppZttGk/ Z5vzkXD5rSmrBCrF0iYqQ6BZaE3X7dWeNNtFcRD39KlFSxinv+nH4i6ieVrgnW6JIgzXhXC2c06c6 BKNwphq3CiuTID9WMdnR5jf7Qg0+y9VV5bk5iUj02yGHPVTdsfMRxugfIhnXuV6S1PbiJn8MVLxVj YYI4BSDqG6cxPyIYUNgp1lfkTxCFiHy/KjadQ3fXvpoJ1UqG7QihI9ZP+FzpYRVQoRJX8TWEjr+9N HYXmTTkFJ27naV92fAag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raDiO-0000000CihU-1Hoj; Wed, 14 Feb 2024 11:46:12 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raDiJ-0000000Cigr-0cwp for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 11:46:10 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-dcd94fb9e4dso879233276.2 for ; Wed, 14 Feb 2024 03:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707911165; x=1708515965; darn=lists.infradead.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XMm6H1+3sxiadbeuUfjignaOEewFpqqASgu/afNzhas=; b=t7IVHnVasinVDGfT+erw7tbzX69B2YAGps0LWjtFaz1IAuXdBmUYKxHwWRy9TenCy0 3q4Jzjsi7r2c34si5yQR3ql2EyD93ICZzLIOZE15BOydK6yaqo6wMX0/iTr8IPWQVyNu /y/wsgEZEbQdQ2lq8vh9RDriV4XEyw10a3F4pMtdk91A1/psz99SvP2Cev5BFpnBEk7V SR6SGNEK8p2hPEnGWtY3q19i3MeulDIarg++StbwPi0Z3AX2t2D1iBqJQNHCqSzTuMYW s8W6nF2u+iGBAOKQepL6SKvtbbk8U+2UcYYIoHuUmbzmna2tUsZtWHeLqrck9M4lCQZi SX0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707911165; x=1708515965; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XMm6H1+3sxiadbeuUfjignaOEewFpqqASgu/afNzhas=; b=f2gUs86yhhmLDa3r7wpOfgDtlP0E2jyK3sz0QFhPvJ+8t3kRv7eBCiBGhELY3C004o l7doxI4L9rNp+LGxjGUTSnwpGPD8PkuP7Xa0I6jbrpdK2F2vZcnMcusP4i6guBJXYxVb XfDlqcqVFWt/JSBmyDeBCYJ6IltEmL71MaCM+zH39jF3de/bGLQ0kQA/19A9GvsaZLO7 zKIdKdlNyF8zm/2fBj5Ax3DWOyE6GkV1LuqOC+JOuMpe6zAUt4coICfMbc09KyK20237 yAvhiT3W9ZBS9PPLY3xV9rc6vOU9uCanzNr4o7W+alIA+/cGpllJDwZmG/TP8xQm3IN6 sfQQ== X-Forwarded-Encrypted: i=1; AJvYcCVealUJZRgDQer+5wNF5S2jcOQ3LYPvGMiZobd3GWZJmGGQ7zHGeKTsbIVgTK7aVJY/nYMU3GLLv4Jjb3Q42fddpAYwiEzuCz14bYRStarc8HJAl2M= X-Gm-Message-State: AOJu0YwEC1uBgtGhsjvqBdlOlGu352i7Rp1WyXm4nr0jlZ5CoQsEdnmw NckdTM2sHF1T1IXsl4AnuEPGltnLijbWH9poE/lX1Tl/ywS465nzJND1D0UPdssCyaU4o7xrrWD I+NEzZ7UbLp7JBcfIkyfN+WMfI1h7QBNDrteJgQ== X-Google-Smtp-Source: AGHT+IFTWaiUO0/FDR6+92ostMkJC/ZQk2A+9uMYuYsQostIt3tNe1w41GyxBHI4EGWLZGEFOqxCNQkKG0weW2iyQng= X-Received: by 2002:a25:854d:0:b0:dcd:5e0f:19c7 with SMTP id f13-20020a25854d000000b00dcd5e0f19c7mr1595156ybn.54.1707911164746; Wed, 14 Feb 2024 03:46:04 -0800 (PST) MIME-Version: 1.0 References: <20240122-ipq5332-nsscc-v4-0-19fa30019770@quicinc.com> <20240122-ipq5332-nsscc-v4-2-19fa30019770@quicinc.com> <7a69a68d-44c2-4589-b286-466d2f2a0809@lunn.ch> <11fda059-3d8d-4030-922a-8fef16349a65@quicinc.com> In-Reply-To: <11fda059-3d8d-4030-922a-8fef16349a65@quicinc.com> From: Dmitry Baryshkov Date: Wed, 14 Feb 2024 13:45:53 +0200 Message-ID: Subject: Re: [PATCH v4 2/8] clk: qcom: ipq5332: enable few nssnoc clocks in driver probe To: Kathiravan Thirumoorthy Cc: Andrew Lunn , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Catalin Marinas , Will Deacon , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240214_034607_219279_0028F24A X-CRM114-Status: GOOD ( 27.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 14 Feb 2024 at 11:20, Kathiravan Thirumoorthy wrote: > > > > On 1/26/2024 1:35 AM, Andrew Lunn wrote: > > On Mon, Jan 22, 2024 at 11:26:58AM +0530, Kathiravan Thirumoorthy wrote: > >> gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk are > >> enabled by default and it's RCG is properly configured by bootloader. > > > > Which bootloader? Mainline barebox? > > > Thanks for taking time to review the patches. I couldn't get time to > respond back, sorry for the delay. > > I was referring to the U-boot which is delivered as part of the QSDK. I > will call it out explicitly in the next patch. > > > > >> Some of the NSS clocks needs these clocks to be enabled. To avoid > >> these clocks being disabled by clock framework, drop these entries > >> from the clock table and enable it in the driver probe itself. > > > > If they are critical clocks, i would expect a device to reference > > them. The CCF only disabled unused clocks in late_initcall_sync(), > > which means all drivers should of probed and taken a reference on any > > clocks they require. > > > Some of the NSSCC clocks are enabled by bootloaders and CCF disables the > same (because currently there are no consumers for these clocks > available in the tree. These clocks are consumed by the Networking > drivers which are being upstreamed). To access the NSSCC clocks, > gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, gcc_nssnoc_nsscc_clk clocks > needs to be enabled, else system is going to reboot. To prevent this, I > enabled it in probe. > > However looking back, gcc_snoc_nssnoc_clk, gcc_snoc_nssnoc_1_clk, > gcc_nssnoc_nsscc_clk are consumed by the networking drivers only. So is > it okay to drop these clocks from the GCC driver and add it back once > the actual consumer needs it? So that we don't have to enable it in probe. > > Please let me know your thoughts. If there are no in-kernel consumers, there is no need to worry about them at all, nobody is going to access corresponding hardware. If you have out-of-tree modules, you also probably have your out-of-tree overlays. So you can make use of these clocks in your overlay. I don't see a point in dropping the clock if it is going to be readded later. -- With best wishes Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel