From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffWiG-0007sT-C0 for linux-mtd@lists.infradead.org; Tue, 17 Jul 2018 20:36:49 +0000 Date: Tue, 17 Jul 2018 22:36:36 +0200 From: Boris Brezillon To: Arnd Bergmann Cc: Miquel Raynal , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Abhishek Sahu , Archit Taneja , Masahiro Yamada , linux-mtd , Linux Kernel Mailing List Subject: Re: [PATCH] nand: ranw: qcom_nand: stop using phys_to_dma() Message-ID: <20180717223636.125d5563@bbrezillon> In-Reply-To: References: <20180711122709.358159-1-arnd@arndb.de> <20180711150449.4152333c@bbrezillon> <20180717220136.2782fc5d@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 17 Jul 2018 22:29:58 +0200 Arnd Bergmann wrote: > On Tue, Jul 17, 2018 at 10:01 PM, Boris Brezillon > wrote: > > Hi Arnd, > > > > On Wed, 11 Jul 2018 16:26:31 +0200 > > Arnd Bergmann wrote: > > > >> On Wed, Jul 11, 2018 at 3:04 PM, Boris Brezillon > >> wrote: > >> > On Wed, 11 Jul 2018 14:26:58 +0200 > >> > Arnd Bergmann wrote: > >> > > >> >> Compile-testing this driver on x86 caused a link error: > >> >> > >> >> ERROR: "__phys_to_dma" [drivers/mtd/nand/raw/qcom_nandc.ko] undefined! > >> >> > >> >> The problem here is that the driver attempts to convert the physical > >> >> address into the DMA controller as a dma_addr_t and calls phys_to_dma() > >> >> to do the conversion. > >> >> > >> >> However, there is no generic way to convert a phys_addr_t into a dma_addr_t > >> >> for anything other than RAM (which should use the dma-mapping API instead). > >> >> The only correct use of phys_to_dma() instead is inside of the dma-mapping > >> >> implementation. > >> > > >> > Should we use dma_map_resource() to do the phys_addr_t to dma_addr_t > >> > conversion? > >> > >> I had not seen that interface before, but yes, that does seem like the best > >> way to do it here. > > > > Do you plan to send a new version using dma_map_resource()? > > I somehow thought you were going to do that yourself, but have now > posted a new version of the patch the way you suggested. I tend not to do that, unless I'm explicitly asked to :-). > > > BTW, there's typo in the subject prefix (s/ranw/rawnand/). > > Hmm, missed that again in v2. Can you fix it up when applying? Sure.