From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57C3614EC52 for ; Sun, 30 Jun 2024 16:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719764628; cv=none; b=pyImJeSVxyZNCk5FEsLplCD8N8qcXQfbpAa75YSJkHPUEYEwzIkuAK06vVshr5yXcaB5+lRJnF6xksO+UiyZiyNMT8mGM3AhphhDK0+Yfg3tGHYqmgX329/i4x4Qe/hTdKpyHPn2Kjpv4U/mDWUzZyBCIQA5FmCnpA3bYG8THRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719764628; c=relaxed/simple; bh=9htU6WoutJrpUNff3Wz+szGkhLvVmq0dajsxQsJ361g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CxAjfvzPiYO/MBARvbM+VTEea0KZOCnOhE/piA4klMemxQthlDIGAhmrCvTCwTmsmOBHmYW+/5K28UdSi65499iFszT+1AOoQuXWQ4EfpufNGucLJP+YyHi304uCD89Q/3dfL6PJG6H5+7ks1y+GeVl5dvlzCKI8VXCdMVd3J6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nzbDSMnN; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nzbDSMnN" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-70df213542bso1054891a12.3 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=vger.kernel.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=nzbDSMnNik+uzqK89xn66O8/kqtzU+cs+lQtp3QU7gZX0dPPJyZsSIMimxqSna0txX 5Cv74H+m2cQfbEC2mNCRABSLgMklRx2Mag2y381EXQ+00UF2eSGZLdgW+Gj/sjH4cKx5 QISzNeXL8GBTX6XSB7bS6j8rsMxLmj2nZ3gRi1WHZ4kPwk3FADDMPs5rSA3MbsYuwJPa bgEUf3zpn6zPAdb7zfPOLvnW9mUHAUlz02XvzFK/tax+kW4jceMDZB3OwkKgazQrQE6S ulGD7Df2xWj2YWa3MH5KYN5Ij2z4fgjMzutJ9vuZssUo+Q5SPQXjq4LeSR8vVTGnVnRi ovzQ== 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=CHCNKtji0o9TNJG9Cb6uEv0JjHWyWZfAqutWBqWsPadkQU+LsDof2xmP3dqcS/1o4x 4x5jKl9Pkaqy7fRhJfdr0eZvvvMXk7vs8F9jzPiC+QKG0Yt9/TXg08wmaXTBSPCAoWC/ WxDJ2rjRvbyRWSnNIdWiHhLHhmNyEmgHDR5mThbRdb471F15EYb3naD8LrOAy8WURUjf A6UdI0x1VMuQHa4kedRLx9EcXO/jnMl4jJHDLZfR/LwlM66HSAkJ6blh8X7bbH4XeJVR rauIOxVlWFdL/8DIBGheKJGakiJmSxyCLzBkyx2Ilw2GlNg1fxSWur8VdGjEj5p+wnsO z2sw== X-Forwarded-Encrypted: i=1; AJvYcCVpsBXhKnv6skv++asmMsJUSNcRdvwq6H9Xiv0FMWQ9ZJX2vyf4LmPP3pJL74DCwNC9mzK0HvT8LFGGS6cefFjLjI6IQCwU1rR+9Q== X-Gm-Message-State: AOJu0Ywk1kdshB/nLnHneArWW5vSxwFWqUC+3O30i1KVEdtsLL/hHt0j 3IM0X8Uir5w+f/10l4BCIHzSIxr075mYdCcfsueAgvnb1qqjEzsO3JaR4Z2Jz1yUsK3OpI6Dcz4 = 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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 -- மணிவண்ணன் சதாசிவம்