Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3133689ybl; Sun, 15 Dec 2019 03:38:43 -0800 (PST) X-Google-Smtp-Source: APXvYqw8YgpOB+azle4YahE8pzXZ8Lh5rJ8GyimnnAhGRA5gvNfex056LaV6Cqx8bSJFdPODVX97 X-Received: by 2002:a05:6830:1615:: with SMTP id g21mr26967995otr.49.1576409923664; Sun, 15 Dec 2019 03:38:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576409923; cv=none; d=google.com; s=arc-20160816; b=WkiGbPKKU//H67xXHSHvC1ueNPn/DRNfwnL4Llx6WeFRAbNsnCFr1CUuJ5a7qOlgf8 W7RfmCqaQ7vNitNRaHqb9n8SI0MILZgcaaGAU3NIlRLWhrLcsMdMH5sjPqHNs1Kr9X14 SDOgds+/k4EoobrRyrRJl/MHbD7TTvL9i7YxxZ5nGCh+pHRrtWX79qaakExzrU2sP8ey IQ1X5gNIojqqvRIdEYJZGONplQFatiKeUhPVBrFqEHHYIHb5Cp0+9Z4IDAjFx2Ft7G7J alO3x++EI7BjvcQM+lVWKZgjrcnQeRbLpUcKDOf7Oz2lHJivwmNZqzKFt2tEuL36z58O NUKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CR4ldJYsjWPwIOsy7PmCr+bpUJ89FRh1L0tumau8bjs=; b=BCaDmy9ovgUUsHh7scOI34W00wM6yZWi09hxBfYwaQWtfhCNNYf9q/BEAQRmezfezV HoexESzOsrNORdzn1Rxl8Pj/nU/rmlqGYS5fG6Fka9n/oBGHhMmkNxQR1LycezrpJiiQ wjnQ7fdXHHqQ/iFKNsyjQvlUbFCYS+1VAG08o/lgjqpoJACp8UpCKG25FbOcB5L50Izw Ia6JStDcglfqYe8AfG+J2Ebg06bnUuZamkik8pmw4VNjT6pswOFxF9OYZVgoSaMMS/P0 EzSE2B7OTGtloaDzq1kfCAiXTHZfQ8/pHqlpditm4g/2Sk4DDvsNZFoPAXNjiXxLC2i/ y01w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si8711057otp.273.2019.12.15.03.37.59; Sun, 15 Dec 2019 03:38:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbfLOL2P (ORCPT + 99 others); Sun, 15 Dec 2019 06:28:15 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:33497 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfLOL2O (ORCPT ); Sun, 15 Dec 2019 06:28:14 -0500 Received: from localhost (unknown [88.190.179.123]) (Authenticated sender: repk@triplefau.lt) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 2A494240004; Sun, 15 Dec 2019 11:28:09 +0000 (UTC) Date: Sun, 15 Dec 2019 12:36:34 +0100 From: Remi Pommarel To: Jerome Brunet Cc: Neil Armstrong , Kevin Hilman , Yue Wang , Michael Turquette , Stephen Boyd , Lorenzo Pieralisi , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 0/2] PCI: amlogic: Make PCIe working reliably on AXG platforms Message-ID: <20191215113634.GB7304@voidbox> References: <20191208210320.15539-1-repk@triplefau.lt> <1jpngxew6l.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1jpngxew6l.fsf@starbuckisacylon.baylibre.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 09, 2019 at 09:32:18AM +0100, Jerome Brunet wrote: > > On Sun 08 Dec 2019 at 22:03, Remi Pommarel wrote: > > > PCIe device probing failures have been seen on some AXG platforms and were > > due to unreliable clock signal output. Setting HHI_MIPI_CNTL0[26] bit > > solved the problem. After being contacted about this, vendor reported that > > this bit was linked to PCIe PLL CML output. > > Thanks for reporting the problem. > > As Martin pointed out, the CML outputs already exist in the AXG clock > controller but are handled using HHI_PCIE_PLL_CNTL6. Although > incomplete, it seems to be aligned with the datasheet I have (v0.9) > > According to the same document, HHI_MIPI_CNTL0 belong to the MIPI Phy. > Unfortunately bit 26 is not documented > > AFAICT, the clock controller is not appropriate driver to deal with this > register/bit > Regarding both @Martin's and your remark. Unfortunately the documentation I have and vendor feedback are a bit vague to me. I do agree that CLKID_PCIE_PLL_CML_ENABLE is not a proper name for this bit because this register is MIPI related. Here is the information I got from the vendor [1]. As you can see HHI_MIPI_CNTL0[29] and HHI_MIPI_CNTL0[26] are related together, and HHI_MIPI_CNTL0[29] is implemented in the clock controller as axg_mipi_enable which is why I used this driver for HHI_MIPI_CNTL0[26]. So maybe I could rename this bit to something MIPI related ? > > > > This serie adds a way to set this bit through AXG clock gating logic. > > Platforms having this kind of issue could make use of this gating by > > applying a patch to their devicetree similar to: > > > > clocks = <&clkc CLKID_USB > > &clkc CLKID_MIPI_ENABLE > > &clkc CLKID_PCIE_A > > - &clkc CLKID_PCIE_CML_EN0>; > > + &clkc CLKID_PCIE_CML_EN0 > > + &clkc CLKID_PCIE_PLL_CML_ENABLE>; > > clock-names = "pcie_general", > > "pcie_mipi_en", > > "pcie", > > - "port"; > > + "port", > > + "pll_cml_en"; > > resets = <&reset RESET_PCIE_PHY>, > > <&reset RESET_PCIE_A>, > > <&reset RESET_PCIE_APB>; > > A few remarks for your future patches: > > * You need to document any need binding you introduce: > It means that there should have been a patch in > Documentation/devicetree/... before using your newclock name in the > pcie driver. As Martin pointed out, dt-bindings should be dealt with > in their own patches > > > > > > > Remi Pommarel (2): > > clk: meson: axg: add pcie pll cml gating > > Whenever possible, patches intended for different maintainers should be > sent separately (different series) Thanks, will do both of the above remarks. > > > PCI: amlogic: Use PCIe pll gate when available > > > > drivers/clk/meson/axg.c | 3 +++ > > drivers/clk/meson/axg.h | 2 +- > > drivers/pci/controller/dwc/pci-meson.c | 5 +++++ > > include/dt-bindings/clock/axg-clkc.h | 1 + > > 4 files changed, 10 insertions(+), 1 deletion(-) > Thanks for reviewing this. [1] https://i.snipboard.io/bHMPeq.jpg -- Remi