Skip to content

mailbox: pcc: Improve completion handling and validation

Sudeep Holla linux-acpi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v13 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Reworked to keep chan_in_use set after a successful doorbell write
and clear it only when the write fails.
- Clarified that ordering is provided by the ordered I/O accessor,
covering both MMIO and port I/O doorbells.
- Clarified the cross-CPU flag access and interrupt-side clearing
before the mailbox core can submit another transfer.
- Link to v1: https://lore.kernel.org/all/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mailbox: pcc: Notify clients on polled completiondrivers/mailbox/pcc.c+9 -11 reply
2/3mailbox: pcc: Check shared memory signature on requestdrivers/mailbox/pcc.c+31 -51 reply
3/3mailbox: pcc: Fix command timeout due to missed interruptdrivers/mailbox/pcc.c+27 -141 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchHuisong LiAdam Young
1/3A-b R-b
2/3
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] mailbox: pcc: Improve completion handling and validation

Hi Jassi,

This series addresses three issues in the PCC mailbox controller which are on the list for a while and discussed/reviewed. Please pick them for v7.3 or let me know if you prefer pull request.

First, notify clients through their receive callback when a command completes through polling, matching the interrupt-driven completion path.

Second, centralize PCC shared memory signature checking in the mailbox controller. Invalid signatures are reported without rejecting otherwise working firmware, while mappings too small to contain a signature remain fatal.

Finally, fix a race where a fast platform can signal command completion before the channel is marked in use, causing a shared interrupt to be ignored and the command to time out. Publish the channel state before ringing the doorbell and use READ_ONCE()/WRITE_ONCE() for the lockless flag accesses.

Regards,
Sudeep

Changes in v2:
- Reworked to keep chan_in_use set after a successful doorbell write
and clear it only when the write fails.
- Clarified that ordering is provided by the ordered I/O accessor,
covering both MMIO and port I/O doorbells.
- Clarified the cross-CPU flag access and interrupt-side clearing
before the mailbox core can submit another transfer.
- Link to v1: https://lore.kernel.org/all/[email protected]

Huisong Li (1):
mailbox: pcc: Fix command timeout due to missed interrupt

Sudeep Holla (2):
mailbox: pcc: Notify clients on polled completion
mailbox: pcc: Check shared memory signature on request

 drivers/mailbox/pcc.c | 87 +++++++++++++++++++++++++++++++++----------
 1 file changed, 67 insertions(+), 20 deletions(-)
Signature · 1 line
2.43.0