[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YuJX1+0GmUBOe133@hovoldconsulting.com>
Date: Thu, 28 Jul 2022 11:33:11 +0200
From: Johan Hovold <johan@...nel.org>
To: Johan Hovold <johan+linaro@...nel.org>
Cc: Marc Zyngier <maz@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh@...nel.org>, linux-kernel@...r.kernel.org,
Dmitry Torokhov <dtor@...omium.org>,
Jon Hunter <jonathanh@...dia.com>
Subject: Re: [PATCH] irqdomain: Fix mapping-creation race
On Thu, Jul 28, 2022 at 11:27:10AM +0200, Johan Hovold wrote:
> Parallel probing (e.g. due to asynchronous probing) of devices that share
> interrupts can currently result in two mappings for the same hardware
> interrupt to be created.
>
> Add a serialising mapping mutex so that looking for an existing mapping
> before creating a new one is done atomically.
>
> Note that serialising the lookup and creation in
> irq_create_mapping_affinity() would have been enough to prevent the
> duplicate mapping, but that could instead cause
> irq_create_fwspec_mapping() to fail when there is a race.
>
> Fixes: 765230b5f084 ("driver-core: add asynchronous probing support for drivers")
> Fixes: b62b2cf5759b ("irqdomain: Fix handling of type settings for existing mappings")
> Cc: Dmitry Torokhov <dtor@...omium.org>
> Cc: Jon Hunter <jonathanh@...dia.com>
> Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
Here's some more background on how I ran into this:
Link: https://lore.kernel.org/r/YuJXMHoT4ijUxnRb@hovoldconsulting.com
Johan
Powered by blists - more mailing lists