From: Thierry Reding <thierry.reding@gmail.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Vidya Sagar <vidyas@nvidia.com>,
bhelgaas@google.com, kthota@nvidia.com,
linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] PCI: tegra: Enable root port specific features
Date: Wed, 8 Oct 2014 09:45:03 +0200 [thread overview]
Message-ID: <20141008074502.GD4999@ulmo> (raw)
In-Reply-To: <54340A45.4050005@wwwdotorg.org>
[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]
On Tue, Oct 07, 2014 at 08:44:05AM -0700, Stephen Warren wrote:
> On 10/07/2014 03:27 AM, Vidya Sagar wrote:
> > Enables root port to advertise its ASPM-L1 capability
> > resulting in possible link entry to L1 when an ASPM-L1 capable
> > device is connected
> > Enables per-controller & per-TMS clock clamping by default
> > Enabling above features result in more power saving
> >
> > It also avoids PM message truncation by waiting for DLLP to finish
> > before entering into L1 or L2
> >
> > Also, it adds helper functions to access root port registers
>
> > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
>
> > @@ -1870,8 +1920,10 @@ static int tegra_pcie_enable(struct tegra_pcie *pcie)
> >
> > tegra_pcie_port_enable(port);
> >
> > - if (tegra_pcie_port_check_link(port))
> > + if (tegra_pcie_port_check_link(port)) {
> > + tegra_pcie_enable_rp_features(port);
> > continue;
> > + }
> >
> > dev_info(pcie->dev, "link %u down, ignoring\n", port->index);
>
> Wouldn't it be better to have the error case inside the if block; most
> error-handling is that way. For example:
>
> if (!tegra_pcie_port_check_link(port)) {
> dev_info(pcie->dev, "link %u down, ignoring\n", port->index);
> tegra_pcie_port_disable(port);
> tegra_pcie_port_free(port);
> continue;
> }
>
> tegra_pcie_enable_rp_features(port);
> ... any other "good case" code (of which there admittedly is none at
> present)
Yes, that's a little more idiomatic. I think it could be a separate
cleanup patch, though.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-10-08 7:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 10:27 [PATCH v1] PCI: tegra: Enable root port specific features Vidya Sagar
2014-10-07 10:27 ` Vidya Sagar
2014-10-07 15:44 ` Stephen Warren
2014-10-07 15:44 ` Stephen Warren
2014-10-08 7:45 ` Thierry Reding [this message]
2014-10-08 7:44 ` Thierry Reding
2014-10-08 7:44 ` Thierry Reding
2014-10-08 7:47 ` Thierry Reding
2014-10-08 7:47 ` Thierry Reding
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=20141008074502.GD4999@ulmo \
--to=thierry.reding@gmail.com \
--cc=bhelgaas@google.com \
--cc=kthota@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=vidyas@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.