From: Matt Porter <mporter@ti.com>
To: Vinod Koul <vkoul@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Linux DaVinci Kernel List
<davinci-linux-open-source@linux.davincidsp.com>,
vinod.koul@intel.com, Linux MMC List <linux-mmc@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Dan Williams <djbw@fb.com>, Chris Ball <cjb@laptop.org>
Subject: Re: [RFC PATCH 1/3] dmaengine: add dma_get_channel_caps()
Date: Wed, 9 Jan 2013 20:59:56 -0500 [thread overview]
Message-ID: <20130110015956.GA12220@beef> (raw)
In-Reply-To: <1351048407.5263.10.camel@vkoul-udesk3>
On Wed, Oct 24, 2012 at 08:43:27AM +0530, Vinod Koul wrote:
> On Tue, 2012-10-23 at 23:49 +0100, Grant Likely wrote:
> > > +enum dmaengine_apis {
> > > + DMAENGINE_MEMCPY = 0x0001,
> > > + DMAENGINE_XOR = 0x0002,
> > > + DMAENGINE_XOR_VAL = 0x0004,
> > > + DMAENGINE_PQ = 0x0008,
> > > + DMAENGINE_PQ_VAL = 0x0010,
> > > + DMAENGINE_MEMSET = 0x0020,
> > > + DMAENGINE_SLAVE = 0x0040,
> > > + DMAENGINE_CYCLIC = 0x0080,
> > > + DMAENGINE_INTERLEAVED = 0x0100,
> > > + DMAENGINE_SG = 0x0200,
> > > +};
> >
> > Actually, one more comment. Why the new enum? Why can't the
> > dma_transaction_type enum be used directly along with dma_cap_mask_t?
> Some of the capabilities above are not there in dma_caps_t like DMA_SG.
> Also DMA_INTERRUPT and DMA_PRIVATE would not make much sense here.
>
> BUT would help to keep things simpler if have one definition which
> includes all.
All good points. I think we can best eliminate this redundant set of
enums by using dma_cap_mask_t and noting in a comment as follows:
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 0181887..9add5ca 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -391,14 +391,15 @@ enum dmaengine_apis {
* a) APIs/ops supported
* b) channel physical capabilities
*
- * @ops: or'ed api capability
+ * @cap_mask: api/ops capability (DMA_INTERRUPT and DMA_PRIVATE
+ * are invalid api/ops and will never be set)
* @seg_nr: maximum number of SG segments supported on a SG/SLAVE
* channel (0 for no maximum or not a SG/SLAVE channel)
* @seg_len: maximum length of SG segments supported on a SG/SLAVE
* channel (0 for no maximum or not a SG/SLAVE channel)
*/
struct dmaengine_chan_caps {
- enum dmaengine_apis ops;
+ dma_cap_mask_t cap_mask;
int seg_nr;
int seg_len;
};
If that sounds good I'll send an updated series with this change.
-Matt
next prev parent reply other threads:[~2013-01-10 1:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 2:51 [RFC PATCH 0/3] dmaengine: add per channel capabilities api Matt Porter
2012-10-19 2:51 ` [RFC PATCH 1/3] dmaengine: add dma_get_channel_caps() Matt Porter
2012-10-23 22:38 ` Grant Likely
2012-10-23 22:49 ` Grant Likely
2012-10-24 3:13 ` Vinod Koul
2013-01-10 1:59 ` Matt Porter [this message]
2012-10-23 22:54 ` Dan Williams
2012-10-24 3:09 ` Vinod Koul
2012-10-19 2:51 ` [RFC PATCH 2/3] dma: edma: add device_channel_caps() support Matt Porter
2012-10-19 2:51 ` [RFC PATCH 3/3] mmc: davinci: get SG segment limits with dma_get_channel_caps() Matt Porter
2012-10-23 22:41 ` Grant Likely
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=20130110015956.GA12220@beef \
--to=mporter@ti.com \
--cc=cjb@laptop.org \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=djbw@fb.com \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=vinod.koul@intel.com \
--cc=vkoul@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 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).