Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452609 > unrolled thread

Re: [PATCH 1/7] k3dma: Fix hisi burst clipping

Started byJohn Stultz <john.stultz@linaro.org>
First post2016-07-30 00:50 +0200
Last post2016-08-05 05:30 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/7] k3dma: Fix hisi burst clipping John Stultz <john.stultz@linaro.org> - 2016-07-30 00:50 +0200
    Re: [PATCH 1/7] k3dma: Fix hisi burst clipping Vinod Koul <vinod.koul@intel.com> - 2016-08-04 15:10 +0200
      Re: [PATCH 1/7] k3dma: Fix hisi burst clipping John Stultz <john.stultz@linaro.org> - 2016-08-04 19:40 +0200
        Re: [PATCH 1/7] k3dma: Fix hisi burst clipping Vinod Koul <vinod.koul@intel.com> - 2016-08-05 05:30 +0200

#1452609 — Re: [PATCH 1/7] k3dma: Fix hisi burst clipping

FromJohn Stultz <john.stultz@linaro.org>
Date2016-07-30 00:50 +0200
SubjectRe: [PATCH 1/7] k3dma: Fix hisi burst clipping
Message-ID<s0oLo-2v7-9@gated-at.bofh.it>
On Sun, Jul 24, 2016 at 12:25 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> On Wed, Jul 20, 2016 at 08:53:03PM -0700, John Stultz wrote:
>> From: Andy Green <andy.green@linaro.org>
>>
>> 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?

thanks
-john

[toc] | [next] | [standalone]


#1456393

FromVinod Koul <vinod.koul@intel.com>
Date2016-08-04 15:10 +0200
Message-ID<s2qzn-166-17@gated-at.bofh.it>
In reply to#1452609
On Fri, Jul 29, 2016 at 03:40:46PM -0700, John Stultz wrote:
> On Sun, Jul 24, 2016 at 12:25 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> > On Wed, Jul 20, 2016 at 08:53:03PM -0700, John Stultz wrote:
> >> From: Andy Green <andy.green@linaro.org>
> >>
> >> 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.

-- 
~Vinod

[toc] | [prev] | [next] | [standalone]


#1456604

FromJohn Stultz <john.stultz@linaro.org>
Date2016-08-04 19:40 +0200
Message-ID<s2uMF-45c-7@gated-at.bofh.it>
In reply to#1456393
On Thu, Aug 4, 2016 at 6:08 AM, Vinod Koul <vinod.koul@intel.com> 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 <vinod.koul@intel.com> wrote:
>> > On Wed, Jul 20, 2016 at 08:53:03PM -0700, John Stultz wrote:
>> >> From: Andy Green <andy.green@linaro.org>
>> >>
>> >> 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.

thanks
-john

[toc] | [prev] | [next] | [standalone]


#1456862

FromVinod Koul <vinod.koul@intel.com>
Date2016-08-05 05:30 +0200
Message-ID<s2DZD-26z-7@gated-at.bofh.it>
In reply to#1456604
On Thu, Aug 04, 2016 at 10:36:32AM -0700, John Stultz wrote:
> On Thu, Aug 4, 2016 at 6:08 AM, Vinod Koul <vinod.koul@intel.com> 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 <vinod.koul@intel.com> wrote:
> >> > On Wed, Jul 20, 2016 at 08:53:03PM -0700, John Stultz wrote:
> >> >> From: Andy Green <andy.green@linaro.org>
> >> >>
> >> >> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web