diff mbox

[v3,9/9] hw/phb3: Override root slot's prepare_link_change() with PHB's

Message ID 1476419167-16688-10-git-send-email-gwshan@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Gavin Shan Oct. 14, 2016, 4:26 a.m. UTC
For PCI slot behind root port, its prepare_link_change() should be
same to PHB's. Otherwise, the UTL events cannot be masked when the
slot is reseted, leading to EEH error because of UTL link-down
event.

Cc: stable # 5.3.0+
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 hw/phb3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stewart Smith Oct. 17, 2016, 6:40 a.m. UTC | #1
Gavin Shan <gwshan@linux.vnet.ibm.com> writes:
> For PCI slot behind root port, its prepare_link_change() should be
> same to PHB's. Otherwise, the UTL events cannot be masked when the
> slot is reseted, leading to EEH error because of UTL link-down
> event.
>
> Cc: stable # 5.3.0+

Merged to skiboot 5.3.x as of 96714cd3475878b9bf3b455f11c53d9acf307649
diff mbox

Patch

diff --git a/hw/phb3.c b/hw/phb3.c
index 35bc73a..1c09ffe 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -284,6 +284,14 @@  static void phb3_root_port_init(struct phb *phb, struct pci_device *dev,
 	uint16_t val16;
 	uint32_t val32;
 
+	/* Use PHB's callback so that the UTL events will be masked
+	 * or unmasked when the link is down or up.
+	 */
+	if (dev->slot && dev->slot->ops.prepare_link_change &&
+	    phb->slot && phb->slot->ops.prepare_link_change)
+		dev->slot->ops.prepare_link_change =
+			phb->slot->ops.prepare_link_change;
+
 	/* Mask UTL link down event if root slot supports surprise
 	 * hotplug as the event should be handled by hotplug driver
 	 * instead of EEH subsystem.