Re: [PATCH v6 06/20] irqdomain: Fix mapping-creation race

From: Marc Zyngier
Date: Wed Mar 08 2023 - 09:53:59 EST


On Wed, 08 Mar 2023 14:41:05 +0000,
Cyril Brulebois <kibi@xxxxxxxxxx> wrote:
>
> Hi Johan,
>
> And thanks so much for this patch series.
>
> Johan Hovold <johan+linaro@xxxxxxxxxx> (2023-02-13):
> > Parallel probing of devices that share interrupts (e.g. when a driver
> > uses asynchronous probing) can currently result in two mappings for the
> > same hardware interrupt to be created due to missing serialisation.
> >
> > Make sure to hold the irq_domain_mutex when creating mappings so that
> > looking for an existing mapping before creating a new one is done
> > atomically.
>
> Just for information: This patch fixes a long-standing regression
> regarding Raspberry Pi devices, which have been failing to boot (at
> least reliably) due to MMC timeouts for a long while; I think that
> started between v5.17 and v5.19, but I couldn't bisect at the time
> (I was already chasing some other regression).
>
> Example bug report:
> https://bugs.debian.org/1019700
>
> Before trying to pinpoint when the regression appeared, I've checked
> these versions, with a Debian testing userspace as of 2023-03-07:
> - v6.1.12: affected.
> - v6.2: affected.
> - v6.3-rc1: not affected.
>
> A bisect between v6.2 and v6.3-rc1 led me to this patch specifically.
> Seeing how it's part of a patch series, and how previous patches are
> preliminary ones, I've checked that cherry-picking the first 6 patches
> on top of v6.1.15 indeed fixes the problem there too, and it does
> (git cherry-pick v6.2-rc4..601363cc08da25747feb87c55573dd54de91d66a).
>
>
> With the following systems:
> - Pi 4 B, using external storage (SD card),
> - CM4 Lite on CM4 IO Board, using external storage (SD card),
> - CM4 on CM4 IO Board, using internal storage (eMMC),
>
> I've been able to verify that v6.1.12 (baseline in Debian testing)
> triggers this MMC timeout issue, while v6.1.15 + the aforementioned
> range of cherry-picked commits no longer triggers this issue.
>
> (Methodology: cold boot then reboot 20 times, monitoring via serial
> console to keep HDMI output of the equation; affected systems stop
> booting after 1-4 boots; unaffected systems boot and reboot just fine
> all the time.)
>
>
> This looks like a critical bugfix for Raspberry Pi users.
>
> Seeing the stable@ mention is about 4.8, I suppose this is going to be
> considered for a wide range of kernels already… but I'm happy to dig
> into this further to pinpoint when the regression appeared, if that's
> helpful.

If you have an interest in these patches being backported, may I
suggest you look at the backporting failures that have been
reported[1]?

Note that now that 4.9 is out of the picture, nothing is going to be
backported past 4.14.

Thanks,

M.

[1] https://lore.kernel.org/r/167812853717924@xxxxxxxxx

--
Without deviation from the norm, progress is not possible.