17 Jul, 2020

1 commit

  • Utilize the Broadcom interrupt controller standard property
    "brcm,irq-can-wake" to flag whether this particular interrupt controller
    instance is wake-up capable.

    Since we do not know what type of parent interrupt controller we are
    interfaced with, ensure that enable_irq_wake() is called early on.

    Signed-off-by: Justin Chen
    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200709223016.989-2-f.fainelli@gmail.com

    Justin Chen
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

29 Apr, 2019

1 commit

  • It is useful to print which interrupt controllers are registered in the
    system and which parent IRQ they use, especially given that L2 interrupt
    controllers do not call request_irq() on their parent interrupt and do
    not appear under /proc/interrupts for that reason.

    We used to print the base register address virtual address which had
    little value, use %pOF to print the path to the Device Tree node which
    maps to the physical address more easily and is what people need to
    troubleshoot systems.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier

    Florian Fainelli
     

16 Feb, 2018

1 commit

  • Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
    pointers are being hashed when printed. Displaying the virtual memory at
    bootup time is not helpful. so delete the prints.

    Acked-by: Florian Fainelli
    Signed-off-by: Jaedon Shin
    Signed-off-by: Marc Zyngier

    Jaedon Shin
     

31 Aug, 2017

1 commit


12 Oct, 2016

1 commit

  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

13 Jun, 2016

1 commit

  • The probe functions in this driver are not exported or declared
    for use elsewhere, so make them static to fix the warnings:

    drivers/irqchip/irq-bcm7120-l2.c:218:12: warning: symbol 'bcm7120_l2_intc_probe' was not declared. Should it be static?
    drivers/irqchip/irq-bcm7120-l2.c:342:12: warning: symbol 'bcm7120_l2_intc_probe_7120' was not declared. Should it be static?
    drivers/irqchip/irq-bcm7120-l2.c:349:12: warning: symbol 'bcm7120_l2_intc_probe_3380' was not declared. Should it be static?

    Signed-off-by: Ben Dooks
    Link: https://lkml.kernel.org/r/1465408798-16201-1-git-send-email-ben.dooks@codethink.co.uk
    Signed-off-by: Jason Cooper

    Ben Dooks
     

16 Sep, 2015

1 commit

  • Most interrupt flow handlers do not use the irq argument. Those few
    which use it can retrieve the irq number from the irq descriptor.

    Remove the argument.

    Search and replace was done with coccinelle and some extra helper
    scripts around it. Thanks to Julia for her help!

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu

    Thomas Gleixner
     

27 Jul, 2015

2 commits

  • Our irq-bcm7120-l2 interrupt controller driver utilizes the same handler
    function for the different parent interrupts it services: UPG_MAIN, UPG_BSC for
    instance.

    The problem is that function reads the IRQSTAT register which can combine
    interrupt causes for different parent interrupts, such that we can end-up in
    the following situation:

    - CPU takes an interrupt
    - bcm7120_l2_intc_irq_handle() reads IRQSTAT
    - generic_handle_irq() is invoked
    - there are still pending interrupts flagged in IRQSTAT from a different parent
    - handle_bad_irq() is invoked for these since they come from a different irq_desc/irq

    In order to fix this, make sure that we always mask IRQSTAT with the
    appropriate bits that correspond go the parent interrupt source this is coming
    from. To simplify things, associate an unique structure per parent interrupt
    handler to avoid multiplying the number of lookups.

    Fixes: a5042de2688d ("irqchip: bcm7120-l2: Add Broadcom BCM7120-style Level 2 interrupt controller")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Cc: cernekee@gmail.com
    Cc: jason@lakedaemon.net
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: gregory.0xf0@gmail.com
    Cc: computersforpeace@gmail.com
    Link: http://lkml.kernel.org/r/1437691941-3100-1-git-send-email-f.fainelli@gmail.com
    Signed-off-by: Thomas Gleixner

    Florian Fainelli
     
  • Make use of the new irq_chip_generic suspend/resume callbacks.

    This is required because if there are no installed child IRQs for this
    chip, the irq_chip::irq_{suspend,resume} functions will not be called.
    However, we still need to save/restore the forwarding mask, to enable
    the top-level GIC interrupt; otherwise, we lose UART output after S3
    resume.

    In addition to refactoring the callbacks, we have to self-initialize the
    mask cache, since the genirq core also doesn't initialize this until the
    first child IRQ is installed.

    The original problem report is described in extra detail here:
    http://lkml.kernel.org/g/20150619224123.GL4917@ld-irv-0074

    Signed-off-by: Brian Norris
    Tested-by: Florian Fainelli
    Cc: Gregory Fong
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: linux-mips@linux-mips.org
    Cc: Kevin Cernekee
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1437607300-40858-2-git-send-email-computersforpeace@gmail.com
    Signed-off-by: Thomas Gleixner

    Brian Norris
     

12 Jul, 2015

2 commits

  • Chained irq handlers usually set up handler data as well. We now have
    a function to set both under irq_desc->lock. Replace the two calls
    with one.

    Search and conversion was done with coccinelle:

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_handler_data(E1, E2) != 0)
    - BUG();
    |
    -irq_set_handler_data(E1, E2);
    )
    -irq_set_chained_handler(E1, E3);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_handler_data(E1, E2) != 0)
    - BUG();
    ...
    |
    -irq_set_handler_data(E1, E2);
    ...
    )
    -irq_set_chained_handler(E1, E3);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    Reported-by: Russell King
    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Kevin Cernekee
    Cc: Florian Fainelli
    Cc: Thomas Gleixner
    Cc: Jason Cooper
    Cc: linux-mips@linux-mips.org

    Thomas Gleixner
     
  • The IRQCHIP_DECLARE macro moved to to 'include/linux/irqchip.h', so
    the local irqchip.h became an empty shell, which solely includes
    include/linux/irqchip.h

    Include the global header in all irqchip drivers instead of the local
    header, so we can remove it.

    Signed-off-by: Joel Porquet
    Cc: vgupta@synopsys.com
    Cc: monstr@monstr.eu
    Cc: ralf@linux-mips.org
    Cc: jason@lakedaemon.net
    Link: http://lkml.kernel.org/r/1882096.X39jVG8e0D@joel-zenbook
    Signed-off-by: Thomas Gleixner

    Joel Porquet
     

01 Apr, 2015

3 commits

  • These controllers support multiple enable/status pairs (64+ IRQs),
    can put the enable/status words at different offsets, and do not
    support multiple parent IRQs.

    Signed-off-by: Kevin Cernekee
    Cc: f.fainelli@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: abrestic@chromium.org
    Cc: tglx@linutronix.de
    Cc: jason@lakedaemon.net
    Cc: jogo@openwrt.org
    Cc: arnd@arndb.de
    Cc: computersforpeace@gmail.com
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/8843/
    Signed-off-by: Ralf Baechle

    Kevin Cernekee
     
  • The BCM7xxx instances of this block (listed in the register manual as
    simply "IRQ0") all have the following items in common:

    - brcm,int-map-mask: for routing different bits in the L2 to different
    parent IRQs

    - brcm,int-fwd-mask: for hardwiring certain IRQs to bypass the L2 and
    use dedicated L1 lines

    - one enable/status pair (32 bits only)

    Much of the driver code can be shared with BCM3380-style controllers, but
    in order to do this cleanly, let's split out the BCM7xxx-specific logic
    first.

    Signed-off-by: Kevin Cernekee
    Cc: f.fainelli@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: abrestic@chromium.org
    Cc: tglx@linutronix.de
    Cc: jason@lakedaemon.net
    Cc: jogo@openwrt.org
    Cc: arnd@arndb.de
    Cc: computersforpeace@gmail.com
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/8842/
    Signed-off-by: Ralf Baechle

    Kevin Cernekee
     
  • Currently the driver assumes that REG_BASE+0x00 is the IRQ enable mask,
    and REG_BASE+0x04 is the IRQ status mask. This is true on BCM3384 and
    BCM7xxx, but it is not true for some of the controllers found on BCM63xx
    chips. So we will change a couple of key assumptions:

    - Don't assume that both the IRQEN and IRQSTAT registers will be
    covered by a single ioremap() operation.

    - Don't assume any particular ordering (IRQSTAT might show up before
    IRQEN on some chips).

    - For an L2 controller with >=64 IRQs, don't assume that every
    IRQEN/IRQSTAT pair will use the same register spacing.

    This patch changes the "plumbing" but doesn't yet provide a way for users
    to instantiate a controller with arbitrary IRQEN/IRQSTAT offsets.

    Signed-off-by: Kevin Cernekee
    Cc: f.fainelli@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: abrestic@chromium.org
    Cc: tglx@linutronix.de
    Cc: jason@lakedaemon.net
    Cc: jogo@openwrt.org
    Cc: computersforpeace@gmail.com
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/8841/
    Signed-off-by: Ralf Baechle

    Kevin Cernekee
     

11 Dec, 2014

1 commit

  • Pull irq core updates from Thomas Gleixner:
    "This is the first (boring) part of irq updates:

    - support for big endian I/O accessors in the generic irq chip

    - cleanup of brcmstb/bcm7120 drivers so they can be reused for non
    ARM SoCs

    - the usual pile of fixes and updates for the various ARM irq chips"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
    irqchip: dw-apb-ictl: Add PM support
    irqchip: dw-apb-ictl: Enable IRQ_GC_MASK_CACHE_PER_TYPE
    irqchip: dw-apb-ictl: Always use use {readl|writel}_relaxed
    ARM: orion: convert the irq_reg_{readl,writel} calls to the new API
    irqchip: atmel-aic: Add missing entry for rm9200 irq fixups
    irqchip: atmel-aic: Rename at91sam9_aic_irq_fixup for naming consistency
    irqchip: atmel-aic: Add specific irq fixup function for sam9g45 and sam9rl
    irqchip: atmel-aic: Add irq fixups for at91sam926x SoCs
    irqchip: atmel-aic: Add irq fixup for RTT block
    irqchip: brcmstb-l2: Convert driver to use irq_reg_{readl,writel}
    irqchip: bcm7120-l2: Convert driver to use irq_reg_{readl,writel}
    irqchip: bcm7120-l2: Decouple driver from brcmstb-l2
    irqchip: bcm7120-l2: Extend driver to support 64+ bit controllers
    irqchip: bcm7120-l2: Use gc->mask_cache to simplify suspend/resume functions
    irqchip: bcm7120-l2: Fix missing nibble in gc->unused mask
    irqchip: bcm7120-l2: Make sure all register accesses use base+offset
    irqchip: bcm7120-l2, brcmstb-l2: Remove ARM Kconfig dependency
    irqchip: bcm7120-l2: Eliminate bad IRQ check
    irqchip: brcmstb-l2: Eliminate dependency on ARM code
    genirq: Generic chip: Add big endian I/O accessors
    ...

    Linus Torvalds
     

26 Nov, 2014

1 commit


09 Nov, 2014

7 commits

  • On BE MIPS systems this needs to use the new IRQ_GC_BE_IO gc_flag. In
    all other cases it will use the standard readl/writel accessors.

    The initial irq_fwd_mask setup runs before "gc" is initialized, so it
    is unchanged for now. This could potentially be a problem on an ARM
    system that boots in LE mode but runs a BE kernel, but currently none
    of the supported ARM platforms are ever expected to run BE.

    Signed-off-by: Kevin Cernekee
    Acked-by: Arnd Bergmann
    Link: https://lkml.kernel.org/r/1415342669-30640-14-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • Some chips, such as BCM6328, only require bcm7120-l2. Some BCM7xxx STB
    configurations only require brcmstb-l2. Treat them as two separate
    entities, and update the mach-bcm dependencies to reflect the change.

    Signed-off-by: Kevin Cernekee
    Acked-by: Arnd Bergmann
    Acked-by: Florian Fainelli
    Link: https://lkml.kernel.org/r/1415342669-30640-13-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • Most implementations of the bcm7120-l2 controller only have a single
    32-bit enable word + 32-bit status word. But some instances have added
    more enable/status pairs in order to support 64+ IRQs (which are all
    ORed into one parent IRQ input). Make the following changes to allow
    the driver to support this:

    - Extend DT bindings so that multiple words can be specified for the
    reg property, various masks, etc.

    - Add loops to the probe/handle functions to deal with each word
    separately

    - Allocate 1 generic-chip for every 32 IRQs, so we can still use the
    clr/set helper functions

    - Update the documentation

    This uses one domain per bcm7120-l2 DT node. If the DT node defines
    multiple enable/status pairs (i.e. >=64 IRQs) then the driver will
    create a single IRQ domain with 2+ generic chips. Multiple generic chips
    are required because the generic-chip code can only handle one
    enable/status register pair per instance.

    Signed-off-by: Kevin Cernekee
    Acked-by: Arnd Bergmann
    Link: https://lkml.kernel.org/r/1415342669-30640-12-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • The cached value already incorporates irq_fwd_mask, and was saved the
    last time an IRQ was enabled/disabled.

    Signed-off-by: Kevin Cernekee
    Acked-by: Florian Fainelli
    Acked-by: Arnd Bergmann
    Link: https://lkml.kernel.org/r/1415342669-30640-11-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • This mask should have been 0xffff_ffff, not 0x0fff_ffff.

    The change should not have an effect on current users (STB) because bits
    31:27 are unused.

    Signed-off-by: Kevin Cernekee
    Acked-by: Arnd Bergmann
    Acked-by: Florian Fainelli
    Link: https://lkml.kernel.org/r/1415342669-30640-10-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • A couple of accesses to IRQEN (base+0x00) just used "base" directly, so
    they would break if IRQEN ever became nonzero. Make sure that all
    reads/writes specify the register offset constant.

    Signed-off-by: Kevin Cernekee
    Acked-by: Florian Fainelli
    Acked-by: Arnd Bergmann
    Link: https://lkml.kernel.org/r/1415342669-30640-9-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     
  • This check may be prone to race conditions, e.g.

    1) Some external event (e.g. GPIO level) causes an IRQ to become pending
    2) Peripheral asserts the L2 IRQ
    3) CPU takes an interrupt
    4) The event from #1 goes away
    5) bcm7120_l2_intc_irq_handle() reads back a 0 status

    Unlike the hardware supported by brcmstb-l2, the bcm7120-l2 controller
    does not latch the IRQ status. Bits can change if the inputs to the
    controller change. Also, do_bad_IRQ() is an ARM-specific macro.

    So let's just nuke it.

    Signed-off-by: Kevin Cernekee
    Acked-by: Florian Fainelli
    Acked-by: Arnd Bergmann
    Link: https://lkml.kernel.org/r/1415342669-30640-7-git-send-email-cernekee@gmail.com
    Signed-off-by: Jason Cooper

    Kevin Cernekee
     

14 Sep, 2014

1 commit

  • This patch adds support for the Level-2 interrupt controller
    hardware found in Broadcom Set Top Box System-on-a-Chip devices. This
    interrupt controller is implemented using a single enable register.

    This interrupt controller is always present on the platforms supported
    by the irq-brcmstb-l2 driver, hence the reason why both are compiled
    using the same Kconfig symbol.

    [jac] removed the following warning:
    drivers/irqchip/irq-bcm7120-l2.c: In function 'bcm7120_l2_intc_irq_handle':
    drivers/irqchip/irq-bcm7120-l2.c:49:27: warning: unused variable 'gc' [-Wunused-variable]

    Signed-off-by: Florian Fainelli
    Link: https://lkml.kernel.org/r/1410309862-27784-2-git-send-email-f.fainelli@gmail.com
    Signed-off-by: Jason Cooper

    Florian Fainelli