drivers/pci/hotplug: Fix initial state for empty slot

am: 4f77c55c3a

Change-Id: I06aecc89657e692b88615195afccf6e47ed6b136
This commit is contained in:
Gavin Shan
2017-03-15 02:23:46 +00:00
committed by android-build-merger

View File

@@ -436,9 +436,21 @@ static int pnv_php_enable(struct pnv_php_slot *php_slot, bool rescan)
if (ret)
return ret;
/* Proceed if there have nothing behind the slot */
if (presence == OPAL_PCI_SLOT_EMPTY)
/*
* Proceed if there have nothing behind the slot. However,
* we should leave the slot in registered state at the
* beginning. Otherwise, the PCI devices inserted afterwards
* won't be probed and populated.
*/
if (presence == OPAL_PCI_SLOT_EMPTY) {
if (!php_slot->power_state_check) {
php_slot->power_state_check = true;
return 0;
}
goto scan;
}
/*
* If the power supply to the slot is off, we can't detect