From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343Ab2IDGiu (ORCPT ); Tue, 4 Sep 2012 02:38:50 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:62745 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172Ab2IDGis (ORCPT ); Tue, 4 Sep 2012 02:38:48 -0400 MIME-Version: 1.0 In-Reply-To: <5044AB51.3040106@yahoo.es> References: <50439D44.3080100@yahoo.es> <5044AB51.3040106@yahoo.es> Date: Tue, 4 Sep 2012 09:38:47 +0300 Message-ID: Subject: Re: [PATCH v4 2/3] dw_dmac: max_mem_width limits value for SRC/DST_TR_WID register From: Andy Shevchenko To: Hein Tibosch Cc: Viresh Kumar , Andrew Morton , Hans-Christian Egtvedt , Arnd Bergmann , spear-devel , Linux Kernel Mailing List , "ludovic.desroches" , Havard Skinnemoen , Nicolas Ferre Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 3, 2012 at 4:06 PM, Hein Tibosch wrote: > 1. The first draft of the patches worked with the max allowable value for > the SRC_WIDTH & DST_WIDTH fields: 0,1,2,3... Viresh thought it was not > transparent enough, he suggested to make it simpler with a binary choice of > 32- or 64-bits, defaulting to 64-bits. > But Andy is right: there are versions supporting 256-bit wide memory transfers. > I'd also go for this previous solution and use: "min(max_mem_width, width)" > > The only problem is that one doesn't want to change arch code for other > platforms (ARM) so I proposed: let "max_mem_width=0" mean: leave it up to > the driver, for now 3 : 64-bits. Sounds better to support all possible options without any additional layer of conversion, isn't it? > 2. In another version I made 'max_mem_width' a member of 'dw_dma_platform_data' > because I also see it as 'constant' for all dma slaves. > But the dw_dmac controller can be used for multiple (types of) memories > and in that case, maybe a limit per slave might be desirable? My knowledge > of DMA-hardware doesn't reach far enough to judge that. As Viresh told early that will not cover memory-to-memory transfers. > I'd say: for now let it become a member of 'dw_dma_platform_data' because > it's the max value of a register field. I support such choice. > 3. Felipe Balbi: why don't we ask the DW IP for its maximum allowed value of > SRC_WIDTH & DST_WIDTH (on the memory side)? Sure, would be elegant! It's not so simple, unfortunately. > Alternatively, we could do a small dma-memcpy-test at start-up and try all > values from 5 (or 7) down to 2. The first value that works correctly will be > used as the maximum. Oh, it might be good idea to get this value in case neither IP nor platform data provides it. I'm pretty sure the platform device driver has to know this beforehand. -- With Best Regards, Andy Shevchenko