summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-08-05 09:19:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-16 10:10:56 +0200
commitbb3db40acb4cb29e9c2389581edf73a52d9e8973 (patch)
tree1b6b417342483f2e725e11ee3a20b7f75e57cab6 /kernel
parent42fc595675ec5c8e9e7db197bdd6c661bdc4fa05 (diff)
downloadlinux-stable-bb3db40acb4cb29e9c2389581edf73a52d9e8973.tar.gz
linux-stable-bb3db40acb4cb29e9c2389581edf73a52d9e8973.tar.bz2
linux-stable-bb3db40acb4cb29e9c2389581edf73a52d9e8973.zip
genirq/affinity: Create affinity mask for single vector
commit 491beed3b102b6e6c0e7734200661242226e3933 upstream. Since commit c66d4bd110a1f8 ("genirq/affinity: Add new callback for (re)calculating interrupt sets"), irq_create_affinity_masks() returns NULL in case of single vector. This change has caused regression on some drivers, such as lpfc. The problem is that single vector requests can happen in some generic cases: 1) kdump kernel 2) irq vectors resource is close to exhaustion. If in that situation the affinity mask for a single vector is not created, every caller has to handle the special case. There is no reason why the mask cannot be created, so remove the check for a single vector and create the mask. Fixes: c66d4bd110a1f8 ("genirq/affinity: Add new callback for (re)calculating interrupt sets") Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190805011906.5020-1-ming.lei@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/affinity.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index f18cd5aa33e8..656c14333613 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -253,11 +253,9 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd)
* Determine the number of vectors which need interrupt affinities
* assigned. If the pre/post request exhausts the available vectors
* then nothing to do here except for invoking the calc_sets()
- * callback so the device driver can adjust to the situation. If there
- * is only a single vector, then managing the queue is pointless as
- * well.
+ * callback so the device driver can adjust to the situation.
*/
- if (nvecs > 1 && nvecs > affd->pre_vectors + affd->post_vectors)
+ if (nvecs > affd->pre_vectors + affd->post_vectors)
affvecs = nvecs - affd->pre_vectors - affd->post_vectors;
else
affvecs = 0;