From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1429732AbdDYMS7 (ORCPT ); Tue, 25 Apr 2017 08:18:59 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:30928 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1429548AbdDYMSu (ORCPT ); Tue, 25 Apr 2017 08:18:50 -0400 Subject: Re: [PATCH v2 2/2] spi: spi-ti-qspi: Use bounce buffer if read buffer is not DMA'ble To: Mark Brown References: <20170411115225.31709-1-vigneshr@ti.com> <20170411115225.31709-3-vigneshr@ti.com> <20170421170655.dpyxlwipfwnwjjwy@sirena.org.uk> CC: , , From: Vignesh R Message-ID: <3955ad22-28a2-5222-4ae3-aa34dc69cde6@ti.com> Date: Tue, 25 Apr 2017 17:48:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170421170655.dpyxlwipfwnwjjwy@sirena.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 21 April 2017 10:36 PM, Mark Brown wrote: > On Tue, Apr 11, 2017 at 05:22:25PM +0530, Vignesh R wrote: >> Flash filesystems like JFFS2, UBIFS and MTD block layer can provide >> vmalloc'd or kmap'd buffers that cannot be mapped using dma_map_sg() and >> can potentially be in memory region above 32bit addressable region(ie >> buffers belonging to memory region backed by LPAE) of DMA, implement >> spi_flash_can_dma() interface to inform SPI core not to map such >> buffers. > > I'll apply this since it fixes bugs for your systems but it feels like > something that we should be moving further into the core since LPAE > isn't specific to your devices. We should ideally have something > (possibly in the DMA mapping code even) which does the remapping without > the driver needing to know about it. > I agree, there is a need to have generic remapping code. Also, I guess, once UBIFS is moved to use kmalloc'd buffers SPI flash devices will not have to worry much about vmalloc'd buffers. -- Regards Vignesh