30 Dec, 2020

1 commit

  • [ Upstream commit 4615fbc3788ddc8e7c6d697714ad35a53729aa2c ]

    When an interrupt allocation fails for N interrupts, it is pretty
    common for the error handling code to free the same number of interrupts,
    no matter how many interrupts have actually been allocated.

    This may result in the domain freeing code to be unexpectedly called
    for interrupts that have no mapping in that domain. Things end pretty
    badly.

    Instead, add some checks to irq_domain_free_irqs_hierarchy() to make sure
    that thiss does not follow the hierarchy if no mapping exists for a given
    interrupt.

    Fixes: 6a6544e520abe ("genirq/irqdomain: Remove auto-recursive hierarchy support")
    Signed-off-by: Marc Zyngier
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20201129135551.396777-1-maz@kernel.org
    Signed-off-by: Sasha Levin

    Marc Zyngier
     

30 Nov, 2020

1 commit

  • There is currently no way to convey the affinity of an interrupt
    via irq_create_mapping(), which creates issues for devices that
    expect that affinity to be managed by the kernel.

    In order to sort this out, rename irq_create_mapping() to
    irq_create_mapping_affinity() with an additional affinity parameter that
    can be passed down to irq_domain_alloc_descs().

    irq_create_mapping() is re-implemented as a wrapper around
    irq_create_mapping_affinity().

    No functional change.

    Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")
    Signed-off-by: Laurent Vivier
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Greg Kurz
    Cc: Michael Ellerman
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20201126082852.1178497-2-lvivier@redhat.com

    Laurent Vivier
     

10 Oct, 2020

1 commit

  • It appears that some HW is ugly enough that not all the interrupts
    connected to a particular interrupt controller end up with the same
    hierarchy depth (some of them are terminated early). This leaves
    the irqchip hacker with only two choices, both equally bad:

    - create discrete domain chains, one for each "hierarchy depth",
    which is very hard to maintain

    - create fake hierarchy levels for the shallow paths, leading
    to all kind of problems (what are the safe hwirq values for these
    fake levels?)

    Implement the ability to cut short a single interrupt hierarchy
    from a level marked as being disconnected by using the new
    irq_domain_disconnect_hierarchy() helper.

    The irqdomain allocation code will then perform the trimming

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

27 Jul, 2020

2 commits

  • Add export for irq_domain_update_bus_token() so that
    we can allow drivers like the qcom-pdc driver to be
    loadable as a module.

    Signed-off-by: John Stultz
    Signed-off-by: Marc Zyngier
    Reviewed-by: Linus Walleij
    Cc: Andy Gross
    Cc: Bjorn Andersson
    Cc: Joerg Roedel
    Cc: Thomas Gleixner
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: Linus Walleij
    Cc: Maulik Shah
    Cc: Lina Iyer
    Cc: Saravana Kannan
    Cc: Todd Kjos
    Cc: Greg Kroah-Hartman
    Cc: linux-arm-msm@vger.kernel.org
    Cc: iommu@lists.linux-foundation.org
    Cc: linux-gpio@vger.kernel.org
    Link: https://lore.kernel.org/r/20200710231824.60699-2-john.stultz@linaro.org

    John Stultz
     
  • The is_fwnode_irqchip() helper will check if the fwnode_handle is empty.
    There is no need to perform a redundant check outside of it.

    Signed-off-by: Zenghui Yu
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200716083905.287-1-yuzenghui@huawei.com

    Zenghui Yu
     

21 May, 2020

3 commits

  • In some cases we need to have an IRQ domain created out of software node.

    One of such cases is DesignWare GPIO driver when it's instantiated from
    half-baked ACPI table (alas, we can't fix it for devices which are few years
    on market) and thus using software nodes to quirk this. But the driver
    is using IRQ domains based on per GPIO port firmware nodes, which are in
    the above case software ones. This brings a warning message to be printed

    [ 73.957183] irq: Invalid fwnode type for irqdomain

    and creates an anonymous IRQ domain without a debugfs entry.

    Allowing software nodes to be valid for IRQ domains rids us of the warning
    and debugs gets correctly populated.

    % ls -1 /sys/kernel/debug/irq/domains/
    ...
    intel-quark-dw-apb-gpio:portA

    Signed-off-by: Andy Shevchenko
    [maz: refactored commit message]
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200520164927.39090-3-andriy.shevchenko@linux.intel.com

    Andy Shevchenko
     
  • Now that __irq_domain_add() is able to better deals with generic
    fwnodes, there is no need to special-case ACPI anymore.

    Get rid of the special treatment for ACPI.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200520164927.39090-2-andriy.shevchenko@linux.intel.com

    Andy Shevchenko
     
  • __irq_domain_add() relies in some places on the fact that the fwnode
    can be only of type OF. This prevents refactoring of the code to support
    other types of fwnode. Make it less OF-dependent by switching it
    to use the fwnode directly where it makes sense.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200520164927.39090-1-andriy.shevchenko@linux.intel.com

    Andy Shevchenko
     

18 May, 2020

1 commit


08 Mar, 2020

2 commits

  • irq_domain_alloc_irqs_hierarchy() has 3 call sites in the compilation unit
    but only one of them checks for the pointer which is being dereferenced
    inside the called function. Move the check into the function. This allows
    for catching the error instead of the following crash:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    PC is at 0x0
    LR is at gpiochip_hierarchy_irq_domain_alloc+0x11f/0x140
    ...
    [] (gpiochip_hierarchy_irq_domain_alloc)
    [] (__irq_domain_alloc_irqs)
    [] (irq_create_fwspec_mapping)
    [] (gpiochip_to_irq)
    [] (gpiod_to_irq)
    [] (gpio_irqs_init [gpio_irqs])
    [] (gpio_irqs_exit+0xecc/0xe84 [gpio_irqs])
    Code: bad PC value

    Signed-off-by: Alexander Sverdlin
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20200306174720.82604-1-alexander.sverdlin@nokia.com

    Alexander Sverdlin
     
  • The function got renamed at some point, but the kernel-doc was not updated.

    Signed-off-by: luanshi
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/1583200125-58806-1-git-send-email-zhangliguang@linux.alibaba.com

    luanshi
     

21 Jan, 2020

1 commit

  • Fix a memory leak reported by kmemleak:
    unreferenced object 0xffff000bc6f50e80 (size 128):
    comm "kworker/23:2", pid 201, jiffies 4294894947 (age 942.132s)
    hex dump (first 32 bytes):
    00 00 00 00 41 00 00 00 86 c0 03 00 00 00 00 00 ....A...........
    00 a0 b2 c6 0b 00 ff ff 40 51 fd 10 00 80 ff ff ........@Q......
    backtrace:
    [] kmem_cache_alloc_trace+0x1a4/0x320
    [] irq_domain_push_irq+0x7c/0x188
    [] thunderx_gpio_probe+0x3ac/0x438
    [] pci_device_probe+0xe4/0x198
    [] really_probe+0xdc/0x320
    [] driver_probe_device+0x5c/0xf0
    [] __device_attach_driver+0x88/0xc0
    [] bus_for_each_drv+0x7c/0xc8
    [] __device_attach+0xe4/0x140
    [] device_initial_probe+0x18/0x20
    [] bus_probe_device+0x98/0xa0
    [] deferred_probe_work_func+0x74/0xa8
    [] process_one_work+0x1c8/0x470
    [] worker_thread+0x1f8/0x428
    [] kthread+0xfc/0x128
    [] ret_from_fork+0x10/0x18

    Fixes: 495c38d3001f ("irqdomain: Add irq_domain_{push,pop}_irq() functions")
    Signed-off-by: Kevin Hao
    Signed-off-by: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200120043547.22271-1-haokexin@gmail.com

    Kevin Hao
     

20 Jan, 2020

1 commit

  • Add a new function irq_domain_translate_onecell() that is to be used as
    the translate function in struct irq_domain_ops.

    Signed-off-by: Yash Shah
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/1575976274-13487-2-git-send-email-yash.shah@sifive.com

    Yash Shah
     

05 Nov, 2019

1 commit


03 Sep, 2019

1 commit

  • Recently device pass-through stops working for Linux VM running on Hyper-V.

    git-bisect shows the regression is caused by the recent commit
    467a3bb97432 ("PCI: hv: Allocate a named fwnode ..."), but the root cause
    is that the commit d59f6617eef0 forgets to set the domain->fwnode for
    IRQCHIP_FWNODE_NAMED*, and as a result:

    1. The domain->fwnode remains to be NULL.

    2. irq_find_matching_fwspec() returns NULL since "h->fwnode == fwnode" is
    false, and pci_set_bus_msi_domain() sets the Hyper-V PCI root bus's
    msi_domain to NULL.

    3. When the device is added onto the root bus, the device's dev->msi_domain
    is set to NULL in pci_set_msi_domain().

    4. When a device driver tries to enable MSI-X, pci_msi_setup_msi_irqs()
    calls arch_setup_msi_irqs(), which uses the native MSI chip (i.e.
    arch/x86/kernel/apic/msi.c: pci_msi_controller) to set up the irqs, but
    actually pci_msi_setup_msi_irqs() is supposed to call
    msi_domain_alloc_irqs() with the hbus->irq_domain, which is created in
    hv_pcie_init_irq_domain() and is associated with the Hyper-V chip
    hv_msi_irq_chip. Consequently, the irq line is not properly set up, and
    the device driver can not receive any interrupt.

    Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only")
    Fixes: 467a3bb97432 ("PCI: hv: Allocate a named fwnode instead of an address-based one")
    Reported-by: Lili Deng
    Signed-off-by: Dexuan Cui
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/PU1P153MB01694D9AF625AC335C600C5FBFBE0@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM

    Dexuan Cui
     

07 Aug, 2019

1 commit

  • Booting a large arm64 server (HiSi D05) leads to the following
    shouting at boot time:

    [ 20.722132] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.730851] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.739560] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.748267] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.756975] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.765683] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!
    [ 20.774391] debugfs: File 'irqchip@(____ptrval____)-3' in directory 'domains' already present!

    and many more... Evidently, we expect something a bit more informative
    than ____ptrval____, and certainly we want all of our domains, not just
    the first one.

    For that, turn the %p used to generate the fwnode name into something
    that won't be repainted (%pa). Given that we've now fixed all users to
    pass a pointer to a PA, it will actually do the right thing.

    Acked-by: Thomas Gleixner
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

06 Jul, 2019

1 commit


29 May, 2019

1 commit


29 Apr, 2019

1 commit


09 Mar, 2019

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v5.1 cycle:

    Core changes:

    - The big change this time around is the irqchip handling in the
    qualcomm pin controllers, closely coupled with the gpiochip. This
    rework, in a classic fall-between-the-chairs fashion has been
    sidestepped for too long.

    The Qualcomm IRQchips using the SPMI and SSBI transport mechanisms
    have been rewritten to use hierarchical irqchip. This creates the
    base from which I intend to gradually pull support for hierarchical
    irqchips into the gpiolib irqchip helpers to cut down on duplicate
    code.

    We have too many hacks in the kernel because people have been
    working around the missing hierarchical irqchip for years, and once
    it was there, noone understood it for a while. We are now slowly
    adapting to using it.

    This is why this pull requests include changes to MFD, SPMI,
    IRQchip core and some ARM Device Trees pertaining to the Qualcomm
    chip family. Since Qualcomm have so many chips and such large
    deployments it is paramount that this platform gets this right, and
    now it (hopefully) does.

    - Core support for pull-up and pull-down configuration, also from the
    device tree. When a simple GPIO chip supports an "off or on" pull-up
    or pull-down resistor, we provide a way to set this up using
    machine descriptors or device tree.

    If more elaborate control of pull up/down (such as resistance shunt
    setting) is required, drivers should be phased over to use pin
    control. We do not yet provide a userspace ABI for this pull
    up-down setting but I suspect the makers are going to ask for it
    soon enough. PCA953x is the first user of this new API.

    - The GPIO mockup driver has been revamped after some discussion
    improving the IRQ simulator in the process.

    The idea is to make it possible to use the mockup for both testing
    and virtual prototyping, e.g. when you do not yet have a GPIO
    expander to play with but really want to get something to develop
    code around before hardware is available. It's neat. The blackbox
    testing usecase is currently making its way into kernelci.

    - ACPI GPIO core preserves non direction flags when updating flags.

    - A new device core helper for devm_platform_ioremap_resource() is
    funneled through the GPIO tree with Greg's ACK.

    New drivers:

    - TQ-Systems QTMX86 GPIO controllers (using port-mapped I/O)

    - Gateworks PLD GPIO driver (vaccumed up from OpenWrt)

    - AMD G-Series PCH (Platform Controller Hub) GPIO driver.

    - Fintek F81804 & F81966 subvariants.

    - PCA953x now supports NXP PCAL6416.

    Driver improvements:

    - IRQ support on the Nintendo Wii (Hollywood) GPIO.

    - get_direction() support for the MVEBU driver.

    - Set the right output level on SAMA5D2.

    - Drop the unused irq trigger setting on the Spreadtrum driver.

    - Wakeup support for PCA953x.

    - A slew of cleanups in the various Intel drivers"

    * tag 'gpio-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (110 commits)
    gpio: gpio-omap: fix level interrupt idling
    gpio: amd-fch: Set proper output level for direction_output
    x86: apuv2: remove unused variable
    gpio: pca953x: Use PCA_LATCH_INT
    platform/x86: fix PCENGINES_APU2 Kconfig warning
    gpio: pca953x: Fix dereference of irq data in shutdown
    gpio: amd-fch: Fix type error found by sparse
    gpio: amd-fch: Drop const from resource
    gpio: mxc: add check to return defer probe if clock tree NOT ready
    gpio: ftgpio: Register per-instance irqchip
    gpio: ixp4xx: Add DT bindings
    x86: pcengines apuv2 gpio/leds/keys platform driver
    gpio: AMD G-Series PCH gpio driver
    drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource()
    gpio: tqmx86: Set proper output level for direction_output
    gpio: sprd: Change to use SoC compatible string
    gpio: sprd: Use SoC compatible string instead of wildcard string
    gpio: of: Handle both enable-gpio{,s}
    gpio: of: Restrict enable-gpio quirk to regulator-gpio
    gpio: davinci: use devm_platform_ioremap_resource()
    ...

    Linus Torvalds
     

23 Feb, 2019

1 commit


21 Feb, 2019

1 commit

  • The default irq domain allows legacy code to create irqdomain
    mappings without having to track the domain it is allocating
    from. Setting the default domain is a one shot, fire and forget
    operation, and no effort was made to be able to retrieve this
    information at a later point in time.

    Newer irqdomain APIs (the hierarchical stuff) relies on both
    the irqchip code to track the irqdomain it is allocating from,
    as well as some form of firmware abstraction to easily identify
    which piece of HW maps to which irq domain (DT, ACPI).

    For systems without such firmware (or legacy platform that are
    getting dragged into the 21st century), things are a bit harder.
    For these cases (and these cases only!), let's provide a way
    to retrieve the default domain, allowing the use of the v2 API
    without having to resort to platform-specific hacks.

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

13 Feb, 2019

1 commit

  • Add a new function irq_domain_translate_twocell() that is to be used as
    the translate function in struct irq_domain_ops for the v2 IRQ API.

    This patch also changes irq_domain_xlate_twocell() from the v1 IRQ API
    to call irq_domain_translate_twocell() in the v2 IRQ API. This required
    changes to of_phandle_args_to_fwspec()'s arguments so that it can be
    called from multiple places.

    Cc: Thomas Gleixner
    Reviewed-by: Marc Zyngier
    Signed-off-by: Brian Masney
    Signed-off-by: Linus Walleij

    Brian Masney
     

30 Jan, 2019

1 commit


19 Dec, 2018

1 commit

  • The interrupt affinity management uses straight cpumask pointers to convey
    the automatically assigned affinity masks for managed interrupts. The core
    interrupt descriptor allocation also decides based on the pointer being non
    NULL whether an interrupt is managed or not.

    Devices which use managed interrupts usually have two classes of
    interrupts:

    - Interrupts for multiple device queues
    - Interrupts for general device management

    Currently both classes are treated the same way, i.e. as managed
    interrupts. The general interrupts get the default affinity mask assigned
    while the device queue interrupts are spread out over the possible CPUs.

    Treating the general interrupts as managed is both a limitation and under
    certain circumstances a bug. Assume the following situation:

    default_irq_affinity = 4..7

    So if CPUs 4-7 are offlined, then the core code will shut down the device
    management interrupts because the last CPU in their affinity mask went
    offline.

    It's also a limitation because it's desired to allow manual placement of
    the general device interrupts for various reasons. If they are marked
    managed then the interrupt affinity setting from both user and kernel space
    is disabled.

    To remedy that situation it's required to convey more information than the
    cpumasks through various interfaces related to interrupt descriptor
    allocation.

    Instead of adding yet another argument, create a new data structure
    'irq_affinity_desc' which for now just contains the cpumask. This struct
    can be expanded to convey auxilliary information in the next step.

    No functional change, just preparatory work.

    [ tglx: Simplified logic and clarified changelog ]

    Suggested-by: Thomas Gleixner
    Suggested-by: Bjorn Helgaas
    Signed-off-by: Dou Liyang
    Signed-off-by: Thomas Gleixner
    Cc: linux-pci@vger.kernel.org
    Cc: kashyap.desai@broadcom.com
    Cc: shivasharan.srikanteshwara@broadcom.com
    Cc: sumit.saxena@broadcom.com
    Cc: ming.lei@redhat.com
    Cc: hch@lst.de
    Cc: douliyang1@huawei.com
    Link: https://lkml.kernel.org/r/20181204155122.6327-2-douliyangs@gmail.com

    Dou Liyang
     

09 Oct, 2018

1 commit

  • Fix a grammar mistake in .

    [ mingo: While at it also fix another similar error in another comment as well. ]

    Signed-off-by: Geert Uytterhoeven
    Cc: Jiri Kosina
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20181008111726.26286-1-geert%2Brenesas@glider.be
    Signed-off-by: Ingo Molnar

    Geert Uytterhoeven
     

01 Oct, 2018

2 commits

  • On a DT based system, we use the of_node full name to name the
    corresponding irq domain. We expect that name to be unique, so so that
    domains with the same base name won't clash (this happens on multi-node
    topologies, for example).

    Since a7e4cfb0a7ca ("of/fdt: only store the device node basename in
    full_name"), of_node_full_name() lies and only returns the basename. This
    breaks the above requirement, and we end-up with only a subset of the
    domains in /sys/kernel/debug/irq/domains.

    Let's reinstate the feature by using the fancy new %pOF format specifier,
    which happens to do the right thing.

    Fixes: a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name")
    Signed-off-by: Marc Zyngier
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20181001100522.180054-3-marc.zyngier@arm.com

    Marc Zyngier
     
  • When removing a debugfs file for a given irq domain, we fail to clear the
    corresponding field, meaning that the corresponding domain won't be created
    again if we need to do so.

    It turns out that this is exactly what irq_domain_update_bus_token does
    (delete old file, update domain name, recreate file).

    This doesn't have any impact other than making debug more difficult, but we
    do value ease of debugging... So clear the debugfs_file field.

    Signed-off-by: Marc Zyngier
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20181001100522.180054-2-marc.zyngier@arm.com

    Marc Zyngier
     

20 Mar, 2018

1 commit

  • Add SPDX identifiers to files

    - which contain an explicit license boiler plate or reference

    - which do not contain a license reference and were not updated in the
    initial SPDX conversion because the license was deduced by the scanners
    via EXPORT_SYMBOL_GPL as GPL2.0 only.

    [ tglx: Moved adding identifiers from the patch which removes the
    references/boilerplate ]

    Signed-off-by: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Greg Kroah-Hartman
    Cc: Philippe Ombredanne
    Link: https://lkml.kernel.org/r/20180314212030.668321222@linutronix.de

    Thomas Gleixner
     

16 Feb, 2018

1 commit


24 Jan, 2018

1 commit

  • CONFIG_IRQ_DOMAIN_DEBUG is similar to CONFIG_GENERIC_IRQ_DEBUGFS,
    just with less information.

    Spring cleanup time.

    Signed-off-by: Marc Zyngier
    Signed-off-by: Thomas Gleixner
    Cc: Yang Shunyong
    Link: https://lkml.kernel.org/r/20180117142647.23622-1-marc.zyngier@arm.com

    Marc Zyngier
     

30 Dec, 2017

1 commit

  • The 'early' argument of irq_domain_activate_irq() is actually used to
    denote reservation mode. To avoid confusion, rename it before abuse
    happens.

    No functional change.

    Fixes: 72491643469a ("genirq/irqdomain: Update irq_domain_ops.activate() signature")
    Signed-off-by: Thomas Gleixner
    Cc: Alexandru Chirvasitu
    Cc: Andy Shevchenko
    Cc: Dou Liyang
    Cc: Pavel Machek
    Cc: Maciej W. Rozycki
    Cc: Mikael Pettersson
    Cc: Josh Poulson
    Cc: Mihai Costache
    Cc: Stephen Hemminger
    Cc: Marc Zyngier
    Cc: linux-pci@vger.kernel.org
    Cc: Haiyang Zhang
    Cc: Dexuan Cui
    Cc: Simon Xiao
    Cc: Saeed Mahameed
    Cc: Jork Loeser
    Cc: Bjorn Helgaas
    Cc: devel@linuxdriverproject.org
    Cc: KY Srinivasan
    Cc: Alan Cox
    Cc: Sakari Ailus ,
    Cc: linux-media@vger.kernel.org

    Thomas Gleixner
     

13 Nov, 2017

1 commit


19 Oct, 2017

2 commits

  • Fix different address spaces warning of sparse.

    kernel/irq/irqdomain.c:1463:14: warning: incorrect type in assignment (different address spaces)
    kernel/irq/irqdomain.c:1463:14: expected void **slot
    kernel/irq/irqdomain.c:1463:14: got void [noderef] **
    kernel/irq/irqdomain.c:1465:66: warning: incorrect type in argument 2 (different address spaces)
    kernel/irq/irqdomain.c:1465:66: expected void [noderef] **slot
    kernel/irq/irqdomain.c:1465:66: got void **slot

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Marc Zyngier

    Masahiro Yamada
     
  • The revmap_trees_mutex protects domain->revmap_tree. There is no
    need to make it global because it is allowed to modify revmap_tree
    of two different domains concurrently. Having said that, this would
    not be a actual bottleneck because the interrupt map/unmap does not
    occur quite often. Rather, the motivation is to tidy up the code
    from a data structure point of view.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Marc Zyngier

    Masahiro Yamada
     

26 Sep, 2017

4 commits

  • Propagate the early activation mode to the irqdomain activate()
    callbacks. This is required for the upcoming reservation, late vector
    assignment scheme, so that the early activation call can act accordingly.

    Signed-off-by: Thomas Gleixner
    Tested-by: Juergen Gross
    Tested-by: Yu Chen
    Acked-by: Juergen Gross
    Cc: Boris Ostrovsky
    Cc: Tony Luck
    Cc: Marc Zyngier
    Cc: Alok Kataria
    Cc: Joerg Roedel
    Cc: "Rafael J. Wysocki"
    Cc: Steven Rostedt
    Cc: Christoph Hellwig
    Cc: Peter Zijlstra
    Cc: Borislav Petkov
    Cc: Paolo Bonzini
    Cc: Rui Zhang
    Cc: "K. Y. Srinivasan"
    Cc: Arjan van de Ven
    Cc: Dan Williams
    Cc: Len Brown
    Link: https://lkml.kernel.org/r/20170913213153.028353660@linutronix.de

    Thomas Gleixner
     
  • Allow irq_domain_activate_irq() to fail. This is required to support a
    reservation and late vector assignment scheme.

    Signed-off-by: Thomas Gleixner
    Tested-by: Juergen Gross
    Tested-by: Yu Chen
    Acked-by: Juergen Gross
    Cc: Boris Ostrovsky
    Cc: Tony Luck
    Cc: Marc Zyngier
    Cc: Alok Kataria
    Cc: Joerg Roedel
    Cc: "Rafael J. Wysocki"
    Cc: Steven Rostedt
    Cc: Christoph Hellwig
    Cc: Peter Zijlstra
    Cc: Borislav Petkov
    Cc: Paolo Bonzini
    Cc: Rui Zhang
    Cc: "K. Y. Srinivasan"
    Cc: Arjan van de Ven
    Cc: Dan Williams
    Cc: Len Brown
    Link: https://lkml.kernel.org/r/20170913213152.933882227@linutronix.de

    Thomas Gleixner
     
  • The irq_domain_ops.activate() callback has no return value and no way to
    tell the function that the activation is early.

    The upcoming changes to support a reservation scheme which allows to assign
    interrupt vectors on x86 only when the interrupt is actually requested
    requires:

    - A return value, so activation can fail at request_irq() time

    - Information that the activate invocation is early, i.e. before
    request_irq().

    Signed-off-by: Thomas Gleixner
    Tested-by: Juergen Gross
    Tested-by: Yu Chen
    Acked-by: Juergen Gross
    Cc: Boris Ostrovsky
    Cc: Tony Luck
    Cc: Marc Zyngier
    Cc: Alok Kataria
    Cc: Joerg Roedel
    Cc: "Rafael J. Wysocki"
    Cc: Steven Rostedt
    Cc: Christoph Hellwig
    Cc: Peter Zijlstra
    Cc: Borislav Petkov
    Cc: Paolo Bonzini
    Cc: Rui Zhang
    Cc: "K. Y. Srinivasan"
    Cc: Arjan van de Ven
    Cc: Dan Williams
    Cc: Len Brown
    Link: https://lkml.kernel.org/r/20170913213152.848490816@linutronix.de

    Thomas Gleixner
     
  • Some interrupt domains like the X86 vector domain has special requirements
    for debugging, like showing the vector usage on the CPUs.

    Add a callback to the irqdomain ops which can be filled in by domains which
    require it and add conditional invocations to the irqdomain and the per irq
    debug files.

    Signed-off-by: Thomas Gleixner
    Tested-by: Juergen Gross
    Tested-by: Yu Chen
    Acked-by: Juergen Gross
    Cc: Boris Ostrovsky
    Cc: Tony Luck
    Cc: Marc Zyngier
    Cc: Alok Kataria
    Cc: Joerg Roedel
    Cc: "Rafael J. Wysocki"
    Cc: Steven Rostedt
    Cc: Christoph Hellwig
    Cc: Peter Zijlstra
    Cc: Borislav Petkov
    Cc: Paolo Bonzini
    Cc: Rui Zhang
    Cc: "K. Y. Srinivasan"
    Cc: Arjan van de Ven
    Cc: Dan Williams
    Cc: Len Brown
    Link: https://lkml.kernel.org/r/20170913213152.512937505@linutronix.de

    Thomas Gleixner
     

06 Sep, 2017

1 commit

  • Pull device properties framework updates from Rafael Wysocki:
    "These introduce fwnode operations for all of the separate types of
    'firmware nodes' that can be handled by the device properties
    framework, make the framework use const fwnode arguments all over, add
    a helper for the consolidated handling of node references and switch
    over the framework to the new UUID API.

    Specifics:

    - Introduce fwnode operations for all of the separate types of
    'firmware nodes' that can be handled by the device properties
    framework and drop the type field from struct fwnode_handle (Sakari
    Ailus, Arnd Bergmann).

    - Make the device properties framework use const fwnode arguments
    where possible (Sakari Ailus).

    - Add a helper for the consolidated handling of node references to
    the device properties framework (Sakari Ailus).

    - Switch over the ACPI part of the device properties framework to the
    new UUID API (Andy Shevchenko)"

    * tag 'devprop-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI: device property: Switch to use new generic UUID API
    device property: export irqchip_fwnode_ops
    device property: Introduce fwnode_property_get_reference_args
    device property: Constify fwnode property API
    device property: Constify argument to pset fwnode backend
    ACPI: Constify internal fwnode arguments
    ACPI: Constify acpi_bus helper functions, switch to macros
    ACPI: Prepare for constifying acpi_get_next_subnode() fwnode argument
    device property: Get rid of struct fwnode_handle type field
    ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node()

    Linus Torvalds