Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765348AbcLWJVV (ORCPT ); Fri, 23 Dec 2016 04:21:21 -0500 Received: from mail-co1nam03on0061.outbound.protection.outlook.com ([104.47.40.61]:13605 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1764425AbcLWJVC (ORCPT ); Fri, 23 Dec 2016 04:21:02 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Appana Durga Kedareswara Rao To: Laurent Pinchart CC: "dan.j.williams@intel.com" , "vinod.koul@intel.com" , "michal.simek@xilinx.com" , Soren Brinkmann , "moritz.fischer@ettus.com" , "luis@debethencourt.com" , "Jose.Abreu@synopsys.com" , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3] dmaengine: xilinx_dma: Check for channel idle state before submitting dma descriptor Thread-Topic: [PATCH 1/3] dmaengine: xilinx_dma: Check for channel idle state before submitting dma descriptor Thread-Index: AQHSVuWKMv099oZq9EGvoV87jhWJ2KEKMEmAgAMg2sCAAbLoAIAGH0Pg Date: Fri, 23 Dec 2016 08:49:07 +0000 Message-ID: References: <1481814682-31780-1-git-send-email-appanad@xilinx.com> <5248247.n0rV8xBPrZ@avalon> <2156938.MvgiZll4tB@avalon> In-Reply-To: <2156938.MvgiZll4tB@avalon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.94.175] Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22778.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(24454002)(51914003)(81166006)(33656002)(55846006)(54356999)(23726003)(6116002)(3846002)(102836003)(4326007)(229853002)(50986999)(189998001)(8676002)(38730400001)(76176999)(47776003)(2906002)(81156014)(2920100001)(46406003)(63266004)(106466001)(106116001)(8746002)(92566002)(7736002)(305945005)(356003)(5660300001)(626004)(6916009)(97756001)(110136003)(2900100001)(93886004)(2950100002)(50466002)(8936002)(5250100002)(7696004)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0201MB1080;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT027;1:PbU4hNjy0GpGAn/IWUwm7Ok5a5AOaxvSm4Gg9fSo4rgiEUn1ArTbZVGt8+3tIxvU2rOBJJW/vgoCjQRF7+tdch86KLOazSInvPTSWQSuxElv6caENa699qXw0JSSIvhqte6kKU+OtwZKkoZRI4+guEeBii6WAfhLelXNvYiwHVBS6fCPraMClWrkORZKkP6rtTlZM005jwoaIGMDJwOVhQ646EU/zI94vjpuuE+To8MuFaHl4lTOeVaoWp+13GN6fqrNdoXnm17vj0UTYvC4TtOIqo/5+V7rSIxNuRgf20pqnfGHOWQssn0GJ98eiKyk8DT8a6DoLxeWsqV46E/9H4nUk2X7bBK96TtSwsboCe/2dHPkS8AEpe08ft9BvNZsxlosqYMfMlqIsXdKEdxWJOcoKW55+lytGsds04M1/VG8Cz+tQ1ucQt3tPa1DwBEzmyO+bb6eATiabhHOSMMIMXQ8ZEhx5apCVWWsec6lKPVG0jRA/AeC4ttRu3K/s7JO9K5hxr41jvirRZgz2X2+VD8KYl9lTgUW3F9SI9Qh1KPk/SddlHI1QUsxFjRgc8mVQ9PmgPupP+2ElFjtvyKr/Q086NqoPD40F3zQOLDzG2D2dLoyiPnv+NlH80Pm/s+H7zHmf14byspmmHt6T85m8g== X-MS-Office365-Filtering-Correlation-Id: bb31c57c-a629-4350-5b17-08d42b10929a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002);SRVR:BY1PR0201MB1080; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0201MB1080;3:UvuI6tWUv3Jts6qIMjcAHVprvZlJjcnx8a19DYMV7fiLKXrJzY+obJiA8u+xGzDvMWBBltIXut4KDjNS72nsO6i4ACR1D/NItCVQgc7pzxYXmmGEoL11+Rcqzh5qm/uDNta5iG9yEF91kO2/wOlfZOISuDMA9tXJwvsGEOMfPX1BaGw/v2LcjpayOGArJiMyaM3Ag54xipaToe0IB7d8GrrhGe9JXPm8Y+O4a4088Eem1X9sf27zrErX8nXyMs/DUbPK0ZEB+KyhvIMSeiUW9EuKpENCMq1YU+4+8MTxcL9ON1+AkGBYR0wElYkJv56SymfoEXyoPoNyDDJHNv6scnWA/Ku/CzoA8IDM3G9Cdz0ZmW40wTfAq2MbugcjnZude/DNCXta0fj51C+uP3L4Yw== X-Microsoft-Exchange-Diagnostics: 1;BY1PR0201MB1080;25:bxbgtMD8OJEATI0USE00NwAinoiuK9H0TQ/lOU1E3ys09tDjehV4s0SH3tTioie2tXz3Xe3+it/+mnRA/4vrEoOmUkon0cC0aT6ORjXVHPUV5rp2u4nSreTatxmUkuWW63KIDDqcIafoGbDS5bpSRb8lnMly7MnHhxkZEWgV8AFc+J5CiYtsRXq9o9IiuSFlqMBhRT0LES/h8P5w8FIQhiJ/OfcfZxGd0UODfH9xc3LTQOrMdV3boB+f+1JwgJsycTqv0PheurYfNSoGfjEplfCN7Hp5rWOs0WgqvSMbzyLPrHar7pojqQiMroZhyYtE5wJCXUPp2OQpMbv6Rb7lCd+l2dueJN3Mu6/TX1I7tjduyKfZ7EXJXciISLTMwmrXRCjQ2n8mfMUqov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bmQc/S+Vh3cX1U6yT2PIrmtpyN0ZWlZydw+lvqk3cJwWdg+8T7FeznUdUX9l5bymqDarVJes/Xy3I+O8OlXKXxVsmlDSpsDUQecIalacu4M2CNjVeFAFvl/7ve12rgjhkqbTAjY+Mzli0iBCCTyIbtLj4bukVnCU5mvuIQOhnPVsMr9k83Cl6K8yy6qtZyX+Nz7fFPrYicO49r3HrKWdLJq6ZZiht/A3dr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(13023025)(13017025)(13024025)(13018025)(5005006)(8121501046)(13015025)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(6042181);SRVR:BY1PR0201MB1080;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB1080; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0201MB1080;4:/VVWuMlXhk05m6SOnXv/V9HnI929zAPXXKEeUYo6hGCCzieHOv6dnetnEmCrR6QI42I6B6meu7hXW82eTEbLqy++eh91HMKwPWfpPfxU0dI7C2jZHrLRX7zJBpkr2zKfUiR+WXIuKbrgY8zZCyCtkpipzmpd3vPTypPa8O3/N87yngMZWbZcwgGnsj6EbAHHF+L/tRzwY8nUJ9HLwdO8wyPhWWkIzsA8sloGGSmofxv50TUPhtl6HDzw0gFaBQgxcU6Eb1ej/p7TroRjgcxsdZGJvrkhGwo6RGU/YZtMoXOgT/BL6UOFAmWg8I+vUFVmTgEoz9lSkLb5rGCnWQU1FbsjbQEjebc2psAHx765dQhv44Mp7dS0Hoh9wrrp7bWbmemvtcRkiwDN6UXKYUaOfCGWD/8hRHgl/NP+J/CIibOTQaEu6YChSSijg9aX3VTSybAcVsqE9PxOcld8hhrpimc6dhpVfEWa4EiaFs5yJDlVIFnLtLuW4ZQg+fwlexOyOU6jGJ0hoOnptDwmDzk4jPk1RECyEbvDdC6VIPQOP+rYF18zdzUhNgds8Z3imqBzV05ku0NyGXcnoVOEv1dcae4/VsUcd82KUuP1GQ5Y+jEaDATyu9h+jARc2DcHMVI/x3CBRsSIgAj60Etr1kxmhzE4QDpHs7Cgr1/5ioR9X+KG5x7Z1VWlfTqfUcMMudOOm3mtvYeO42bUgAl9sDEorQ== X-Forefront-PRVS: 016572D96D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR0201MB1080;23:JVLN4+gUPHEkB53u0bTePwmYk5WE1hXhkQuIMIc?= =?us-ascii?Q?Ps2B2WKvGSgCjBTYcKhhJoO6E+VJ4PMSVGIdlWOssqMaNpMwaDIr6ZY06Cra?= =?us-ascii?Q?sJHdOZASA6qkd2EP2pHniYo7tUX0VJ9kkh3GpbAXFQi37qHM9kwOYs6Eupm0?= =?us-ascii?Q?wkezv8KBPA5vg1KhgS+c1T9sI/rHV2Yk6G1AwORDPcUo6WMlLxGdjbzNFiyi?= =?us-ascii?Q?k1YcStqage6m11s9vcqfVnormGec3VL+mN+Z8thDKAjqRBGJwpip/HlnDD28?= =?us-ascii?Q?nEB8KGFI+2d096TO7BjQ5MmO60f/5xuu03e1iWIbb0UsI+kh2FA+Qisa6ZzX?= =?us-ascii?Q?dSo0h/XVEKI6ac3ThivBz0UnIiNv3O21AK7iAIhmBzNgMl9A+M/nPHw/Vs92?= =?us-ascii?Q?LmH0zF46ZdtkCoPxPkizDUyOJNZCXxWDPXdphXoUWeal1jJW1bC/LijdWjKg?= =?us-ascii?Q?NldkE9DLx24Y8D/HtbKu/VNoV0YyAtZueeZyu9MTk+2H6b1on1BrwXaC7ZuY?= =?us-ascii?Q?NeecZBRM3/qNTNxGV+bzM3kfVyxLOrLk+5AqkSS4jt3lhGZbqJ7JHLlIDTOP?= =?us-ascii?Q?lH2JrSKi9MQOyilbCRHKobY37e2WQMWVKD0xgFimYXxmm+reqBbSs3j/gEp0?= =?us-ascii?Q?C6J4vfdfxY6n567M+vUpdAo9KqVfS9K4uUoCZKwO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GoWafn6BvTshitvG+dcaJQnWHw/k+pJNPTEJFblWUg1BCYvj91NUdZFe3yERTuc+a72ZEzLxY0uaQzRHEuA==;5:TyYxDm845oH4GdSpczPGMIfy+5nyXaEDLlIE8xCvIju5vNtWGHJkdvMxy+b495KTVz5QTX8IPVaw4ZIuD3azTpFBJBrI0mFsND/nSRxzu8G+83qe8dng6lPSt8cvK2Ipu0ekLv7EVffl25BMPj4PQm+57oTQiRoVCxmruPggm3s=;24:DB8xQjJbdzVNoON2CkSRFrTLhAP/m0V6832mBE98a65Pz23JVB8HCVqF8hMPKSAoEyWx6TgLMS+W+zfac74/0iJ1taX3zn152FcXqH+FGc4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY1PR0201MB1080;7:tjt3l2+OvLKyERCikrYJexh2ccU+AYmsot/slkZBdF2zJ2ZqxyBcmgEHGTFt5r9V7toX+ISAefwFY+TuRJa0F3PnmbIC1mwlj/9f+/dQCCn1I6s4J22MnWttxLXWKWg/8QrOIcbntdaS0GK0a5/f0y9RBxnHLljkd5Swki/LRdEyjusH7grqFcefdXHvCldTbRieUXfTaEaEP54rJ1IxiNxMs2EIlLnPLfcdCsftzjA/a2+of8OCnZW56P3iyAVaLUoY0025PWhvzS7UDEfskGTQgmP96UszxlmGy3J15H6ZyXGje9mOg8w0pnaAgw27euJswRhKl0hU2RkFNgXHnytM+ckscuEa0K+ht91h76vxsfIqWQVaeB00blU/eX9mEB8QtCaHLtHrNikMokWJ0F8SZ+rio2fzd6V4BCiGEsKox9l1vPHDZqS4YjD3Nkpd/Tk60bRFo4x0AONOv1A/sw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2016 08:49:14.1080 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0201MB1080 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uBN9LRor004877 Content-Length: 1792 Lines: 51 Hi Laurent Pinchart, Sorry for the delay in the reply. Thanks for the review... > > Hi Kedar, > > On Monday 19 Dec 2016 15:39:43 Appana Durga Kedareswara Rao wrote: > > Hi Laurent Pinchart, > > > > Thanks for the review... > > > > > > + if (!chan->idle) > > > > + return; > > > > > > Don't you need to perform the same check for the DMA and CDMA channels > ? > > > If so, shouldn't this be moved to common code ? > > > > Will fix it in v2... > > > > > There's another problem (not strictly introduced by this patch) I > > > wanted to mention. The append_desc_queue() function, called from > > > your tx_submit handler, appends descriptors to the pending_list. The > > > DMA engine API states that a transfer submitted by tx_submit will > > > not be executed until > > > .issue_pending() is called. However, if a transfer is in progress at > > > tx_submit time, I believe that the IRQ handler, at transfer > > > completion, will start the next transfer from the pending_list even > > > if > > > .issue_pending() hasn't been called for it. > > > > > > > if (list_empty(&chan->pending_list)) > > > > return; > > > > If user submits more than h/w limit then that case only driver will > > process The descriptors from the pending_list for other cases the > > pending_list will be Empty so driver just returns from there. > > I understand that, but that's not the problem. Your .tx_submit() handler calls > append_desc_queue() which adds the tx descriptor to the pending_list. If a > transfer is in progress at that time, I believe the transfer completion IRQ handler > will take the next descriptor from the pending_list and process it, even though > issue_pending() hasn't been called for it. > Thanks for the explanation... Agree will keep this my to-do list... Regards, Kedar.