Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e380d66 authored by Gavin Shan's avatar Gavin Shan Committed by android-build-merger
Browse files

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

am: 4f77c55c

Change-Id: I06aecc89657e692b88615195afccf6e47ed6b136
parents 07163c88 4f77c55c
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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