Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1717745
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.12 25/41] blk-mq-pci: add a fallback when pci_irq_get_affinity returns NULL |
| Date | 2017-08-22 21:30 +0200 |
| Message-ID | <uhn2b-6Mv-45@gated-at.bofh.it> (permalink) |
| References | <uhmSu-6HP-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit c005390374957baacbc38eef96ea360559510aa7 upstream.
While pci_irq_get_affinity should never fail for SMP kernel that
implement the affinity mapping, it will always return NULL in the
UP case, so provide a fallback mapping of all queues to CPU 0 in
that case.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
block/blk-mq-pci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/block/blk-mq-pci.c
+++ b/block/blk-mq-pci.c
@@ -36,12 +36,18 @@ int blk_mq_pci_map_queues(struct blk_mq_
for (queue = 0; queue < set->nr_hw_queues; queue++) {
mask = pci_irq_get_affinity(pdev, queue);
if (!mask)
- return -EINVAL;
+ goto fallback;
for_each_cpu(cpu, mask)
set->mq_map[cpu] = queue;
}
return 0;
+
+fallback:
+ WARN_ON_ONCE(set->nr_hw_queues > 1);
+ for_each_possible_cpu(cpu)
+ set->mq_map[cpu] = 0;
+ return 0;
}
EXPORT_SYMBOL_GPL(blk_mq_pci_map_queues);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.12 00/41] 4.12.9-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 28/41] perf/x86: Fix RDPMC vs. mm_struct tracking Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 09/41] md: fix test in md_write_start() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 31/41] x86/elf: Remove the unnecessary ADDR_NO_RANDOMIZE checks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 19/41] mm/cma_debug.c: fix stack corruption due to sprintf usage Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 21/41] mm/vmalloc.c: dont unconditonally use __GFP_HIGHMEM Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 02/41] parisc: pci memory bar assignment fails with 64bit kernels on dino/cujo Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 10/41] md: always clear ->safemode when md_check_recovery gets the mddev lock. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 25/41] blk-mq-pci: add a fallback when pci_irq_get_affinity returns NULL Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 05/41] drm/i915: Perform an invalidate prior to executing golden renderstate Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 22/41] mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 01/41] audit: Fix use after free in audit_remove_watch_rule() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 27/41] xen-blkfront: use a right index when checking requests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 18/41] mm: fix double mmap_sem unlock on MMF_UNSTABLE enforced SIGBUS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 32/41] irqchip/atmel-aic: Fix unbalanced of_node_put() in aic_common_irq_fixup() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
[PATCH 4.12 29/41] x86/asm/64: Clear AC on NMI entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-22 21:30 +0200
Re: [PATCH 4.12 00/41] 4.12.9-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-23 02:40 +0200
Re: [PATCH 4.12 00/41] 4.12.9-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-23 02:50 +0200
csiph-web