Re:Re: [PATCH] powerpc/sysdev: fix compile errors

From: çæè
Date: Tue Feb 18 2020 - 05:32:54 EST



From: Christophe Leroy <christophe.leroy@xxxxxx>
Date: 2020-01-21 16:37:07
To:"çæè" <wenhu.wang@xxxxxxxx>,Andrew Donnellan <ajd@xxxxxxxxxxxxx>
cc: Kate Stewart <kstewart@xxxxxxxxxxxxxxxxxxx>,Richard Fontana <rfontana@xxxxxxxxxx>,Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>,linux-kernel@xxxxxxxxxxxxxxx,wangwenhu <wenhu.pku@xxxxxxxxx>,Paul Mackerras <paulus@xxxxxxxxx>,trivial@xxxxxxxxxx,Thomas Gleixner <tglx@xxxxxxxxxxxxx>,linuxppc-dev@xxxxxxxxxxxxxxxx,lonehugo@xxxxxxxxxxx
Subject: Re: [PATCH] powerpc/sysdev: fix compile errors>
>
>Le 21/01/2020 Ã 07:59, çæè a ÃcritÂ:
>> åääïAndrew Donnellan <ajd@xxxxxxxxxxxxx>
>> åéææï2020-01-21 14:13:07
>> æääïwangwenhu <wenhu.pku@xxxxxxxxx>,Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>,Paul Mackerras <paulus@xxxxxxxxx>,Michael Ellerman <mpe@xxxxxxxxxxxxxx>,Kate Stewart <kstewart@xxxxxxxxxxxxxxxxxxx>,Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>,Richard Fontana <rfontana@xxxxxxxxxx>,Thomas Gleixner <tglx@xxxxxxxxxxxxx>,linuxppc-dev@xxxxxxxxxxxxxxxx,linux-kernel@xxxxxxxxxxxxxxx
>> æéäïtrivial@xxxxxxxxxx,lonehugo@xxxxxxxxxxx,wenhu.wang@xxxxxxxx
>> äéïRe: [PATCH] powerpc/sysdev: fix compile errors>On 21/1/20 4:31 pm, wangwenhu wrote:
>>>> From: wangwenhu <wenhu.wang@xxxxxxxx>
>>>>
>>>> Include arch/powerpc/include/asm/io.h into fsl_85xx_cache_sram.c to
>>>> fix the implicit declaration compile errors when building Cache-Sram.
>>>>
>>>> arch/powerpc/sysdev/fsl_85xx_cache_sram.c: In function âinstantiate_cache_sramâ:
>>>> arch/powerpc/sysdev/fsl_85xx_cache_sram.c:97:26: error: implicit declaration of function âioremap_coherentâ; did you mean âbitmap_complementâ? [-Werror=implicit-function-declaration]
>>>> cache_sram->base_virt = ioremap_coherent(cache_sram->base_phys,
>>>> ^~~~~~~~~~~~~~~~
>>>> bitmap_complement
>>>> arch/powerpc/sysdev/fsl_85xx_cache_sram.c:97:24: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
>>>> cache_sram->base_virt = ioremap_coherent(cache_sram->base_phys,
>>>> ^
>>>> arch/powerpc/sysdev/fsl_85xx_cache_sram.c:123:2: error: implicit declaration of function âiounmapâ; did you mean âroundupâ? [-Werror=implicit-function-declaration]
>>>> iounmap(cache_sram->base_virt);
>>>> ^~~~~~~
>>>> roundup
>>>> cc1: all warnings being treated as errors
>>>>
>>>> Signed-off-by: wangwenhu <wenhu.wang@xxxxxxxx>
>>>
>>> How long has this code been broken for?
>>
>> It's been broken almost 15 months since the commit below:
>> "commit aa91796ec46339f2ed53da311bd3ea77a3e4dfe1
>> Author: Christophe Leroy <christophe.leroy@xxxxxx>
>> Date: Tue Oct 9 13:51:41 2018 +0000
>>
>> powerpc: don't use ioremap_prot() nor __ioremap() unless really needed."
>>
>> And we are working on it now for further development.
>
>That's pretty surprising. That commit didn't change the iounmap(). It
>only replaced ioremap_prot() by ioremap_coherent(). Both are defined in io.h
>
>Christophe
>

The compile error exists since the uploading of the driver
Details below:
1. "ioremap_flags" defined in "asm/io.h" was used primarily(Wed Oct 13 17:30:56 2010):
(6db92cc9d07d: powerpc/85xx: add cache-sram support);
2. "ioremap_prot" was used to replace "ioremap_flags"
(40f1ce7fb7e8: powerpc: Remove ioremap_flags);
3. "ioremap_coherent" was used to replace "ioremap_prot":
(aa91796ec463: powerpc: don't use ioremap_prot() nor __ioremap() unless really needed.)

So I will do the re-patch with a "Fixed" tag and "<linux/io.h>" include modification.
Which commit should be referenced to append to "Fixed" tag? (No.1 or No.3 ?)

Wenhu

>>
>>>
>>>> ---
>>>> arch/powerpc/sysdev/fsl_85xx_cache_sram.c | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/arch/powerpc/sysdev/fsl_85xx_cache_sram.c b/arch/powerpc/sysdev/fsl_85xx_cache_sram.c
>>>> index f6c665dac725..29b6868eff7d 100644
>>>> --- a/arch/powerpc/sysdev/fsl_85xx_cache_sram.c
>>>> +++ b/arch/powerpc/sysdev/fsl_85xx_cache_sram.c
>>>> @@ -17,6 +17,7 @@
>>>> #include <linux/of_platform.h>
>>>> #include <asm/pgtable.h>
>>>> #include <asm/fsl_85xx_cache_sram.h>
>>>> +#include <asm/io.h>
>>>>
>>>> #include "fsl_85xx_cache_ctlr.h"
>>>>
>>>
>>> --
>>> Andrew Donnellan OzLabs, ADL Canberra
>>> ajd@xxxxxxxxxxxxx IBM Australia Limited
>>>
>>
>> Wenhu
>>