Skip to contentSkip to conversation

mailbox: pcc: don't zero error register

PATCH In review Punit Agrawal 2 participants 3 messages Nov 5, 2025 – Dec 3, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: pcc: don't zero error register

From: Jamie Iles <[email protected]>

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)")
---
 drivers/mailbox/pcc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mailbox/pcc.c +4 -4
index 1aa3a7dbb7be..5b454769d260 100644
@@ -281,9 +281,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;
 	}
@@ -750,7 +749,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;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Punit Agrawal

From: Jamie Iles <[email protected]>

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.

Quoted 5 lines

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)")

Good catch!

Signature · 2 lines
Regards,
Sudeep
#2 lore raw
Quoted 13 lines · Sudeep Holla
Quoted 12 lines · Punit Agrawal

From: Jamie Iles <[email protected]>

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.

Quoted 5 lines
Quoted 1 line
Fixes c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)")

Good catch!

Thanks! It looks like Jassi picked up the patch as a fix for v6.18.