All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix page addr in tcmu_flush_dcache_range
@ 2017-11-18  9:14 tang.wenji
  2017-11-20 20:16 ` Mike Christie
  0 siblings, 1 reply; 2+ messages in thread
From: tang.wenji @ 2017-11-18  9:14 UTC (permalink / raw)
  To: target-devel

From: tangwenji <tang.wenji@zte.com.cn>

The page addr should be update.

Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
---
 drivers/target/target_core_user.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 942d0942..82dc246 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -470,12 +470,13 @@ static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd)
 static inline void tcmu_flush_dcache_range(void *vaddr, size_t size)
 {
 	unsigned long offset = offset_in_page(vaddr);
+	void *start = vaddr - offset;
 
 	size = round_up(size+offset, PAGE_SIZE);
-	vaddr -= offset;
 
 	while (size) {
-		flush_dcache_page(virt_to_page(vaddr));
+		flush_dcache_page(virt_to_page(start));
+		start += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
 }
-- 
2.8.1.windows.1


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

* Re: [PATCH] fix page addr in tcmu_flush_dcache_range
  2017-11-18  9:14 [PATCH] fix page addr in tcmu_flush_dcache_range tang.wenji
@ 2017-11-20 20:16 ` Mike Christie
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2017-11-20 20:16 UTC (permalink / raw)
  To: target-devel

On 11/18/2017 03:14 AM, tang.wenji@zte.com.cn wrote:
> From: tangwenji <tang.wenji@zte.com.cn>
> 
> The page addr should be update.
> 
> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
>  drivers/target/target_core_user.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 942d0942..82dc246 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -470,12 +470,13 @@ static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd)
>  static inline void tcmu_flush_dcache_range(void *vaddr, size_t size)
>  {
>  	unsigned long offset = offset_in_page(vaddr);
> +	void *start = vaddr - offset;
>  
>  	size = round_up(size+offset, PAGE_SIZE);
> -	vaddr -= offset;
>  
>  	while (size) {
> -		flush_dcache_page(virt_to_page(vaddr));
> +		flush_dcache_page(virt_to_page(start));
> +		start += PAGE_SIZE;
>  		size -= PAGE_SIZE;
>  	}
>  }
> 

Reviewed-by: Mike Christie <mchristi@redhat.com>

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

end of thread, other threads:[~2017-11-20 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-18  9:14 [PATCH] fix page addr in tcmu_flush_dcache_range tang.wenji
2017-11-20 20:16 ` Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.