netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daney, David" <David.Daney@caviumnetworks.com>
To: Ido Shamay <idos@dev.mellanox.co.il>,
	David Daney <ddaney.cavm@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Cc: Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	"Hal Rosenstock" <hal.rosenstock@gmail.com>,
	Amir Vadai <amirv@mellanox.com>,
	"Or Gerlitz" <ogerlitz@mellanox.com>,
	Yishai Hadas <yishaih@mellanox.com>,
	"Matan Barak" <matanb@mellanox.com>,
	Majd Dibbiny <majd@mellanox.com>,
	"Jack Morgenstein" <jackm@dev.mellanox.co.il>,
	Moni Shoua <monis@mellanox.com>,
	Eugenia Emantayev <eugenia@mellanox.co.il>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Yuval Atias <yuvala@mellanox.com>,
	Maor Gottlieb <maorg@mellanox.com>,
	David Daney <david.daney@cavium.com>
Subject: RE: [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent().
Date: Thu, 30 Apr 2015 00:07:05 +0000	[thread overview]
Message-ID: <BN3PR0701MB1719B826CB12B1C6FD9E00989AD60@BN3PR0701MB1719.namprd07.prod.outlook.com> (raw)
In-Reply-To: <5540E71E.2050200@dev.mellanox.co.il>

First of all, let me apologize for top posting, but it is currently my only option.

I have been away from my office for the last couple of weeks, I was going to re-send on Monday, May 4.  If you would like to do it before then, please go ahead and do that.

Thanks,
David Daney

-----Original Message-----
From: Ido Shamay [mailto:idos@dev.mellanox.co.il] 
Sent: Wednesday, April 29, 2015 7:14 AM
To: David Daney; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org; David S. Miller
Cc: Roland Dreier; Sean Hefty; Hal Rosenstock; Amir Vadai; Or Gerlitz; Yishai Hadas; Matan Barak; Majd Dibbiny; Jack Morgenstein; Moni Shoua; Eugenia Emantayev; Saeed Mahameed; Yuval Atias; Maor Gottlieb; David Daney
Subject: Re: [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?

      reply	other threads:[~2015-04-30  0:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 23:00 [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent() David Daney
2015-04-07 19:43 ` Ido Shamay
2015-04-12 21:33   ` Ido Shamay
2015-04-29 14:13     ` Ido Shamay
2015-04-30  0:07       ` Daney, David [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN3PR0701MB1719B826CB12B1C6FD9E00989AD60@BN3PR0701MB1719.namprd07.prod.outlook.com \
    --to=david.daney@caviumnetworks.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=eugenia@mellanox.co.il \
    --cc=hal.rosenstock@gmail.com \
    --cc=idos@dev.mellanox.co.il \
    --cc=jackm@dev.mellanox.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=majd@mellanox.com \
    --cc=maorg@mellanox.com \
    --cc=matanb@mellanox.com \
    --cc=monis@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=roland@kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=sean.hefty@intel.com \
    --cc=yishaih@mellanox.com \
    --cc=yuvala@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).