Re: [PATCH 2/2] ata: octeon: Add compile test support

From: Rob Herring
Date: Thu Jun 22 2023 - 09:42:10 EST


On Wed, Jun 21, 2023 at 10:26 PM Damien Le Moal <dlemoal@xxxxxxxxxx> wrote:
>
> On 6/22/23 12:01, Guenter Roeck wrote:
> > On 6/21/23 17:57, Damien Le Moal wrote:
> >> On 6/22/23 01:51, Guenter Roeck wrote:
> >>> On Wed, Jun 14, 2023 at 11:36:33AM -0600, Rob Herring wrote:
> >>>> Add COMPILE_TEST to enable building Cavium Octeon drivers in MIPS
> >>>> allyesconfig/allmodconfig builds. There's a dependency on MIPS headers,
> >>>> so other arches can't be enabled.
> >>>>
> >>>> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
> >>>> ---
> >>>> Tested on allmodconfig build. Not sure if there's other MIPS configs
> >>>> where this doesn't work. We'll see what 0-day says.
> >>>
> >>> Odd, in next-20230621 I get:
> >>>
> >>> Building mips:allmodconfig ... failed
> >>
> >> Indeed odd. Given that this is an allmodconfig, I would assume that
> >> CONFIG_CAVIUM_OCTEON_SOC is set ?
> >>
> >
> > No, it is not. CONFIG_CAVIUM_OCTEON_SOC is a choice option,
> > meaning only one of the choices can be set, and mips:allmodconfig
> > selects a different choice.
>
> OK. Then I think I need to drop this patch as I do not see how to allow
> COMPILE_TEST without CONFIG_CAVIUM_OCTEON_SOC being set.
>
> Rob ?

These could be fixed, but not sure it's worth the effort.

> >
> > Guenter
> >
> >>> --------------
> >>> Error log:
> >>> ERROR: modpost: "__udivdi3" [drivers/ata/pata_octeon_cf.ko] undefined!

This is due to 64-bit divides on 32-bit build, so do_div() needs to be used.

> >>> ERROR: modpost: "octeon_get_io_clock_rate" [drivers/ata/pata_octeon_cf.ko] undefined!

We'd need a static inline in the header for octeon_get_io_clock_rate().

Of course the real fix is Octeon needs to move to use the clock framework.

> >>> ERROR: modpost: "__tracepoint_ata_bmdma_stop" [drivers/ata/pata_octeon_cf.ko] undefined!
> >>> ERROR: modpost: "__traceiter_ata_bmdma_stop" [drivers/ata/pata_octeon_cf.ko] undefined!

Probably can just drop the trace_ata_bmdma_stop() call. It was added
to replace a printk.

Rob