[Skiboot] [PATCH] Retry link training at PCIe GEN1 if presence detected but training repeatedly failed

Timothy Pearson tpearson at raptorengineering.com
Thu Dec 13 14:43:33 AEDT 2018


Certain older PCIe 1.0 devices will not train unless the training process starts at GEN1 speeds.
As a last resort when a device will not train, fall back to GEN1 speed for the last training attempt.

This is verified to fix devices based on the Conexant CX23888 on the Talos II platform.

Signed-off-by: Timothy Pearson <tpearson at raptorengineering.com>
---
 hw/phb4.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/phb4.c b/hw/phb4.c
index 50e1be1c..a9905c79 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1,4 +1,5 @@
 /* Copyright 2013-2016 IBM Corp.
+ * Copyright 2018 Raptor Engineering, LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -2269,6 +2270,14 @@ static int64_t phb4_retry_state(struct pci_slot *slot)
 	/* Mark link as down */
 	phb4_prepare_link_change(slot, false);
 
+	/* Last attempt to activate link */
+	if (slot->link_retries == 1) {
+		if (slot->state == PHB4_SLOT_LINK_WAIT) {
+			PHBERR(p, "Falling back to GEN1 training\n");
+			p->max_link_speed = 1;
+		}
+	}
+
 	if (!slot->link_retries--) {
 		switch (slot->state) {
 		case PHB4_SLOT_LINK_WAIT_ELECTRICAL:


More information about the Skiboot mailing list