From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>,
Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
<stable@vger.kernel.org>
Subject: [PATCH] PCI, pciehp: Turn on link a while to workaround presense detection
Date: Fri, 6 Dec 2013 12:22:37 -0800 [thread overview]
Message-ID: <1386361357-7767-1-git-send-email-yinghai@kernel.org> (raw)
During hotplug test on platform, found slot status register does not
report present status correctly. That present bit does not get cleared
even after that card is removed.
That problem is caused by commit:
| commit 2debd9289997fc5d1c0043b41201a8b40d5e11d0
|
| PCI: pciehp: Disable/enable link during slot power off/on
It looks like chipset bug, that PresDet bit is "OR" operation between
sideband input from FPGA, and chipset inband detection from pcie link.
It does not like if we disable pcie link at first and power off
other side device, and it has input from inband detection
always 1.
Workaround: Try turn on link a while after power off.
After this patch, PresDet report correct status when removing or adding
card later.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: <stable@vger.kernel.org> 3.4+
---
drivers/pci/hotplug/pciehp_hpc.c | 9 +++++++++
1 file changed, 9 insertions(+)
Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
@@ -637,6 +637,15 @@ int pciehp_power_off_slot(struct slot *
}
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);
+
+ /*
+ * Enable link for a while so chipset could settle down
+ * inband presence detection logic
+ */
+ pciehp_link_enable(ctrl);
+ msleep(20);
+ pciehp_link_disable(ctrl);
+
return 0;
}
next reply other threads:[~2013-12-06 20:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 20:22 Yinghai Lu [this message]
2013-12-07 5:11 ` [PATCH] PCI, pciehp: Turn on link a while to workaround presense detection Ethan Zhao
2013-12-07 18:35 ` Bjorn Helgaas
2013-12-08 3:19 ` Yinghai Lu
2013-12-08 4:55 ` Ethan Zhao
2013-12-08 6:04 ` Yinghai Lu
2013-12-09 18:33 ` Bjorn Helgaas
2013-12-08 21:29 ` Rajat Jain
2013-12-09 0:58 ` Yinghai Lu
2013-12-09 2:10 ` Ethan Zhao
2013-12-09 18:46 ` Rajat Jain
2013-12-09 19:28 ` Yinghai Lu
2013-12-09 19:35 ` Rajat Jain
2013-12-09 20:20 ` Yinghai Lu
2013-12-10 0:34 ` Guenter Roeck
2013-12-10 21:44 ` Yinghai Lu
2013-12-10 22:00 ` Guenter Roeck
2013-12-10 4:07 ` Ethan Zhao
2013-12-10 9:01 ` Rajat Jain
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=1386361357-7767-1-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=bhelgaas@google.com \
--cc=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-pci@vger.kernel.org \
--cc=stable@vger.kernel.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).