All of lore.kernel.org
 help / color / mirror / Atom feed
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: [v1,2/2] dmaengine: dw: implement per-channel protection control setting
Date: Mon, 5 Nov 2018 16:27:41 +0200	[thread overview]
Message-ID: <20181105142741.GI10650@smile.fi.intel.com> (raw)

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.

Also, it's possible to use (though better to check) dwc->chan.chan_id, though I
dunno if it's reliable.

WARNING: multiple messages have this Message-ID (diff)
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 16:27:41 +0200	[thread overview]
Message-ID: <20181105142741.GI10650@smile.fi.intel.com> (raw)
In-Reply-To: <20181105142254.GG10650@smile.fi.intel.com>

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.

Also, it's possible to use (though better to check) dwc->chan.chan_id, though I
dunno if it's reliable.

-- 
With Best Regards,
Andy Shevchenko

             reply	other threads:[~2018-11-05 14:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 14:27 Andy Shevchenko [this message]
2018-11-05 14:27 ` [PATCH v1 2/2] dmaengine: dw: implement per-channel protection control setting Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2018-11-06 18:36 [v1,1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Christian Lamparter
2018-11-06 18:36 ` [PATCH v1 1/2] " Christian Lamparter
2018-11-05 23:06 [v1,1/2] " Rob Herring
2018-11-05 23:06 ` [PATCH v1 1/2] " Rob Herring
2018-11-05 16:23 [v1,2/2] dmaengine: dw: implement per-channel protection control setting Andy Shevchenko
2018-11-05 16:23 ` [PATCH v1 2/2] " Andy Shevchenko
2018-11-05 16:06 [v1,2/2] " Christian Lamparter
2018-11-05 16:06 ` [PATCH v1 2/2] " Christian Lamparter
2018-11-05 14:23 [v1,1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Andy Shevchenko
2018-11-05 14:23 ` [PATCH v1 1/2] " Andy Shevchenko
2018-11-05 14:22 [v1,2/2] dmaengine: dw: implement per-channel protection control setting Andy Shevchenko
2018-11-05 14:22 ` [PATCH v1 2/2] " Andy Shevchenko
2018-11-04 17:01 [v1,2/2] " Christian Lamparter
2018-11-04 17:01 ` [PATCH v1 2/2] " Christian Lamparter
2018-11-04 17:01 [v1,1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Christian Lamparter
2018-11-04 17:01 ` [PATCH v1 1/2] " 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=20181105142741.GI10650@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.