From: Thierry Reding <thierry.reding@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Manikanta Maddireddy <mmaddireddy@nvidia.com>,
bhelgaas@google.com, jonathanh@nvidia.com,
linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org,
mperttunen@nvidia.com
Subject: Re: [PATCH V2 2/4] PCI: tegra: Add Tegra186 PCIe support
Date: Tue, 17 Oct 2017 22:27:49 +0200 [thread overview]
Message-ID: <20171017202749.GB10482@ulmo> (raw)
In-Reply-To: <20171017173428.GE5641@bhelgaas-glaptop.roam.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 3056 bytes --]
On Tue, Oct 17, 2017 at 12:34:28PM -0500, Bjorn Helgaas wrote:
> On Wed, Sep 27, 2017 at 05:28:35PM +0530, Manikanta Maddireddy wrote:
> > UPHY programming is performed by BPMP, PHY enable calls are
> > not required for Tegra186 PCIe. Power partition ungate is
> > done by BPMP powergate driver.
> >
> > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> > Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
> > Tested-by: Mikko Perttunen <mperttunen@nvidia.com>
> > ---
> > V2: Add soc->program_uphy check for phy_exit call
> > drivers/pci/host/pci-tegra.c | 132 +++++++++++++++++++++++++++++++++++--------
> > 1 file changed, 108 insertions(+), 24 deletions(-)
>
> > @@ -1012,10 +1016,12 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
> > afi_writel(pcie, value, AFI_FUSE);
> > }
> >
> > - err = tegra_pcie_phy_power_on(pcie);
> > - if (err < 0) {
> > - dev_err(dev, "failed to power on PHY(s): %d\n", err);
> > - return err;
> > + if (soc->program_uphy) {
> > + err = tegra_pcie_phy_power_on(pcie);
> > + if (err < 0) {
> > + dev_err(dev, "failed to power on PHY(s): %d\n", err);
> > + return err;
> > + }
>
> This looks good: it's obvious that the previously-supported devices
> continue to work the same way because you set ".program_uphy = true"
> for them. (It would be even more obvious if you changed the sense so
> that only the new device had to add this initializaer, but in general
> I prefer the positive logic as you have here, and I did verify that
> you added the initializer for all tegra_pcie_soc variants.)
>
> > @@ -1048,19 +1054,23 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
> > static void tegra_pcie_power_off(struct tegra_pcie *pcie)
> > {
> > struct device *dev = pcie->dev;
> > + const struct tegra_pcie_soc *soc = pcie->soc;
> > int err;
> >
> > /* TODO: disable and unprepare clocks? */
> >
> > - err = tegra_pcie_phy_power_off(pcie);
> > - if (err < 0)
> > - dev_err(dev, "failed to power off PHY(s): %d\n", err);
> > + if (soc->program_uphy) {
> > + err = tegra_pcie_phy_power_off(pcie);
> > + if (err < 0)
> > + dev_err(dev, "failed to power off PHY(s): %d\n", err);
> > + }
> >
> > reset_control_assert(pcie->pcie_xrst);
> > reset_control_assert(pcie->afi_rst);
> > reset_control_assert(pcie->pex_rst);
> >
> > - tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
> > + if (!dev->pm_domain)
> > + tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
>
> But this one isn't obvious because nothing in your patch obviously
> affects dev->pm_domain, so I can't tell whether this is safe. It's
> worth a changelog comment to help justify this.
The last sentence in the commit message is what this is about. Maybe it
should be more verbose:
Since the BPMP controls the powergates on Tegra186, there is no
need to manually power on and off the PCIe power partition. The
BPMP generic power domain driver takes care of it instead.
?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-17 20:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 11:58 [PATCH V2 0/4] Add Tegra186 PCIe support Manikanta Maddireddy
2017-09-27 11:58 ` [PATCH V2 1/4] dt-bindings: pci: tegra: Document Tegra186 PCIe DT Manikanta Maddireddy
2017-10-13 16:37 ` Thierry Reding
2017-09-27 11:58 ` [PATCH V2 2/4] PCI: tegra: Add Tegra186 PCIe support Manikanta Maddireddy
2017-10-13 16:38 ` Thierry Reding
2017-10-17 17:34 ` Bjorn Helgaas
2017-10-17 20:27 ` Thierry Reding [this message]
2017-10-18 13:27 ` Bjorn Helgaas
2017-10-18 14:14 ` Manikanta Maddireddy
2017-10-18 16:29 ` Bjorn Helgaas
2017-10-19 6:51 ` Manikanta Maddireddy
2017-09-27 11:58 ` [PATCH V2 3/4] arm64: tegra: Add PCIe node for Tegra186 Manikanta Maddireddy
2017-10-19 10:48 ` Thierry Reding
2017-09-27 11:58 ` [PATCH V2 4/4] arm64: tegra: Enable PCIe on Jetson TX2 Manikanta Maddireddy
2017-10-19 10:49 ` Thierry Reding
2017-10-17 17:37 ` [PATCH V2 0/4] Add Tegra186 PCIe support Bjorn Helgaas
2017-10-17 20:28 ` Thierry Reding
2017-10-18 5:07 ` Manikanta Maddireddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171017202749.GB10482@ulmo \
--to=thierry.reding@gmail.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mmaddireddy@nvidia.com \
--cc=mperttunen@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).