Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756252AbcCUPE6 (ORCPT ); Mon, 21 Mar 2016 11:04:58 -0400 Received: from down.free-electrons.com ([37.187.137.238]:35924 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755468AbcCUPE4 (ORCPT ); Mon, 21 Mar 2016 11:04:56 -0400 Date: Mon, 21 Mar 2016 16:04:43 +0100 From: Boris Brezillon To: Franklin S Cooper Jr Cc: nsekhar@ti.com, dwmw2@infradead.org, computersforpeace@gmail.com, rogerq@ti.com, tony@atomide.com, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 6/7] mtd: nand: omap2: Fix high memory dma prefetch transfer Message-ID: <20160321160443.0a4165d1@bbrezillon> In-Reply-To: <1457654203-20856-7-git-send-email-fcooper@ti.com> References: <1457654203-20856-1-git-send-email-fcooper@ti.com> <1457654203-20856-7-git-send-email-fcooper@ti.com> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 38 Hi Franklin, On Thu, 10 Mar 2016 17:56:42 -0600 Franklin S Cooper Jr wrote: > Based on DMA documentation and testing using high memory buffer when > doing dma transfers can lead to various issues including kernel > panics. I guess it all comes from the vmalloced buffer case, which are not guaranteed to be physically contiguous (one of the DMA requirement, unless you have an iommu). > > To workaround this simply use cpu copy. The amount of high memory > buffers used are very uncommon so no noticeable performance hit should > be seen. Hm, that's not necessarily true. UBI and UBIFS allocate their buffers using vmalloc (vmalloced buffers fall in the high_memory region), and those are likely to be dis-contiguous if you have NANDs with pages > 4k. I recently posted patches to ease sg_table creation from any kind of virtual address [1][2]. Can you try them and let me know if it fixes your problem? Thanks, Boris [1]https://lkml.org/lkml/2016/3/8/276 [2]https://lkml.org/lkml/2016/3/8/277 -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com