linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Om Prakash Singh <omp@nvidia.com>
To: <kw@linux.com>, <helgaas@kernel.org>, <vidyas@nvidia.com>,
	<lorenzo.pieralisi@arm.com>, <bhelgaas@google.com>,
	<thierry.reding@gmail.com>, <jonathanh@nvidia.com>
Cc: <linux-tegra@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kthota@nvidia.com>,
	<mmaddireddy@nvidia.com>, Om Prakash Singh <omp@nvidia.com>
Subject: [PATCH V3 3/5] PCI: tegra194: Disable interrupts before entering L2
Date: Wed, 23 Jun 2021 15:35:23 +0530	[thread overview]
Message-ID: <20210623100525.19944-4-omp@nvidia.com> (raw)
In-Reply-To: <20210623100525.19944-1-omp@nvidia.com>

In suspend_noirq() call if link doesn't goto L2, PERST# is asserted
to bring link to detect state. However, this is causing surprise
link down AER error. Since Kernel is executing noirq suspend calls,
AER interrupt is not processed. PME and AER are shared interrupts
and PCIe subsystem driver enables wake capability of PME irq during
suspend. So this AER will cause suspend failure due to pending
AER interrupt.

After PCIe link is in L2, interrupts are not expected since PCIe
controller will be in reset state. Disable PCIe interrupts before
going to L2 state to avoid pending AER interrupt.

Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Vidya Sagar <vidyas@nvidia.com>
---
 drivers/pci/controller/dwc/pcie-tegra194.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 66e00b276cd3..64ec0da31b5b 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1593,6 +1593,16 @@ static void tegra_pcie_dw_pme_turnoff(struct tegra_pcie_dw *pcie)
 		return;
 	}
 
+	/*
+	 * PCIe controller exits from L2 only if reset is applied, so
+	 * controller doesn't handle interrupts. But in cases where
+	 * L2 entry fails, PERST# is asserted which can trigger surprise
+	 * link down AER. However this function call happens in
+	 * suspend_noirq(), so AER interrupt will not be processed.
+	 * Disable all interrupts to avoid such a scenario.
+	 */
+	appl_writel(pcie, 0x0, APPL_INTR_EN_L0_0);
+
 	if (tegra_pcie_try_link_l2(pcie)) {
 		dev_info(pcie->dev, "Link didn't transition to L2 state\n");
 		/*
-- 
2.17.1


  parent reply	other threads:[~2021-06-23 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 10:05 [PATCH V3 0/5] Update pcie-tegra194 driver Om Prakash Singh
2021-06-23 10:05 ` [PATCH V3 1/5] PCI: tegra194: Fix handling BME_CHGED event Om Prakash Singh
2021-06-23 10:05 ` [PATCH V3 2/5] PCI: tegra194: Fix MSI-X programming Om Prakash Singh
2021-06-23 10:05 ` Om Prakash Singh [this message]
2021-06-23 10:05 ` [PATCH V3 4/5] PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode Om Prakash Singh
2021-06-23 10:05 ` [PATCH V3 5/5] PCI: tegra194: Cleanup unused code Om Prakash Singh
2021-06-29  5:17 ` [PATCH V3 0/5] Update pcie-tegra194 driver Om Prakash Singh
2021-07-26  7:01 ` Om Prakash Singh
2021-08-04 11:29 ` Lorenzo Pieralisi

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=20210623100525.19944-4-omp@nvidia.com \
    --to=omp@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kthota@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mmaddireddy@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --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 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).