Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5915506rdb; Thu, 14 Dec 2023 03:31:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy9SGmGVLtuFf70WARDmlnr64rN4GtBFU4iRP1VFSpC4bkDsAGmk8BCUkrbRT9qtJkjukk X-Received: by 2002:a05:6830:20c6:b0:6d9:e950:b976 with SMTP id z6-20020a05683020c600b006d9e950b976mr9476454otq.73.1702553471494; Thu, 14 Dec 2023 03:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702553471; cv=none; d=google.com; s=arc-20160816; b=SDXnh3Sg1ZbMOJxhGw+0w+YozBfDyjRIP03pWrVcQr/L7YgV7O+Nwg2oYi8/bJ3qz9 IN4QbxPmXpCjF7SJonP4nD3Hti/1Yzhx7IhmLm25L2GmZFWEQ27CElbGwqLFkI+c96zb uYJrNVR1pjbtxJ3mXTydS6ePwkXyPNa7495cAZLG25IoI+m/6gCX9OxCusw1QakxeC9M b6BMdBgNKP81NpqUOG9MaMQx963YMzBpgIq4uCHFQk1zmX51cnlPCeafSgpF4Ym042YC F1yLvbjR5sTqaCq4Dp2XMz2NCucaIyxQi2tWp+SIr6WCRx4nIW7CyNpaHYrhjSxP939F JSIw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=37W340CFSr2y3VT07Cwo06uSwhWarACrup83ZmfdB4I=; fh=dYMIS7P+qKtpUZqnNMBTLx12scAL45v5yUi2kdgQLyM=; b=zvVG8PBAtTNogEypnAt6zE01TSpJLCYqLjvN3x+cJ693x+pmXNN9kbNSVa6y5q/EyG 5q7eYy5HlfKaCbLnL82lvGeFzenWj/1V2J3YNZbIt7pOq3o4k78IYlBwJq720M1nXIdK poyhI40iQP+A5lxfaHuejhdwnoJN3BQRnWnURP4NVBCC7EJ55MgO2+GmyZ8Dl+oGBRhE hyPXECBnorO0ZdHFmhcfiNkz4PbhQsbEKq9R5Kum+B3Gafa3G7xfdYBqGwgat36YSWov 2IdiJ/kQ+eykcr6EKOghwZGfDhyimSMuudoucBsi5lIY/sae04W0zQix21YlGljv8fvN +1cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V4XPPGfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fi2-20020a056a00398200b006ce42ae90edsi10988745pfb.291.2023.12.14.03.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:31:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V4XPPGfs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 76178831D2D9; Thu, 14 Dec 2023 03:31:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443954AbjLNLao (ORCPT + 99 others); Thu, 14 Dec 2023 06:30:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443921AbjLNLan (ORCPT ); Thu, 14 Dec 2023 06:30:43 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3194B7 for ; Thu, 14 Dec 2023 03:30:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F7E6C433C7; Thu, 14 Dec 2023 11:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702553449; bh=Fk0lWlyniz2h5a3rEQxROF0ImdCpeMxK4CdTL7O7dQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V4XPPGfs7RCX22aO8nbSp3XIZux1Lb2jKnmSf9SHDPgFiZMu5zgYkzmzL4PgIOH4t QuZ0eCyXprrpyBJQQgTMltqZ8ZVyWj4uTJDAphoVJ8oFckdNACOC0WGNKn9r04t2oq xltWlehbXiB67ZMAQWnrQoVj+DiZFHN+NBfjuvU1NjyfB2Ddu2aM8iXCgFRBLDoYay g16QEPXF4AC9zWT9gmFiFBsI33WYK0hPLPOcUfOEHPmaactnayJJez1VEVBtwiNR9Y JXNF0ItDpZyc3IIfSo37+EWJEtomFXaWoVDWCwsbw7IKpOoNzZjlXdqVxDxK0o7E4d aB6mka1O0ln2A== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rDjvR-0008HE-0v; Thu, 14 Dec 2023 12:30:46 +0100 Date: Thu, 14 Dec 2023 12:30:45 +0100 From: Johan Hovold To: Manivannan Sadhasivam 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: References: <20231214091101.45713-1-manivannan.sadhasivam@linaro.org> <20231214103907.GL2938@thinkpad> <20231214111409.GB48078@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214111409.GB48078@thinkpad> 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:31:07 -0800 (PST) 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. > > 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/ Without access to docs I can only ask questions and try to do tedious inferences from incomplete open sources (e.g. downstream devicetrees). Johan