login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2009
»
April
»
1
Re: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Hans-Christian Egtvedt
Subject:
Re: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
Date: Tuesday, March 31, 2009 - 10:10 pm
On Tue, 31 Mar 2009 15:03:07 +0100 "Sosnowski, Maciej" <maciej.sosnowski@intel.com> wrote:
quoted text
> Hans-Christian Egtvedt wrote: > > This patch adds a cyclic DMA interface to the DW DMA driver. This is > > very useful if you want to use the DMA controller in combination > > with a sound device which uses cyclic buffers. > > > > Using a DMA channel for cyclic DMA will disable the possibility to > > use it as a normal DMA engine until the user calls the cyclic free > > function on the DMA channel. Also a cyclic DMA list can not be > > prepared if the channel is already active. > > > > Signed-off-by: Hans-Christian Egtvedt > > <hans-christian.egtvedt@atmel.com> --- > > drivers/dma/dw_dmac.c | 303 > > +++++++++++++++++++++++++++++++++++++++++++- > > drivers/dma/dw_dmac_regs.h | 7 +- include/linux/dw_dmac.h > > | 19 +++ 3 files changed, 327 insertions(+), 2 deletions(-) > > > > The patch looks good to me. >
Thanks
quoted text
> Just a few remarks below: > > > + for (i = 0; i < dwc->cdesc->periods; i++) > > + dwc_dump_lli(dwc, > > &dwc->cdesc->desc[i]->lli); + > > + return; > > + } > > +} > > This return is not needed >
Agreed, will fixup.
quoted text
> > +void dw_dma_cyclic_stop(struct dma_chan *chan) > > +{ > > + struct dw_dma_chan *dwc = to_dw_dma_chan(chan); > > + struct dw_dma *dw = > > to_dw_dma(dwc->chan.device); + > > + channel_clear_bit(dw, CH_EN, dwc->mask); > > + while (dma_readl(dw, CH_EN) & dwc->mask) > > + cpu_relax(); > > +} > > Don't you need locks in dw_dma_cyclic_stop? >
Hmmm, I'll look into this.
quoted text
> > + was_cyclic = test_and_set_bit(DW_DMA_IS_CYCLIC, > > &dwc->flags); > > + if (was_cyclic) { > > + spin_unlock_bh(&dwc->lock); > > + dev_dbg(chan2dev(&dwc->chan), > > + "channel already prepared for > > cyclic DMA\n"); > > + return ERR_PTR(-EBUSY); > > + } > > + spin_unlock_bh(&dwc->lock); > > In this case both spin_unlock_bh() could be replaced by single one > called before "if (was_cyclic)": >
Ah yes, will fixup.
quoted text
> + was_cyclic = test_and_set_bit(DW_DMA_IS_CYCLIC, &dwc->flags); > + spin_unlock_bh(&dwc->lock); > + if (was_cyclic) { > + dev_dbg(chan2dev(&dwc->chan), > + "channel already prepared for cyclic > DMA\n"); > + return ERR_PTR(-EBUSY); > + } >
-- Best regards, Hans-Christian Egtvedt --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/2] dw_dmac: set CAP_PRIVATE capability for DW DMA ...
, Hans-Christian Egtvedt
, (Tue Mar 24, 4:35 am)
[PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Hans-Christian Egtvedt
, (Tue Mar 24, 4:35 am)
RE: [PATCH 1/2] dw_dmac: set CAP_PRIVATE capability for DW ...
, Sosnowski, Maciej
, (Tue Mar 31, 7:01 am)
RE: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Sosnowski, Maciej
, (Tue Mar 31, 7:02 am)
RE: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Sosnowski, Maciej
, (Tue Mar 31, 7:03 am)
Re: [PATCH 1/2] dw_dmac: set CAP_PRIVATE capability for DW ...
, Hans-Christian Egtvedt
, (Tue Mar 31, 10:04 pm)
Re: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Hans-Christian Egtvedt
, (Tue Mar 31, 10:10 pm)
Re: [PATCH 1/2] dw_dmac: set CAP_PRIVATE capability for DW ...
, Dan Williams
, (Tue Mar 31, 10:30 pm)
Re: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Haavard Skinnemoen
, (Wed Apr 1, 1:28 am)
Re: [PATCH 1/2] dw_dmac: set CAP_PRIVATE capability for DW ...
, Hans-Christian Egtvedt
, (Wed Apr 1, 1:33 am)
Re: [PATCH 2/2] dw_dmac: add cyclic API to DW DMA driver
, Hans-Christian Egtvedt
, (Wed Apr 1, 2:11 am)
[PATCH v2 1/1] dw_dmac: add cyclic API to DW DMA driver
, Hans-Christian Egtvedt
, (Wed Apr 1, 6:28 am)
Re: [PATCH v2 1/1] dw_dmac: add cyclic API to DW DMA driver
, Haavard Skinnemoen
, (Wed Apr 1, 6:39 am)
[PATCH v3 1/1] dw_dmac: add cyclic API to DW DMA driver
, Hans-Christian Egtvedt
, (Wed Apr 1, 6:47 am)
Re: [PATCH v3 1/1] dw_dmac: add cyclic API to DW DMA driver
, Haavard Skinnemoen
, (Wed Apr 1, 6:52 am)
RE: [PATCH v3 1/1] dw_dmac: add cyclic API to DW DMA driver
, Sosnowski, Maciej
, (Wed Apr 1, 8:08 am)
Re: [PATCH v3 1/1] dw_dmac: add cyclic API to DW DMA driver
, Dan Williams
, (Wed Apr 1, 3:46 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
<