mailbox/pcc: support mailbox management of the shared buffer
authorAdam Young <admiyo@os.amperecomputing.com>
Tue, 15 Jul 2025 00:10:07 +0000 (20:10 -0400)
committerJassi Brar <jassisinghbrar@gmail.com>
Fri, 8 Aug 2025 04:49:56 +0000 (23:49 -0500)
commit5378bdf6a611a32500fccf13d14156f219bb0c85
tree023c4674575babb3a8b444847504f191e5326748
parent75f1fbc9fd409a0c232dc78871ee7df186da9d57
mailbox/pcc: support mailbox management of the shared buffer

Define a new, optional, callback that allows the driver to
specify how the return data buffer is allocated.  If that callback
is set,  mailbox/pcc.c is now responsible for reading from and
writing to the PCC shared buffer.

This also allows for proper checks of the Commnand complete flag
between the PCC sender and receiver.

For Type 4 channels, initialize the command complete flag prior
to accepting messages.

Since the mailbox does not know what memory allocation scheme
to use for response messages, the client now has an optional
callback that allows it to allocate the buffer for a response
message.

When an outbound message is written to the buffer, the mailbox
checks for the flag indicating the client wants an tx complete
notification via IRQ.  Upon receipt of the interrupt It will
pair it with the outgoing message. The expected use is to
free the kernel memory buffer for the previous outgoing message.

Signed-off-by: Adam Young <admiyo@os.amperecomputing.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/pcc.c
include/acpi/pcc.h