From patchwork Wed Jun 29 14:00:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 928482 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5TDsqnE012487 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Jun 2011 13:55:20 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbvE1-0000eq-13; Wed, 29 Jun 2011 13:54:41 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QbvE0-000775-Kx; Wed, 29 Jun 2011 13:54:40 +0000 Received: from am1ehsobe004.messaging.microsoft.com ([213.199.154.207] helo=AM1EHSOBE004.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbvDx-00076S-4v; Wed, 29 Jun 2011 13:54:38 +0000 Received: from mail81-am1-R.bigfish.com (10.3.201.245) by AM1EHSOBE004.bigfish.com (10.3.204.24) with Microsoft SMTP Server id 14.1.225.22; Wed, 29 Jun 2011 13:54:34 +0000 Received: from mail81-am1 (localhost.localdomain [127.0.0.1]) by mail81-am1-R.bigfish.com (Postfix) with ESMTP id 4731D5C00CF; Wed, 29 Jun 2011 13:54:34 +0000 (UTC) X-SpamScore: -9 X-BigFish: VS-9(zz1432N98dKzz1202hzz8275dhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail81-am1 (localhost.localdomain [127.0.0.1]) by mail81-am1 (MessageSwitch) id 1309355674110974_9202; Wed, 29 Jun 2011 13:54:34 +0000 (UTC) Received: from AM1EHSMHS010.bigfish.com (unknown [10.3.201.243]) by mail81-am1.bigfish.com (Postfix) with ESMTP id 157ED1330050; Wed, 29 Jun 2011 13:54:34 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS010.bigfish.com (10.3.207.110) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 29 Jun 2011 13:54:32 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Wed, 29 Jun 2011 08:54:31 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p5TDsRs9029072; Wed, 29 Jun 2011 08:54:28 -0500 (CDT) Date: Wed, 29 Jun 2011 22:00:39 +0800 From: Shawn Guo To: Wolfram Sang Subject: Re: [PATCH v7 1/3] MTD : add the common code for GPMI-NFC controller driver Message-ID: <20110629140038.GB25931@S2100-06.ap.freescale.net> References: <1309335878-16678-1-git-send-email-b32955@freescale.com> <1309335878-16678-2-git-send-email-b32955@freescale.com> <20110629100658.GE1992@pengutronix.de> <20110629103337.GF1992@pengutronix.de> <4E0B0296.6060902@freescale.com> <20110629122942.GH1992@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110629122942.GH1992@pengutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110629_095437_470645_0A956020 X-CRM114-Status: GOOD ( 20.60 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.207 listed in list.dnswl.org] Cc: dedekind1@gmail.com, thierry.nolf.barco@gmail.com, Huang Shijie , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, LW@KARO-electronics.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Jun 2011 13:58:08 +0000 (UTC) On Wed, Jun 29, 2011 at 02:29:42PM +0200, Wolfram Sang wrote: > > > > Still, the problem exists: When a second channel GPMI channel is > > > requested, dmaengine will return -EBUSY, because the DMAIRQ is already > > > taken. > > > > > Yes, we should change the DMA code, it is a DMA bug. > > I ever submitted a patch about the issue: > > http://patchwork.ozlabs.org/patch/87145/ > > That approach was rejected because it would register the same handler > n-times where one time would do. Your other approach puts too much > mach-specific details into the driver IMO and probably won't scale very > well. Maybe we should add something to the private dma_data (like flags > indicating SHARED) and then do some refcounting? > I would suggest leave this gpmi specific quirk to gpmi driver to sort out. With the following mxs-dma change, it should work if gpmi driver can pass the valid gpmi irq number for only one gpmi channel, and -1 for all others. diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 88aad4f..ea27002 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -327,10 +327,12 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) memset(mxs_chan->ccw, 0, PAGE_SIZE); - ret = request_irq(mxs_chan->chan_irq, mxs_dma_int_handler, - 0, "mxs-dma", mxs_dma); - if (ret) - goto err_irq; + if (mxs_chan->chan_irq >= 0) { + ret = request_irq(mxs_chan->chan_irq, mxs_dma_int_handler, + 0, "mxs-dma", mxs_dma); + if (ret) + goto err_irq; + } ret = clk_enable(mxs_dma->clk); if (ret)