From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796223036; b=qPkA/TWnyBLwu7LixiDk9TTPBJmcjVwI85rS0X98OQY6xhIdy5fS1reNCe8EDLCq7z6W 66BgSExFuAH9imwzs1QwkSgRaXJ4pQqIZ2Rgg9wh7ZZC7ONQPjVKmOoplK7N10/plzUoz dqvFChoWczWXXHmVjYxWj6z+A9WyZHDLMWgFrDHoHNmsbmhjOgB2QoNeUvn0D2PoIobqM KNyOvp3yVg6Y62SiF9hoUXcC5OdCrG0PyS+GGQ7XS0XVNIl5c5/tO6iOBO3pQDXmd+izB dfPVoyLHlkNAFHTsndpV+0JDGvTeRYUhSFpGbzLst1xrScK7GUKCHIkKeQs8XFVXctQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796223036; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=nhD1sNh/twPF0nuk0TR162pH6eLvyhstcDCwAJDrINw=; b=BL/7i44Pn9jAAQABsuNwD/nL10bNNUEaSYnCcihI9GUcVIXrS2vsmcGhQzBIPTwUaZqX L7LQPoDRCYupZc6OsSOosSkGZ+cRVVygIyDrFIeMizdNLVrPb3vOK6Q5pBYhWA5LSUHnz ejOMnv9cawFlryrYy/zcaJFrM8ypYk5YTCKSWDywH8bVc2oAlYWkszy/wLT7a9buq5OUT 3DGE56tTr/WWDaLXLLLtL6UGA6l3ggOEjfay5nsUEUnn4rqw/iLbXCVPZkyCh6UAGrUEh H4njgf0iW6B4XiTvgldZjygY/7pKTCRPtqs0pTU5z6S4awOi3V9myOW0HMQFoHaR79w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aVhySlIy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C24D5606A32C; Wed, 2 Dec 2026 14:50:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aVhySlIy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64C4A1F00896; Wed, 2 Dec 2026 14:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796223036; bh=nhD1sNh/twPF0nuk0TR162pH6eLvyhstcDCwAJDrINw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=aVhySlIy907WYiEJs27e54v9yDO2nHChXse6dSCrw0zJ9shCYX94Zhqf0QK8o49DR KBYqDW7AY7fvRn9ZONp/sEoxgbumWpY/8Xq1IwvMpHmkac/hjR4WYndCsb47GWyDum NjKF0FXcd698NuTN8NamY6kCoxpcfH2i0hcMD1K3KPum2B9PrDU47mm42D+x6khtzt WWGXnV89ZZ8wNRmcZ9hfW9B/LNGfjMmiRygXgj9sxnbShBCHn5UTbC++2H+ewjint6 BM6VAcDARJcuG/hEx89VImNwKt/dj51qxIoE4RWz2Yn92YwhLvEFwElZOh9PKmFuWe KRlj77mPqbGcA== Date: Wed, 2 Dec 2026 08:50:34 -0600 From: Rob Herring To: Jerome Brunet Cc: Han Gao , Stephen Boyd , Brian Masney , Jerome Brunet , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Yao Zi , Chen Wang , Han Gao , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, sophgo@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] clk: sophgo: sg2042: Keep gates used by firmware enabled Message-ID: <20261202145034.GA768275-robh@kernel.org> References: <20261122-b4-sg2042-efi-rtc-v2-0-6d087e03e4e8@iscas.ac.cn> <179579169278.2788166.8963233310700352675.b4-review@b4> X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <179579169278.2788166.8963233310700352675.b4-review@b4> On Fri, Nov 27, 2026 at 04:01:32PM +0100, Jerome Brunet wrote: > > On Milk-V Pioneer, firmware uses I2C0 for the EFI RTC and the serial > > flash for its own image and EFI variables. Both sit behind clock gates > > shared with devices Linux drives, so runtime PM on the Linux side can > > turn them off under the firmware, and GetTime() returns EFI_NOT_READY. > > > > Let firmware list such gates in protected-clocks on the clkgen node, > > and keep them enabled. > > > > qcom, the only current user of protected-clocks, does not register such > > clocks at all. That would break the I2C controllers Linux uses, as the > > DesignWare driver needs the clock rate, so here they stay registered and > > are only kept on. I'm not sure this fits the intended use; suggestions > > welcome. > > > > Tested on Milk-V Pioneer. > > > > Signed-off-by: Han Gao > > --- > > Changes in v2: > > - Drop the EFI MMIO patch, Ard is taking it through the EFI tree > > - Use protected-clocks instead of scanning reserved nodes under /soc > > (Krzysztof) > > Hey Krzysztof, > > Using protected-clocks in the way proposed in this series would give it a different > behavior/meaning compared to what introduced it in Qcom: > > - Qualcomm skips registering listed clocks. A consumer requesting a listed ID gets NULL. > - SG2042 still registers listed gates and marks them CLK_IS_CRITICAL. > A consumer gets a valid clock handle, can read its rate, but releasing its enable > reference won’t turn off the hardware gate. > > Having different meaning for the same property is not ideal, is it ? > Eventually that might be something we could fold into the framework, but that can only > happen if the meaning is consistent. > > IMO what they are trying to do here might be more appropriate, but Qcom was there first. > OTOH, actually registering the clock in Qcom would not be a breaking change DT wise, the driver > would start returning a handle where it would previously have returned NULL. > > What is your view on this ? >From a DT perspective, I don't think it matters too much if the OS behavior varies in the way you describe. It would be nice if the framework handled it rather than individual drivers though and providing read-only clocks seems more useful than hiding the clocks. Rob