dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/
       [not found] <CAKMK7uFjtbsareLBGjCWvypybNRVROpkrD-oCDxvnj8B+EkDgQ@mail.gmail.com>
@ 2016-08-23 15:50 ` Chris Wilson
  2016-08-23 16:32   ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2016-08-23 15:50 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-mm, Daniel Vetter, intel-gfx, Joonas Lahtinen

PAGE_KERNEL_IO is an x86-ism. Though it is used to define the pgprot_t
used for the iomapped region, it itself is just PAGE_KERNEL. On all
other arches, PAGE_KERNEL_IO is undefined so in a general header we must
refrain from using it.

v2: include pgtable for pgprot_combine()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata about the io-mapping")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: linux-mm@kvack.org
---
 include/linux/io-mapping.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index b4c4b5c4216d..a87dd7fffc0a 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -112,7 +112,7 @@ io_mapping_unmap(void __iomem *vaddr)
 #else
 
 #include <linux/uaccess.h>
-#include <asm/pgtable_types.h>
+#include <asm/pgtable.h>
 
 /* Create the io_mapping object*/
 static inline struct io_mapping *
@@ -123,7 +123,7 @@ io_mapping_init_wc(struct io_mapping *iomap,
 	iomap->base = base;
 	iomap->size = size;
 	iomap->iomem = ioremap_wc(base, size);
-	iomap->prot = pgprot_writecombine(PAGE_KERNEL_IO);
+	iomap->prot = pgprot_writecombine(PAGE_KERNEL);
 
 	return iomap;
 }
-- 
2.9.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/
  2016-08-23 15:50 ` [PATCH v2] io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/ Chris Wilson
@ 2016-08-23 16:32   ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2016-08-23 16:32 UTC (permalink / raw)
  To: Chris Wilson
  Cc: dri-devel, intel-gfx, Daniel Vetter, Joonas Lahtinen, linux-mm

On Tue, Aug 23, 2016 at 04:50:24PM +0100, Chris Wilson wrote:
> PAGE_KERNEL_IO is an x86-ism. Though it is used to define the pgprot_t
> used for the iomapped region, it itself is just PAGE_KERNEL. On all
> other arches, PAGE_KERNEL_IO is undefined so in a general header we must
> refrain from using it.
> 
> v2: include pgtable for pgprot_combine()
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata about the io-mapping")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: linux-mm@kvack.org

This one seems to have worked out, applied to dinq.

Thanks, Daniel

> ---
>  include/linux/io-mapping.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
> index b4c4b5c4216d..a87dd7fffc0a 100644
> --- a/include/linux/io-mapping.h
> +++ b/include/linux/io-mapping.h
> @@ -112,7 +112,7 @@ io_mapping_unmap(void __iomem *vaddr)
>  #else
>  
>  #include <linux/uaccess.h>
> -#include <asm/pgtable_types.h>
> +#include <asm/pgtable.h>
>  
>  /* Create the io_mapping object*/
>  static inline struct io_mapping *
> @@ -123,7 +123,7 @@ io_mapping_init_wc(struct io_mapping *iomap,
>  	iomap->base = base;
>  	iomap->size = size;
>  	iomap->iomem = ioremap_wc(base, size);
> -	iomap->prot = pgprot_writecombine(PAGE_KERNEL_IO);
> +	iomap->prot = pgprot_writecombine(PAGE_KERNEL);
>  
>  	return iomap;
>  }
> -- 
> 2.9.3
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-23 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAKMK7uFjtbsareLBGjCWvypybNRVROpkrD-oCDxvnj8B+EkDgQ@mail.gmail.com>
2016-08-23 15:50 ` [PATCH v2] io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/ Chris Wilson
2016-08-23 16:32   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox