In case of irq_default_affinity != cpu_possible_mask, setting the affinity for the pre/post vectors to irq_default_affinity is a breakage. Just set the pre/post vectors to cpu_possible_mask and be done with it. Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Dou Liyang <douliyangs@xxxxxxxxx> --- kernel/irq/affinity.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d122575ba1b4..aaa1dd82c3df 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -257,7 +257,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) /* Fill out vectors at the beginning that don't need affinity */ for (curvec = 0; curvec < affd->pre_vectors; curvec++) - cpumask_copy(&masks[curvec].mask, irq_default_affinity); + cpumask_copy(&masks[curvec].mask, cpu_possible_mask); /* * Spread on present CPUs starting from affd->pre_vectors. If we * have multiple sets, build each sets affinity mask separately. @@ -282,12 +282,15 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) } /* Fill out vectors at the end that don't need affinity */ - if (usedvecs >= affvecs) + if (usedvecs >= affvecs) { curvec = affd->pre_vectors + affvecs; - else + } else { curvec = affd->pre_vectors + usedvecs; + for (; curvec < affd->pre_vectors + affvecs; curvec++) + cpumask_copy(&masks[curvec].mask, irq_default_affinity); + } for (; curvec < nvecs; curvec++) - cpumask_copy(&masks[curvec].mask, irq_default_affinity); + cpumask_copy(&masks[curvec].mask, cpu_possible_mask); /* Setup complementary information */ for (i = 0; i < nvecs; i++) { -- 2.17.2