diff mbox

[v4,1/5] powerpc: io.h: move iomap.h include so that it can use readq/writeq defs

Message ID 20170718165528.7383-2-logang@deltatee.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show

Commit Message

Logan Gunthorpe July 18, 2017, 4:55 p.m. UTC
Subsequent patches in this series makes use of the readq and writeq
defines in iomap.h. However, as is, they get missed on the powerpc
platform seeing the include comes before the define. This patch
moves the include down to fix this.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Suresh Warrier <warrier@linux.vnet.ibm.com>
Cc: "Oliver O'Halloran" <oohall@gmail.com>
---
 arch/powerpc/include/asm/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Ellerman July 19, 2017, 5:57 a.m. UTC | #1
Logan Gunthorpe <logang@deltatee.com> writes:

> Subsequent patches in this series makes use of the readq and writeq
> defines in iomap.h. However, as is, they get missed on the powerpc
> platform seeing the include comes before the define. This patch
> moves the include down to fix this.
>
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Suresh Warrier <warrier@linux.vnet.ibm.com>
> Cc: "Oliver O'Halloran" <oohall@gmail.com>
> ---
>  arch/powerpc/include/asm/io.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Seems fair enough, have you tested it at all?

cheers
Logan Gunthorpe July 19, 2017, 4:04 p.m. UTC | #2
On 18/07/17 11:57 PM, Michael Ellerman wrote:
> Seems fair enough, have you tested it at all?

It's only been compile tested and the kbuild robot has beat up on it a bit.

Thanks,

Logan
Horia Geanta July 20, 2017, 10:27 a.m. UTC | #3
On 7/19/2017 7:04 PM, Logan Gunthorpe wrote:
> 
> 
> On 18/07/17 11:57 PM, Michael Ellerman wrote:
>> Seems fair enough, have you tested it at all?
> 
> It's only been compile tested and the kbuild robot has beat up on it a bit.
> 
Looks like the patch set does not compile on PPC (.config generated
using make corenet64_smp_defconfig):

[...]
  LD      vmlinux.o
  MODPOST vmlinux.o
drivers/crypto/caam/jr.o: In function `rd_reg64':
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:154:
undefined reference to `.ioread64be_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:151:
undefined reference to `.ioread64_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:151:
undefined reference to `.ioread64_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:154:
undefined reference to `.ioread64be_lo_hi'
drivers/crypto/caam/jr.o: In function `wr_reg64':
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:141:
undefined reference to `.iowrite64_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:141:
undefined reference to `.iowrite64_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:144:
undefined reference to `.iowrite64be_lo_hi'
/home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:144:
undefined reference to `.iowrite64be_lo_hi'
make: *** [vmlinux] Error 1

Regards,
Horia
Michael Ellerman July 20, 2017, 11:10 a.m. UTC | #4
Logan Gunthorpe <logang@deltatee.com> writes:

> On 18/07/17 11:57 PM, Michael Ellerman wrote:
>> Seems fair enough, have you tested it at all?
>
> It's only been compile tested and the kbuild robot has beat up on it a bit.

OK. I don't think I see any way it can break anything, so feel free to
merge it, it'll get boot testing on powerpc once it's in linux-next.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers
Horia Geanta July 20, 2017, 12:36 p.m. UTC | #5
On 7/20/2017 1:27 PM, Horia Geantă wrote:
> On 7/19/2017 7:04 PM, Logan Gunthorpe wrote:
>>
>>
>> On 18/07/17 11:57 PM, Michael Ellerman wrote:
>>> Seems fair enough, have you tested it at all?
>>
>> It's only been compile tested and the kbuild robot has beat up on it a bit.
>>
> Looks like the patch set does not compile on PPC (.config generated
> using make corenet64_smp_defconfig):
> 
> [...]
>   LD      vmlinux.o
>   MODPOST vmlinux.o
> drivers/crypto/caam/jr.o: In function `rd_reg64':
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:154:
> undefined reference to `.ioread64be_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:151:
> undefined reference to `.ioread64_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:151:
> undefined reference to `.ioread64_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:154:
> undefined reference to `.ioread64be_lo_hi'
> drivers/crypto/caam/jr.o: In function `wr_reg64':
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:141:
> undefined reference to `.iowrite64_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:141:
> undefined reference to `.iowrite64_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:144:
> undefined reference to `.iowrite64be_lo_hi'
> /home/b05471/repos/cryptodev-2.6/drivers/crypto/caam/regs.h:144:
> undefined reference to `.iowrite64be_lo_hi'
> make: *** [vmlinux] Error 1
> 
include/asm-generic/iomap.h is included before
include/linux/io-64-nonatomic-lo-hi.h:

include/linux/io.h -> arch/powerpc/include/asm/io.h ->
include/asm-generic/iomap.h

Thus, the "extern" version of ioread64_lo_hi and friends will be used
(and not the inline version from io-64-nonatomic-lo-hi.h).

But for this kernel .config:
-CONFIG_GENERIC_IOMAP=n and
-there is no implementation of io{read|write}64[be]{_lo_hi|_hi_lo} in
arch/powerpc/kernel/iomap.c

Regards,
Horia
Logan Gunthorpe July 20, 2017, 3:39 p.m. UTC | #6
On 20/07/17 06:36 AM, Horia Geantă wrote:
> include/asm-generic/iomap.h is included before
> include/linux/io-64-nonatomic-lo-hi.h:
> 
> include/linux/io.h -> arch/powerpc/include/asm/io.h ->
> include/asm-generic/iomap.h
> 
> Thus, the "extern" version of ioread64_lo_hi and friends will be used
> (and not the inline version from io-64-nonatomic-lo-hi.h).
> 
> But for this kernel .config:
> -CONFIG_GENERIC_IOMAP=n and
> -there is no implementation of io{read|write}64[be]{_lo_hi|_hi_lo} in
> arch/powerpc/kernel/iomap.c

Ah, thanks for the triage. I'll take a look at fixing this for a v5.

Logan
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 422f99cf9924..af074923d598 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -33,8 +33,6 @@  extern struct pci_dev *isa_bridge_pcidev;
 #include <asm/mmu.h>
 #include <asm/ppc_asm.h>
 
-#include <asm-generic/iomap.h>
-
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
 #endif
@@ -663,6 +661,8 @@  static inline void name at					\
 #define writel_relaxed(v, addr)	writel(v, addr)
 #define writeq_relaxed(v, addr)	writeq(v, addr)
 
+#include <asm-generic/iomap.h>
+
 #ifdef CONFIG_PPC32
 #define mmiowb()
 #else