[PATCH] PCI/hotplug: Take two seconds as settlement time after power-on

Gavin Shan gwshan at linux.vnet.ibm.com
Wed Aug 10 16:58:33 AEST 2016


The PCI adapter's firmware isn't fully functional when the PCIe bus
link is up. 1.8 seconds are needed for the firmware to be completely
functional according to the PCI bus settlement time (after reset)
we have in EEH code (EEH_PE_RST_SETTLE_TIME). Without the delay, the
driver fails to initialize the hot added adapter as observed on the
Sumsung NVME card (144d:a821).

This takes two seconds, a bit more than 1.8 seconds, as the PCI bus
settlement time before PCI scanning in hot add sequence. With this
applied, no error reported from driver on the Sumsung NVME adapter.

Reported-by: Meng Li <shlimeng at cn.ibm.com>
Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 drivers/pci/hotplug/pnv_php.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c
index e6245b0..21f1f9d 100644
--- a/drivers/pci/hotplug/pnv_php.c
+++ b/drivers/pci/hotplug/pnv_php.c
@@ -11,6 +11,7 @@
 
 #include <linux/libfdt.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>
 
@@ -434,6 +435,12 @@ static int pnv_php_enable(struct pnv_php_slot *php_slot, bool rescan)
 	if (unlikely(ret))
 		return ret;
 
+	/* Take two seconds as settlement time. Otherwise, the firmware
+	 * of PCI adapter behind the PCI slot isn't functional completely
+	 * in time. It causes initializing failure reported from device
+	 * driver as observed on Sumsung NVME adapter (144d:a821).
+	 */
+	msleep(2000);
 scan:
 	if (presence == OPAL_PCI_SLOT_PRESENT) {
 		if (rescan) {
-- 
2.1.0



More information about the Linuxppc-dev mailing list