Thread (16 messages) 16 messages, 5 authors, 2025-12-18
STALE196d
Revisions (25)
  1. v6 [diff vs current]
  2. v7 [diff vs current]
  3. v8 [diff vs current]
  4. v9 [diff vs current]
  5. v10 [diff vs current]
  6. v11 [diff vs current]
  7. v12 [diff vs current]
  8. v13 [diff vs current]
  9. v14 [diff vs current]
  10. v15 [diff vs current]
  11. v16 [diff vs current]
  12. v17 [diff vs current]
  13. v18 [diff vs current]
  14. v20 [diff vs current]
  15. v21 [diff vs current]
  16. v22 [diff vs current]
  17. v23 [diff vs current]
  18. v24 [diff vs current]
  19. v25 [diff vs current]
  20. v25 [diff vs current]
  21. v25 [diff vs current]
  22. v27 [diff vs current]
  23. v28 [diff vs current]
  24. v29 [diff vs current]
  25. v30 current

[PATCH v30 1/3] mailbox: pcc: Type3 Buffer handles ACK IRQ

From: Adam Young <hidden>
Date: 2025-10-16 21:02:38
Also in: lkml
Subsystem: acpi pcc(platform communication channel) mailbox driver, mailbox api, the rest · Maintainers: Sudeep Holla, Jassi Brar, Linus Torvalds

The PCC protocol type 3 requests include a field that indicates that the
recipient should trigger an interrupt once the message has been read
from the buffer. The sender uses this interrupt to know that a
transmission is complete, and it is safe to send additional messages.

Signed-off-by: Adam Young <redacted>

mailbox/pcc extended memory helper functions
---
 drivers/mailbox/pcc.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index f6714c233f5a..978a7b674946 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -306,6 +306,18 @@ static void pcc_chan_acknowledge(struct pcc_chan_info *pchan)
 		pcc_chan_reg_read_modify_write(&pchan->db);
 }
 
+static bool pcc_last_tx_done(struct mbox_chan *chan)
+{
+	struct pcc_chan_info *pchan = chan->con_priv;
+	u64 val;
+
+	pcc_chan_reg_read(&pchan->cmd_complete, &val);
+	if (!val)
+		return false;
+	else
+		return true;
+}
+
 /**
  * pcc_mbox_irq - PCC mailbox interrupt handler
  * @irq:	interrupt number
@@ -340,6 +352,14 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
 	 * required to avoid any possible race in updatation of this flag.
 	 */
 	pchan->chan_in_use = false;
+
+	/**
+	 * The remote side sent an ack.
+	 */
+	if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE &&
+	    chan->active_req)
+		mbox_chan_txdone(chan, 0);
+
 	mbox_chan_received_data(chan, NULL);
 
 	pcc_chan_acknowledge(pchan);
@@ -490,6 +510,7 @@ static const struct mbox_chan_ops pcc_chan_ops = {
 	.send_data = pcc_send_data,
 	.startup = pcc_startup,
 	.shutdown = pcc_shutdown,
+	.last_tx_done = pcc_last_tx_done,
 };
 
 /**
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help