diff options
author | Michael Neuling <mikey@neuling.org> | 2017-05-05 15:47:48 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-05-08 14:29:23 +1000 |
commit | 7657fe3362c3bc7fff196ad3d47c5d2d49342b0b (patch) | |
tree | 191893b708d011cada540a461d7f19f9377f17a8 /hw | |
parent | 70bc370883330c8b1076555c126647a3cdf88706 (diff) | |
download | skiboot-7657fe3362c3bc7fff196ad3d47c5d2d49342b0b.zip skiboot-7657fe3362c3bc7fff196ad3d47c5d2d49342b0b.tar.gz skiboot-7657fe3362c3bc7fff196ad3d47c5d2d49342b0b.tar.bz2 |
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 <mikey@neuling.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/phb4.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |