]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/mpic: Pass first free vector number to mpic_setup_error_int()
authorBharat Bhushan <Bharat.Bhushan@nxp.com>
Fri, 29 Jun 2018 10:24:32 +0000 (15:54 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 Jul 2018 11:58:09 +0000 (21:58 +1000)
Update the comment to account for the spurious interrupt number. The
code was already accounting for it, but that was unclear because it
was achieved by mpic_setup_error_int() knowing that the number it was
passed was the last used vector, rather than the first free vector.

So change the meaning of the argument to the first free vector and
update the caller to pass 13, instead of 12, to achieve the same
result.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
[mpe: Rewrite change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/sysdev/fsl_mpic_err.c
arch/powerpc/sysdev/mpic.c

index 488ec453038a44e10893665b7953173acfe5efc4..2a98837dc6ba778957f092eafea79fd46a2a0901 100644 (file)
@@ -76,7 +76,7 @@ int mpic_setup_error_int(struct mpic *mpic, int intvec)
        mpic->flags |= MPIC_FSL_HAS_EIMR;
        /* allocate interrupt vectors for error interrupts */
        for (i = MPIC_MAX_ERR - 1; i >= 0; i--)
-               mpic->err_int_vecs[i] = --intvec;
+               mpic->err_int_vecs[i] = intvec--;
 
        return 0;
 }
index 353b43972bbffd122699700f16751e93b6748474..934a77324f6b5bd1e4529536a16adf31df1528b8 100644 (file)
@@ -1380,12 +1380,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
                 * global vector number space, as in case of ipis
                 * and timer interrupts.
                 *
-                * Available vector space = intvec_top - 12, where 12
+                * Available vector space = intvec_top - 13, where 13
                 * is the number of vectors which have been consumed by
-                * ipis and timer interrupts.
+                * ipis, timer interrupts and spurious.
                 */
                if (fsl_version >= 0x401) {
-                       ret = mpic_setup_error_int(mpic, intvec_top - 12);
+                       ret = mpic_setup_error_int(mpic, intvec_top - 13);
                        if (ret)
                                return NULL;
                }