Received: by 10.192.165.148 with SMTP id m20csp405412imm; Wed, 2 May 2018 02:18:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpT7PZ0djKSSW66rI7z8yzP7/stDN5pRaRIjbW9y/+6w9Snuva8uQVMgWB9G/kuUxwBrIn9 X-Received: by 2002:a63:5f4f:: with SMTP id t76-v6mr15513684pgb.108.1525252716076; Wed, 02 May 2018 02:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525252716; cv=none; d=google.com; s=arc-20160816; b=v4ViGjIyeIPjbO9KSX94fSaP7mwOsSBpt1TSi2H9Qij1Bul9lpRXF8nEPbPoFLOPmJ q9pure7hcatzAsMgBISrEJIxFBD4vYyUA2SX3wlzxqUzkxw3nqpIoNfIeuVcd1iizFhx TapoR+8z7TLVf+YTtxfOJ0WbeKRvRCCdIqActFE7EChi3ywZ0M/iZoVc1AYn4KiBhHvz Nh7iY6bnXs+5/wpczpVHmqFkFYEphLQmDpBd2wFXvbT+HqpaDB7gWn/URLlDyYX8a4vi sjjG6MM+fzEGP1yWxgnLtJumb0rP6nYkDhyi3CJpki2SIaPeVtzSdvq5v+K5MbmjBNeK qn2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=3iWQqXRPmJL9m1JYLfrhktVmBZm6GTFcUhLdc4JoLXQ=; b=OmF4jj/I50Z009BO7c2JKMpxRx+sG210QoZ2qrHmLX0MC/w4KXmckcC0OdXW/72hGR hTgqJ7OB89ZgySDTvh3/ucJDBGlrgo9+vvOGRPoUgi/k/gvXjFxI7hRsUFvDMt7w5ztD CffeEVpc60s6/EPPUoN6VsrUp8dUBs0Lfq3aols7gJcwd7Y/4is/NqtDtJM0AU3vnGAz AAJxiXy9zehjT/APGytvXPfUgZzcdUYHOMdDf8w1yGsuWEpW3GVwVRZpxPOV0Ey8R5bW 9v4NWmPgSPiUQKznmLESVfXsgSUuSUKu0B7YTHjL9w2MKfZeBDIRKqNq6NM4JUQecaHS GArA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si11088986plo.20.2018.05.02.02.18.21; Wed, 02 May 2018 02:18:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751174AbeEBJQu (ORCPT + 99 others); Wed, 2 May 2018 05:16:50 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42108 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbeEBJQr (ORCPT ); Wed, 2 May 2018 05:16:47 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9B8D3207DA; Wed, 2 May 2018 11:16:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 52614207CC; Wed, 2 May 2018 11:16:35 +0200 (CEST) Date: Wed, 2 May 2018 11:16:35 +0200 From: Boris Brezillon To: Ladislav Michl Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Boris Brezillon , Peter Ujfalusi , Roger Quadros , Aaro Koskinen , Tony Lindgren , "H. Nikolaus Schaller" , Andreas Kemnade Subject: Re: [PATCH v2] mtd: onenand: omap2: Disable DMA for HIGHMEM buffers Message-ID: <20180502111635.689397fc@bbrezillon> In-Reply-To: <20180502080636.GA2124@lenoch> References: <20180416065256.GA24455@lenoch> <20180420220134.3021860f@bbrezillon> <20180502080636.GA2124@lenoch> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 May 2018 10:06:36 +0200 Ladislav Michl wrote: > Hi Boris, > > (and apologies for delay) > > On Fri, Apr 20, 2018 at 10:01:34PM +0200, Boris Brezillon wrote: > > Hi Ladislav, > > > > On Mon, 16 Apr 2018 08:52:59 +0200 > > Ladislav Michl wrote: > > > > > dma_map_single doesn't get the proper DMA address for vmalloced area, > > > > That's not true, it returns the right DMA (physical) address, it's just > > that: > > To be honest I used log message from commit dcf08227e964 which is dealing > with the same issue. Okay, looks like I was wrong. The problem is caused by the virt_to_page() call done in dma_map_single_attrs() which expects a valid virtual address (one that is present in the identity mapping). If you pass a vmalloc address to it, the conversion is broken and that's probably why you end up with a NULL pointer exception. Maybe you should just say that dma_map_single() does not work for vmalloc-ed buffers instead of saying that it does not get the right DMA address.