Re: [PATCH] ion: Handle the memory mapping correctly on x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 04, 2015 at 12:21:35AM +0000, Radhakrishna, Pradeep wrote:
> >From b4069e7fe1b2aa1660b3f944e246c13b4947db21 Mon Sep 17 00:00:00 2001
> From: Zhebin Jin <zhebin.jin@xxxxxxxxx>
> Date: Wed, 8 Jul 2015 10:35:06 +0800
> Subject: [PATCH] ion: Handle the memory mapping correctly on x86

Why is all of this here in the patch body?


> 
> This patch modifies the ion page pool code to address
> limitation in x86 PAT. That is, when one physical page is
> mapped to multiple virtual pages, the same cache policy
> should be used. So there is a need to add set_memory_wc/uc
> call to avoid aliases. Otherwise, all mappings will be
> cached(write back), no matter which cache policy is choosed
> to do the mapping.
> 
> Signed-off-by: Zhebin Jin <zhebin.jin@xxxxxxxxx>
> Signed-off-by: Pradeep Radhakrishna <pradeep.radhakrishna@xxxxxxxxx>
> ---
>  drivers/staging/android/ion/ion_page_pool.c   |   33 ++++++++++++++++++++++---
>  drivers/staging/android/ion/ion_priv.h        |    2 +-
>  drivers/staging/android/ion/ion_system_heap.c |    5 ++--
>  3 files changed, 34 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c
> index 0e20e62..566946b 100644
> --- a/drivers/staging/android/ion/ion_page_pool.c
> +++ b/drivers/staging/android/ion/ion_page_pool.c
> @@ -21,6 +21,11 @@
>  #include <linux/list.h>
>  #include <linux/module.h>
>  #include <linux/slab.h>
> +
> +#if defined(CONFIG_X86)
> +#include <asm/cacheflush.h>
> +#endif

That's never ok.

> +
>  #include "ion_priv.h"
>  
>  struct ion_page_pool_item {
> @@ -34,6 +39,16 @@ static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
>  
>  	if (!page)
>  		return NULL;
> +
> +#if defined(CONFIG_X86)

Nor is that, come on, you know better than to put #if in a .c file.

Please get Intel internal developers to review patch submissions before
sending them out and relying on the community to point out basic issues
like this.  That's what they are there for :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux