From patchwork Sun Aug 3 17:13:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 4666111 X-Patchwork-Delegate: vinod.koul@intel.com Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 160A6C0338 for ; Sun, 3 Aug 2014 17:13:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2085C201C7 for ; Sun, 3 Aug 2014 17:13:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22409200E8 for ; Sun, 3 Aug 2014 17:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbaHCRNO (ORCPT ); Sun, 3 Aug 2014 13:13:14 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58533 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769AbaHCRNN (ORCPT ); Sun, 3 Aug 2014 13:13:13 -0400 Received: from axis700.grange (xdsl-85-197-61-212.netcologne.de [85.197.61.212]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0Liq3V-1WbtAk49dN-00czBJ; Sun, 03 Aug 2014 19:13:08 +0200 Received: by axis700.grange (Postfix, from userid 1000) id B654040BDB; Sun, 3 Aug 2014 19:13:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id B317F40BD9; Sun, 3 Aug 2014 19:13:07 +0200 (CEST) Date: Sun, 3 Aug 2014 19:13:07 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: dmaengine@vger.kernel.org cc: Vinod Koul , "Shevchenko, Andriy" , devicetree@vger.kernel.org, Grant Likely , Rob Herring , Phil Edworthy , Arnd Bergmann Subject: [PATCH 2/2] dmaengine: nbpfaxi: convert to tasklet In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:eeHiaCt9lBEpf5O2WcyTS36RBWk/xqrZaGFdMqMiJJ4 1jlYvQPULsiVBOjOnOWaDn+LZfrhSWrpfUS4oIvhul5IK385M3 F5pHjxy4UTsuIKriERYVU3zcRQeZ5k/UZlH6MyIX+1siZizASl 2oP1l0YFA78UFOe+Cz1S+h8rvHOkNqjeWPgefGlht9pBr7NObn 75Jlh/+mTog0Ttc/rwl91tjzUCOZ8mrXt/fVQ/tcQ34fiHDBtr zT5CusArDthzZR9IiiUAkx/0/MowyLcE6oq+rZkBo+KGrgx8eD gRmxVWHCrcwmls/gSfq4y8ju6CRBNoJPZg8UxbQeAEDu3pceE9 7TOH/KuQIpx0X9UJeZoX0w4wCfywRNmn1P6HsIjmTXHwQl3KTM HUROGiZCIFCyQ== Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is common among dmaengine drivers to use a tasklet for bottom half interrupt processing. Convert nbpfaxi to do the same. Signed-off-by: Guennadi Liakhovetski --- drivers/dma/nbpfaxi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 5b40ac8..cea6a37 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -197,6 +197,7 @@ struct nbpf_desc_page { */ struct nbpf_channel { struct dma_chan dma_chan; + struct tasklet_struct tasklet; void __iomem *base; struct nbpf_device *nbpf; char name[16]; @@ -1111,9 +1112,9 @@ static struct dma_chan *nbpf_of_xlate(struct of_phandle_args *dma_spec, return dchan; } -static irqreturn_t nbpf_chan_irqt(int irq, void *dev) +static void nbpf_chan_tasklet(unsigned long data) { - struct nbpf_channel *chan = dev; + struct nbpf_channel *chan = (struct nbpf_channel *)data; struct nbpf_desc *desc, *tmp; dma_async_tx_callback callback; void *param; @@ -1176,8 +1177,6 @@ static irqreturn_t nbpf_chan_irqt(int irq, void *dev) if (must_put) nbpf_desc_put(desc); } - - return IRQ_HANDLED; } static irqreturn_t nbpf_chan_irq(int irq, void *dev) @@ -1186,6 +1185,7 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) bool done = nbpf_status_get(chan); struct nbpf_desc *desc; irqreturn_t ret; + bool bh = false; if (!done) return IRQ_NONE; @@ -1200,7 +1200,8 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) ret = IRQ_NONE; goto unlock; } else { - ret = IRQ_WAKE_THREAD; + ret = IRQ_HANDLED; + bh = true; } list_move_tail(&desc->node, &chan->done); @@ -1216,6 +1217,9 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) unlock: spin_unlock(&chan->lock); + if (bh) + tasklet_schedule(&chan->tasklet); + return ret; } @@ -1258,8 +1262,9 @@ static int nbpf_chan_probe(struct nbpf_device *nbpf, int n) snprintf(chan->name, sizeof(chan->name), "nbpf %d", n); - ret = devm_request_threaded_irq(dma_dev->dev, chan->irq, - nbpf_chan_irq, nbpf_chan_irqt, IRQF_SHARED, + tasklet_init(&chan->tasklet, nbpf_chan_tasklet, (unsigned long)chan); + ret = devm_request_irq(dma_dev->dev, chan->irq, + nbpf_chan_irq, IRQF_SHARED, chan->name, chan); if (ret < 0) return ret;