2022-06-01 16:54:36

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [musl] Re: [GIT PULL] asm-generic changes for 5.19

On Tue, May 31, 2022 at 6:01 PM Huacai Chen <[email protected]> wrote:
> On Tue, May 31, 2022 at 7:15 PM Arnd Bergmann <[email protected]> wrote:
> > On Tue, May 31, 2022 at 10:17 AM Huacai Chen <[email protected]> wrote:

> https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next
> has been updated. Now this branch droped irqchip drivers and pci
> drivers. But the existing irqchip drivers need some small adjustment
> to avoid build errors [1], and I hope Marc can give an Acked-by.

Ok, glad you got that working.

What about the ACPI changes? I see that these are needed to get a clean build,
and as I understood it, they are supposed to get merged through the
acpica tree.

> This branch can be built with defconfig and allmodconfig (except
> drivers/platform/surface/aggregator/controller.c, because it requires
> 8bit/16bit cmpxchg, which I was told to remove their support).

Right, that is ok to keep in there, we should fix that by adding a Kconfig
dependency for the driver. It looks like it has a CONFIG_ACPI dependency,
so it is currently limited to x86/arm64/ia64, which all have the short
cmpxchg(),
but in reality this driver can only work on x86 and arm64.

Arnd


2022-06-01 20:35:39

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [musl] Re: [GIT PULL] asm-generic changes for 5.19

On Tue, May 31, 2022 at 10:07 PM Arnd Bergmann <[email protected]> wrote:
>
> On Tue, May 31, 2022 at 6:01 PM Huacai Chen <[email protected]> wrote:
> > On Tue, May 31, 2022 at 7:15 PM Arnd Bergmann <[email protected]> wrote:
> > > On Tue, May 31, 2022 at 10:17 AM Huacai Chen <[email protected]> wrote:
>
> > https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next
> > has been updated. Now this branch droped irqchip drivers and pci
> > drivers. But the existing irqchip drivers need some small adjustment
> > to avoid build errors [1], and I hope Marc can give an Acked-by.
>
> Ok, glad you got that working.
>

From an allmodconfig build, I see two more things that could be addressed first:

drivers/pci/probe.c: In function 'pci_scan_bridge_extend':
drivers/pci/probe.c:1298:44: error: implicit declaration of function
'pcibios_assign_all_busses' [-Werror=implicit-function-declaration]
1298 | if ((secondary || subordinate) &&
!pcibios_assign_all_busses() &&
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/setup-res.c: In function '__pci_assign_resource':
drivers/pci/setup-res.c:257:46: error: 'PCIBIOS_MIN_IO' undeclared
(first use in this function)
257 | min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO :
PCIBIOS_MIN_MEM;
| ^~~~~~~~~~~~~~
drivers/pci/setup-res.c:257:46: note: each undeclared identifier is
reported only once for each function it appears in
drivers/pci/setup-res.c:257:63: error: 'PCIBIOS_MIN_MEM' undeclared
(first use in this function)
257 | min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO :
PCIBIOS_MIN_MEM;
|
^~~~~~~~~~~~~~~
drivers/pci/quirks.c: In function 'quirk_isa_dma_hangs':
drivers/pci/quirks.c:252:14: error: 'isa_dma_bridge_buggy' undeclared
(first use in this function)
252 | if (!isa_dma_bridge_buggy) {
| ^~~~~~~~~~~~~~~~~~~~

I think you accidentally dropped the asm/pci.h header, so adding that one back
should make it build again.


lib/test_printf.c:215: warning: "PTR" redefined
215 | #define PTR ((void *)0xffff0123456789abUL)
|
In file included from /git/arm-soc/arch/loongarch/include/asm/vdso/vdso.h:9,
from
/git/arm-soc/arch/loongarch/include/asm/vdso/gettimeofday.h:13,
from /git/arm-soc/include/vdso/datapage.h:137,
from /git/arm-soc/arch/loongarch/include/asm/vdso.h:11,
from /git/arm-soc/arch/loongarch/include/asm/elf.h:13,
from /git/arm-soc/include/linux/elf.h:6,
from /git/arm-soc/include/linux/module.h:19,
from /git/arm-soc/lib/test_printf.c:10:
/git/arm-soc/arch/loongarch/include/asm/asm.h:182: note: this is the
location of the previous definition
182 | #define PTR .dword
|

Not sure what the best fix is for this, maybe the contents of asm/asm.h could
just be hidden in an "#idef __ASSEMBLER__" check. This can be a follow-up
patch when the branch is merged.

Arnd

2022-06-01 21:20:35

by WANG Xuerui

[permalink] [raw]
Subject: Re: [musl] Re: [GIT PULL] asm-generic changes for 5.19

On 6/1/22 04:07, Arnd Bergmann wrote:
> On Tue, May 31, 2022 at 6:01 PM Huacai Chen <[email protected]> wrote:
>> On Tue, May 31, 2022 at 7:15 PM Arnd Bergmann <[email protected]> wrote:
>>> On Tue, May 31, 2022 at 10:17 AM Huacai Chen <[email protected]> wrote:
>> https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next
>> has been updated. Now this branch droped irqchip drivers and pci
>> drivers. But the existing irqchip drivers need some small adjustment
>> to avoid build errors [1], and I hope Marc can give an Acked-by.
> Ok, glad you got that working.
>
> What about the ACPI changes? I see that these are needed to get a clean build,
> and as I understood it, they are supposed to get merged through the
> acpica tree.

I think the acpica bits could be dropped with some effort too; the main
dependency on the various ACPI 6.5 tables are the SMP bits, which relies
on the new MADT CPUINTC tables. While the others also provide
information, they're not as fundamental as this, and even this CPUINTC
piece can be taken out given we can't run this branch on any real
LoongArch hardware after all (due to the irqchip changes being backed
out), I think we can just leave the remaining bits dummy-initialized
with some simple comment. We can review once the new branch with only
arch/loongarch changes is out.

>> This branch can be built with defconfig and allmodconfig (except
>> drivers/platform/surface/aggregator/controller.c, because it requires
>> 8bit/16bit cmpxchg, which I was told to remove their support).
> Right, that is ok to keep in there, we should fix that by adding a Kconfig
> dependency for the driver. It looks like it has a CONFIG_ACPI dependency,
> so it is currently limited to x86/arm64/ia64, which all have the short
> cmpxchg(),
> but in reality this driver can only work on x86 and arm64.

In case this isn't obvious to any non-native English speaker: the driver
is written for the Microsoft Surface, which only has x86 and arm64
variants to this date and the list is probably not going to expand in
the foreseeable future, so the word "work" here takes a quite literal
sense. ;-)

I agree a tiny fix for that driver could be added later that limits the
driver to X86 || ARM64. As a popular product line, adding support for
yet another architecture would be a news visible enough for the crowd
that they'll come and tweak the Kconfig themselves.


2022-06-01 21:35:09

by WANG Xuerui

[permalink] [raw]
Subject: Re: [musl] Re: [GIT PULL] asm-generic changes for 5.19

On 6/1/22 04:40, Arnd Bergmann wrote:
> lib/test_printf.c:215: warning: "PTR" redefined
> 215 | #define PTR ((void *)0xffff0123456789abUL)
> |
> In file included from /git/arm-soc/arch/loongarch/include/asm/vdso/vdso.h:9,
> from
> /git/arm-soc/arch/loongarch/include/asm/vdso/gettimeofday.h:13,
> from /git/arm-soc/include/vdso/datapage.h:137,
> from /git/arm-soc/arch/loongarch/include/asm/vdso.h:11,
> from /git/arm-soc/arch/loongarch/include/asm/elf.h:13,
> from /git/arm-soc/include/linux/elf.h:6,
> from /git/arm-soc/include/linux/module.h:19,
> from /git/arm-soc/lib/test_printf.c:10:
> /git/arm-soc/arch/loongarch/include/asm/asm.h:182: note: this is the
> location of the previous definition
> 182 | #define PTR .dword
> |
>
> Not sure what the best fix is for this, maybe the contents of asm/asm.h could
> just be hidden in an "#idef __ASSEMBLER__" check. This can be a follow-up
> patch when the branch is merged.

Ah, the dreaded PTR... This has plagued Loongson users since antiquity
(i.e. the MIPS era).

It must have been the case that the arch/loongarch was based on an
earlier version of arch/mips, that didn't have the commit fa62f39dc7e25
("MIPS: Fix build error due to PTR used in more places"). So the fix
would be simple: just rename the PTR to something else. MIPS changed
that to PTR_WD and maybe we could re-use that name.

But I agree that wrapping the whole asm/asm.h with an #ifdef
__ASSEMBLY__ is very reasonable regardless. Maybe both could be done.