lkml.org 
[lkml]   [2020]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: vmxnet3: avoid accessing the data mapped to streaming DMA
From
Date


On 2020/8/4 6:59, David Miller wrote:
> From: Jia-Ju Bai <baijiaju@tsinghua.edu.cn>
> Date: Sun, 2 Aug 2020 21:11:07 +0800
>
>> In vmxnet3_probe_device(), "adapter" is mapped to streaming DMA:
>> adapter->adapter_pa = dma_map_single(..., adapter, ...);
>>
>> Then "adapter" is accessed at many places in this function.
>>
>> Theses accesses may cause data inconsistency between CPU cache and
>> hardware.
>>
>> To fix this problem, dma_map_single() is called after these accesses.
>>
>> Signed-off-by: Jia-Ju Bai <baijiaju@tsinghua.edu.cn>
> 'adapter' is accessed everywhere, in the entire driver, not just here
> in the probe function.

Okay, replacing dma_map_single() with dma_alloc_coherent() may be better.
If you think this solution is okay, I can submit a new patch.


Best wishes,
Jia-Ju Bai

\
 
 \ /
  Last update: 2020-08-04 04:19    [W:0.047 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site