irqdomain: Fix mapping-creation race
stable inclusion from stable-v5.10.175 commit 4ab311d51cd99ddc48e828e70fbdf9c076416cf2 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ab311d51cd99ddc48e828e70fbdf9c076416cf2 -------------------------------- [ Upstream commit 601363cc ] 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. Fixes: 765230b5 ("driver-core: add asynchronous probing support for drivers") Fixes: b62b2cf5 ("irqdomain: Fix handling of type settings for existing mappings") Link: https://lore.kernel.org/r/YuJXMHoT4ijUxnRb@hovoldconsulting.com Cc: stable@vger.kernel.org # 4.8 Cc: Dmitry Torokhov <dtor@chromium.org> Cc: Jon Hunter <jonathanh@nvidia.com> Tested-by:Hsin-Yi Wang <hsinyi@chromium.org> Tested-by:
Mark-PK Tsai <mark-pk.tsai@mediatek.com> Signed-off-by:
Johan Hovold <johan+linaro@kernel.org> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230213104302.17307-7-johan+linaro@kernel.org Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment