Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966292AbbD2OOX (ORCPT ); Wed, 29 Apr 2015 10:14:23 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38688 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966230AbbD2OOT (ORCPT ); Wed, 29 Apr 2015 10:14:19 -0400 Message-ID: <5540E71E.2050200@dev.mellanox.co.il> Date: Wed, 29 Apr 2015 17:13:50 +0300 From: Ido Shamay User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 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(). References: <1428361229-31542-1-git-send-email-ddaney.cavm@gmail.com> <55243362.5040207@dev.mellanox.co.il> <552AE4A4.30005@dev.mellanox.co.il> In-Reply-To: <552AE4A4.30005@dev.mellanox.co.il> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1430 Lines: 37 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 >>> >>> 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 > Thanks David, this is good for us Hi David, Are you resending this patch or you want us to do that? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/