[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211112172942.04553027@jic23-huawei>
Date: Fri, 12 Nov 2021 17:29:42 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>,
Artur Rojek <contact@...ur-rojek.eu>,
Paul Cercueil <paul@...pouillou.net>,
linux-mips@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>,
linux-iio@...r.kernel.org, Florian Fainelli <f.fainelli@...il.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v2] iio/adc: ingenic: fix (MIPS) ingenic-adc build
errors
On Tue, 9 Nov 2021 18:37:55 -0800
Randy Dunlap <rdunlap@...radead.org> wrote:
> MIPS does not always provide clk*() interfaces and there are no
> always-present stubs for them, so depending on "MIPS || COMPILE_TEST"
> is not strong enough to prevent build errors.
>
> Likewise MACH_INGENIC_SOC || COMPILE_TEST is not strong enough
> since if only COMPILE_TEST=y (with some other MIPS MACH_ or CPU or
> BOARD setting), there are still the same build errors.
>
> It looks like depending on MACH_INGENIC is the only thing that is
> sufficient here in order to prevent build errors.
>
> mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4770_adc_init_clk_div':
> ingenic-adc.c:(.text+0xe4): undefined reference to `clk_get_parent'
> mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4725b_adc_init_clk_div':
> ingenic-adc.c:(.text+0x1b8): undefined reference to `clk_get_parent'
>
> Fixes: 1a78daea107d ("IIO: add Ingenic JZ47xx ADC driver.")
> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> Reported-by: kernel test robot <lkp@...el.com>
> Cc: Artur Rojek <contact@...ur-rojek.eu>
> Cc: Paul Cercueil <paul@...pouillou.net>
> Cc: linux-mips@...r.kernel.org
> Cc: Jonathan Cameron <jic23@...nel.org>
> Cc: Lars-Peter Clausen <lars@...afoo.de>
> Cc: linux-iio@...r.kernel.org
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: Andy Shevchenko <andy.shevchenko@...il.com>
I'm a bit confused. There are stubs in include/linux/clk.h for these.
Why do those not apply here? Are these platforms built with CONFIG_CLK but
don't provide all the functions?
That sounds highly error prone and rather defeats the object of the
stubs. Could we either provide the missing stubs, or solve this some other
way. I'm not keen to massively cut the build coverage this driver is getting
by dropping COMPILE_TEST if there is any route to avoid doing so.
Based on the guess than any platform with clks must be able to turn them on
I grepped for int clk_enable() and there seem to be only two possiblities
bcm63xx and lantiq as sources of the build breakage.
Jonathan
> ---
> v2: use MACH_INGENIC instead of MACH_INGENIC_SOC (thanks, Paul)
>
> drivers/iio/adc/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20211105.orig/drivers/iio/adc/Kconfig
> +++ linux-next-20211105/drivers/iio/adc/Kconfig
> @@ -501,7 +501,7 @@ config INA2XX_ADC
>
> config INGENIC_ADC
> tristate "Ingenic JZ47xx SoCs ADC driver"
> - depends on MIPS || COMPILE_TEST
> + depends on MACH_INGENIC
> select IIO_BUFFER
> help
> Say yes here to build support for the Ingenic JZ47xx SoCs ADC unit.
Powered by blists - more mailing lists