linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3] ARM: tegra: disable LP2 cpuidle state if PCIe is enabled
Date: Mon, 12 Aug 2013 13:09:50 +0200	[thread overview]
Message-ID: <20130812110949.GB12042@ulmo> (raw)
In-Reply-To: <1376078656-1378-1-git-send-email-swarren@wwwdotorg.org>

On Fri, Aug 09, 2013 at 02:04:16PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Tegra20 HW appears to have a bug such that PCIe device interrupts, whether
> they are legacy IRQs or MSI, are lost when LP2 is enabled. To work around
> this, simply disable LP2 if the PCI driver and DT node are both enabled.

This description is no longer accurate.

> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> I intend to apply this on top of Thierry's Tegra PCIe driver series.
> 
> v3: Only disable LP2 if a PCIe device that requests an interrupt is
> actually present. This prevents the loss of power-saving when the WAR
> isn't required.

Currently I see the informational message about LP2 being disabled
rather early in PCI setup. That's probably caused by the .map_irq()
being called during enumeration/fixup. So effectively this disables LP2
as soon as a PCI device is found, whether it needs the IRQ or not. But I
don't think we can do any better than this, so that's fine.

[...]
> diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
[...]
> +void tegra_cpuidle_pcie_irqs_in_use(void)
> +{
> +	switch (tegra_chip_id) {
> +	case TEGRA20:
> +		if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
> +			tegra20_cpuidle_pcie_irqs_in_use();
> +		break;
> +	}
> +}

I plan to eventually (3.13 perhaps) support building the pci-tegra
driver as a module since most or all prerequisites are now in place, so
we'll need to export this function eventually. But we can do that when
we actually need it. Perhaps somebody will find a better fix for the LP2
problem until then.

> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
[...]
> @@ -41,6 +41,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/sizes.h>
>  #include <linux/slab.h>
> +#include <linux/tegra-cpuidle.h>

That file doesn't exist in any tree I have. Perhaps it's a new file and
you forgot to add it in this commit?

I've added that file locally to test the patch and verified that it
works around the issue on TrimSlice while not causing any regressions on
Beaver (it doesn't run any code on !ARCH_TEGRA_2x_SOC anyway, but better
safe than sorry).

So with the missing header file added:

Tested-by: Thierry Reding <treding@nvidia.com>

And with an updated commit message:

Acked-by: Thierry Reding <treding@nvidia.com>

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130812/d8727962/attachment.sig>

      reply	other threads:[~2013-08-12 11:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 20:04 [PATCH V3] ARM: tegra: disable LP2 cpuidle state if PCIe is enabled Stephen Warren
2013-08-12 11:09 ` Thierry Reding [this message]

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=20130812110949.GB12042@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).