Commit 7d6e3fa8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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()
  ...
parents e5e726f7 47fb0cfd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -28,3 +28,17 @@ Description:
		value comes from an ACPI _PXM method or a similar firmware
		source. Initial users for this file would be devices like
		arm smmu which are populated by arm64 acpi_iort.

What:		/sys/bus/platform/devices/.../msi_irqs/
Date:		August 2021
Contact:	Barry Song <song.bao.hua@hisilicon.com>
Description:
		The /sys/devices/.../msi_irqs directory contains a variable set
		of files, with each file being named after a corresponding msi
		irq vector allocated to that device.

What:		/sys/bus/platform/devices/.../msi_irqs/<N>
Date:		August 2021
Contact:	Barry Song <song.bao.hua@hisilicon.com>
Description:
		This attribute will show "msi" if <N> is a valid msi irq
+25 −3
Original line number Diff line number Diff line
@@ -55,8 +55,24 @@ exist then it will allocate a new Linux irq_desc, associate it with
the hwirq, and call the .map() callback so the driver can perform any
required hardware setup.

When an interrupt is received, irq_find_mapping() function should
be used to find the Linux IRQ number from the hwirq number.
Once a mapping has been established, it can be retrieved or used via a
variety of methods:

- irq_resolve_mapping() returns a pointer to the irq_desc structure
  for a given domain and hwirq number, and NULL if there was no
  mapping.
- irq_find_mapping() returns a Linux IRQ number for a given domain and
  hwirq number, and 0 if there was no mapping
- irq_linear_revmap() is now identical to irq_find_mapping(), and is
  deprecated
- generic_handle_domain_irq() handles an interrupt described by a
  domain and a hwirq number
- handle_domain_irq() does the same thing for root interrupt
  controllers and deals with the set_irq_reg()/irq_enter() sequences
  that most architecture requires

Note that irq domain lookups must happen in contexts that are
compatible with a RCU read-side critical section.

The irq_create_mapping() function must be called *atleast once*
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
IRQ number and call the .map() callback so that driver can program the
Linux IRQ number into the hardware.

Most drivers cannot use this mapping.
Most drivers cannot use this mapping, and it is now gated on the
CONFIG_IRQ_DOMAIN_NOMAP option. Please refrain from introducing new
users of this API.

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

As the name implies, the *_legacy() functions are deprecated and only
exist to ease the support of ancient platforms. No new users should be
added.

The legacy map assumes a contiguous range of IRQ numbers has already
been allocated for the controller and that the IRQ number can be
calculated by adding a fixed offset to the hwirq number, and
+4 −1
Original line number Diff line number Diff line
@@ -22,7 +22,10 @@ properties:
    maxItems: 1

  clocks:
    maxItems: 1
    minItems: 1
    items:
      - description: APB interface clock source
      - description: GPIO debounce reference clock source

  gpio-controller: true

+1 −1
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ static void idu_cascade_isr(struct irq_desc *desc)
	irq_hw_number_t idu_hwirq = core_hwirq - FIRST_EXT_IRQ;

	chained_irq_enter(core_chip, desc);
	generic_handle_irq(irq_find_mapping(idu_domain, idu_hwirq));
	generic_handle_domain_irq(idu_domain, idu_hwirq);
	chained_irq_exit(core_chip, desc);
}

+2 −10
Original line number Diff line number Diff line
@@ -196,14 +196,6 @@ static int sa1111_map_irq(struct sa1111 *sachip, irq_hw_number_t hwirq)
	return irq_create_mapping(sachip->irqdomain, hwirq);
}

static void sa1111_handle_irqdomain(struct irq_domain *irqdomain, int irq)
{
	struct irq_desc *d = irq_to_desc(irq_linear_revmap(irqdomain, irq));

	if (d)
		generic_handle_irq_desc(d);
}

/*
 * SA1111 interrupt support.  Since clearing an IRQ while there are
 * active IRQs causes the interrupt output to pulse, the upper levels
@@ -234,11 +226,11 @@ static void sa1111_irq_handler(struct irq_desc *desc)

	for (i = 0; stat0; i++, stat0 >>= 1)
		if (stat0 & 1)
			sa1111_handle_irqdomain(irqdomain, i);
			generic_handle_domain_irq(irqdomain, i);

	for (i = 32; stat1; i++, stat1 >>= 1)
		if (stat1 & 1)
			sa1111_handle_irqdomain(irqdomain, i);
			generic_handle_domain_irq(irqdomain, i);

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