IRQ subsystem changes for v4.11
Subsystems (9)
Linus,
Please pull the latest irq-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-core-for-linus
# HEAD: 3900dea4cda7c28d7921370bc4d22b08463ed94c irqchip/qcom: Fix error handling
The main changes in this cycle were:
- Add support for the Qualcomm interrupt combiner, together with its ACPI bindings
- Add Cortina Systems Gemini (ARM SoC) irqchip driver
- ... misc other irqchip driver fixes/updates and cleanups
- genirq core debug output and other cleanups
Thanks,
Ingo
------------------>
Agustin Vega-Frias (3):
ACPI: Generic GSI: Do not attempt to map non-GSI IRQs during bus scan
ACPI: Add support for ResourceSource/IRQ domain mapping irqchip/qcom: Add IRQ combiner driver
Alim Akhtar (1):
irqchip/gic-v3: Remove duplicate definition of GICD_TYPER_LPIS
Arnd Bergmann (1):
genirq/msi: Add stubs for get_cached_msi_msg/pci_write_msi_msg
Bartosz Golaszewski (1):
irqdesc: Add a resource managed version of irq_alloc_descs()
Christophe JAILLET (1):
irqchip/qcom: Fix error handling
H Hartley Sweeten (1):
genirq: Fix /proc/interrupts output alignment
Heiner Kallweit (1):
genirq/devres: Use dev_name(dev) as default for devname
Jeremy Kerr (1):
genirq: Clarify logic calculating bogus irqreturn_t values
Linus Walleij (2):
irqchip: DT bindings for Cortina Gemini irqchip
irqchip: Add a driver for Cortina Gemini
Marc Zyngier (4):
irqchip/gic-v3-its: Refactor command encoding irqchip/gic-v3-its: Drop deprecated GITS_BASER_TYPE_CPU irqchip/gic-v3-its: Rename MAPVI to MAPTI irqchip/gic-v3-its: Zero command on allocation
Marcin Nowakowski (1):
irqchip/mips-gic: Fix local interrupts
Matthias Brugger (1):
irq/platform-msi: Fix comment about maximal MSIs
Robert Richter (1):
irqchip/gic-v3-its: Fix command buffer allocation
Shanker Donthineni (1):
irqchip/gic-v3-its: Enable cacheable attribute Read-allocate hints
.../cortina,gemini-interrupt-controller.txt | 22 ++ Documentation/driver-model/devres.txt | 5 + drivers/acpi/Makefile | 2 +- drivers/acpi/gsi.c | 98 ------- drivers/acpi/irq.c | 297 +++++++++++++++++++++ drivers/acpi/resource.c | 18 +- drivers/base/platform-msi.c | 2 +- drivers/base/platform.c | 10 + drivers/irqchip/Kconfig | 9 + drivers/irqchip/Makefile | 2 + drivers/irqchip/irq-gemini.c | 185 +++++++++++++ drivers/irqchip/irq-gic-v3-its.c | 85 +++--- drivers/irqchip/irq-mips-gic.c | 29 ++ drivers/irqchip/qcom-irq-combiner.c | 296 ++++++++++++++++++++ include/linux/acpi.h | 10 + include/linux/irq.h | 19 ++ include/linux/irqchip/arm-gic-v3.h | 5 +- include/linux/msi.h | 11 +- kernel/irq/devres.c | 65 ++++- kernel/irq/proc.c | 2 + kernel/irq/spurious.c | 4 +- 21 files changed, 1027 insertions(+), 149 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/cortina,gemini-interrupt-controller.txt delete mode 100644 drivers/acpi/gsi.c create mode 100644 drivers/acpi/irq.c create mode 100644 drivers/irqchip/irq-gemini.c create mode 100644 drivers/irqchip/qcom-irq-combiner.c
Documentation/devicetree/bindings/interrupt-controller/cortina,gemini-interrupt-controller.txt new file +22 -0
@@ -0,0 +1,22 @@ +* Cortina Systems Gemini interrupt controller + +This interrupt controller is found on the Gemini SoCs. + +Required properties: +- compatible: must be "cortina,gemini-interrupt-controller" +- reg: The register bank for the interrupt controller. +- interrupt-controller: Identifies the node as an interrupt controller +- #interrupt-cells: The number of cells to define the interrupts. + Must be 2 as the controller can specify level or rising edge + IRQs. The bindings follows the standard binding for controllers + with two cells specified in + interrupt-controller/interrupts.txt + +Example: + +interrupt-controller@48000000 { + compatible = "cortina,gemini-interrupt-controller"; + reg = <0x48000000 0x1000>; + interrupt-controller; + #interrupt-cells = <2>; +};
Documentation/driver-model/devres.txt +5 -0
@@ -306,6 +306,11 @@ IRQ devm_request_any_context_irq() devm_request_irq() devm_request_threaded_irq() + devm_irq_alloc_descs() + devm_irq_alloc_desc() + devm_irq_alloc_desc_at() + devm_irq_alloc_desc_from() + devm_irq_alloc_descs_from() LED devm_led_classdev_register()
drivers/acpi/Makefile +1 -1
@@ -55,7 +55,7 @@ acpi-$(CONFIG_DEBUG_FS) += debugfs.o acpi-$(CONFIG_ACPI_NUMA) += numa.o acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o acpi-y += acpi_lpat.o -acpi-$(CONFIG_ACPI_GENERIC_GSI) += gsi.o +acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o acpi-$(CONFIG_ACPI_WATCHDOG) += acpi_watchdog.o # These are (potentially) separate modules
drivers/acpi/gsi.c deleted +0 -98
98 lines not on this page · raw message
drivers/acpi/irq.c new file +297 -0
297 lines not on this page · raw message
drivers/acpi/resource.c +17 -1
@@ -43,6 +43,19 @@ static inline bool acpi_iospace_resource_valid(struct resource *res) { return true; }#endif +#if IS_ENABLED (CONFIG_ACPI_GENERIC_GSI ) +static inline bool is_gsi (struct acpi_resource_extended_irq *ext_irq) +{ +return ext_irq->resource_source.string_length ==0 && + ext_irq->producer_consumer ==ACPI_CONSUMER ; +} +#else +static inline bool is_gsi (struct acpi_resource_extended_irq *ext_irq) +{ +return true; +} +#endif +static bool acpi_dev_resource_len_valid (u64 start,u64 end,u64 len,bool io) {u64 reslen = end - start +1 ;
@@ -470,9 +483,12 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,acpi_dev_irqresource_disabled (res,0 );return false; } -acpi_dev_get_irqresource (res, ext_irq->interrupts[index], +if (is_gsi (ext_irq)) +acpi_dev_get_irqresource (res, ext_irq->interrupts[index], ext_irq->triggering, ext_irq->polarity, ext_irq->sharable, false); +else +acpi_dev_irqresource_disabled (res,0 );break ;default : res->flags =0 ;
drivers/base/platform-msi.c +1 -1
@@ -206,7 +206,7 @@ platform_msi_alloc_priv_data(struct device *dev, unsigned int nvec, {struct platform_msi_priv_data *datap;/* -* Limit the number of interrupts to 256 per device. Should we +* Limit the number of interrupts to 2048 per device. Should we * need to bump this up, DEV_ID_SHIFT should be adjusted * accordingly (which would impact the max number of MSI * capable devices).
drivers/base/platform.c +10 -0
@@ -102,6 +102,16 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) } r =platform_get_resource (dev,IORESOURCE_IRQ , num); +if (has_acpi_companion (&dev->dev)) { +if (r && r->flags &IORESOURCE_DISABLED ) { +int ret; + + ret =acpi_irq_get (ACPI_HANDLE (&dev->dev), num, r); +if (ret) +return ret; + } + } +/* * The resources may pass trigger flags to the irqs that need * to be set up. It so happens that the trigger flags for
drivers/irqchip/Kconfig +9 -0
@@ -283,3 +283,12 @@ config EZNPS_GIC config STM32_EXTI bool select IRQ_DOMAIN + +config QCOM_IRQ_COMBINER + bool "QCOM IRQ combiner support" + depends on ARCH_QCOM && ACPI + select IRQ_DOMAIN + select IRQ_DOMAIN_HIERARCHY + help + Say yes here to add support for the IRQ combiner devices embedded + in Qualcomm Technologies chips.
drivers/irqchip/Makefile +2 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_ATH79) += irq-ath79-misc.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o +obj-$(CONFIG_ARCH_GEMINI) += irq-gemini.o obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.o obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
@@ -75,3 +76,4 @@ obj-$(CONFIG_LS_SCFG_MSI) += irq-ls-scfg-msi.o obj-$(CONFIG_EZNPS_GIC) += irq-eznps.o obj-$(CONFIG_ARCH_ASPEED) += irq-aspeed-vic.o obj-$(CONFIG_STM32_EXTI) += irq-stm32-exti.o +obj-$(CONFIG_QCOM_IRQ_COMBINER) += qcom-irq-combiner.o
drivers/irqchip/irq-gemini.c new file +185 -0
185 lines not on this page · raw message
drivers/irqchip/irq-gic-v3-its.c +45 -40
212 lines not on this page · raw message
drivers/irqchip/irq-mips-gic.c +29 -0
@@ -968,6 +968,34 @@ static struct irq_domain_ops gic_ipi_domain_ops = { .match = gic_ipi_domain_match, }; +static void __init gic_map_single_int (struct device_node *node, +unsigned int irq) +{ +unsigned int linux_irq; +struct irq_fwspec local_int_fwspec = { + .fwnode = &node->fwnode, + .param_count =3 , + .param = { + [0 ] =GIC_LOCAL , + [1 ] = irq, + [2 ] =IRQ_TYPE_NONE , + }, + }; + +if (!gic_local_irq_is_routable (irq)) +return ; + + linux_irq =irq_create_fwspec_mapping (&local_int_fwspec); +WARN_ON (!linux_irq); +} + +static void __init gic_map_interrupts (struct device_node *node) +{ +gic_map_single_int (node,GIC_LOCAL_INT_TIMER ); +gic_map_single_int (node,GIC_LOCAL_INT_PERFCTR ); +gic_map_single_int (node,GIC_LOCAL_INT_FDC ); +} + static void __init __gic_init(unsigned long gic_base_addr, unsigned long gic_addrspace_size, unsigned int cpu_vec, unsigned int irqbase,
@@ -1067,6 +1095,7 @@ static void __init __gic_init(unsigned long gic_base_addr, }gic_basic_init (); +gic_map_interrupts (node); } void __init gic_init(unsigned long gic_base_addr,
drivers/irqchip/qcom-irq-combiner.c new file +296 -0
296 lines not on this page · raw message
include/linux/acpi.h +10 -0
@@ -1153,4 +1153,14 @@ int parse_spcr(bool earlycon);static inline int parse_spcr (bool earlycon) {return 0 ; }#endif +#if IS_ENABLED (CONFIG_ACPI_GENERIC_GSI ) +int acpi_irq_get (acpi_handle handle,unsigned int index,struct resource *res); +#else +static inline +int acpi_irq_get (acpi_handle handle,unsigned int index,struct resource *res) +{ +return -EINVAL ; +} +#endif +#endif /*_LINUX_ACPI_H*/
include/linux/irq.h +19 -0
@@ -715,6 +715,10 @@ unsigned int arch_dynirq_lower_bound(unsigned int from);int __irq_alloc_descs (int irq,unsigned int from,unsigned int cnt,int node,struct module *owner,const struct cpumask *affinity); +int __devm_irq_alloc_descs (struct device *dev,int irq,unsigned int from, +unsigned int cnt,int node,struct module *owner, +const struct cpumask *affinity); +/* use macros to avoid needing export.h for THIS_MODULE */ #define irq_alloc_descs (irq, from, cnt, node) \ __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE, NULL)
@@ -731,6 +735,21 @@ int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,#define irq_alloc_descs_from (from, cnt, node) \ irq_alloc_descs(-1, from, cnt, node) +#define devm_irq_alloc_descs (dev, irq, from, cnt, node) \ + __devm_irq_alloc_descs(dev, irq, from, cnt, node, THIS_MODULE, NULL) + +#define devm_irq_alloc_desc (dev, node) \ + devm_irq_alloc_descs(dev, -1, 0, 1, node) + +#define devm_irq_alloc_desc_at (dev, at, node) \ + devm_irq_alloc_descs(dev, at, at, 1, node) + +#define devm_irq_alloc_desc_from (dev, from, node) \ + devm_irq_alloc_descs(dev, -1, from, 1, node) + +#define devm_irq_alloc_descs_from (dev, from, cnt, node) \ + devm_irq_alloc_descs(dev, -1, from, cnt, node) +void irq_free_descs (unsigned int irq,unsigned int cnt);static inline void irq_free_desc (unsigned int irq) {
include/linux/irqchip/arm-gic-v3.h +1 -4
@@ -73,7 +73,6 @@#define GICD_TYPER_ID_BITS (typer) ((((typer) >> 19) & 0x1f) + 1)#define GICD_TYPER_IRQS (typer) ((((typer) & 0x1f) + 1) * 32) -#define GICD_TYPER_LPIS (1U << 17)#define GICD_IROUTER_SPI_MODE_ONE (0U << 31)#define GICD_IROUTER_SPI_MODE_ANY (1U << 31)
@@ -306,7 +305,7 @@#define GITS_BASER_TYPE_NONE 0#define GITS_BASER_TYPE_DEVICE 1#define GITS_BASER_TYPE_VCPU 2 -#define GITS_BASER_TYPE_CPU 3 +#define GITS_BASER_TYPE_RESERVED3 3#define GITS_BASER_TYPE_COLLECTION 4#define GITS_BASER_TYPE_RESERVED5 5#define GITS_BASER_TYPE_RESERVED6 6
@@ -320,8 +319,6 @@#define GITS_CMD_MAPD 0x08#define GITS_CMD_MAPC 0x09#define GITS_CMD_MAPTI 0x0a -/* older GIC documentation used MAPVI for this command */ -#define GITS_CMD_MAPVI GITS_CMD_MAPTI#define GITS_CMD_MAPI 0x0b#define GITS_CMD_MOVI 0x01#define GITS_CMD_DISCARD 0x0f
include/linux/msi.h +10 -1
@@ -17,7 +17,13 @@ struct msi_desc;struct pci_dev ;struct platform_msi_priv_data ;void __get_cached_msi_msg (struct msi_desc *entry,struct msi_msg *msg); +#ifdef CONFIG_GENERIC_MSI_IRQ void get_cached_msi_msg (unsigned int irq,struct msi_msg *msg); +#else +static inline void get_cached_msi_msg (unsigned int irq,struct msi_msg *msg) +{ +} +#endif typedef void (*irq_write_msi_msg_t )(struct msi_desc *desc,struct msi_msg *msg);
@@ -116,11 +122,15 @@ struct msi_desc {struct pci_dev *msi_desc_to_pci_dev (struct msi_desc *desc);void *msi_desc_to_pci_sysdata (struct msi_desc *desc); +void pci_write_msi_msg (unsigned int irq,struct msi_msg *msg);#else /* CONFIG_PCI_MSI */ static inline void *msi_desc_to_pci_sysdata (struct msi_desc *desc) {return NULL ; } +static inline void pci_write_msi_msg (unsigned int irq,struct msi_msg *msg) +{ +}#endif /* CONFIG_PCI_MSI */ struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,
@@ -128,7 +138,6 @@ struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,void free_msi_entry (struct msi_desc *entry);void __pci_read_msi_msg (struct msi_desc *entry,struct msi_msg *msg);void __pci_write_msi_msg (struct msi_desc *entry,struct msi_msg *msg); -void pci_write_msi_msg (unsigned int irq,struct msi_msg *msg);u32 __pci_msix_desc_mask_irq (struct msi_desc *desc,u32 flag);u32 __pci_msi_desc_mask_irq (struct msi_desc *desc,u32 mask,u32 flag);
kernel/irq/devres.c +63 -2
98 lines not on this page · raw message
kernel/irq/proc.c +2 -0
@@ -487,6 +487,8 @@ int show_interrupts(struct seq_file *p, void *v) }if (desc->irq_data.domain)seq_printf (p," %*d" , prec, (int ) desc->irq_data.hwirq); +else +seq_printf (p," %*s" , prec,"" );#ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL seq_printf (p," %-8s" ,irqd_is_level_type (&desc->irq_data) ?"Level" :"Edge" );#endif
kernel/irq/spurious.c +3 -1
@@ -175,7 +175,9 @@ static void poll_spurious_irqs(unsigned long dummy)static inline int bad_action_ret (irqreturn_t action_ret) { -if (likely (action_ret <= (IRQ_HANDLED |IRQ_WAKE_THREAD ))) +unsigned int r = action_ret; + +if (likely (r <= (IRQ_HANDLED |IRQ_WAKE_THREAD )))return 0 ;return 1 ; }
Quoted 10 lines · Ingo Molnar
Linus,
Please pull the latest irq-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-core-for-linus # HEAD: 3900dea4cda7c28d7921370bc4d22b08463ed94c irqchip/qcom: Fix error handlingThe main changes in this cycle were:
Quoted 8 lines
- Add support for the Qualcomm interrupt combiner, together with its ACPI bindings
- Add Cortina Systems Gemini (ARM SoC) irqchip driver
- ... misc other irqchip driver fixes/updates and cleanups
- genirq core debug output and other cleanups
So Thomas tells me that while he's on the road he has already sent this tree (and the timers tree) to you already (and I was blind to not see it in my mbox), so please disregard this duplicated pull request! ;-)
Thanks,
Ingo