From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Christian Lamparter <chunkeey@gmail.com>
Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>,
Vinod Koul <vkoul@kernel.org>, Viresh Kumar <vireshk@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH v1 2/2] dmaengine: dw: implement per-channel protection control setting
Date: Mon, 5 Nov 2018 18:23:30 +0200 [thread overview]
Message-ID: <20181105162330.GP10650@smile.fi.intel.com> (raw)
In-Reply-To: <25273848.Yt2vXhTyVK@debian64>
On Mon, Nov 05, 2018 at 05:06:20PM +0100, Christian Lamparter wrote:
> On Monday, November 5, 2018 3:27:41 PM CET Andy Shevchenko wrote:
> > On Mon, Nov 05, 2018 at 04:22:54PM +0200, Andy Shevchenko wrote:
> > > On Sun, Nov 04, 2018 at 06:01:39PM +0100, Christian Lamparter wrote:
> >
> > > > + struct dw_dma *dw = to_dw_dma(dwc->chan.device);
> > > > + size_t chanidx = (size_t)(dwc - dw->chan);
> > >
> > > We have mask field, so, index is a first set bit out of mask, __ffs(mask).
> > >
> > > unsigned int protctl = dw->pdata->protctl[__ffs(mask)];
> >
> > dwc->mask, of course.
> Ok, will do. I'll sent a v2 later this week.
>
> > Also, it's possible to use (though better to check) dwc->chan.chan_id,
> > though I dunno if it's reliable.
> dwc->chan.chan_id is subjected to the chan_allocation setting.
> So, if it's set to CHAN_ALLOCATION_DESCENDING the dt prop array values
> for the protctl would need to be reversed as well in order to match the
> other per-channel settings (for example multiblock).
> So, let's not do that since this gets very confusing.
Yes, that's what I suspected. So, __ffs(dwc->mask) seems feasible approach.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2018-11-05 16:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 17:01 [PATCH v1 1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Christian Lamparter
2018-11-04 17:01 ` [PATCH v1 2/2] dmaengine: dw: implement per-channel protection control setting Christian Lamparter
2018-11-05 14:22 ` Andy Shevchenko
2018-11-05 14:27 ` Andy Shevchenko
2018-11-05 16:06 ` Christian Lamparter
2018-11-05 16:23 ` Andy Shevchenko [this message]
2018-11-05 14:23 ` [PATCH v1 1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Andy Shevchenko
2018-11-05 23:06 ` Rob Herring
2018-11-06 18:36 ` Christian Lamparter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181105162330.GP10650@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=chunkeey@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=vireshk@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).