From 7657fe3362c3bc7fff196ad3d47c5d2d49342b0b Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Fri, 5 May 2017 15:47:48 +1000 Subject: phb4: Fix slot presence detect phb4_get_presence_state() needs to set *val to indicate the presence of something in the slot. Currently it doesn't set *val at all. The existing logic is correct, so this patch just sets val in the right places. This has the nice side effect of improving boot times since we no longer waste time tring to train links that don't have anything present. Signed-off-by: Michael Neuling Acked-by: Benjamin Herrenschmidt Signed-off-by: Stewart Smith --- hw/phb4.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw') diff --git a/hw/phb4.c b/hw/phb4.c index 0b0c3d8..41468c9 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -1847,6 +1847,7 @@ static int64_t phb4_get_presence_state(struct pci_slot *slot, uint8_t *val) PHBDBG(p, "hp_status=0x%016llx, dlp_train_ctl=0x%016llx\n", hps, dtctl); + *val = OPAL_PCI_SLOT_PRESENT; /* Check presence detect */ if (hps & PHB_PCIE_HPSTAT_PRESENCE) { /* If it says not present but link is up, then we assume @@ -1857,6 +1858,7 @@ static int64_t phb4_get_presence_state(struct pci_slot *slot, uint8_t *val) PHBERR(p, "Presence detect 0 but link set !\n"); return OPAL_SHPC_DEV_PRESENT; } + *val = OPAL_PCI_SLOT_EMPTY; return OPAL_SHPC_DEV_NOT_PRESENT; } -- cgit v1.1