All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qiang Zheng <zhengqiang10@huawei.com>
To: <helgaas@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<gabriele.paoloni@huawei.com>, <linuxarm@huawei.com>
Subject: [PATCH V2] Bug fix for PME interrupt handler, add Root Status check
Date: Sat, 30 Sep 2017 10:12:06 +0800	[thread overview]
Message-ID: <1506737526-94266-1-git-send-email-zhengqiang10@huawei.com> (raw)

PCIe PME and hot plug share same interrupt number. In some special case,
Link down event cause hot plug interrupt, devices is not disconnected,
But read config will return 0xff.

In that case, PME work function will run and not return Because
Root Status PME bit always 1 and can not be cleared.

This patch add Root Status check in PME interrupt handler,
Just do same as pciehp isr Slot status check.

Signed-off-by: Qiang Zheng <zhengqiang10@huawei.com>
---
 drivers/pci/pcie/pme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index fafdb16..2ff2e57 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -273,7 +273,7 @@ static irqreturn_t pcie_pme_irq(int irq, void *context)
 	spin_lock_irqsave(&data->lock, flags);
 	pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta);
 
-	if (!(rtsta & PCI_EXP_RTSTA_PME)) {
+	if (rtsta == U32_MAX || !(rtsta & PCI_EXP_RTSTA_PME)) {
 		spin_unlock_irqrestore(&data->lock, flags);
 		return IRQ_NONE;
 	}
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Qiang Zheng <zhengqiang10@huawei.com>
To: helgaas@kernel.org
Cc: linux-pci@vger.kernel.org, linux-pm@vger.kernel.org,
	gabriele.paoloni@huawei.com, linuxarm@huawei.com
Subject: [PATCH V2] Bug fix for PME interrupt handler, add Root Status check
Date: Sat, 30 Sep 2017 10:12:06 +0800	[thread overview]
Message-ID: <1506737526-94266-1-git-send-email-zhengqiang10@huawei.com> (raw)

PCIe PME and hot plug share same interrupt number. In some special case,
Link down event cause hot plug interrupt, devices is not disconnected,
But read config will return 0xff.

In that case, PME work function will run and not return Because
Root Status PME bit always 1 and can not be cleared.

This patch add Root Status check in PME interrupt handler,
Just do same as pciehp isr Slot status check.

Signed-off-by: Qiang Zheng <zhengqiang10@huawei.com>
---
 drivers/pci/pcie/pme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index fafdb16..2ff2e57 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -273,7 +273,7 @@ static irqreturn_t pcie_pme_irq(int irq, void *context)
 	spin_lock_irqsave(&data->lock, flags);
 	pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta);
 
-	if (!(rtsta & PCI_EXP_RTSTA_PME)) {
+	if (rtsta == U32_MAX || !(rtsta & PCI_EXP_RTSTA_PME)) {
 		spin_unlock_irqrestore(&data->lock, flags);
 		return IRQ_NONE;
 	}
-- 
1.9.1

             reply	other threads:[~2017-09-30  2:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30  2:12 Qiang Zheng [this message]
2017-09-30  2:12 ` [PATCH V2] Bug fix for PME interrupt handler, add Root Status check Qiang Zheng
2017-10-01  0:45 ` Rafael J. Wysocki
2017-10-04 22:11 ` Bjorn Helgaas
2017-10-05 13:02   ` Rafael J. Wysocki

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=1506737526-94266-1-git-send-email-zhengqiang10@huawei.com \
    --to=zhengqiang10@huawei.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxarm@huawei.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.