Re: [PATCH] MIPS: Add KSEG*ADDR definitions to CONFIG_64BIT
From: Denis Efremov
Date: Tue Dec 10 2019 - 15:14:43 EST
Hi,
On 10.12.2019 21:57, Paul Burton wrote:
> Hi Denis,
>
> On Tue, Dec 10, 2019 at 08:27:39PM +0300, Denis Efremov wrote:
>> The patch adds KSEG0ADDR, KSEG1ADDR, KSEG2ADDR, KSEG3ADDR
>> definitions to CONFIG_64BIT ifdef. This fixes broken compilation:
>> CC drivers/watchdog/mtx-1_wdt.o
>> In file included from drivers/watchdog/mtx-1_wdt.c:44:
>> ./arch/mips/include/asm/mach-au1x00/au1000.h: In function âalchemy_rdsysâ:
>> ./arch/mips/include/asm/mach-au1x00/au1000.h:603:36: error: implicit
>> declaration of function âKSEG1ADDRâ; did you mean âCKSEG1ADDRâ?
>> [-Werror=implicit-function-declaration]
>
> Since this driver is meant to run on a system that only supports 32 bit
> kernels, I think it would be better to correct its dependencies in
> Kconfig like so:
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 58e7c100b6ad..509cbb6d2cea 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1648,7 +1648,7 @@ config JZ4740_WDT
>
> config WDT_MTX1
> tristate "MTX-1 Hardware Watchdog"
> - depends on MIPS_MTX1 || (MIPS && COMPILE_TEST)
> + depends on MIPS_MTX1 || (MIPS && 32BIT && COMPILE_TEST)
> help
> Hardware driver for the MTX-1 boards. This is a watchdog timer that
> will reboot the machine after a 100 seconds timer expired.
>
> And mark this with the appropriate fixes tag:
>
> Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
>
> What do you think?
>
> Alternatively the driver could just use the existing & equivalent
> CKSEG1ADDR() macro as the compiler suggested, but in that case it'd be
> good to check that's the only change needed to build cleanly with
> CONFIG_64BIT=y.
>
Thank you for the suggestion. I will prepare V2 and fix the same way other
drivers that break the compilation with CONFIG_64BIT and missing KSEG1ADDR.
> Thanks,
> Paul
>