diff mbox series

drm/i915: Skip remap_io_mapping() for non-x86 platforms

Message ID 20211112132456.19800-1-siva.mullati@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Skip remap_io_mapping() for non-x86 platforms | expand

Commit Message

Mullati Siva Nov. 12, 2021, 1:24 p.m. UTC
From: "Mullati, Siva" <siva.mullati@intel.com>

The _PAGE_CACHE_MASK macro is not defined in non-x86
architectures and it's been used in remap_io_mapping().
Only hw that supports mappable aperture would hit this path
remap_io_mapping(), So skip this code for non-x86  architectures.

Signed-off-by: Mullati, Siva <siva.mullati@intel.com>
---
 drivers/gpu/drm/i915/i915_mm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jani Nikula Nov. 12, 2021, 2:09 p.m. UTC | #1
On Fri, 12 Nov 2021, Mullati Siva <siva.mullati@intel.com> wrote:
> From: "Mullati, Siva" <siva.mullati@intel.com>
>
> The _PAGE_CACHE_MASK macro is not defined in non-x86
> architectures and it's been used in remap_io_mapping().
> Only hw that supports mappable aperture would hit this path
> remap_io_mapping(), So skip this code for non-x86  architectures.
>
> Signed-off-by: Mullati, Siva <siva.mullati@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_mm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
> index 666808cb3a32..5e2a1868b957 100644
> --- a/drivers/gpu/drm/i915/i915_mm.c
> +++ b/drivers/gpu/drm/i915/i915_mm.c
> @@ -91,6 +91,7 @@ int remap_io_mapping(struct vm_area_struct *vma,
>  		     unsigned long addr, unsigned long pfn, unsigned long size,
>  		     struct io_mapping *iomap)
>  {
> +#if defined(CONFIG_X86)

Please don't add conditional compilation within functions. Please use
#if IS_ENABLED() instead of #if defined or #ifdef.

BR,
Jani.

>  	struct remap_pfn r;
>  	int err;
>  
> @@ -108,6 +109,7 @@ int remap_io_mapping(struct vm_area_struct *vma,
>  		zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
>  		return err;
>  	}
> +#endif
>  
>  	return 0;
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index 666808cb3a32..5e2a1868b957 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -91,6 +91,7 @@  int remap_io_mapping(struct vm_area_struct *vma,
 		     unsigned long addr, unsigned long pfn, unsigned long size,
 		     struct io_mapping *iomap)
 {
+#if defined(CONFIG_X86)
 	struct remap_pfn r;
 	int err;
 
@@ -108,6 +109,7 @@  int remap_io_mapping(struct vm_area_struct *vma,
 		zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT);
 		return err;
 	}
+#endif
 
 	return 0;
 }