Skip to content

Commit 5931e4e

Browse files
committed
Merge branch 'irq/core' into irq/urgent
Pull in the upstream changes so a fix for them can be applied.
2 parents ce7980a + 6f3ee0e commit 5931e4e

37 files changed

+1020
-830
lines changed

Documentation/kernel-hacking/locking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,11 +1277,11 @@ Manfred Spraul points out that you can still do this, even if the data
12771277
is very occasionally accessed in user context or softirqs/tasklets. The
12781278
irq handler doesn't use a lock, and all other accesses are done as so::
12791279

1280-
spin_lock(&lock);
1280+
mutex_lock(&lock);
12811281
disable_irq(irq);
12821282
...
12831283
enable_irq(irq);
1284-
spin_unlock(&lock);
1284+
mutex_unlock(&lock);
12851285

12861286
The disable_irq() prevents the irq handler from running
12871287
(and waits for it to finish if it's currently running on other CPUs).

Documentation/translations/it_IT/kernel-hacking/locking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,11 +1307,11 @@ se i dati vengono occasionalmente utilizzati da un contesto utente o
13071307
da un'interruzione software. Il gestore d'interruzione non utilizza alcun
13081308
*lock*, e tutti gli altri accessi verranno fatti così::
13091309

1310-
spin_lock(&lock);
1310+
mutex_lock(&lock);
13111311
disable_irq(irq);
13121312
...
13131313
enable_irq(irq);
1314-
spin_unlock(&lock);
1314+
mutex_unlock(&lock);
13151315

13161316
La funzione disable_irq() impedisce al gestore d'interruzioni
13171317
d'essere eseguito (e aspetta che finisca nel caso fosse in esecuzione su

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10942,6 +10942,8 @@ L: [email protected]
1094210942
S: Maintained
1094310943
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
1094410944
F: kernel/irq/
10945+
F: include/linux/group_cpus.h
10946+
F: lib/group_cpus.c
1094510947

1094610948
IRQCHIP DRIVERS
1094710949
M: Thomas Gleixner <[email protected]>

arch/x86/kernel/apic/io_apic.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,18 +2364,15 @@ static int mp_irqdomain_create(int ioapic)
23642364
return -ENODEV;
23652365
}
23662366

2367-
ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops,
2368-
(void *)(long)ioapic);
2369-
2367+
ip->irqdomain = irq_domain_create_hierarchy(parent, 0, hwirqs, fn, cfg->ops,
2368+
(void *)(long)ioapic);
23702369
if (!ip->irqdomain) {
23712370
/* Release fw handle if it was allocated above */
23722371
if (!cfg->dev)
23732372
irq_domain_free_fwnode(fn);
23742373
return -ENOMEM;
23752374
}
23762375

2377-
ip->irqdomain->parent = parent;
2378-
23792376
if (cfg->type == IOAPIC_DOMAIN_LEGACY ||
23802377
cfg->type == IOAPIC_DOMAIN_STRICT)
23812378
ioapic_dynirq_base = max(ioapic_dynirq_base,

arch/x86/platform/uv/uv_irq.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,9 @@ static struct irq_domain *uv_get_irq_domain(void)
166166
if (!fn)
167167
goto out;
168168

169-
uv_domain = irq_domain_create_tree(fn, &uv_domain_ops, NULL);
170-
if (uv_domain)
171-
uv_domain->parent = x86_vector_domain;
172-
else
169+
uv_domain = irq_domain_create_hierarchy(x86_vector_domain, 0, 0, fn,
170+
&uv_domain_ops, NULL);
171+
if (!uv_domain)
173172
irq_domain_free_fwnode(fn);
174173
out:
175174
mutex_unlock(&uv_lock);

block/blk-mq-cpumap.c

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,66 +10,29 @@
1010
#include <linux/mm.h>
1111
#include <linux/smp.h>
1212
#include <linux/cpu.h>
13+
#include <linux/group_cpus.h>
1314

1415
#include <linux/blk-mq.h>
1516
#include "blk.h"
1617
#include "blk-mq.h"
1718

18-
static int queue_index(struct blk_mq_queue_map *qmap,
19-
unsigned int nr_queues, const int q)
20-
{
21-
return qmap->queue_offset + (q % nr_queues);
22-
}
23-
24-
static int get_first_sibling(unsigned int cpu)
25-
{
26-
unsigned int ret;
27-
28-
ret = cpumask_first(topology_sibling_cpumask(cpu));
29-
if (ret < nr_cpu_ids)
30-
return ret;
31-
32-
return cpu;
33-
}
34-
3519
void blk_mq_map_queues(struct blk_mq_queue_map *qmap)
3620
{
37-
unsigned int *map = qmap->mq_map;
38-
unsigned int nr_queues = qmap->nr_queues;
39-
unsigned int cpu, first_sibling, q = 0;
40-
41-
for_each_possible_cpu(cpu)
42-
map[cpu] = -1;
43-
44-
/*
45-
* Spread queues among present CPUs first for minimizing
46-
* count of dead queues which are mapped by all un-present CPUs
47-
*/
48-
for_each_present_cpu(cpu) {
49-
if (q >= nr_queues)
50-
break;
51-
map[cpu] = queue_index(qmap, nr_queues, q++);
21+
const struct cpumask *masks;
22+
unsigned int queue, cpu;
23+
24+
masks = group_cpus_evenly(qmap->nr_queues);
25+
if (!masks) {
26+
for_each_possible_cpu(cpu)
27+
qmap->mq_map[cpu] = qmap->queue_offset;
28+
return;
5229
}
5330

54-
for_each_possible_cpu(cpu) {
55-
if (map[cpu] != -1)
56-
continue;
57-
/*
58-
* First do sequential mapping between CPUs and queues.
59-
* In case we still have CPUs to map, and we have some number of
60-
* threads per cores then map sibling threads to the same queue
61-
* for performance optimizations.
62-
*/
63-
if (q < nr_queues) {
64-
map[cpu] = queue_index(qmap, nr_queues, q++);
65-
} else {
66-
first_sibling = get_first_sibling(cpu);
67-
if (first_sibling == cpu)
68-
map[cpu] = queue_index(qmap, nr_queues, q++);
69-
else
70-
map[cpu] = map[first_sibling];
71-
}
31+
for (queue = 0; queue < qmap->nr_queues; queue++) {
32+
for_each_cpu(cpu, &masks[queue])
33+
qmap->mq_map[cpu] = qmap->queue_offset + queue;
7234
}
35+
kfree(masks);
7336
}
7437
EXPORT_SYMBOL_GPL(blk_mq_map_queues);
7538

drivers/irqchip/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ config LS_EXTIRQ
389389

390390
config LS_SCFG_MSI
391391
def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
392-
depends on PCI && PCI_MSI
392+
depends on PCI_MSI
393393

394394
config PARTITION_PERCPU
395395
bool
@@ -658,6 +658,7 @@ config APPLE_AIC
658658
bool "Apple Interrupt Controller (AIC)"
659659
depends on ARM64
660660
depends on ARCH_APPLE || COMPILE_TEST
661+
select GENERIC_IRQ_IPI_MUX
661662
help
662663
Support for the Apple Interrupt Controller found on Apple Silicon SoCs,
663664
such as the M1.

drivers/irqchip/irq-alpine-msi.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,20 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv,
199199
}
200200

201201
gic_domain = irq_find_host(gic_node);
202+
of_node_put(gic_node);
202203
if (!gic_domain) {
203204
pr_err("Failed to find the GIC domain\n");
204205
return -ENXIO;
205206
}
206207

207-
middle_domain = irq_domain_add_tree(NULL,
208-
&alpine_msix_middle_domain_ops,
209-
priv);
208+
middle_domain = irq_domain_add_hierarchy(gic_domain, 0, 0, NULL,
209+
&alpine_msix_middle_domain_ops,
210+
priv);
210211
if (!middle_domain) {
211212
pr_err("Failed to create the MSIX middle domain\n");
212213
return -ENOMEM;
213214
}
214215

215-
middle_domain->parent = gic_domain;
216-
217216
msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
218217
&alpine_msix_domain_info,
219218
middle_domain);

0 commit comments

Comments
 (0)