Skip to contentSkip to conversation

mailbox: pcc: Notify clients on polled completion

PATCH In review Sudeep Holla 2 participants 3 messages Jun 27 – Jun 29

Subsystems (3)
lore
Share & tools
lore

Sudeep Holla

author maintainer
#0 lore raw

PATCH v2 1/1 mailbox: pcc: Notify clients on polled completion

PCC channels without a platform interrupt rely on the mailbox polling path to detect command completion.

That path currently only reports transmit completion to the mailbox core, so clients that wait for their receive callback do not get notified when the command completes.

Call mbox_chan_received_data() when polling observes completion on a channel without a platform IRQ, matching the interrupt-driven completion path.

---
v1->v2:
- Check if MBOX_TXDONE_BY_POLL instead of absence of pchan->plat_irq

v1: https://patch.msgid.link/[email protected]

 drivers/mailbox/pcc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mailbox/pcc.c +9 -1
index bde5e0852157..bb55f15edae3 100644
@@ -490,7 +490,15 @@ static bool pcc_last_tx_done(struct mbox_chan *chan)
 {
 	struct pcc_chan_info *pchan = chan->con_priv;
 
-	return pcc_mbox_cmd_complete_check(pchan);
+	if (!(chan->txdone_method & MBOX_TXDONE_BY_POLL))
+		return false;
+
+	if (!pcc_mbox_cmd_complete_check(pchan))
+		return false;
+
+	mbox_chan_received_data(chan, NULL);
+
+	return true;
 }
 
 /**
Signature · 1 line
2.43.0
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · Sudeep Holla

PCC channels without a platform interrupt rely on the mailbox polling path to detect command completion.

That path currently only reports transmit completion to the mailbox core, so clients that wait for their receive callback do not get notified when the command completes.

Quoted 6 lines

Call mbox_chan_received_data() when polling observes completion on a channel without a platform IRQ, matching the interrupt-driven completion path.

LGTM,

Quoted 30 lines

---
v1->v2:
- Check if MBOX_TXDONE_BY_POLL instead of absence of pchan->plat_irq

v1: https://patch.msgid.link/[email protected]

  drivers/mailbox/pcc.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mailbox/pcc.c +9 -1
index bde5e0852157..bb55f15edae3 100644
@@ -490,7 +490,15 @@ static bool pcc_last_tx_done(struct mbox_chan *chan)
  {
  	struct pcc_chan_info *pchan = chan->con_priv;
 
-	return pcc_mbox_cmd_complete_check(pchan);
+	if (!(chan->txdone_method & MBOX_TXDONE_BY_POLL))
+		return false;
+
+	if (!pcc_mbox_cmd_complete_check(pchan))
+		return false;
+
+	mbox_chan_received_data(chan, NULL);
+
+	return true;
  }
 
  /**
Acked-by on v2 1/1
#2 lore raw
In reply to Sudeep Holla
Quoted 7 lines · Sudeep Holla

PCC channels without a platform interrupt rely on the mailbox polling path to detect command completion.

That path currently only reports transmit completion to the mailbox core, so clients that wait for their receive callback do not get notified when the command completes.

Quoted 6 lines

Call mbox_chan_received_data() when polling observes completion on a channel without a platform IRQ, matching the interrupt-driven completion path.

LGTM,

Quoted 1 line

/**