Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5899979rdb; Thu, 14 Dec 2023 03:01:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/DsC/ysGJ5r8tfmTU/VkqJbUkdO57m4jFrfDBdIV7HfecD7vBEj0lBbZ1o354hyTeAwck X-Received: by 2002:a05:6358:7f0d:b0:170:f134:9fc7 with SMTP id p13-20020a0563587f0d00b00170f1349fc7mr4249175rwn.42.1702551674042; Thu, 14 Dec 2023 03:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702551673; cv=none; d=google.com; s=arc-20160816; b=UCXalvRixnkO+T46XSSJAnTYQb7+ElUWangJZi/pb4PPmnRpqPqmo/2Bu0xEZrj+// rfBLDU0zGBSGXfVkbRYNCNQ3hswdl8mIE1PCxa9X/edvyuJjXMHwG53HYQyFSl2Re1LQ H8GwT4mOm+FZg6oCVhJ452lXHqiPl/crwVVrtwG55SvmnVgXxBxfFqLBtI3oggZ8iVqt Ssq/o3vg8MpdjSBksUkyv2enw4+iRPZkvrmdlAs+Xt/1IONBMLN0rBrM9axb2Z+7KH1r A9lzHx+QJxOohn9dh4nr/p/As6puApeSKuhsLgoOLEQzc2BKD/vOFAJeCM06EhAs3VjX OV4A== 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=V6MPL5ne9SEON5/+iFxKFxs08vBHgiBYvNq227k1/Ow=; fh=kk0g4ecHJ0vCywDcPGJ9kKBWvgZmURNmwq0iovliwQc=; b=WzApIH42MjORrZXDHjeT33DH1gUrkrrNY0Ht+hQZLmdMcmqctSCfmPS7CsIarGuDWZ uomiTmKviSheFqfaiotvXeBSwWzwy+VTSCBVbF+6wLpXBFmijZoKqOHx8hu5zhlHULe6 n5JV1xM00SkNnkuFS3E1J+NJQ1Gj2A67AYBke3kVsZECMBa/4n5jmK3R0RGbRe670Y+8 2M73ZLel6YxYmU0Mlk15BOWOAglAatpoLG1qnBQ9/vvuigEvOEWYpVMuc3hGUR6k0O4D E0/zk+QJOELcC29ZdnxbXC3qqXNtRwpz/tOEN04WP1Jm1aXrsSeAPHKOubgLyLxj5Q8+ t9oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ogYv/BY8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j7-20020a654287000000b005c69bfbde6dsi11306000pgp.202.2023.12.14.03.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:01:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ogYv/BY8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 B5157808BDA5; Thu, 14 Dec 2023 03:01:10 -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 S1443812AbjLNLAk (ORCPT + 99 others); Thu, 14 Dec 2023 06:00:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443752AbjLNLAi (ORCPT ); Thu, 14 Dec 2023 06:00:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C2111D for ; Thu, 14 Dec 2023 03:00:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73183C433C8; Thu, 14 Dec 2023 11:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702551644; bh=7yvbMVFBoOU0OI0FWqy3sbSDeL+03VBIkmMdqGb8y1Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ogYv/BY8KjwpLoUv98i4AbfwNhxdm/I1XuoOWIHLNEC150LI+SNaUFxa4qcv+Bbxh jlgbSpDlMjyxdJ4oEXAN3tUK4QwUFNaeO7TESAV9D6TJM9G+V6dkgWcUtV2kxjND7Z kJ9U9fFg73ioIRp5DluSNU5ZAvrkl+cXa9y/hOPLnP8BtW2bUUREmNKgsAtcxDxIwh iPHjAcFdb8ObYptpIXvqLplA6ESG6Yoh+sDC0FG7sK4l602q9jnzREssYsYS8iZF9M +tm1nSztqlo/fq43/CQsuoh1RK+R07teCawbnDvm+6NOnk0NUIWEbdnnhsXbXzA2IP a2RirpniqQ6RA== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rDjSK-00088x-0r; Thu, 14 Dec 2023 12:00:40 +0100 Date: Thu, 14 Dec 2023 12:00:40 +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 Subject: Re: [PATCH 00/16] Fix Qcom UFS PHY clocks Message-ID: References: <20231214091101.45713-1-manivannan.sadhasivam@linaro.org> <20231214103907.GL2938@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214103907.GL2938@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 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:01:10 -0800 (PST) [ +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: > > > > > This series fixes the clocks supplied to QMP PHY IPs in the Qcom SoCs. All > > > of the Qcom SoCs except MSM8996 require 3 clocks for QMP UFS: > > > > > > * ref - 19.2MHz reference clock from RPM/RPMh > > > * ref_aux - Auxiliary reference clock from GCC > > > * qref - QREF clock from GCC or TCSR (TCSR since SM8550) > > > > > > MSM8996 only requires 'ref' and 'qref' clocks. > > > > > > Hence, this series fixes the binding, DT and GCC driver to reflect the > > > actual clock topology. > > > > Is this based on documentation for all the SoCs or on inference from the > > current (upstream and downstream) devicetrees? > > It is based on the internal documentation. Even downstream devicetrees are > wrong. I should've mentioned it in the cover letter. > > > Are you sure that you should not just describe that some of these UFS > > reference clocks are sourced from CXO in the clock driver instead? > > I don't get your comment fully. Could you please elaborate? Unless the PHY consumes CXO directly, it should not be included in the binding as you are suggesting here. 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. > > Take a look at commits > > > > f446022b932a ("arm64: dts: qcom: sc8280xp: fix UFS reference clocks") > > f6abcc21d943 ("clk: qcom: gcc-sc8280xp: add cxo as parent for three ufs ref clks") > > Btw, these commits are not accurate. In all the SoCs before SM8550, reference > clock for the UFS device comes from the UFS controller. There is a dedicated > register in UFSHC memory map that is being toggled by the driver to > enable/disable reference clock for the UFS device. > > Since SM8550, reference clock is directly sourced from RPMh. I'm preparing a > series to fix it. 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. > Unfortunately, this information is not depicted correctly in the downstream > devicetrees. I was hoping the information that those commits are based on would be correct as it came from Qualcomm and Bjorn. I have no illusions about the downstream devicetrees being correct. :) Johan