]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/gic-v3-its: Recompute the number of pages on page size change
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 26 Jan 2016 14:24:15 +0000 (14:24 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 26 Jan 2016 15:34:06 +0000 (16:34 +0100)
commit9e54337131b5fa42fb7a873514862332fda18731
treeef3edb1c9ad9e788b19361bde9be10dea539dab9
parentacaecf3d9f7d8bc9e9b16cc71db8d43e61d336ae
irqchip/gic-v3-its: Recompute the number of pages on page size change

When the programming of a GITS_BASERn register fails because of
an unsupported ITS page size, we retry it with a smaller page size.
Unfortunately, we don't recompute the number of allocated ITS pages,
indicating the wrong value computed in the original allocation.

A convenient fix is to free the pages we allocated, update the
page size, and restart the allocation. This will ensure that
we always allocate the right amount in the case of a device
table, specially if we have to reduce the allocation order
to stay within the boundaries of the ITS maximum allocation.

Reported-and-tested-by: Ma Jun <majun258@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1453818255-1289-1-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/irqchip/irq-gic-v3-its.c