Message ID | 1466808476-32690-9-git-send-email-benh@kernel.crashing.org |
---|---|
State | Accepted |
Headers | show |
On Sat, 2016-06-25 at 08:47 +1000, Benjamin Herrenschmidt wrote: > More to go, especially we need to review recovery, but at least > this enables indirect and errors out on not-yet-supported EX > targeting. > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> This conflicts upstream due to : commit e761222593a1ae932cddbc81239b6a7cd98ddb70 Author: Vipin K Parashar < vipin@linux.vnet.ibm.com > Date: Mon Jun 6 14:56:37 2016 +0530 hw/xscom: Reset XSCOM engine after finite number of retries when busy I have a rebase here: https://github.com/mikey/skiboot/commit/baaae284ee8c3089b50e265ef99774f500ef41bb Other than that: Acked-by: Michael Neuling <mikey@neuling.org> > --- > hw/xscom.c | 29 ++++++++++++++++++++--------- > 1 file changed, 20 insertions(+), 9 deletions(-) > > diff --git a/hw/xscom.c b/hw/xscom.c > index 395217b..f8a6402 100644 > --- a/hw/xscom.c > +++ b/hw/xscom.c > @@ -129,13 +129,17 @@ static int xscom_handle_error(uint64_t hmer, > uint32_t gcid, uint32_t pcb_addr, > * recovery procedures > */ > switch(stat) { > - /* XSCOM blocked, just retry */ > - case 1: > + case 1: /* XSCOM blocked, just retry */ > return OPAL_BUSY; > - /* CPU is asleep, don't retry */ > - case 2: > + case 2: /* Chiplet offline, no retry */ > return OPAL_WRONG_STATE; > - } > + case 3: /* Partial good */ > + case 4: /* Invalid address / address error */ > + case 5: /* Clock error */ > + case 6: /* Parity error */ > + case 7: /* Time out */ > + break; > + }; > > /* XXX: Create error log entry ? */ > log_simple_error(&e_info(OPAL_RC_XSCOM_RW), > @@ -254,7 +258,7 @@ static int xscom_indirect_read(uint32_t gcid, > uint64_t pcb_addr, uint64_t *val) > uint64_t data; > int rc, retries; > > - if (proc_gen != proc_gen_p8) { > + if (proc_gen < proc_gen_p8) { > *val = (uint64_t)-1; > return OPAL_UNSUPPORTED; > } > @@ -297,7 +301,7 @@ static int xscom_indirect_write(uint32_t gcid, > uint64_t pcb_addr, uint64_t val) > uint64_t data; > int rc, retries; > > - if (proc_gen != proc_gen_p8) > + if (proc_gen < proc_gen_p8) > return OPAL_UNSUPPORTED; > > /* Write indirect address & data */ > @@ -334,8 +338,13 @@ static uint32_t xscom_decode_chiplet(uint32_t > partid, uint64_t *pcb_addr) > uint32_t gcid = (partid & 0x0fffffff) >> 4; > uint32_t core = partid & 0xf; > > - *pcb_addr |= P8_EX_PCB_SLAVE_BASE; > - *pcb_addr |= core << 24; > + if (proc_gen == proc_gen_p9) { > + /* XXX Not supported */ > + *pcb_addr = 0; > + } else { > + *pcb_addr |= P8_EX_PCB_SLAVE_BASE; > + *pcb_addr |= core << 24; > + } > > return gcid; > } > @@ -357,6 +366,8 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, > uint64_t *val) > return centaur_xscom_read(partid, pcb_addr, val); > case 4: /* EX chiplet */ > gcid = xscom_decode_chiplet(partid, &pcb_addr); > + if (pcb_addr == 0) > + return OPAL_UNSUPPORTED; > break; > default: > return OPAL_PARAMETER;
diff --git a/hw/xscom.c b/hw/xscom.c index 395217b..f8a6402 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -129,13 +129,17 @@ static int xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_addr, * recovery procedures */ switch(stat) { - /* XSCOM blocked, just retry */ - case 1: + case 1: /* XSCOM blocked, just retry */ return OPAL_BUSY; - /* CPU is asleep, don't retry */ - case 2: + case 2: /* Chiplet offline, no retry */ return OPAL_WRONG_STATE; - } + case 3: /* Partial good */ + case 4: /* Invalid address / address error */ + case 5: /* Clock error */ + case 6: /* Parity error */ + case 7: /* Time out */ + break; + }; /* XXX: Create error log entry ? */ log_simple_error(&e_info(OPAL_RC_XSCOM_RW), @@ -254,7 +258,7 @@ static int xscom_indirect_read(uint32_t gcid, uint64_t pcb_addr, uint64_t *val) uint64_t data; int rc, retries; - if (proc_gen != proc_gen_p8) { + if (proc_gen < proc_gen_p8) { *val = (uint64_t)-1; return OPAL_UNSUPPORTED; } @@ -297,7 +301,7 @@ static int xscom_indirect_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val) uint64_t data; int rc, retries; - if (proc_gen != proc_gen_p8) + if (proc_gen < proc_gen_p8) return OPAL_UNSUPPORTED; /* Write indirect address & data */ @@ -334,8 +338,13 @@ static uint32_t xscom_decode_chiplet(uint32_t partid, uint64_t *pcb_addr) uint32_t gcid = (partid & 0x0fffffff) >> 4; uint32_t core = partid & 0xf; - *pcb_addr |= P8_EX_PCB_SLAVE_BASE; - *pcb_addr |= core << 24; + if (proc_gen == proc_gen_p9) { + /* XXX Not supported */ + *pcb_addr = 0; + } else { + *pcb_addr |= P8_EX_PCB_SLAVE_BASE; + *pcb_addr |= core << 24; + } return gcid; } @@ -357,6 +366,8 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val) return centaur_xscom_read(partid, pcb_addr, val); case 4: /* EX chiplet */ gcid = xscom_decode_chiplet(partid, &pcb_addr); + if (pcb_addr == 0) + return OPAL_UNSUPPORTED; break; default: return OPAL_PARAMETER;
More to go, especially we need to review recovery, but at least this enables indirect and errors out on not-yet-supported EX targeting. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- hw/xscom.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)