]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
irqchip, gicv3-its: Read typer register outside the loop
authorRobert Richter <rrichter@cavium.com>
Wed, 27 Aug 2014 14:24:24 +0000 (16:24 +0200)
committerJulien Grall <julien.grall@citrix.com>
Mon, 28 Sep 2015 11:05:07 +0000 (12:05 +0100)
No need to read the typer register in the loop. Values do not change.

This patch is basically a prerequisite for a follow-on patch that adds
errata code for Cavium ThunderX. It moves the calculation of the
number of id entries to the beginning of the function close to other
setup values that are needed to allocate the its table. Now we have a
central location to modify the setup parameters and the errata code
can be implemented in a single block.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
drivers/irqchip/irq-gic-v3-its.c

index 7c79ba6e9813da352c07954ea2e964f7ad26d521..32ef94892ca05206b6634b419770a544c7621b9e 100644 (file)
@@ -838,6 +838,8 @@ static int its_alloc_tables(struct its_node *its)
        int psz = SZ_64K;
        u64 shr = GITS_BASER_InnerShareable;
        u64 cache = GITS_BASER_WaWb;
+       u64 typer = readq_relaxed(its->base + GITS_TYPER);
+       u32 ids = GITS_TYPER_DEVBITS(typer);
 
        for (i = 0; i < GITS_BASER_NR_REGS; i++) {
                u64 val = readq_relaxed(its->base + GITS_BASER + i * 8);
@@ -861,9 +863,6 @@ static int its_alloc_tables(struct its_node *its)
                 * For other tables, only allocate a single page.
                 */
                if (type == GITS_BASER_TYPE_DEVICE) {
-                       u64 typer = readq_relaxed(its->base + GITS_TYPER);
-                       u32 ids = GITS_TYPER_DEVBITS(typer);
-
                        /*
                         * 'order' was initialized earlier to the default page
                         * granule of the the ITS.  We can't have an allocation