From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752931AbcHLOIp (ORCPT ); Fri, 12 Aug 2016 10:08:45 -0400 Received: from mga01.intel.com ([192.55.52.88]:3499 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752772AbcHLOIn (ORCPT ); Fri, 12 Aug 2016 10:08:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,510,1464678000"; d="scan'208";a="154820081" Message-ID: <1471010908.4887.100.camel@linux.intel.com> Subject: Re: Wrong "nollp" DW DMAC parameter value on ARC SDP. From: Andy Shevchenko To: Eugeniy Paltsev Cc: "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "viresh.kumar@linaro.org" , "Nelson.Pereira@synopsys.com" , "vinod.koul@intel.com" , "linux-snps-arc@lists.infradead.org" Date: Fri, 12 Aug 2016 17:08:28 +0300 In-Reply-To: <1471008972.21247.40.camel@synopsys.com> References: <1470988994.21247.33.camel@synopsys.com> <1470999584.4887.94.camel@linux.intel.com> <1471008972.21247.40.camel@synopsys.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.4-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-08-12 at 13:36 +0000, Eugeniy Paltsev wrote: > On Fri, 2016-08-12 at 13:59 +0300, Andy Shevchenko wrote: > > > > On Fri, 2016-08-12 at 08:03 +0000, Eugeniy Paltsev wrote: > > > > > > > > > Hi, > > > > > > "nollp" parameter defines if DW DMAC channel supports multi block > > > transfer or not. > > > > > > It is calculated in runtime, but differently depending on on > > > availability of pdata. If pdata is absent "nollp" is calculated > > > using > > > autoconfig hardware registers. Otherwise "nollp" is calculated > > > using > > > the next code construction: > > > channel_writel(dwc, LLP, DWC_LLP_LOC(0xffffffff)); > > > dwc->nollp = DWC_LLP_LOC(channel_readl(dwc, LLP)) == 0; > > > channel_writel(dwc, LLP, 0); > > > > > > I realized that these methods give different results. > > > For example on ARC AXS101 SDP in case of using autoconfig "nollp" > > > was > > > calculated as "true" (and DMAC works fine),  > > > otherwise "nollp" was calculated as "false" (and DMAC doesn't > > > work). > > Can you show out what the value you read back? > > channel_readl(dwc, LLP) return 0xfffffffc Nice. Oh, forgot to ask, what are the DW_PARAMS and DWC_PARAMS[x] are on the same hardware? I assume we are talking about that one which has no hardware LLP support. > > > So I'm wondering how the code in question really works? > > > From DW AHB DMAC databook I wasn't able to find anything relevant > > > to > > > this tricky implementation. Could you please clarify a little but > > > what > > > happens here? > > "Table 4-1: > > ... > > Hardcode Channel x LLP register to 0? > > ... > > Description: If set to 1, hardcodes channel x Linked List Pointer > > register to 0 (LLPx.LOC == 0), ..." So, any comment on this one? I suppose you may have an access to some internal Synopsys documentation which might shed a light. Or maybe I missed something else which should be considered. > > > Maybe we should add "nollp" field in pdata structure and receive > > > it > > > from pdata/device tree (like we use "is_private" or "is_memcpu" > > > fields) > > Yeah, perhaps we can remove that trick since we need this flag to be > > set > > on Intel Quark which might have the same issue as your case [1]. > > > > [1] http://www.spinics.net/lists/linux-serial/msg22948.html > > > > In which tree I can find this patch applied, so I may base my work on > it? The series is under review. I'm preparing v10, so, I would like to re- make this patch with regarding to your input. For now I would prefer just to remove the trick, but I still wonder what the circumstances are to bring it not working. -- Andy Shevchenko Intel Finland Oy