Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753820AbcCISua (ORCPT ); Wed, 9 Mar 2016 13:50:30 -0500 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33218 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789AbcCISu2 (ORCPT ); Wed, 9 Mar 2016 13:50:28 -0500 Date: Wed, 9 Mar 2016 10:50:24 -0800 From: Brian Norris To: Jiancheng Xue Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, dwmw2@infradead.org, zajec5@gmail.com, boris.brezillon@free-electrons.com, jteki@openedev.com, ezequiel@vanguardiasur.com.ar, juhosg@openwrt.org, shijie.huang@intel.com, mika.westerberg@linux.intel.com, furquan@google.com, han.xu@freescale.com, fabio.estevam@freescale.com, manabian@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, yanhaifeng@hisilicon.com, yanghongwei@hisilicon.com, suwenping@hisilicon.com, raojun@hisilicon.com, ml.yang@hisilicon.com, gaofei@hisilicon.com, zhangzhenxing@hisilicon.com, xuejiancheng@hisilicon.com, Binquan Peng Subject: Re: [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash controller driver Message-ID: <20160309185024.GN55664@google.com> References: <1456474316-24473-1-git-send-email-xuejiancheng@huawei.com> <20160307225229.GC55664@google.com> <56DE9A79.30704@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56DE9A79.30704@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 761 Lines: 20 On Tue, Mar 08, 2016 at 05:25:13PM +0800, Jiancheng Xue wrote: > On 2016/3/8 6:52, Brian Norris wrote: > [...] > >> +static void hisi_spi_nor_dma_transfer(struct spi_nor *nor, u32 start_off, > >> + u32 dma_buf, u32 len, u8 op_type) > > > > Does this controller support 64-bit addresses? What if you see LPAE, or > > an ARM64 CPU? It'd be nice if you don't truncate potentially 64-bit > > dma_buf down to u32. > > > > Brian > > > No, this controller just supports 32-bit addresses. So I think I have to truncate 64-bit dma_buf. :( Then you should handle this proactively. Either some kind of WARN_ON and error condition, or I think dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)) should be able to ensure you get addresses in the appropriate range? Brian