# \[PATCH\] drivers/video/fbdev: use ioremap\_wc() instead of \_\_ioremap(\_PAGE\_NO\_CACHE)

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- List: linuxppc-dev
- 3 messages, 2 authors
- Page: https://ratatoskr.run/linuxppc-dev/2018/08/5363371/t

## \[PATCH\] drivers/video/fbdev: use ioremap\_wc() instead of \_\_ioremap(\_PAGE\_NO\_CACHE)

- From: Christophe Leroy \<hidden\>
- Date: 2018-08-24 10:16:26 
- Message: https://ratatoskr.run/linuxppc-dev/2018/08/5363371.md

```text
_PAGE_NO_CACHE is a target specific flag. Prefer generic functions.

Signed-off-by: Christophe Leroy <redacted>
---
 drivers/video/fbdev/chipsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
index f103665cad43..48fbc22d6867 100644
--- a/drivers/video/fbdev/chipsfb.c
+++ b/drivers/video/fbdev/chipsfb.c
@@ -401,7 +401,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 #endif /* CONFIG_PMAC_BACKLIGHT */
 
 #ifdef CONFIG_PPC
-	p->screen_base = __ioremap(addr, 0x200000, _PAGE_NO_CACHE);
+	p->screen_base = ioremap_wc(addr, 0x200000);
 #else
 	p->screen_base = ioremap(addr, 0x200000);
 #endif
-- 
2.13.3
```

## Re: \[PATCH\] drivers/video/fbdev: use ioremap\_wc() instead of \_\_ioremap(\_PAGE\_NO\_CACHE)

- From: Christophe LEROY \<hidden\>
- Date: 2018-08-24 11:10:42 
- Message: https://ratatoskr.run/linuxppc-dev/2018/08/5363414.md

```text


Le 24/08/2018 à 13:05, Segher Boessenkool a écrit :
> On Fri, Aug 24, 2018 at 10:16:22AM +0000, Christophe Leroy wrote:
>> _PAGE_NO_CACHE is a target specific flag. Prefer generic functions.
>
>>   #ifdef CONFIG_PPC
>> -	p->screen_base = __ioremap(addr, 0x200000, _PAGE_NO_CACHE);
>> +	p->screen_base = ioremap_wc(addr, 0x200000);
>>   #else
>
> But that is not the same.  I think you want ioremap_nocache?
>
>

No, ioremap_nocache() is _PAGE_NO_CACHE | _PAGE_GUARDED



/arch/powerpc/include/asm/io.h

#define ioremap_nocache(addr, size)	ioremap((addr), (size))


/arch/powerpc/mm/pgtable_32.c:

void __iomem *
ioremap_wc(phys_addr_t addr, unsigned long size)
{
	return __ioremap_caller(addr, size, _PAGE_NO_CACHE,
				__builtin_return_address(0));
}

void __iomem *
ioremap(phys_addr_t addr, unsigned long size)
{
	return __ioremap_caller(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED,
				__builtin_return_address(0));
}

Christophe
```

## Re: \[PATCH\] drivers/video/fbdev: use ioremap\_wc() instead of \_\_ioremap(\_PAGE\_NO\_CACHE)

- From: Segher Boessenkool \<hidden\>
- Date: 2018-08-24 11:24:25 
- Message: https://ratatoskr.run/linuxppc-dev/2018/08/5363423.md

```text
On Fri, Aug 24, 2018 at 10:16:22AM +0000, Christophe Leroy wrote:
> _PAGE_NO_CACHE is a target specific flag. Prefer generic functions.

>  #ifdef CONFIG_PPC
> -	p->screen_base = __ioremap(addr, 0x200000, _PAGE_NO_CACHE);
> +	p->screen_base = ioremap_wc(addr, 0x200000);
>  #else

But that is not the same.  I think you want ioremap_nocache?


Segher
```
