Re: [PATCH] pinctrl: sunxi: dt: number the IRQ banks from the first one that has IRQs
From: Andre Przywara
Date: Thu Oct 01 2026 - 08:44:52 EST
Hi Linus,
On 10/1/26 14:06, Linus Walleij wrote:
On Wed, Sep 30, 2026 at 5:27 PM Andre Przywara <andre.przywara@xxxxxxx> wrote:
Yes, this is a known issue, and I already provided a quite different fix
for this[1]: the A523 manual actually lists a PortA GPIO interrupt, even
though this is pretty likely not functional. But specifying this IRQ in
the DT fixes the problem as well.
The DT binding does not say how the IRQs are assigned to the GPIO ports,
so from that point of view my solution is similarly usable as yours -
though admittedly yours looks a little better and more future proof.
I guess we now need to figure out how we want to handle this in the
future, and add an explanation to the binding. The A733 has a similar
problem: PortA does not exist. This time the manual does not explicitly
specify a GPIO IRQ, but conspicuously leaves a gap before the PortB GPIO
IRQ, so we can use that as well.
Linus, Chen-Yu, Jernej: what do you think?
Can't we do both patches? Maybe there is something I don't get with this
code...
Well, if we change the DT and the code, they fight each other, and would be off by one again. So we need to decide for one solution, and since this affects the DT, this has compatibility implications. At the moment the code assumes that GPIO IRQ counting starts with PortA, regardless of whether this implemented or not. That does not sound very future proof: while A523 specifies an IRQ for PortA (even though it's not implemented!), I am afraid future SoCs might not.
So having Pablo's patch would make a lot of sense, but would break with the just changed DT for the A523. That former DT change was fine, since it never worked before, and the new v7.2 DT should work on older kernels even.
So we could revert the DT patch, and take Pablo's code patch, with a Fixes: tag, but that would create some broken combinations meanwhile.
And in any case we should add a word to the binding document, to pin down what's expected here.
Cheers,
Andre.