From: Viresh Kumar <viresh.kumar@st.com>
To: <vinod.koul@intel.com>, <dan.j.williams@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <armando.visconti@st.com>,
<shiraz.hashim@st.com>, Viresh Kumar <viresh.kumar@st.com>
Subject: [PATCH V2 resend 2/7] dmaengine/dw_dmac: Enable resubmission from callback routine.
Date: Tue, 26 Apr 2011 11:08:10 +0530 [thread overview]
Message-ID: <80d88f1c48496acbb6caa9628ec2854c3a44effc.1303796005.git.viresh.kumar@st.com> (raw)
In-Reply-To: <cover.1303796005.git.viresh.kumar@st.com>
Resubmission of new transfer must be allowed from callbacks. For this release
lock before calling callback routine and enable them again.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
drivers/dma/dw_dmac.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 4f4df9f..dbe8203 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -197,8 +197,8 @@ static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first)
static void
dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc)
{
- dma_async_tx_callback callback;
- void *param;
+ dma_async_tx_callback callback = NULL;
+ void *param = NULL;
struct dma_async_tx_descriptor *txd = &desc->txd;
struct dw_desc *child;
@@ -238,12 +238,10 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc)
}
}
- /*
- * The API requires that no submissions are done from a
- * callback, so we don't need to drop the lock here
- */
+ spin_unlock_irqrestore(&dwc->lock, dw->flags);
if (callback)
callback(param);
+ spin_lock_irqsave(&dwc->lock, dw->flags);
}
static void dwc_complete_all(struct dw_dma *dw, struct dw_dma_chan *dwc)
--
1.7.2.2
next prev parent reply other threads:[~2011-04-26 5:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 5:38 [PATCH V2 resend 0/7] dmaengine/dw_dmac updates Viresh Kumar
2011-04-26 5:38 ` [PATCH V2 resend 1/7] dmaengine/dw_dmac: Replace spin_lock_bh with irqsave variants Viresh Kumar
2011-04-26 5:38 ` Viresh Kumar [this message]
2011-04-26 5:38 ` [PATCH V2 resend 3/7] dmaengine/dw_dmac: call dwc_descriptor_complete from dwc_control with lock held Viresh Kumar
2011-04-26 5:38 ` [PATCH V2 resend 4/7] dmaengine/dw_dmac: don't call callback routine in case dmaengine_terminate_all() is called Viresh Kumar
2011-04-26 5:38 ` [PATCH V2 resend 5/7] dmaengine/dw_dmac: set residue as total len in dwc_tx_status if status is !DMA_SUCCESS Viresh Kumar
2011-04-26 5:38 ` [PATCH V2 resend 6/7] dmaengine/dw_dmac: Divide one sg to many desc, if sg len is greater than DWC_MAX_COUNT Viresh Kumar
2011-04-26 5:38 ` [PATCH V2 resend 7/7] dmaengine/dw_dmac: implement pause and resume in dwc_control Viresh Kumar
2011-04-26 6:07 ` [PATCH V2 resend 0/7] dmaengine/dw_dmac updates Koul, Vinod
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=80d88f1c48496acbb6caa9628ec2854c3a44effc.1303796005.git.viresh.kumar@st.com \
--to=viresh.kumar@st.com \
--cc=armando.visconti@st.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shiraz.hashim@st.com \
--cc=vinod.koul@intel.com \
/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
all inboxes | Powered by JetHome®