Re: [PATCH 2/2] mailbox: qcom-ipcc: amend qcom_ipcc_irq_fn() to report errors

From: Brian Masney

Date: Mon Mar 16 2026 - 07:10:42 EST


On Mon, Mar 16, 2026 at 11:26:18AM +0100, Gabriele Paoloni wrote:
> check the virq value returned by irq_find_mapping(), also
> check the return value of generic_handle_irq(); return IRQ_NONE
> if either of the checks fails.
>
> Signed-off-by: Gabriele Paoloni <gpaoloni@xxxxxxxxxx>
> ---
> drivers/mailbox/qcom-ipcc.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
> index c23efaaa64a1..0795184591f0 100644
> --- a/drivers/mailbox/qcom-ipcc.c
> +++ b/drivers/mailbox/qcom-ipcc.c
> @@ -75,7 +75,7 @@ static irqreturn_t qcom_ipcc_irq_fn(int irq, void *data)
> {
> struct qcom_ipcc *ipcc = data;
> u32 hwirq;
> - int virq;
> + int virq, ret;

Put variables in reverse Christmas tree order.

Brian


>
> for (;;) {
> hwirq = readl(ipcc->base + IPCC_REG_RECV_ID);
> @@ -83,8 +83,14 @@ static irqreturn_t qcom_ipcc_irq_fn(int irq, void *data)
> break;
>
> virq = irq_find_mapping(ipcc->irq_domain, hwirq);
> + if (unlikely(!virq))
> + return IRQ_NONE;
> +
> writel(hwirq, ipcc->base + IPCC_REG_RECV_SIGNAL_CLEAR);
> - generic_handle_irq(virq);
> +
> + ret = generic_handle_irq(virq);
> + if (unlikely(ret))
> + return IRQ_NONE;
> }
>
> return IRQ_HANDLED;
> --
> 2.48.1
>