Skip to content

Commit fca7bf9

Browse files
bharatympe
authored andcommitted
powerpc/mpic: Pass first free vector number to mpic_setup_error_int()
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 <[email protected]> [mpe: Rewrite change log] Signed-off-by: Michael Ellerman <[email protected]>
1 parent fdf743c commit fca7bf9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/powerpc/sysdev/fsl_mpic_err.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int mpic_setup_error_int(struct mpic *mpic, int intvec)
7676
mpic->flags |= MPIC_FSL_HAS_EIMR;
7777
/* allocate interrupt vectors for error interrupts */
7878
for (i = MPIC_MAX_ERR - 1; i >= 0; i--)
79-
mpic->err_int_vecs[i] = --intvec;
79+
mpic->err_int_vecs[i] = intvec--;
8080

8181
return 0;
8282
}

arch/powerpc/sysdev/mpic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,12 +1380,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
13801380
* global vector number space, as in case of ipis
13811381
* and timer interrupts.
13821382
*
1383-
* Available vector space = intvec_top - 12, where 12
1383+
* Available vector space = intvec_top - 13, where 13
13841384
* is the number of vectors which have been consumed by
1385-
* ipis and timer interrupts.
1385+
* ipis, timer interrupts and spurious.
13861386
*/
13871387
if (fsl_version >= 0x401) {
1388-
ret = mpic_setup_error_int(mpic, intvec_top - 12);
1388+
ret = mpic_setup_error_int(mpic, intvec_top - 13);
13891389
if (ret)
13901390
return NULL;
13911391
}

0 commit comments

Comments
 (0)