Skip to content

Commit 7d6e3fa

Browse files
committed
Merge tag 'irq-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq updates from Thomas Gleixner: "Updates to the interrupt core and driver subsystems: Core changes: - The usual set of small fixes and improvements all over the place, but nothing stands out MSI changes: - Further consolidation of the PCI/MSI interrupt chip code - Make MSI sysfs code independent of PCI/MSI and expose the MSI interrupts of platform devices in the same way as PCI exposes them. Driver changes: - Support for ARM GICv3 EPPI partitions - Treewide conversion to generic_handle_domain_irq() for all chained interrupt controllers - Conversion to bitmap_zalloc() throughout the irq chip drivers - The usual set of small fixes and improvements" * tag 'irq-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (57 commits) platform-msi: Add ABI to show msi_irqs of platform devices genirq/msi: Move MSI sysfs handling from PCI to MSI core genirq/cpuhotplug: Demote debug printk to KERN_DEBUG irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy irqdomain: Export irq_domain_disconnect_hierarchy() irqchip/gic-v3: Fix priority comparison when non-secure priorities are used irqchip/apple-aic: Fix irq_disable from within irq handlers pinctrl/rockchip: drop the gpio related codes gpio/rockchip: drop irq_gc_lock/irq_gc_unlock for irq set type gpio/rockchip: support next version gpio controller gpio/rockchip: use struct rockchip_gpio_regs for gpio controller gpio/rockchip: add driver for rockchip gpio dt-bindings: gpio: change items restriction of clock for rockchip,gpio-bank pinctrl/rockchip: add pinctrl device to gpio bank struct pinctrl/rockchip: separate struct rockchip_pin_bank to a head file pinctrl/rockchip: always enable clock for gpio controller genirq: Fix kernel doc indentation EDAC/altera: Convert to generic_handle_domain_irq() powerpc: Bulk conversion to generic_handle_domain_irq() nios2: Bulk conversion to generic_handle_domain_irq() ...
2 parents e5e726f + 47fb0cf commit 7d6e3fa

File tree

147 files changed

+1826
-1677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1826
-1677
lines changed

Documentation/ABI/testing/sysfs-bus-platform

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ Description:
2828
value comes from an ACPI _PXM method or a similar firmware
2929
source. Initial users for this file would be devices like
3030
arm smmu which are populated by arm64 acpi_iort.
31+
32+
What: /sys/bus/platform/devices/.../msi_irqs/
33+
Date: August 2021
34+
Contact: Barry Song <song.bao.hua@hisilicon.com>
35+
Description:
36+
The /sys/devices/.../msi_irqs directory contains a variable set
37+
of files, with each file being named after a corresponding msi
38+
irq vector allocated to that device.
39+
40+
What: /sys/bus/platform/devices/.../msi_irqs/<N>
41+
Date: August 2021
42+
Contact: Barry Song <song.bao.hua@hisilicon.com>
43+
Description:
44+
This attribute will show "msi" if <N> is a valid msi irq

Documentation/core-api/irq/irq-domain.rst

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,24 @@ exist then it will allocate a new Linux irq_desc, associate it with
5555
the hwirq, and call the .map() callback so the driver can perform any
5656
required hardware setup.
5757

58-
When an interrupt is received, irq_find_mapping() function should
59-
be used to find the Linux IRQ number from the hwirq number.
58+
Once a mapping has been established, it can be retrieved or used via a
59+
variety of methods:
60+
61+
- irq_resolve_mapping() returns a pointer to the irq_desc structure
62+
for a given domain and hwirq number, and NULL if there was no
63+
mapping.
64+
- irq_find_mapping() returns a Linux IRQ number for a given domain and
65+
hwirq number, and 0 if there was no mapping
66+
- irq_linear_revmap() is now identical to irq_find_mapping(), and is
67+
deprecated
68+
- generic_handle_domain_irq() handles an interrupt described by a
69+
domain and a hwirq number
70+
- handle_domain_irq() does the same thing for root interrupt
71+
controllers and deals with the set_irq_reg()/irq_enter() sequences
72+
that most architecture requires
73+
74+
Note that irq domain lookups must happen in contexts that are
75+
compatible with a RCU read-side critical section.
6076

6177
The irq_create_mapping() function must be called *atleast once*
6278
before any call to irq_find_mapping(), lest the descriptor will not
@@ -137,7 +153,9 @@ required. Calling irq_create_direct_mapping() will allocate a Linux
137153
IRQ number and call the .map() callback so that driver can program the
138154
Linux IRQ number into the hardware.
139155

140-
Most drivers cannot use this mapping.
156+
Most drivers cannot use this mapping, and it is now gated on the
157+
CONFIG_IRQ_DOMAIN_NOMAP option. Please refrain from introducing new
158+
users of this API.
141159

142160
Legacy
143161
------
@@ -157,6 +175,10 @@ for IRQ numbers that are passed to struct device registrations. In that
157175
case the Linux IRQ numbers cannot be dynamically assigned and the legacy
158176
mapping should be used.
159177

178+
As the name implies, the *_legacy() functions are deprecated and only
179+
exist to ease the support of ancient platforms. No new users should be
180+
added.
181+
160182
The legacy map assumes a contiguous range of IRQ numbers has already
161183
been allocated for the controller and that the IRQ number can be
162184
calculated by adding a fixed offset to the hwirq number, and

Documentation/devicetree/bindings/gpio/rockchip,gpio-bank.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ properties:
2222
maxItems: 1
2323

2424
clocks:
25-
maxItems: 1
25+
minItems: 1
26+
items:
27+
- description: APB interface clock source
28+
- description: GPIO debounce reference clock source
2629

2730
gpio-controller: true
2831

arch/arc/kernel/mcip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static void idu_cascade_isr(struct irq_desc *desc)
352352
irq_hw_number_t idu_hwirq = core_hwirq - FIRST_EXT_IRQ;
353353

354354
chained_irq_enter(core_chip, desc);
355-
generic_handle_irq(irq_find_mapping(idu_domain, idu_hwirq));
355+
generic_handle_domain_irq(idu_domain, idu_hwirq);
356356
chained_irq_exit(core_chip, desc);
357357
}
358358

arch/arm/common/sa1111.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,6 @@ static int sa1111_map_irq(struct sa1111 *sachip, irq_hw_number_t hwirq)
196196
return irq_create_mapping(sachip->irqdomain, hwirq);
197197
}
198198

199-
static void sa1111_handle_irqdomain(struct irq_domain *irqdomain, int irq)
200-
{
201-
struct irq_desc *d = irq_to_desc(irq_linear_revmap(irqdomain, irq));
202-
203-
if (d)
204-
generic_handle_irq_desc(d);
205-
}
206-
207199
/*
208200
* SA1111 interrupt support. Since clearing an IRQ while there are
209201
* active IRQs causes the interrupt output to pulse, the upper levels
@@ -234,11 +226,11 @@ static void sa1111_irq_handler(struct irq_desc *desc)
234226

235227
for (i = 0; stat0; i++, stat0 >>= 1)
236228
if (stat0 & 1)
237-
sa1111_handle_irqdomain(irqdomain, i);
229+
generic_handle_domain_irq(irqdomain, i);
238230

239231
for (i = 32; stat1; i++, stat1 >>= 1)
240232
if (stat1 & 1)
241-
sa1111_handle_irqdomain(irqdomain, i);
233+
generic_handle_domain_irq(irqdomain, i);
242234

243235
/* For level-based interrupts */
244236
desc->irq_data.chip->irq_unmask(&desc->irq_data);

arch/arm/mach-pxa/pxa_cplds_irqs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ static irqreturn_t cplds_irq_handler(int in_irq, void *d)
3939

4040
do {
4141
pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask;
42-
for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) {
43-
generic_handle_irq(irq_find_mapping(fpga->irqdomain,
44-
bit));
45-
}
42+
for_each_set_bit(bit, &pending, CPLDS_NB_IRQ)
43+
generic_handle_domain_irq(fpga->irqdomain, bit);
4644
} while (pending);
4745

4846
return IRQ_HANDLED;

arch/arm/mach-s3c/irq-s3c24xx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static void s3c_irq_demux(struct irq_desc *desc)
298298
struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc);
299299
struct s3c_irq_intc *intc = irq_data->intc;
300300
struct s3c_irq_intc *sub_intc = irq_data->sub_intc;
301-
unsigned int n, offset, irq;
301+
unsigned int n, offset;
302302
unsigned long src, msk;
303303

304304
/* we're using individual domains for the non-dt case
@@ -318,8 +318,7 @@ static void s3c_irq_demux(struct irq_desc *desc)
318318
while (src) {
319319
n = __ffs(src);
320320
src &= ~(1 << n);
321-
irq = irq_find_mapping(sub_intc->domain, offset + n);
322-
generic_handle_irq(irq);
321+
generic_handle_domain_irq(sub_intc->domain, offset + n);
323322
}
324323

325324
chained_irq_exit(chip, desc);

arch/mips/ath25/ar2315.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ static void ar2315_misc_irq_handler(struct irq_desc *desc)
6969
{
7070
u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
7171
ar2315_rst_reg_read(AR2315_IMR);
72-
unsigned nr, misc_irq = 0;
72+
unsigned nr;
73+
int ret = 0;
7374

7475
if (pending) {
7576
struct irq_domain *domain = irq_desc_get_handler_data(desc);
7677

7778
nr = __ffs(pending);
78-
misc_irq = irq_find_mapping(domain, nr);
79-
}
8079

81-
if (misc_irq) {
8280
if (nr == AR2315_MISC_IRQ_GPIO)
8381
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_GPIO);
8482
else if (nr == AR2315_MISC_IRQ_WATCHDOG)
8583
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_WD);
86-
generic_handle_irq(misc_irq);
87-
} else {
88-
spurious_interrupt();
84+
85+
ret = generic_handle_domain_irq(domain, nr);
8986
}
87+
88+
if (!pending || ret)
89+
spurious_interrupt();
9090
}
9191

9292
static void ar2315_misc_irq_unmask(struct irq_data *d)

arch/mips/ath25/ar5312.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,21 @@ static void ar5312_misc_irq_handler(struct irq_desc *desc)
7373
{
7474
u32 pending = ar5312_rst_reg_read(AR5312_ISR) &
7575
ar5312_rst_reg_read(AR5312_IMR);
76-
unsigned nr, misc_irq = 0;
76+
unsigned nr;
77+
int ret = 0;
7778

7879
if (pending) {
7980
struct irq_domain *domain = irq_desc_get_handler_data(desc);
8081

8182
nr = __ffs(pending);
82-
misc_irq = irq_find_mapping(domain, nr);
83-
}
8483

85-
if (misc_irq) {
86-
generic_handle_irq(misc_irq);
84+
ret = generic_handle_domain_irq(domain, nr);
8785
if (nr == AR5312_MISC_IRQ_TIMER)
8886
ar5312_rst_reg_read(AR5312_TIMER);
89-
} else {
90-
spurious_interrupt();
9187
}
88+
89+
if (!pending || ret)
90+
spurious_interrupt();
9291
}
9392

9493
/* Enable the specified AR5312_MISC_IRQ interrupt */

arch/mips/lantiq/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void ltq_hw_irq_handler(struct irq_desc *desc)
300300
*/
301301
irq = __fls(irq);
302302
hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module);
303-
generic_handle_irq(irq_linear_revmap(ltq_domain, hwirq));
303+
generic_handle_domain_irq(ltq_domain, hwirq);
304304

305305
/* if this is a EBU irq, we need to ack it or get a deadlock */
306306
if (irq == LTQ_ICU_EBU_IRQ && !module && LTQ_EBU_PCC_ISTAT != 0)

0 commit comments

Comments
 (0)