27 Jul, 2020

2 commits

  • The newly introduced IRQCHIP_PLATFORM_DRIVER_* macros expand into
    module-related macros, but do so without including module.h.
    Depending on the driver and/or architecture, this happens to work,
    or not.

    Unconditionnaly include linux/module.h to sort it out.

    Fixes: f3b5e608ed6d ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
    Reported-by: kernel test robot
    Cc: Saravana Kannan
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Compiling an irqchip driver as a platform driver needs to bunch of
    things to be done right:
    - Making sure the parent domain is initialized first
    - Making sure the device can't be unbound from sysfs
    - Disallowing module unload if it's built as a module
    - Finding the parent node
    - Etc.

    Instead of trying to make sure all future irqchip platform drivers get
    this right, provide boilerplate macros that take care of all of this.

    An example use would look something like this. Where acme_foo_init and
    acme_bar_init are similar to what would be passed to IRQCHIP_DECLARE.

    IRQCHIP_PLATFORM_DRIVER_BEGIN(acme_irq)
    IRQCHIP_MATCH("acme,foo", acme_foo_init)
    IRQCHIP_MATCH("acme,bar", acme_bar_init)
    IRQCHIP_PLATFORM_DRIVER_END(acme_irq)

    Signed-off-by: Saravana Kannan
    Signed-off-by: Marc Zyngier
    Cc: John Stultz
    Link: https://lore.kernel.org/r/20200718000637.3632841-2-saravanak@google.com

    Saravana Kannan
     

27 Jun, 2020

1 commit

  • In an effort to enable -Wcast-function-type in the top-level Makefile to
    support Control Flow Integrity builds, there are the need to remove all
    the function callback casts.

    To do this, modify the IRQCHIP_ACPI_DECLARE macro to use the new defined
    macro ACPI_DECLARE_SUBTABLE_PROBE_ENTRY instead of the macro
    ACPI_DECLARE_PROBE_ENTRY. This is necessary to be able to initialize the
    the acpi_probe_entry struct using the probe_subtbl field instead of the
    probe_table field and avoid function cast mismatches.

    Also, modify the prototype of the functions used by the invocation of the
    IRQCHIP_ACPI_DECLARE macro to match all the parameters.

    Co-developed-by: Marc Zyngier
    Signed-off-by: Marc Zyngier
    Signed-off-by: Oscar Carter
    Acked-by: Rafael J. Wysocki
    Link: https://lore.kernel.org/r/20200530143430.5203-3-oscar.carter@gmx.com

    Oscar Carter
     

18 Dec, 2018

1 commit

  • Go over the IRQ subsystem source code (including irqchip drivers) and
    fix common typos in comments.

    No change in functionality intended.

    Signed-off-by: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: linux-kernel@vger.kernel.org

    Ingo Molnar
     

01 Oct, 2015

1 commit

  • DT enjoys a rather nice probing infrastructure for irqchips, while
    ACPI is so far stuck into a very distant past.

    This patch introduces a declarative API, allowing irqchips to be
    self-contained and be called when a particular entry is matched
    in the MADT table.

    Signed-off-by: Marc Zyngier
    Acked-by: Catalin Marinas
    Reviewed-by: Hanjun Guo
    Acked-by: Thomas Gleixner
    Tested-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Marc Zyngier
     

03 Jul, 2015

1 commit

  • At the moment the IRQCHIP_DECLARE macro is only declared locally in
    drivers/irqchip/irqchip.h. It prevents from using it directly in arch/*
    directories whenever irqchip drivers only exist there, which happens in a few
    cases (e.g. arc, arm, microblaze and mips).

    This patch makes the macro to be globally defined, i.e. in
    include/linux/irqchip.h, and thus usable for arch-specific declarations of
    irqchip drivers. In this way, it is very similar to what clocksource does (ie
    CLOCKSOURCE_OF_DECLARE is defined in include/linux/clocksource.h).

    For now, this patch only moves the declaration of the macro
    IRQCHIP_DECLARE to the global header 'include/linux/irqchip.h' and make
    'drivers/irqchip/irqchip.h' include 'include/linux/irqchip.h'. Later, other
    patches will get rid of 'drivers/irqchip/irqchip.h' and modify all the impacted
    irqchip drivers.

    Signed-off-by: Joel Porquet
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1435865565-14114-1-git-send-email-joel@porquet.org
    Signed-off-by: Thomas Gleixner

    Joel Porquet
     

06 Jun, 2013

1 commit

  • We add an empty irqchip_init dummy function for cases in which
    CONFIG_IRQCHIP is not used. In these cases irqchip.c is not compiled,
    but a funtion call may still be present in architecture code, that in
    runtime doesn't get hit.

    E.g. this is needed in the arch/arm/mach-shmobile/intc-r8a7740.c
    interrupt setup code where OF use and non OF us is both handled in one
    file.

    Signed-off-by: Bastian Hecht
    [horms+renesas@verge.net.au: Make non-CONFIG_IRQCHIP version static inline
    and remove trailing ';'.]
    Signed-off-by: Simon Horman

    Bastian Hecht
     

11 Jan, 2013

1 commit

  • With the recent creation of the drivers/irqchip/ directory, it is
    desirable to move irq controller drivers here. At the moment, the only
    driver here is irq-bcm2835, the driver for the irq controller found in
    the ARM BCM2835 SoC, present in Rasberry Pi systems. This irq
    controller driver was exporting its initialization function and its
    irq handling function through a header file in
    .

    When proposing to also move another irq controller driver in
    drivers/irqchip, Rob Herring raised the very valid point that moving
    things to drivers/irqchip was good in order to remove more stuff from
    arch/arm, but if it means adding gazillions of headers files in
    include/linux/irqchip/, it would not be very nice.

    So, upon the suggestion of Rob Herring and Arnd Bergmann, this commit
    introduces a small infrastructure that defines a central
    irqchip_init() function in drivers/irqchip/irqchip.c, which is meant
    to be called as the ->init_irq() callback of ARM platforms. This
    function calls of_irq_init() with an array of match strings and init
    functions generated from a special linker section.

    Note that the irq controller driver initialization function is
    responsible for setting the global handle_arch_irq() variable, so that
    ARM platforms no longer have to define the ->handle_irq field in their
    DT_MACHINE structure.

    A global header, is also added to expose the single
    irqchip_init() function to the reset of the kernel.

    A further commit moves the BCM2835 irq controller driver to this new
    small infrastructure, therefore removing the include/linux/irqchip/
    directory.

    Signed-off-by: Thomas Petazzoni
    Reviewed-by: Stephen Warren
    Reviewed-by: Rob Herring
    Acked-by: Arnd Bergmann
    [rob.herring: reword commit message to reflect use of linker sections.]
    Signed-off-by: Rob Herring

    Thomas Petazzoni