Re: [PATCH v2 1/2] mfd: core: Reject failed IRQ domain mappings

From: Lee Jones

Date: Thu Nov 19 2026 - 09:38:30 EST


I'm totally confused by this.

Firstly, if this is v2, where is v1? I can't find it.

> irq_create_mapping() returns zero on failure. Storing that value in a
> child IRQ resource lets registration succeed with an invalid IRQ. The
> child then fails to probe, and retrying its probe cannot repair the
> resource after a transient allocation failure.
>
> Return -ENOMEM through the existing resource cleanup path when mapping
> fails, before registering the child. Leave successful mappings owned by
> the IRQ domain provider, since other consumers may share them.
>
> Fixes: c94bb233a9fe ("mfd: Make MFD core code Device Tree and IRQ domain aware")
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
>
> ---
> No hardware testing.

Where is the diff?

Did you hand-craft this patch?

> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 16ad4fd26..e00f31402 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -255,6 +255,10 @@ static int mfd_add_device(struct device *parent, int id,
> cell->resources[r].end);
> res[r].start = res[r].end = irq_create_mapping(
> domain, cell->resources[r].start);
> + if (!res[r].start) {
> + ret = -ENOMEM;
> + goto fail_res_conflict;
> + }

We can talk about the code when you send me a patch!

> } else {
> res[r].start = irq_base +
> cell->resources[r].start;
>
>
> On Tue, 10 Nov 2026 02:32:49 +0000, Myeonghun Pak <mhun512@xxxxxxxxx> wrote:
> > Hi Lee and Dmitry,
> >
> > This series fixes WM831x IRQ resource mismatches and follows Dmitry's
> > request for managed onkey IRQ/work cleanup and MFD-provided mapped IRQs.
> > The provider and consumers are converted together to keep their IRQ
> > resources consistent.
> >
> > Changes since v1:
> > - Use managed IRQ/work cleanup instead of storing the onkey IRQ.
> > - Move IRQ mapping into MFD and update all platform consumers.
> > - Reject failed mappings and unwind consumers before removing the domain.
> > - Retain polling for release detection; the chip only interrupts on assertion.
> > - Drop the previous Reviewed-by tag because the implementation changed
> > substantially.
> >
> > Compile-tested with LLVM, W=1 (arm64), for all 11 changed C objects.
> > No hardware testing.
> >
> > Previous discussion:
> > https://lore.kernel.org/r/atJycIEnUZKVdTjW@xxxxxxxxxx
> >
> > Thanks,
> > Myeonghun

How is this in the patch?

Sorry, but this is not acceptable. If you want to provide additional
context, do so in the cover-letter, or at worst below the '---' not
tagged on to the end of the diff like this.

Try again please.

--
Lee Jones