Skip to content

Commit ff0e4d4

Browse files
Jamie IlesJassi Brar
authored andcommitted
mailbox: pcc: don't zero error register
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: c45ded7 ("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>
1 parent 094b53e commit ff0e4d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/mailbox/pcc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,8 @@ static int pcc_mbox_error_check_and_clear(struct pcc_chan_info *pchan)
276276
if (ret)
277277
return ret;
278278

279-
val &= pchan->error.status_mask;
280-
if (val) {
281-
val &= ~pchan->error.status_mask;
279+
if (val & pchan->error.status_mask) {
280+
val &= pchan->error.preserve_mask;
282281
pcc_chan_reg_write(&pchan->error, val);
283282
return -EIO;
284283
}
@@ -745,7 +744,8 @@ static int pcc_parse_subspace_db_reg(struct pcc_chan_info *pchan,
745744

746745
ret = pcc_chan_reg_init(&pchan->error,
747746
&pcct_ext->error_status_register,
748-
0, 0, pcct_ext->error_status_mask,
747+
~pcct_ext->error_status_mask, 0,
748+
pcct_ext->error_status_mask,
749749
"Error Status");
750750
}
751751
return ret;

0 commit comments

Comments
 (0)