irqdomain: Fix mapping-creation race
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: 765230b5 ("driver-core: add asynchronous probing support for drivers") Fixes: b62b2cf5 ("irqdomain: Fix handling of type settings for existing mappings") Cc: Dmitry Torokhov <dtor@chromium.org> Cc: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/YuJXMHoT4ijUxnRb@hovoldconsulting.com Signed-off-by:Johan Hovold <johan+linaro@kernel.org>
Loading
Please sign in to comment