lkml.org 
[lkml]   [2015]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent().

On 4/13/2015 12:33 AM, Ido Shamay wrote:
> On 4/7/2015 10:43 PM, Ido Shamay wrote:
>> On 4/7/2015 2:00 AM, David Daney wrote:
>>> From: David Daney <david.daney@cavium.com>
>>>
>>> The dma_alloc_coherent() function returns a virtual address which can
>>> be used for coherent access to the underlying memory. On some
>>> architectures, like arm64, undefined behavior results if this memory is
>>> also accessed via virtual mappings that are not coherent. Because of
>>> their undefined nature, operations like virt_to_page() return garbage
>>> when passed virtual addresses obtained from dma_alloc_coherent(). Any
>>> subsequent mappings via vmap() of the garbage page values are unusable
>>> and result in bad things like bus errors (synchronous aborts in ARM64
>>> speak).
>>>
>>> The MLX4 driver contains code that does the equivalent of:
>>>
>>> vmap(virt_to_page(dma_alloc_coherent))
>>>
>>> This results in an OOPs when the device is opened.
>>>
>>> To fix this...
>>>
>>> Always use result of dma_alloc_coherent() directly.
> Acked-by: Ido Shamay <idos@mellanox.com>
> Thanks David, this is good for us

Hi David,

Are you resending this patch or you want us to do that?



\
 
 \ /
  Last update: 2015-04-29 16:41    [W:0.156 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site