diff mbox

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

Message ID 1470812313-19943-1-git-send-email-gwshan@linux.vnet.ibm.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Gavin Shan Aug. 10, 2016, 6:58 a.m. UTC
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@cn.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 drivers/pci/hotplug/pnv_php.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

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) {