Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: peci: xec: Re-add error recovery handling for PECI driver #23701

Merged
merged 1 commit into from
Mar 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion drivers/peci/peci_mchp_xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
}
Expand All @@ -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;
}

Expand Down