drivers: peci: xec: Re-add error recovery handling
Using temp variable to avoid coverity issue without breakin error recovery. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This commit is contained in:
parent
f0a4cb059d
commit
04e190ab87
1 changed files with 7 additions and 1 deletions
|
@ -242,6 +242,7 @@ static int peci_xec_transfer(struct device *dev, struct peci_msg *msg)
|
|||
ARG_UNUSED(dev);
|
||||
int ret;
|
||||
PECI_Type *base = peci_xec_config.base;
|
||||
u8_t err_val = base->ERROR;
|
||||
|
||||
ret = peci_xec_write(dev, msg);
|
||||
if (ret) {
|
||||
|
@ -264,7 +265,7 @@ static int peci_xec_transfer(struct device *dev, struct peci_msg *msg)
|
|||
}
|
||||
|
||||
/* Check for error conditions and perform bus recovery if necessary */
|
||||
if (base->ERROR) {
|
||||
if (err_val) {
|
||||
if (base->ERROR & MCHP_PECI_ERR_RDOV) {
|
||||
LOG_WRN("Read buffer is not empty\n");
|
||||
}
|
||||
|
@ -281,6 +282,11 @@ static int peci_xec_transfer(struct device *dev, struct peci_msg *msg)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
/* ERROR is a clear-on-write register, need to clear errors occurred
|
||||
* at the end of a transaction.
|
||||
*/
|
||||
base->ERROR = err_val;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue