diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 157b799f79744db868a4db589aab921405ae1e8c..7a4bf54a43ad6e0db6394468592e321822d5a656 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -304,6 +304,12 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) if (pcc_chan_reg_read_modify_write(&pchan->plat_irq_ack)) return IRQ_NONE; + /* + * Clear this flag immediately after updating interrupt ack register + * to avoid possible race in updatation of the flag from + * pcc_send_data() that could execute from mbox_chan_received_data() + */ + pchan->chan_in_use = false; mbox_chan_received_data(chan, NULL); /* @@ -314,7 +320,6 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) */ if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) pcc_send_data(chan, NULL); - pchan->chan_in_use = false; return IRQ_HANDLED; }