27 Jul, 2020

1 commit

  • cpu_logical_map is only defined for CONFIG_SMP builds, when we are in an
    UP configuration, the boot CPU is 0.

    Fixes: 6468fc18b006 ("irqchip/irq-bcm7038-l1: Add PM support")
    Reported-by: kernel test robot
    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200724184157.29150-1-f.fainelli@gmail.com

    Florian Fainelli
     

17 Jul, 2020

1 commit

  • We need to have a definition for cpu_logical_map[] which on ARM
    platforms is provided by asm/smp_plat.h. This header is not
    automatically included from linux/smp.h and untangling it is a bit
    difficult.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200709234141.4901-1-f.fainelli@gmail.com

    Florian Fainelli
     

17 Apr, 2020

1 commit

  • Fix the following sparse warning:

    drivers/irqchip/irq-bcm7038-l1.c:419:12: warning: symbol
    'bcm7038_l1_of_init' was not declared. Should it be static?

    Reported-by: Hulk Robot
    Signed-off-by: Jason Yan
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200417074036.46594-1-yanaijie@huawei.com

    Jason Yan
     

22 Mar, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20200319214438.GA21123@embeddedor.com

    Gustavo A. R. Silva
     

11 Nov, 2019

3 commits

  • On some specific chips like 7211 we need to leave some interrupts
    untouched/forwarded to the VPU which is another agent in the system
    making use of that interrupt controller hardware (goes to both ARM GIC
    and VPU L1 interrupt controller). Make that possible by using the
    existing brcm,int-fwd-mask property and take necessary actions to avoid
    masking that interrupt as well as not allowing Linux to map them.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20191024201415.23454-6-f.fainelli@gmail.com

    Florian Fainelli
     
  • If the 'brcm,irq-can-wake' property is specified, make sure we also
    enable the corresponding parent interrupt we are attached to.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20191024201415.23454-4-f.fainelli@gmail.com

    Florian Fainelli
     
  • The current L1 controller does not mask any interrupts when dropping
    into suspend. This mean we can receive unexpected wake up sources.
    Modified the BCM7038 L1 controller to mask the all non-wake interrupts
    before dropping into suspend.

    Signed-off-by: Justin Chen
    Signed-off-by: Florian Fainelli
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20191024201415.23454-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
     

13 Aug, 2018

1 commit

  • When compiling bmips with SMP disabled, the build fails with:

    drivers/irqchip/irq-bcm7038-l1.o: In function `bcm7038_l1_cpu_offline':
    drivers/irqchip/irq-bcm7038-l1.c:242: undefined reference to `irq_set_affinity_locked'
    make[5]: *** [vmlinux] Error 1

    Fix this by adding and setting bcm7038_l1_cpu_offline only when actually
    compiling for SMP. It wouldn't have been used anyway, as it requires
    CPU_HOTPLUG, which in turn requires SMP.

    Fixes: 34c535793bcb ("irqchip/bcm7038-l1: Implement irq_cpu_offline() callback")
    Signed-off-by: Jonas Gorski
    Signed-off-by: Marc Zyngier

    Jonas Gorski
     

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
     

18 Aug, 2017

1 commit

  • The BCM 7038-L1 driver only targets a single CPU at a time, even if
    the notional affinity is wider. Let's inform the core code
    about this.

    Signed-off-by: Marc Zyngier
    Signed-off-by: Thomas Gleixner
    Cc: Andrew Lunn
    Cc: James Hogan
    Cc: Jason Cooper
    Cc: Paul Burton
    Cc: Chris Zankel
    Cc: Kevin Cernekee
    Cc: Wei Xu
    Cc: Max Filippov
    Cc: Florian Fainelli
    Cc: Gregory Clement
    Cc: Matt Redfearn
    Cc: Sebastian Hesselbarth
    Link: http://lkml.kernel.org/r/20170818083925.10108-9-marc.zyngier@arm.com

    Marc Zyngier
     

18 Nov, 2016

1 commit

  • We did not implement an irq_cpu_offline callback for our irqchip, yet we
    support setting a given IRQ's affinity. This resulted in interrupts
    whose affinity mask included CPUs being taken offline not to work
    correctly once the CPU had been put offline.

    Fixes: 5f7f0317ed28 ("IRQCHIP: Add new driver for BCM7038-style level 1 interrupt controllers")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Cc: cernekee@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: ralf@linux-mips.org
    Cc: justinpopo6@gmail.com
    Link: http://lkml.kernel.org/r/1477948656-12966-2-git-send-email-f.fainelli@gmail.com
    Signed-off-by: Thomas Gleixner

    Florian Fainelli
     

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
     

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
     

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

1 commit

  • This is the main peripheral IRQ controller on the BCM7xxx MIPS chips;
    it has the following characteristics:

    - 64 to 160+ level IRQs
    - Atomic set/clear registers
    - Reasonably predictable register layout (N status words, then N
    mask status words, then N mask set words, then N mask clear words)
    - SMP affinity supported on most systems
    - Typically connected to MIPS IRQ 2,3,2,3 on CPUs 0,1,2,3

    This driver registers one IRQ domain and one IRQ chip to cover all
    instances of the block. Up to 4 instances of the block may appear, as
    it supports 4-way IRQ affinity on BCM7435.

    The same block exists on the ARM BCM7xxx chips, but typically the ARM GIC
    is used instead. So this driver is primarily intended for MIPS STB chips.

    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/8844/
    Signed-off-by: Ralf Baechle

    Kevin Cernekee