[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69444f17-91a7-69cc-14f8-7501443064ec@gmail.com>
Date: Mon, 27 Sep 2021 12:43:34 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Rob Herring <robh+dt@...nel.org>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Russell King <linux@...linux.org.uk>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
"maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..."
<bcm-kernel-feedback-list@...adcom.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Ard Biesheuvel <ardb@...nel.org>,
Mike Rapoport <rppt@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Arnd Bergmann <arnd@...db.de>,
Guenter Roeck <linux@...ck-us.net>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Mark Rutland <mark.rutland@....com>,
Andrey Konovalov <andreyknvl@...il.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Valentin Schneider <valentin.schneider@....com>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"moderated list:ARM PORT" <linux-arm-kernel@...ts.infradead.org>,
"open list:SUPERH" <linux-sh@...r.kernel.org>,
"open list:BROADCOM BMIPS MIPS ARCHITECTURE"
<linux-mips@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE"
<devicetree@...r.kernel.org>
Subject: Re: [PATCH 01/11] arch: Export cpu_logical_map to modules
On 9/27/21 12:32 PM, Rob Herring wrote:
> On Fri, Sep 24, 2021 at 12:06 PM Florian Fainelli <f.fainelli@...il.com> wrote:
>>
>> In order to allow drivers/irqchip/irq-bcm7038-l1.c to be built as a
>> module and usable in GKI, export cpu_logical_map or __cpu_logical_map
>> towards the modules.
>
> This is the usage:
>
> #ifdef CONFIG_SMP
> cpu = intc->cpus[cpu_logical_map(smp_processor_id())];
> #else
> cpu = intc->cpus[0];
> #endif
>
> This is totally broken! cpu_logical_map() takes the logical cpu
> number, 0-N, and returns the MPIDR which you then use as an array
> index.
There is no MPIDR on MIPS, which is where this code is being primarily
used as-is. On ARM/ARM64 the driver is used as a second level interrupt
controller with only a single "bank" of registers as opposed to one
per-CPU, meaning that we would always use intc->cpus[0] because you
cannot change the interrupt affinity of a second level interrupt
controller AFAICT. Maybe the above deserves to be made CONFIG_SMP &&
CONFIG_MIPS somehow.
--
Florian
Powered by blists - more mailing lists