Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751693AbcDREBp (ORCPT ); Mon, 18 Apr 2016 00:01:45 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:47921 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbcDREBn (ORCPT ); Mon, 18 Apr 2016 00:01:43 -0400 Date: Mon, 18 Apr 2016 00:00:39 -0400 (EDT) Message-Id: <20160418.000039.1946438541182822213.davem@davemloft.net> To: okaya@codeaurora.org Cc: linux-rdma@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, yishaih@mellanox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion From: David Miller In-Reply-To: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> References: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 17 Apr 2016 21:01:42 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 584 Lines: 16 From: Sinan Kaya Date: Sat, 16 Apr 2016 18:23:32 -0400 > Current code is assuming that the address returned by dma_alloc_coherent > is a logical address. This is not true on ARM/ARM64 systems. This patch > replaces dma_alloc_coherent with dma_map_page API. The address returned > can later by virtually mapped from the CPU side with vmap API. > > Signed-off-by: Sinan Kaya You can't do this. The DMA map page API gives non-coherent mappings, and thus requires proper flushing. So a straight conversion like this is never legitimate.