summaryrefslogtreecommitdiff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorJamie Iles <jamie.iles@oss.qualcomm.com>2025-11-05 14:42:29 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:12:42 +0900
commitc6fb023cfb17899246e278537d412a7c916c797c (patch)
treea34e9a925df9011e4efcb611d123506c22e8ddc2 /drivers/mailbox
parentbd41e48d43a9528914980ab3484e14ced7eb3c4b (diff)
downloadlinux-c6fb023cfb17899246e278537d412a7c916c797c.tar.gz
linux-c6fb023cfb17899246e278537d412a7c916c797c.tar.bz2
linux-c6fb023cfb17899246e278537d412a7c916c797c.zip
mailbox: pcc: don't zero error register
[ Upstream commit ff0e4d4c97c94af34cc9cad37b5a5cdbe597a3b0 ] The error status mask for a type 3/4 subspace is used for reading the error status, and the bitwise inverse is used for clearing the error with the intent being to preserve any of the non-error bits. However, we were previously applying the mask to extract the status and then applying the inverse to the result which ended up clearing all bits. Instead, store the inverse mask in the preserve mask and then use that on the original value read from the error status so that only the error is cleared. Fixes: c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)") Signed-off-by: Jamie Iles <jamie.iles@oss.qualcomm.com> Signed-off-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/pcc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 94e99b87496d..072998846755 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -278,9 +278,8 @@ static int pcc_mbox_error_check_and_clear(struct pcc_chan_info *pchan)
if (ret)
return ret;
- val &= pchan->error.status_mask;
- if (val) {
- val &= ~pchan->error.status_mask;
+ if (val & pchan->error.status_mask) {
+ val &= pchan->error.preserve_mask;
pcc_chan_reg_write(&pchan->error, val);
return -EIO;
}
@@ -662,7 +661,8 @@ static int pcc_parse_subspace_db_reg(struct pcc_chan_info *pchan,
ret = pcc_chan_reg_init(&pchan->error,
&pcct_ext->error_status_register,
- 0, 0, pcct_ext->error_status_mask,
+ ~pcct_ext->error_status_mask, 0,
+ pcct_ext->error_status_mask,
"Error Status");
}
return ret;