diff mbox

[stable,5.1] hw/phb3: fix error handling in complete reset

Message ID 20161122085539.27027-1-andrew.donnellan@au1.ibm.com
State Accepted
Headers show

Commit Message

Andrew Donnellan Nov. 22, 2016, 8:55 a.m. UTC
During a complete reset, when we get a timeout waiting for pending
transaction in state PHB3_STATE_CRESET_WAIT_CQ, we mark the PHB as broken
and return OPAL_PARAMETER.

Change the return code to OPAL_HARDWARE which is way more sensible, and set
the state to PHB3_STATE_FENCED so that the kernel can retry the complete
reset.

Reported-by: Pradipta Ghosh <pradghos@in.ibm.com>
Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

This patch applies on top of skiboot 5.1.18. I'm going to submit a similar 
fix for mainline.

This patch goes along with Russell's kernel patch at [0] that fixes the 
handling of return values from the skiboot reset functions.

[0] http://patchwork.ozlabs.org/patch/695990/

---
 hw/phb3.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Stewart Smith Dec. 13, 2016, 4:50 a.m. UTC | #1
Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:
> During a complete reset, when we get a timeout waiting for pending
> transaction in state PHB3_STATE_CRESET_WAIT_CQ, we mark the PHB as broken
> and return OPAL_PARAMETER.
>
> Change the return code to OPAL_HARDWARE which is way more sensible, and set
> the state to PHB3_STATE_FENCED so that the kernel can retry the complete
> reset.
>
> Reported-by: Pradipta Ghosh <pradghos@in.ibm.com>
> Suggested-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
>
> ---
>
> This patch applies on top of skiboot 5.1.18. I'm going to submit a similar 
> fix for mainline.
>
> This patch goes along with Russell's kernel patch at [0] that fixes the 
> handling of return values from the skiboot reset functions.
>
> [0] http://patchwork.ozlabs.org/patch/695990/

Thanks, merged to 5.1.x as of 284c465
diff mbox

Patch

diff --git a/hw/phb3.c b/hw/phb3.c
index 62b67cb..85e1e90 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2485,10 +2485,9 @@  static int64_t phb3_sm_complete_reset(struct phb3 *p)
 		assert(false);
 	}
 
-	/* Mark the PHB as dead and expect it to be removed */
 error:
-	p->state = PHB3_STATE_BROKEN;
-	return OPAL_PARAMETER;
+	p->state = PHB3_STATE_FENCED;
+	return OPAL_HARDWARE;
 }
 
 static int64_t phb3_complete_reset(struct phb *phb, uint8_t assert)