Path: csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Yao Yuan Newsgroups: linux.kernel Subject: RE: [PATCH v1 1/5] dma: Add QorIQ qDMA engine driver support Date: Wed, 24 Aug 2016 09:20:02 +0200 Message-ID: References: X-Greylist: delayed 3658 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Aug 2016 03:15:51 EDT Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TO6B+1+rJFQeEQB8idyl1k1MXEJa75ug8spEo+RkNh0=; b=bUz8dQH7wQKaWsO62ptP0jMEi9QbsmV6nH/Edw23etndi/VajM+VvByf4bPfeRA5rwNNTq40l/w53SFG7uAEkkXza6/3/I3Ung09O8WiEwZz8Uw7I3q+KS2OQRnm/xlFvdBOL9qgsN0wR5LCTD2GBw/KbrwQyRjz8hTzLYlcRWM= Thread-Topic: [PATCH v1 1/5] dma: Add QorIQ qDMA engine driver support Thread-Index: AQHR+RzOuyl5MDQIvkeDE5tT439/VqBOcA+AgAkDdyA= Accept-Language: en-US, zh-CN Content-Language: en-US Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yao.yuan@nxp.com; X-Originating-IP: [192.158.241.86] X-Ms-Office365-Filtering-Correlation-ID: 53a970ac-b6a6-41f4-95ec-08d3cbd036b9 X-Microsoft-Exchange-Diagnostics: 1;DB6PR0401MB2408;6:CND9qgLMelWtO8UC1xuSV/6WT4r05y/Fv2SzmKcTnBeYbdmdh2lq1jYMVtgXpVpRwqS1+g6qYfeIaOhHTPwnkH5s3+2KG8wZAZMfaxDQxWLHXGPZyv3EbZtrxKCcQr81f1GN0zFTifGbNEuYH4S1WluARRjHREkPPO95JQv55U05Z2Imjs5mw2NM9kbLn3uTh5hIj1L8fQ+eIChEEYz93JI+OYBFFe9Kk7CXlKFrQCiXr1MeqbMdv1FQI80Pbbt08FDKHeIA3/i/RvzQmKiTPkqhzsor9nkJgDroA2iqvNQxLiNmute1r++4d+j5yVWErL1m4CI+gCG7oeKsQ8iRrA==;5:IbK7FavyRUJDGCzaLbbdWXctxhMcCW6t0KlSk5wyFmj3XCsOwsn74Z3q6CF/XtLbCrTd6ZPoP1ZdfOASueBUUrpycSHb2QgawNctNVku7ndcu6IvcxnRCrQoPVrZmWvIo6i6iYeD7EHJqL/QSaLMYw==;24:Mv21+a3sf5YG8U8T5NJUcQaou+X63KMEL1BfECCwzHI75+Q65XPpQ87k1zbTzMf9iJrDvT6Zqfo9inUyyA4hSg7Xj5Ny/T6M3eqFoM4LaTc=;7:U1+raYYSnVree60RTeRVY/6PBZ5xyMh2W2BfCUeAxL2zhmQ68tVxSp52wZQS74EYIyK4n5bsssnYY6QdvQ9hTVhOf3+0dqnnsDrS0NC5JHqXvKHyrwrbpD3jWngMFOM9Zpu5NrmTv2H6zODGCFBuPJ5eDMJ3ThyPoKF3mSAR5AnH5DH9ElUsAOQErvic7yo6c4gBJXj5+zexLPSS7B4uoZ0bs9kilplzSJTY7Kxb8dXuYlFtCZL14FjMoAGzmjoO X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2408; X-Microsoft-Antispam-Prvs: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-Cfa-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:DB6PR0401MB2408;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0401MB2408; X-Forefront-Prvs: 0044C17179 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(24454002)(377454003)(189002)(10400500002)(2900100001)(8666005)(106116001)(105586002)(77096005)(2950100001)(11100500001)(106356001)(7416002)(5002640100001)(122556002)(2906002)(3280700002)(33656002)(92566002)(97736004)(54356999)(189998001)(551934003)(19580395003)(4326007)(76576001)(3660700001)(66066001)(68736007)(76176999)(5001770100001)(50986999)(5660300001)(74316002)(3846002)(86362001)(102836003)(586003)(305945005)(81166006)(87936001)(101416001)(81156014)(8676002)(6116002)(8936002)(7846002)(7736002)(7696003)(9686002)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0401MB2408;H:DB6PR0401MB2407.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-Spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) Spamdiagnosticoutput: 1:99 Spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Originatororg: nxp.com X-Ms-Exchange-Crosstenant-Originalarrivaltime: 24 Aug 2016 03:39:11.8878 (UTC) X-Ms-Exchange-Crosstenant-Fromentityheader: Hosted X-Ms-Exchange-Crosstenant-ID: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-Ms-Exchange-Transport-Crosstenantheadersstamped: DB6PR0401MB2408 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 29 Organization: linux.* mail to news gateway X-Original-Cc: "vinod.koul@intel.com" , "robh+dt@kernel.org" , "dan.j.williams@intel.com" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , Yang-Leo Li , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-Original-Date: Wed, 24 Aug 2016 03:39:11 +0000 X-Original-Message-ID: X-Original-References: <1471502328-28305-1-git-send-email-yao.yuan@freescale.com> <1471502328-28305-2-git-send-email-yao.yuan@freescale.com> <20160818091603.GT1041@n2100.armlinux.org.uk> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1469128 On Thu, Aug 18, 2016 at 05:16 PM +0800, Russell King wrote: > On Thu, Aug 18, 2016 at 02:38:44PM +0800, Yuan Yao wrote: > > + spin_lock(&fsl_comp->qchan->vchan.lock); > > + if (status =3D=3D DMA_COMPLETE) > > + vchan_cookie_complete(&fsl_comp->vdesc); > > + fsl_comp->qchan->status =3D status; >=20 > This is buggy - if the DMA has finished processing it, even if it finishe= d in error, it > must _complete_ the transaction. Completion is not the same as being > successful - it means that the DMA is no longer processing the cookie. >=20 > The issue here is that when the _following_ transaction completes success= fully, > _this_ transaction will effectively be marked as complete due to the way = the > cookie system works. >=20 > So... to get this straight - "completion" means "I have finished processi= ng this > transaction". It does not mean "I successfully processed this transactio= n > without any errors." >=20 Thanks for your review. So you mean that I should call vchan_cookie_complete no matter whether the = error issue in QDMA? I have some random DMA error test case, it seems work will.