From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759448AbcHED2i (ORCPT ); Thu, 4 Aug 2016 23:28:38 -0400 Received: from mga03.intel.com ([134.134.136.65]:27306 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753834AbcHED2g (ORCPT ); Thu, 4 Aug 2016 23:28:36 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,472,1464678000"; d="scan'208";a="1035458606" Date: Fri, 5 Aug 2016 09:06:10 +0530 From: Vinod Koul To: John Stultz Cc: lkml , Andy Green , Zhangfei Gao , Jingoo Han , Krzysztof Kozlowski , Maxime Ripard , Dan Williams , Mark Brown , Andy Green Subject: Re: [PATCH 1/7] k3dma: Fix hisi burst clipping Message-ID: <20160805033610.GK9681@localhost> References: <1469073189-9167-1-git-send-email-john.stultz@linaro.org> <1469073189-9167-2-git-send-email-john.stultz@linaro.org> <20160724072509.GC9681@localhost> <20160804130833.GI9681@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Thu, Aug 04, 2016 at 10:36:32AM -0700, John Stultz wrote: > On Thu, Aug 4, 2016 at 6:08 AM, Vinod Koul wrote: > > On Fri, Jul 29, 2016 at 03:40:46PM -0700, John Stultz wrote: > >> On Sun, Jul 24, 2016 at 12:25 AM, Vinod Koul wrote: > >> > On Wed, Jul 20, 2016 at 08:53:03PM -0700, John Stultz wrote: > >> >> From: Andy Green > >> >> > >> >> Max burst len is a 4-bit field, but at the moment it's clipped with > >> >> a 5-bit constant... reduce it to that which can be expressed > >> > > >> > Maybe we should GENMASK() etc to avoid these errors.. > >> > >> Not sure I follow what you're thinking here... can you clarify a bit? > > > > I am assuming the 4bit field was a mistake by orignal author. Using GENMASK, > > BIT etc macro helps you to avoid those as one would look at datasheet and > > say this is specfied as bit 5 thru 9, so let me say GENMASK(5, 0) rather > > than a typo which missed 5th bit. > > > > But ofcourse if the error was due to some other reason then this one doesnt > > help. > > It was more that in taking the cfg->src/dst_maxburst value and setting > it as a value that can be represented in 4 bits for the hardware: > if ((maxburst == 0) || (maxburst > 16)) > val = 16; > else > val = maxburst - 1; > > However, the logic error is trying to set the value to 16 if maxburst > is larger then 16, when 16 is 5 bits, when 15 is the largest value we > can express in 4 bits. > > So I'm not sure how GENMASK() would be particularly useful (I guess > using val = GENMASK(4,0) instead of val = 15?). But I'm not sure that > makes the code any clearer. Looks like this was latter case, so it doesnt seem to help here -- ~Vinod