OSDN Git Service

irqchip/gic: Atomically update affinity
authorMarc Zyngier <maz@kernel.org>
Sun, 21 Jun 2020 13:43:15 +0000 (14:43 +0100)
committerMarc Zyngier <maz@kernel.org>
Sun, 21 Jun 2020 14:24:46 +0000 (15:24 +0100)
commit005c34ae4b44f085120d7f371121ec7ded677761
tree93bd22485a697d1dbba97b2829b82e03c08ae57f
parent559fe74ba6b0c8283e923a64f19fc0398fb64d04
irqchip/gic: Atomically update affinity

The GIC driver uses a RMW sequence to update the affinity, and
relies on the gic_lock_irqsave/gic_unlock_irqrestore sequences
to update it atomically.

But these sequences only expand into anything meaningful if
the BL_SWITCHER option is selected, which almost never happens.

It also turns out that using a RMW and locks is just as silly,
as the GIC distributor supports byte accesses for the GICD_TARGETRn
registers, which when used make the update atomic by definition.

Drop the terminally broken code and replace it by a byte write.

Fixes: 04c8b0f82c7d ("irqchip/gic: Make locking a BL_SWITCHER only feature")
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
drivers/irqchip/irq-gic.c