Commit 3b353ab0 authored by Marc Zyngier's avatar Marc Zyngier Committed by Mark-PK Tsai
Browse files

BACKPORT: irqdomain: Fix domain registration race



[ Upstream commit 8932c32c ]

Hierarchical domains created using irq_domain_create_hierarchy() are
currently added to the domain list before having been fully initialised.

This specifically means that a racing allocation request might fail to
allocate irq data for the inner domains of a hierarchy in case the
parent domain pointer has not yet been set up.

Note that this is not really any issue for irqchip drivers that are
registered early (e.g. via IRQCHIP_DECLARE() or IRQCHIP_ACPI_DECLARE())
but could potentially cause trouble with drivers that are registered
later (e.g. modular drivers using IRQCHIP_PLATFORM_DRIVER_BEGIN(),
gpiochip drivers, etc.).

Fixes: afb7da83 ("irqdomain: Introduce helper function irq_domain_add_hierarchy()")
Cc: stable@vger.kernel.org      # 3.19
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
[ johan: add commit message ]
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230213104302.17307-8-johan+linaro@kernel.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Bug: 263196443
(cherry picked from commit 985d9fa0)
Change-Id: I52f9d5477755716ecd5ef90a65a730c6fe8d1212
[Resolved minor conflict in kernel/irq/irqdomain.c]
Signed-off-by: default avatarMark-PK Tsai <mark-pk.tsai@mediatek.com>
parent ded8d6b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment