Thread (4 messages) 4 messages, 3 authors, 2022-05-28

Re: [PATCH] powerpc/64: Include cache.h directly in paca.h

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2022-05-28 12:19:45

Christophe Leroy [off-list ref] writes:
Le 27/05/2022 à 13:20, Michael Ellerman a écrit :
quoted
paca.h uses ____cacheline_aligned without directly including cache.h,
where it's defined.

For Book3S builds that's OK because paca.h includes lppaca.h, and it
does include cache.h.

But Book3E builds have been getting cache.h indirectly via printk.h,
which is dicey, and in fact that include was recently removed, leading
to build errors such as:

   ld: fs/isofs/dir.o:(.bss+0x0): multiple definition of `____cacheline_aligned'; fs/isofs/namei.o:(.bss+0x0): first defined here

So include cache.h directly to fix the build error.

Fixes: 534aa1dc975a ("printk: stop including cache.h from printk.h")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
You've got other candidates for the fix:

$ git grep -L linux/cache.h `git grep -l ____cacheline_aligned 
arch/powerpc`
arch/powerpc/include/asm/hardirq.h
arch/powerpc/include/asm/iommu.h
arch/powerpc/include/asm/paca.h
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/prom_init.c

Discussion at 
https://lore.kernel.org/lkml/e3c8b2bf-b55d-4c2c-a1cf-d5e9941e26b0@csgroup.eu/t/ (local)
Adding it to paca.h seems to also fix those build errors, so I'll leave
it at that for now.

Adding cache.h to those other headers should be fine, but I don't want
to do it just before sending my pull request, because changing include
order can easily cause bugs, and they're not always easy to find.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help