summaryrefslogtreecommitdiffstats
path: root/hw/phb4.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-03-20 19:56:54 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-03-28 15:24:13 +1100
commite89d3f32d2167f9821c60c4f5ff54a6d79a0a41a (patch)
treecce0d2fdd31cf0ab4802e13973c6f0a4b42845ca /hw/phb4.c
parent70edcbb4b39d5d90fd487f6f8c6dd459e36935bc (diff)
downloadblackbird-skiboot-e89d3f32d2167f9821c60c4f5ff54a6d79a0a41a.tar.gz
blackbird-skiboot-e89d3f32d2167f9821c60c4f5ff54a6d79a0a41a.zip
hw/phb4: Remove FRESET presence check
When we do an freset the first step is to check if a card is present in the slot. However, this only occurs when we enter phb4_freset() with the slot state set to SLOT_NORMAL. This occurs in: a) The creset path, and b) When the OS manually requests an FRESET via an OPAL call. a) is problematic because in the boot path the generic code will put the slot into FRESET_START manually before calling into phb4_freset(). This can result in a situation where a device is detected on boot, but not after a CRESET. I've noticed this occurring on systems where the PHB's slot presence detect signal is not wired to an adapter. In this situation we can rely on the in-band presence mechanism, but the presence check will make us exit before that has a chance to work. Additionally, if we enter from the CRESET path this early exit leaves the slot's PERST signal being left asserted. This isn't currently an issue, but if we want to support hotplug of devices into the root port it will be. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r--hw/phb4.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index edf54440..4083d715 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2931,30 +2931,20 @@ static int64_t phb4_hreset(struct pci_slot *slot)
static int64_t phb4_freset(struct pci_slot *slot)
{
struct phb4 *p = phb_to_phb4(slot->phb);
- uint8_t presence = 1;
uint64_t reg;
uint16_t reg16;
switch(slot->state) {
case PHB4_SLOT_NORMAL:
+ case PHB4_SLOT_FRESET_START:
PHBDBG(p, "FRESET: Starts\n");
/* Reset max link speed for training */
p->max_link_speed = phb4_get_max_link_speed(p, NULL);
- /* Nothing to do without adapter connected */
- if (slot->ops.get_presence_state)
- slot->ops.get_presence_state(slot, &presence);
- if (!presence) {
- PHBDBG(p, "FRESET: No device\n");
- return OPAL_SUCCESS;
- }
-
PHBDBG(p, "FRESET: Prepare for link down\n");
-
phb4_prepare_link_change(slot, false);
- /* fall through */
- case PHB4_SLOT_FRESET_START:
+
phb4_pcicfg_read16(&p->phb, 0, p->ecap + PCICAP_EXP_LCTL,
&reg16);
reg16 |= PCICAP_EXP_LCTL_LINK_DIS;
OpenPOWER on IntegriCloud