Re: [PATCH] i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling

From: Jeremy Kerr
Date: Wed May 01 2024 - 02:22:24 EST


Hi Dylan,

Just a question on a prior patch you sent:

> Disable IBI IRQ signal and status only when hot-join and SIR enabling
> of all target devices attached to the bus are disabled.
>
> Fixes: e389b1d72a62 ("i3c: dw: Add support for in-band interrupts")

[...]

> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1163,8 +1163,10 @@ static void dw_i3c_master_set_sir_enabled(struct dw_i3c_master *master,
>                 global = reg == 0xffffffff;
>                 reg &= ~BIT(idx);
>         } else {
> -               global = reg == 0;
> +               bool hj_rejected = !!(readl(master->regs + DEVICE_CTRL) & DEV_CTRL_HOT_JOIN_NACK);
> +
>                 reg |= BIT(idx);
> +               global = (reg == 0xffffffff) && hj_rejected;
>         }
>         writel(reg, master->regs + IBI_SIR_REQ_REJECT);
>  

My interpretation of this change is that we keep the "global" IBI irq
enabled if hot-join-nack is set (ie, always, because we don't support
hot join, and configure the hardware to nack all hot join requests).

However, we never enable the hot-join NACK interrupt - IBI_QUEUE_CTRL
bit 0 is never set. So I can't see how we would ever get an interrupt
for the hot join NACK case anyway. Because of that, this patch is just
keeping the IBI threshold interrupt always enabled for no reason.

Or is something else happening here? Is there another cause for the IBI
threshold IRQs?

Cheers,


Jeremy