diff mbox

bounce: call flush_dcache_page after bounce_copy_vec

Message ID 1284356962-32627-1-git-send-email-bryan.wu@canonical.com
State Accepted
Delegated to: Leann Ogasawara
Headers show

Commit Message

Bryan Wu Sept. 13, 2010, 5:49 a.m. UTC
From: Gary King <gking@nvidia.com>

the bounced page needs to be flushed after data is copied into it,
to ensure that architecture implementations can synchronize
instruction and data caches if necessary.

This patch was posted at armlinux mail list and was asked by Andrew
Morton and Jens Axboe. We tried this patch and found is fixed memtester
issue.
(http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)

BugLink: http://bugs.launchpad.net/bugs/633227

Signed-off-by: Gary King <gking@nvidia.com>
Tested-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Tested-by: Sebastien Jan <s-jan@ti.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 mm/bounce.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Stefan Bader Sept. 13, 2010, 12:30 p.m. UTC | #1
On 09/13/2010 07:49 AM, Bryan Wu wrote:
> From: Gary King <gking@nvidia.com>
> 
> the bounced page needs to be flushed after data is copied into it,
> to ensure that architecture implementations can synchronize
> instruction and data caches if necessary.
> 
> This patch was posted at armlinux mail list and was asked by Andrew
> Morton and Jens Axboe. We tried this patch and found is fixed memtester
> issue.
> (http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)
> 
Maybe I could guess where this patch ought to go (given that Leann is on the cc)
but is this ti-omap and by that should go to Lucid to be pulled into Maverick?

-Stefan
> BugLink: http://bugs.launchpad.net/bugs/633227
> 
> Signed-off-by: Gary King <gking@nvidia.com>
> Tested-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
> Tested-by: Sebastien Jan <s-jan@ti.com>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  mm/bounce.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/bounce.c b/mm/bounce.c
> index 13b6dad..1481de6 100644
> --- a/mm/bounce.c
> +++ b/mm/bounce.c
> @@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
>  		 */
>  		vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
>  
> -		flush_dcache_page(tovec->bv_page);
>  		bounce_copy_vec(tovec, vfrom);
> +		flush_dcache_page(tovec->bv_page);
>  	}
>  }
>
Bryan Wu Sept. 13, 2010, 12:42 p.m. UTC | #2
On Mon, Sep 13, 2010 at 8:30 PM, Stefan Bader
<stefan.bader@canonical.com> wrote:
> On 09/13/2010 07:49 AM, Bryan Wu wrote:
>> From: Gary King <gking@nvidia.com>
>>
>> the bounced page needs to be flushed after data is copied into it,
>> to ensure that architecture implementations can synchronize
>> instruction and data caches if necessary.
>>
>> This patch was posted at armlinux mail list and was asked by Andrew
>> Morton and Jens Axboe. We tried this patch and found is fixed memtester
>> issue.
>> (http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)
>>
> Maybe I could guess where this patch ought to go (given that Leann is on the cc)
> but is this ti-omap and by that should go to Lucid to be pulled into Maverick?
>

It is for Maverick ti-omap4 at least. I'm not sure whether it will be
applied to -stable tree. If -stable tree merges it, I believe it is
necessary fixing for both Lucid and Maverick (master and ti-omap4).

-Bryan

> -Stefan
>> BugLink: http://bugs.launchpad.net/bugs/633227
>>
>> Signed-off-by: Gary King <gking@nvidia.com>
>> Tested-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
>> Tested-by: Sebastien Jan <s-jan@ti.com>
>> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
>> ---
>>  mm/bounce.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/bounce.c b/mm/bounce.c
>> index 13b6dad..1481de6 100644
>> --- a/mm/bounce.c
>> +++ b/mm/bounce.c
>> @@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
>>                */
>>               vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
>>
>> -             flush_dcache_page(tovec->bv_page);
>>               bounce_copy_vec(tovec, vfrom);
>> +             flush_dcache_page(tovec->bv_page);
>>       }
>>  }
>>
>
>
Brad Figg Sept. 13, 2010, 2:21 p.m. UTC | #3
On 09/13/2010 05:30 AM, Stefan Bader wrote:
> On 09/13/2010 07:49 AM, Bryan Wu wrote:
>> From: Gary King<gking@nvidia.com>
>>
>> the bounced page needs to be flushed after data is copied into it,
>> to ensure that architecture implementations can synchronize
>> instruction and data caches if necessary.
>>
>> This patch was posted at armlinux mail list and was asked by Andrew
>> Morton and Jens Axboe. We tried this patch and found is fixed memtester
>> issue.
>> (http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)
>>
> Maybe I could guess where this patch ought to go (given that Leann is on the cc)
> but is this ti-omap and by that should go to Lucid to be pulled into Maverick?
>
> -Stefan
>> BugLink: http://bugs.launchpad.net/bugs/633227
>>
>> Signed-off-by: Gary King<gking@nvidia.com>
>> Tested-by: Ricardo Salveti de Araujo<ricardo.salveti@canonical.com>
>> Tested-by: Sebastien Jan<s-jan@ti.com>
>> Signed-off-by: Bryan Wu<bryan.wu@canonical.com>
>> ---
>>   mm/bounce.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/bounce.c b/mm/bounce.c
>> index 13b6dad..1481de6 100644
>> --- a/mm/bounce.c
>> +++ b/mm/bounce.c
>> @@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
>>   		 */
>>   		vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
>>
>> -		flush_dcache_page(tovec->bv_page);
>>   		bounce_copy_vec(tovec, vfrom);
>> +		flush_dcache_page(tovec->bv_page);
>>   	}
>>   }
>>
>
>

Bryan,

Just in case Stefan's email wasn't explicit enough. In the future the Subject of an
email with a pull request / patch should explicitly state which release your patch
is targeted at. For example this one should have read:

[Maverick][ti-omap4][Patch 1/1] bounce: call flush_dcache_page after bounce_copy_vec

Brad
Tim Gardner Sept. 13, 2010, 2:37 p.m. UTC | #4
On 09/12/2010 11:49 PM, Bryan Wu wrote:
> From: Gary King<gking@nvidia.com>
>
> the bounced page needs to be flushed after data is copied into it,
> to ensure that architecture implementations can synchronize
> instruction and data caches if necessary.
>
> This patch was posted at armlinux mail list and was asked by Andrew
> Morton and Jens Axboe. We tried this patch and found is fixed memtester
> issue.
> (http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)
>
> BugLink: http://bugs.launchpad.net/bugs/633227
>
> Signed-off-by: Gary King<gking@nvidia.com>
> Tested-by: Ricardo Salveti de Araujo<ricardo.salveti@canonical.com>
> Tested-by: Sebastien Jan<s-jan@ti.com>
> Signed-off-by: Bryan Wu<bryan.wu@canonical.com>
> ---
>   mm/bounce.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/bounce.c b/mm/bounce.c
> index 13b6dad..1481de6 100644
> --- a/mm/bounce.c
> +++ b/mm/bounce.c
> @@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
>   		 */
>   		vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
>
> -		flush_dcache_page(tovec->bv_page);
>   		bounce_copy_vec(tovec, vfrom);
> +		flush_dcache_page(tovec->bv_page);
>   	}
>   }
>

As this was so enthusiastically endorsed by upstream I've applied this 
to ti-omap4 and have also requested a pre-stable pull request for 
Maverick master.

applied to ti-omap4
Eric Miao Sept. 13, 2010, 2:42 p.m. UTC | #5
On Mon, Sep 13, 2010 at 10:37 PM, Tim Gardner <tim.gardner@canonical.com> wrote:
> On 09/12/2010 11:49 PM, Bryan Wu wrote:
>> From: Gary King<gking@nvidia.com>
>>
>> the bounced page needs to be flushed after data is copied into it,
>> to ensure that architecture implementations can synchronize
>> instruction and data caches if necessary.
>>
>> This patch was posted at armlinux mail list and was asked by Andrew
>> Morton and Jens Axboe. We tried this patch and found is fixed memtester
>> issue.
>> (http://lists.infradead.org/pipermail/linux-arm-kernel/2010-September/025373.html)
>>
>> BugLink: http://bugs.launchpad.net/bugs/633227
>>
>> Signed-off-by: Gary King<gking@nvidia.com>
>> Tested-by: Ricardo Salveti de Araujo<ricardo.salveti@canonical.com>
>> Tested-by: Sebastien Jan<s-jan@ti.com>
>> Signed-off-by: Bryan Wu<bryan.wu@canonical.com>
>> ---
>>   mm/bounce.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/bounce.c b/mm/bounce.c
>> index 13b6dad..1481de6 100644
>> --- a/mm/bounce.c
>> +++ b/mm/bounce.c
>> @@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
>>                */
>>               vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
>>
>> -             flush_dcache_page(tovec->bv_page);
>>               bounce_copy_vec(tovec, vfrom);
>> +             flush_dcache_page(tovec->bv_page);
>>       }
>>   }
>>
>
> As this was so enthusiastically endorsed by upstream I've applied this
> to ti-omap4 and have also requested a pre-stable pull request for
> Maverick master.
>

Yep. <stable@kernel.org> is actually Cc'ed in the original patch, so this
definitely applies to the stable. Possibly to both lucid and maverick.

The merged commit in Linus' tree is:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ac8456d6f9a3011c824176bd6084d39e5f70a382

> applied to ti-omap4
>
> --
> Tim Gardner tim.gardner@canonical.com
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
diff mbox

Patch

diff --git a/mm/bounce.c b/mm/bounce.c
index 13b6dad..1481de6 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -116,8 +116,8 @@  static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
 		 */
 		vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
 
-		flush_dcache_page(tovec->bv_page);
 		bounce_copy_vec(tovec, vfrom);
+		flush_dcache_page(tovec->bv_page);
 	}
 }