From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAA00C27C4F for ; Sun, 30 Jun 2024 16:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=meRrKUBJYAi063Ybn9ckzWyMWuNq5WiRKh+4W6KHvUo=; b=IxdhmRC80r8do+9Gsq2q3TPYJH VGS+oShilHHzQ7ruKiQbZGvrOMfrlQ4eNKfOoYoviN3qNasKj8FRZz+68IzLyKddasjGnJlLDHIw8 BdLhFSToaUN3IVzzxUcLry6UGNdx88BoTPjYq3NQ4u6JjsgIzzGLcTfeDcM74oqtBeDhXy2ILBRMC ZRtkhuqRyplaqKRP0QSsYZ9oWZsfk1iavEa/YdaHjL52K9OQISRqbts7EfqAlMwLTF5uTcBYcpVmV PxU9IXFXRRBMsN0+On+fud/726MBeSPbbbofJXR6DR+UtJ9PGZSPG+JSaDKJXY1wyUGlD2O+G03RB ksQ7Kmig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNxLJ-00000000h4s-3RtN; Sun, 30 Jun 2024 16:23:57 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNxL8-00000000h3Y-2MPs for linux-arm-kernel@lists.infradead.org; Sun, 30 Jun 2024 16:23:48 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7226821ad86so1172825a12.2 for ; Sun, 30 Jun 2024 09:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719764626; x=1720369426; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=meRrKUBJYAi063Ybn9ckzWyMWuNq5WiRKh+4W6KHvUo=; b=Jv6WKX3b6GJd+EmR6ZnZTTckG6l0pahKIxv7MmK3OMlVLNU7JUt7zlEqdFkVv0Dtxm Uen7bl69k0iGw5A2w1ElsFNBSLFRWxp0ZWbMCBfHSkfW3qO0jPt4gfEac40XiOhxylt9 Q2xhs4qovvVyRWatHBPt++RANPNPQZRy3TY1WMuHfGXWUFAoor2rNGP08/V0CiOYGsFT PISEjpTjVXZJ3KNIe/tcQLXOlkC578msDNHJ99yMIKjtGR32aNYHt8xkRchByRlRA2Ja gHVlh1K//GA7phhz2gPj+VtK1Q//YeUJ0AUe5BoKSFaGc2jfO6ZqNsKIdEw2Mk86h7Nh 5Iww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719764626; x=1720369426; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=meRrKUBJYAi063Ybn9ckzWyMWuNq5WiRKh+4W6KHvUo=; b=Ctm8R1GJz0WMm8wpMHPV9/Wq60z/urUSoI5+6twURvUKUI5NKz/J1G5sH21BhYY4N1 cdZfrmAN4a8bWAE7QnxVFnfRxN++C56bh4eZAV2Y10egN5AJ9zIcwaWOX/bEDr287RSr 8vkBZgvcztwrRsoz3RvO7v1/tKLJ5YLBnIp4kYqBjw6J9pJzdmSoELX0hA0/cBQLWoyq QvHHGumUMWLHOuXYJNWn54CQvr4ynNuSlkbCOzgDkuU/7Unc7QsHceFh8DEzZD+qeJZj k0o9mJgV/hvTCVzowgZLmCiWu+j6uzxkxMDYu+wYUJeG2xGJjb/sKppDb8SKhrU6hZrC RfZw== X-Forwarded-Encrypted: i=1; AJvYcCWRirdhaKWwMu826Dq080Apss4vMiy3nGxKfideh7rrsuB3bNFNxKZMwnOL3XxGYJXKoG6chHXMZVBdzFzFF2BcN/kyy+53un0eH5H6iHbswpT36DQ= X-Gm-Message-State: AOJu0YwZBfJtuDUyFgSnFZbBk0qMaKE/Yq75XugV0+ISrNT4lJJQwM7N fmWua42JzYUFWDdp830YMs+afAs/w6+1FJljHIdmqkuUcIj1qKUwQBiyy601fg== X-Google-Smtp-Source: AGHT+IFB5GWSyOiS5lFM4xMyeymwyJX3RWJBnJqEHBblq0QLaA5/nACE76UedKAKXnyWt2Xoaj7jKg== X-Received: by 2002:a05:6a20:b22a:b0:1bd:22fe:fcaa with SMTP id adf61e73a8af0-1bef6275a83mr1942482637.51.1719764625453; Sun, 30 Jun 2024 09:23:45 -0700 (PDT) Received: from thinkpad ([220.158.156.215]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce73e34sm5028683a91.30.2024.06.30.09.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 09:23:45 -0700 (PDT) Date: Sun, 30 Jun 2024 21:53:37 +0530 From: Manivannan Sadhasivam To: Frank Li Cc: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Conor Dooley , linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v6 09/10] PCI: imx6: Call: Common PHY API to set mode, speed, and submode Message-ID: <20240630162337.GD5264@thinkpad> References: <20240617-pci2_upstream-v6-0-e0821238f997@nxp.com> <20240617-pci2_upstream-v6-9-e0821238f997@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240617-pci2_upstream-v6-9-e0821238f997@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240630_092346_649507_38234EC5 X-CRM114-Status: GOOD ( 22.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 17, 2024 at 04:16:45PM -0400, Frank Li wrote: You don't need the colon after 'Call' in subject. > Invoke the common PHY API to configure mode, speed, and submode. While > these functions are optional in the PHY interface, they are necessary for > certain PHY drivers. Lack of support for these functions in a PHY driver > does not cause harm. > > Signed-off-by: Frank Li > --- > drivers/pci/controller/dwc/pci-imx6.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > index ab0ed7ab3007a..18c133f5a56fc 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include This should be moved one entry above. > #include > #include > > @@ -229,6 +230,10 @@ static void imx_pcie_configure_type(struct imx_pcie *imx_pcie) > > id = imx_pcie->controller_id; > > + /* If mode_mask[0] is 0, means use phy driver to set mode */ /* If mode_mask is 0, then generic PHY driver is used to set the mode */ > + if (!drvdata->mode_mask[0]) > + return; > + > /* If mode_mask[id] is zero, means each controller have its individual gpr */ > if (!drvdata->mode_mask[id]) > id = 0; > @@ -808,6 +813,7 @@ static void imx_pcie_ltssm_enable(struct device *dev) > struct imx_pcie *imx_pcie = dev_get_drvdata(dev); > const struct imx_pcie_drvdata *drvdata = imx_pcie->drvdata; > > + phy_set_speed(imx_pcie->phy, PCI_EXP_LNKCAP_SLS_2_5GB); Is this setting really universal? This looks like applicable only to specific platforms supporting this link speed. > if (drvdata->ltssm_mask) > regmap_update_bits(imx_pcie->iomuxc_gpr, drvdata->ltssm_off, drvdata->ltssm_mask, > drvdata->ltssm_mask); > @@ -820,6 +826,7 @@ static void imx_pcie_ltssm_disable(struct device *dev) > struct imx_pcie *imx_pcie = dev_get_drvdata(dev); > const struct imx_pcie_drvdata *drvdata = imx_pcie->drvdata; > > + phy_set_speed(imx_pcie->phy, 0); > if (drvdata->ltssm_mask) > regmap_update_bits(imx_pcie->iomuxc_gpr, drvdata->ltssm_off, > drvdata->ltssm_mask, 0); > @@ -955,6 +962,12 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) > goto err_clk_disable; > } > > + ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); > + if (ret) { > + dev_err(dev, "unable to set pcie PHY mode\n"); s/pcie/PCIe - Mani -- மணிவண்ணன் சதாசிவம்