From: andriy.shevchenko@linux.intel.com (Andy Shevchenko)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH] dmaengine: DW DMAC: split pdata to hardware properties and platform quirks
Date: Fri, 21 Oct 2016 22:00:49 +0300 [thread overview]
Message-ID: <1477076449.6423.14.camel@linux.intel.com> (raw)
In-Reply-To: <1476969404.2882.26.camel@synopsys.com>
On Thu, 2016-10-20@13:16 +0000, Eugeniy Paltsev wrote:
> On Thu, 2016-10-20@13:48 +0300, Andy Shevchenko wrote:
> > On Thu, 2016-09-15@16:14 +0300, Eugeniy Paltsev wrote:
> > >
> > > This patch is to address a proposal by Andy in this thread:
> > > http://www.spinics.net/lists/dmaengine/msg10754.html
> > > Split platform data to actual hardware properties, and platform
> > > quirks.
> > > Now we able to use quirks and hardware properties separately from
> > > different sources (pdata, device tree or autoconfig registers)
> > - if (!chip->pdata) {
> > > + if ((!chip->pdata) ||
> > > + ???(chip->pdata && test_bit(QUIRKS_ONLY_USED, &chip-
> > > > pdata-
> >
> > I don't think you need atomic test / set of those bits.
>
> I don't need?atomic bit operations here, I just used standard bit API
> to make code more clear.
I gave more thoughts to that and I think we would leave boolean
variables in platform data. It would be cleaner for users how they
defined quirks. Besides that any additional quirk or modification of the
existing one will produce simple and readable change.
>
> > > + ?*/
> > > + if (!chip->pdata) {
> > > + set_bit(QUIRKS_IS_PRIVATE, &pdata-
> > > > quirks);
> > >
> > > + set_bit(QUIRKS_IS_MEMCPY, &pdata-
> > > >quirks);
> > > + set_bit(QUIRKS_IS_NOLLP, &pdata->quirks);
>>> + } else {
> > > + pdata->quirks = chip->pdata->quirks;
> > > + }
Ditto.
> > > @@ -1569,7 +1576,7 @@ int dw_dma_probe(struct dw_dma_chip *chip)
> > > ? (dwc_params >> DWC_PARAMS_MBLK_EN
> > > &
> > > 0x1) == 0;
> > > ? } else {
> > > ? dwc->block_size = pdata->block_size;
> > > - dwc->nollp = pdata->is_nollp;
> > > + dwc->nollp = test_bit(QUIRKS_IS_NOLLP,
> > > &pdata->quirks);
> >
> > Perhaps you need another patch which actually moves nollp to dwc-
> > > flags.
>
> As I can see, we already have?DW_DMA_IS_SOFT_LLP flag in "dwc->flags"
> with same functionality, which is set if "dwc->nollp" is true.
> Probably
> we can use this flag and get rid of "dwc->nollp".
> But I'm a bit confused why we clear DW_DMA_IS_SOFT_LLP bit in
> "dwc_scan_descriptors" and "dwc_terminate_all" functions.
> Any ideas about that?
Sounds like a plan. I think you are right, the property quite unlikely
can be changed run-time (though I have one patch regarding Braswell and
CherryView platforms that have a chicken bit to enable / disable the
feature). So, please, get rid of an additional boolean field.
--
Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Intel Finland Oy
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"vireshk@kernel.org" <vireshk@kernel.org>,
"vinod.koul@intel.com" <vinod.koul@intel.com>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: DW DMAC: split pdata to hardware properties and platform quirks
Date: Fri, 21 Oct 2016 22:00:49 +0300 [thread overview]
Message-ID: <1477076449.6423.14.camel@linux.intel.com> (raw)
In-Reply-To: <1476969404.2882.26.camel@synopsys.com>
On Thu, 2016-10-20 at 13:16 +0000, Eugeniy Paltsev wrote:
> On Thu, 2016-10-20 at 13:48 +0300, Andy Shevchenko wrote:
> > On Thu, 2016-09-15 at 16:14 +0300, Eugeniy Paltsev wrote:
> > >
> > > This patch is to address a proposal by Andy in this thread:
> > > http://www.spinics.net/lists/dmaengine/msg10754.html
> > > Split platform data to actual hardware properties, and platform
> > > quirks.
> > > Now we able to use quirks and hardware properties separately from
> > > different sources (pdata, device tree or autoconfig registers)
> > - if (!chip->pdata) {
> > > + if ((!chip->pdata) ||
> > > + (chip->pdata && test_bit(QUIRKS_ONLY_USED, &chip-
> > > > pdata-
> >
> > I don't think you need atomic test / set of those bits.
>
> I don't need atomic bit operations here, I just used standard bit API
> to make code more clear.
I gave more thoughts to that and I think we would leave boolean
variables in platform data. It would be cleaner for users how they
defined quirks. Besides that any additional quirk or modification of the
existing one will produce simple and readable change.
>
> > > + */
> > > + if (!chip->pdata) {
> > > + set_bit(QUIRKS_IS_PRIVATE, &pdata-
> > > > quirks);
> > >
> > > + set_bit(QUIRKS_IS_MEMCPY, &pdata-
> > > >quirks);
> > > + set_bit(QUIRKS_IS_NOLLP, &pdata->quirks);
>>> + } else {
> > > + pdata->quirks = chip->pdata->quirks;
> > > + }
Ditto.
> > > @@ -1569,7 +1576,7 @@ int dw_dma_probe(struct dw_dma_chip *chip)
> > > (dwc_params >> DWC_PARAMS_MBLK_EN
> > > &
> > > 0x1) == 0;
> > > } else {
> > > dwc->block_size = pdata->block_size;
> > > - dwc->nollp = pdata->is_nollp;
> > > + dwc->nollp = test_bit(QUIRKS_IS_NOLLP,
> > > &pdata->quirks);
> >
> > Perhaps you need another patch which actually moves nollp to dwc-
> > > flags.
>
> As I can see, we already have DW_DMA_IS_SOFT_LLP flag in "dwc->flags"
> with same functionality, which is set if "dwc->nollp" is true.
> Probably
> we can use this flag and get rid of "dwc->nollp".
> But I'm a bit confused why we clear DW_DMA_IS_SOFT_LLP bit in
> "dwc_scan_descriptors" and "dwc_terminate_all" functions.
> Any ideas about that?
Sounds like a plan. I think you are right, the property quite unlikely
can be changed run-time (though I have one patch regarding Braswell and
CherryView platforms that have a chicken bit to enable / disable the
feature). So, please, get rid of an additional boolean field.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2016-10-21 19:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 13:14 [PATCH] dmaengine: DW DMAC: split pdata to hardware properties and platform quirks Eugeniy Paltsev
2016-09-15 13:14 ` Eugeniy Paltsev
2016-09-15 15:04 ` kbuild test robot
2016-09-15 15:04 ` kbuild test robot
2016-10-05 15:14 ` Eugeniy Paltsev
2016-10-05 15:14 ` Eugeniy Paltsev
2016-10-07 11:05 ` Andy Shevchenko
2016-10-07 11:05 ` Andy Shevchenko
2016-10-19 11:43 ` Eugeniy Paltsev
2016-10-19 11:43 ` Eugeniy Paltsev
2016-10-20 10:48 ` Andy Shevchenko
2016-10-20 10:48 ` Andy Shevchenko
2016-10-20 13:16 ` Eugeniy Paltsev
2016-10-20 13:16 ` Eugeniy Paltsev
2016-10-21 19:00 ` Andy Shevchenko [this message]
2016-10-21 19:00 ` Andy Shevchenko
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=1477076449.6423.14.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-snps-arc@lists.infradead.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.