Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5925349rdb; Thu, 14 Dec 2023 03:53:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGKafYrez5Y6q0MeFvLhVaXaUWUCN7u6B+UGey7b/wPWYknfIXo8Jwku1Rm8x1IsoVi5DK X-Received: by 2002:a05:6871:5b09:b0:1fb:75a:de75 with SMTP id op9-20020a0568715b0900b001fb075ade75mr11568174oac.99.1702554789584; Thu, 14 Dec 2023 03:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554789; cv=none; d=google.com; s=arc-20160816; b=k8l8cP4H8BsLDvbwRu4zU00lTtE+rBqclKHS+L7CSag2qE6p84w3gCWOD/zLdnoQte fiHzo/7kvssIzVadBpTq1WXaxlZ4x7iWQC6lM7UmxunTZzkj0u0idY4jt2IezbfW24N5 xSWY1m7v9NeDtPSp1c0Yzqax8l0/VG3ziugKvysfB5hX8qYX2OzP+e+GXR5HtvaMvRPa 0ErMJib0YdAkKabh6xhreumQxQOtJIV1XBCNZsOL2ZbWp+DAIrbPuZH3SHLHs/hX2jRn 682qu/P5CdJfPYmvlIqm/MtxQCBY4f0W0mUdY8J8nZCZ9ahelAYSSAt+hAvev7F1MOY4 HtBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YafuactNyZ/cE9Wa5BVHY+Hx98D9TJkfS/BU/YckKEY=; fh=xoZNq5ZN9+MYDVgR3t+IRz0BG0C8FNvAs7u9iRDS99k=; b=oOV4YVVXfuFDi18celKC6ang+rgYAsfyuOQyT1466ThJNlf8hK2ouDaWR6gZ3Pyw9+ LAwp/OlWo9xbWxJ9ITq7xzGu0NWTJWdrOCw4GrM6563TqmI3XBECylknRRHSJQbifRnG Lpg2qTtzBf/TCQa46fOVUqzMyeRbyODYoH/7GM45Svy8WU3OcuDPz8Vae5mHCC0zNhNJ tVc1HzW/4UBvi8adyYCetHhfWz4lwZ8ODEs3Kn/YMkObfxQPQW0ASyTtLSkEG7HdGJVi RdHyvV9NyhS4O/IkmUC/XRQN9THvZPJeXndfAw/VNZA5WZqDRODQYSj98ujVUzO0rqDa mdQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uVct52cU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id m8-20020a63ed48000000b005c6673e2c72si10839977pgk.213.2023.12.14.03.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:53:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uVct52cU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CC16E806E54F; Thu, 14 Dec 2023 03:51:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444134AbjLNLvL (ORCPT + 99 others); Thu, 14 Dec 2023 06:51:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572984AbjLNLuy (ORCPT ); Thu, 14 Dec 2023 06:50:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D591810CB for ; Thu, 14 Dec 2023 03:50:15 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18BF7C433C7; Thu, 14 Dec 2023 11:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702554615; bh=gBxMWK/BJQIfktDOXVActk5N+GeQbJZMHW0htfkV+oc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uVct52cUOIceKATlABivrxGspm4zxEeI7nJUoPLdOQZrR2QVcd0QbZRuQbc+4/NoO mmlP9blb5sOixsg+eUYJQjaTb9kGqxE5/2q6nw4QaEyTcJvbXPsr1QdJNkMQXFldoW o1hc+4HwmRMMMLCbE8vxfX3Mv2fD6FvdaP6nWmMp6p+n7I4UMcbv/TYOtW4xBrLS7N B/7MCCGYwOQ6coCLo7L5ub/dgdSQIkSGBpuyPTpRnVBaTmrnFxXyo4G53qzLlpGr9i YsQs90tkpRJbXQ3+15OR/d6CdZoeBmpKwrXxNd4f6p5qHTgz/UR9zsbF2Go9UHIIMc PJ1YM/zUZBkDg== Date: Thu, 14 Dec 2023 17:19:59 +0530 From: Manivannan Sadhasivam To: Johan Hovold Cc: Manivannan Sadhasivam , andersson@kernel.org, konrad.dybcio@linaro.org, vkoul@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Shazad Hussain , quic_cang@quicinc.com Subject: Re: [PATCH 00/16] Fix Qcom UFS PHY clocks Message-ID: <20231214114959.GC48078@thinkpad> References: <20231214091101.45713-1-manivannan.sadhasivam@linaro.org> <20231214103907.GL2938@thinkpad> <20231214111409.GB48078@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:51:38 -0800 (PST) On Thu, Dec 14, 2023 at 12:30:45PM +0100, Johan Hovold wrote: > On Thu, Dec 14, 2023 at 04:44:09PM +0530, Manivannan Sadhasivam wrote: > > + Can > > > > On Thu, Dec 14, 2023 at 12:00:40PM +0100, Johan Hovold wrote: > > > [ +CC: Shazad ] > > > > > > On Thu, Dec 14, 2023 at 04:09:07PM +0530, Manivannan Sadhasivam wrote: > > > > On Thu, Dec 14, 2023 at 11:15:34AM +0100, Johan Hovold wrote: > > > > > On Thu, Dec 14, 2023 at 02:40:45PM +0530, Manivannan Sadhasivam wrote: > > > > Unless the PHY consumes CXO directly, it should not be included in the > > > binding as you are suggesting here. > > > > PHY is indeed directly consuming CXO. That's why I included it in the binding. > > Ok, good. It's a bit frustrating that people can even seem to agree on > answers to direct questions about that. > I can understand that. > > > We discussed this at some length at the time with Bjorn and Shazad who > > > had access to the documentation and the conclusion was that, at least on > > > sc8280xp, the PHY does not use CXO directly and instead it should be > > > described as a parent to the UFS refclocks in the clock driver: > > > > > > https://lore.kernel.org/lkml/Y2OEjNAPXg5BfOxH@hovoldconsulting.com/ > > > > > > The downstream devicetrees have a bad habit of including parent clocks > > > directly in the consumer node instead of modelling this in clock driver > > > also for other peripherals. > > > > > > > No, I can assure that you got the wrong info. UFS PHY consumes the clock > > directly from RPMh. It took me several days to dig through the UFS and PHY docs > > and special thanks to Can Guo from UFS team, who provided much valuable > > information about these clocks. > > Sounds like you've done your research. > > > > What exactly is wrong with those commits? We know that the controller > > > does not consume GCC_UFS_REF_CLKREF_CLK directly, but describing that as > > > such for now was a deliberate choice: > > > > > > GCC_UFS_REF_CLKREF_CLK is the clock to the devices, but as we > > > don't represent the memory device explicitly it seems suitable > > > to use as "ref_clk" in the ufshc nodes - which would then match > > > the special handling of the "link clock" in the UFS driver. > > > > > > > No, GCC_UFS_REF_CLKREF_CLK is _not_ the clock to UFS devices. I haven't found > > information about this specific register in GCC. Initially I thought this is for > > enabling QREF clocks for the UFS MEM phy, but I haven't found the answer yet. > > Just quoting Bjorn. > > > But as I said earlier, reference clock to UFS devices comes directly from the > > controller and there is a specfic register for controlling that. Starting from > > SM8550, reference clock comes from RPMh. > > Sure, but that was only part of what those commits did or claimed. Bjorn > also explicitly stated that those refclocks were sourced from CXO, even > though I now see a claim from Shazad in that thread claiming the > opposite: > > https://lore.kernel.org/all/Y2Imnf1+v5j5CH9r@hovoldconsulting.com/ To clarify further, what Shazad said about GCC_UFS_REF_CLKREF_CLK is correct. This clock is not directly sourced by CXO, so it should be voted by the _PHY_ driver separately along with CXO (which still feeds PHY). That's what I represented in the binding. > > Without access to docs I can only ask questions and try to do tedious > inferences from incomplete open sources (e.g. downstream devicetrees). > That's the life for most of us :) Even with access to internal docs, it is difficult to find the information we are looking for. Because, a very few people know where the information is buried. - Mani > Johan -- மணிவண்ணன் சதாசிவம்