Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756354AbcLSPyF (ORCPT ); Mon, 19 Dec 2016 10:54:05 -0500 Received: from mail-cys01nam02on0074.outbound.protection.outlook.com ([104.47.37.74]:62014 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754589AbcLSPyA (ORCPT ); Mon, 19 Dec 2016 10:54:00 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.83) 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; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:2790;Count:27 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: AQHSVuWKMv099oZq9EGvoV87jhWJ2KEKMEmAgAMg2sA= Date: Mon, 19 Dec 2016 15:39:43 +0000 Message-ID: References: <1481814682-31780-1-git-send-email-appanad@xilinx.com> <1481814682-31780-2-git-send-email-appanad@xilinx.com> <5248247.n0rV8xBPrZ@avalon> In-Reply-To: <5248247.n0rV8xBPrZ@avalon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.229.139] 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-22770.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-IncomingHeaderCount: 27 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39840400002)(39450400003)(39410400002)(39860400002)(39850400002)(2980300002)(438002)(51914003)(199003)(189002)(7736002)(50466002)(356003)(305945005)(8746002)(229853002)(81156014)(3846002)(8936002)(102836003)(5250100002)(6116002)(46406003)(6916009)(2950100002)(110136003)(97756001)(4326007)(189998001)(2900100001)(2920100001)(106116001)(106466001)(47776003)(55846006)(23726003)(50986999)(54356999)(76176999)(2906002)(81166006)(8676002)(7696004)(5660300001)(38730400001)(63266004)(92566002)(626004)(33656002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CO1PR02MB205;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT025;1:gsJmyyKtN7dgJnFrkEyYYj79DQqWrC9OJT6R4uOBa1EJOyJNZFyW7HvHDVEPVYG5066QV5Ru/4a/3UhJGN08MWRRTiW3xTebi16YDenJgtYF3M5Kqtv9CP8bIu+c2uf3FILul4sk+SfjEno2PHOvI4jKXIIbraT11usNX03O4lZI1zWuFK81310V9DTJ/TtotRrAOBpmE8gjwfFszhWzYF1iEn0ckuTUCfxlbeQDRh6Z9p6ETpiHcPqSMYvbcofx4b/snOzEKY6rur7lYmtxKt3iS8q0h4Yl0q9tsyK2Is7gYsgsR0Ff2jJwSGfN1Q1MLJsEORUb0FTEVXjq7G7T8ThRQYWy9aXYb/vEsvH8zmN2tG9W4tQeLmqdTJkWvZHSDAGrsOkSuqutVaxLnjw4ZCysQNaR7AJaB7Y/K7eyYsOnnv/4Uqc4YdY5ONWTu6bdxqz7GKQq3f+y75xmMZPbGV4zdH4EDxzxXpHGcSuEzxtRF/jVfTFdBjnwkL28ic13C0I/aI3acHGaQMBnWlEcn06iRDjtAvXrasmsy5r5+CU3VVFgcoLPHkO8ngDjo/RMkAQGa+UwmeEfBFMlph2eW+Tv9/q30tuBmaQ3LXI0AWOjrivIarO8Ly6wIioIrxgVx5neYX16RB0eVsMiXx4h6Q== X-MS-Office365-Filtering-Correlation-Id: 42682c79-a702-45cf-17df-08d4282543de X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002);SRVR:CO1PR02MB205; X-Microsoft-Exchange-Diagnostics: 1;CO1PR02MB205;3:wzchjtyJ10l1ZhXJLV+Xtca46mWmWsQcLryiZlmp4MHXAcOzkXuufflfLeO1dZd/916FP3eMHls3D5r8AyckhZXpXvpMWYcxM7JtXcOSlGfVRNn4S7+LL3ICxSFBPcv/0aWsn/ukeBGRQ+j5D/D7lKjsdlDQNdw8jHn3RrAsv5e/yLM5E3qbOWEYSo1jhRmaDsJqaIOvypI+4VjPg3Nh5HmPN/r9iWwceH5b4bnPudfVIM9r+9eBzus/aoF5nhliaLhLZcM1mmiscUalwJDiqp5zpF6mC1z6s3pQcGHQDQau8E1QWN+P1DMT7b7ACvszrIWWZ90ZcMnsT5LYrTEO5Vo7Dq2OdPd58yanKu2yB4O0ZiP4J5BHD5CyczWUB9dBVowq77cZhrjeOghu8q3KmA==;25:WIxu8GE5944dzKcFRp5n59TnPOydbHcacOQ2MP1Q/b1s03R7j19almkIr+Xchg3GijkISTYPv126jDAS1fksSK01KkH0jaqydCgqEX88ZBp3Mp+18siZ3+Zyy3vDqOTtmhKey1tnar8y+5ILYsdSYbFTX9PsgnVoGuOQLZucAMex1R3GTw/IPwCOQ82ZDcWmAkBc1yj2MW9KLbOyb+MCFPxXyJduIOqXdry5+kZrxd9msw7ns+Qjd/BpvG82vuL4Bnl5UTCBSswF7TUSn+mIPpSUiFQan2VlQUMQ3foE/dRi46kkJQTZHlHYczE0BBpc6ZTOE+P0cD0D+qkReoQNcY6vLIdG1jju/5MdC72D54mByFdXXOTYzP7ADWy8Q1s2D+A8OJz54cJyOxj0nEIgJ9NTZ5qxt9woH/Jj70q5sMkdoXfhE2RCPMJtcoPBabwAopHjDudZwFoTHbdrc1zZHw== X-Microsoft-Exchange-Diagnostics: 1;CO1PR02MB205;31:OSGna2sSPHhu+1kYecuMn1fKWXAhDRA17/YEmMbvtWSQMHItwHcNc7B3JntE5dANYYJkeSEoVX1V8KP7zQC3mgzji5YlZwXMPtIld5POWviNf0Cz4kzaUL77YhkQKG3gwxd1ppw9NF5r6lQdoFt5wYiiqUf4RgstR97rOcFqoUmGvzLABy/zXYks2Lw4bO67rAZcnZ0GeHRyToNhn5xOdPu8ZcgBUwf37VmNL6z9VbWYZPm71UaXqPUni/9TCdJro6EfaZ8PiEn4mPCz6uh1rdrla55y6901Zg8YW9w6AVo=;20:kEaKV3Mee6pJxw5MJpxn7lf7ABCYfHJHo33TPm7imBlPrsdiIgTowL4ivQjL7DmLiXjDt+4L95YLZdPuE+5Pa0JJI+ihY6wwVnrHngLJ3dKgxSMuhy6oWJhb/eNewixk+/fzBORa9CKo8jZ4NAB0g1TNUsuBfONyfR3eCFEKIhiP54XAD7vKrDc8MiOs+NYPd+G+1JCOcicNmV0qQ7XUwQ3l6tZu3OMluJhNct27GgEdpT0VpAx71et261FREgR5pbaHgkydstyNvvUkAde4LeCups0dKlpU2ClyUI5w6fuR4BB7eMfckp+hjL9uwB2IHvMgX4J7RfmnI+qvjCHspPnH1ahom6prl2uh/2lSoWv9r4j8TZnYzQsAX9Bo95tEHrnTxHquLdiBgaW2pGkmURqd+0NPMYoH5f8vmbT685hxj4Yx19i/A2yp93wdJ1dYfdYORMb9xYZ7PSgQuSVYXbPTB2rBrXb9B/60B2CRileXwrQwp4/gWtL/olmL6y8S X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:CO1PR02MB205;BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB205; X-Microsoft-Exchange-Diagnostics: 1;CO1PR02MB205;4:XPxz4mualu4yy3uoucJV9F/2GtyyqmiAzxS+1FjkoGDjWxnzQSwfnSkUB4ZKNb/O2WkJOe3UBt3YCAwH4kIMQ5DIRjhidyFg3WKNQEglvZnHgeOj8gJLFQ7thWtwZEsHbzodTN838YAKfiuTVHVTSVdATSXkIpI8hsBED/jCnjm4FCpdZvvZYb8XaKZkCQcFvOrzjm7+s9Km90qcLsKGWNEUiBEdMgHGA/EXSvJZFdgkt+6XEonKNnfZebN2QeShP/5zAOamhr3YBqE9U67k6AZ0pde1W2IKp544tSSz+n/DlleLKxMDASlIgs7fiaIa1LpHQtiyAQpp2UCFNOcpUrG8thezR5dS7x9aouodvCy60OajWQlIc3sk6N4t7qDS9DVLBbKgdRe0xLmCuCpvdKxFcss7PtEDakZVXhZCK48nIIb+tVuGtqoQ640BHUY9b+WyG89XL+HpJJ7DI1+T3OmHs64p7VWBkHw/Q4J857yPKi1ZNavcqQv/PgwssQsjtRqT0+BKQ4HHX/T9+modnO9it8+xpg5YM/Ee+NW4j24/Km4UdMDEtNwzq2g4dAXgliQmOAJi/mpIr2+K0e9C/8U4OP8pqe2wx2PFFXw7gEb5iUjFmf81DhKHZdFKb6Wp0uLXTBiNT0bjjyszc4QR2LDG0e4hVshPRdFV8umKdGqbnHj/conB4uiwcPslQTZw X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO1PR02MB205;23:wVEWEujfISjmAFhHOJoNExyO5/q6tLi5f5jHI4xYNL?= =?us-ascii?Q?KBeflN2lH2v2XoJf1AxY3CXAPa3P/xKz/BrovJc3J+7xP2sxyTrEPHrkV2hb?= =?us-ascii?Q?Vn6dENrRA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J21MOIZ1uuGhwDkNU7QgL99rCQWxDZ/uzxq0M237/o7cftA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR02MB205;7:xIuEWPyFGX3n3F0L5OOF+ttVsOWzJm/7gC3rX74Mm0fGC9mJ8NeNmblQ7vZr/fPEE5RSHOM6hvUJp5v4oGPZ3itaNfMIxqT0W5se9wshb7I8ZpOnf8XHy0Bxql7inB1cHitcqbLM1NWT69z3RUlrXbnyk7Dct7bo3+JhHxpaNi8TboljbIXCIPR15kkywoYZzQxePAq1r4nhwNbyqeavvT6xuIOtmyzwByFCLSea94wtEMdDMi0YdBJvTKsDXTJaupwoemP6fwpvp30tR/HT3OWOgu9GZQufBU4zeFoc7XIDYUPS2H6uWHwfOXqcCj694fBSW7ynApiPFoHy29PtwXYghN3mPcqGrDwJ0zGMGCiXyYchc4QI6IlocDrlAifWtGddg3nq6GI2goT9hjLicpkmDUflIhDiJq9TGfoXwdt0TKKnu11ijj7KxRZbCTl7r674I5SV4ur3yZrLYDnfkg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:39:47.9549 (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.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB205 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 uBJFt8ZT004589 Content-Length: 1747 Lines: 54 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. > > Now that you catch busy channels with a software flag, do you still need the > xilinx_dma_is_running() and xilinx_dma_is_idle() checks ? Three different checks > for the same or very similar conditions are confusing, if you really need them > you should document clearly how they differ. Will remove the xilinx_dma_is_running and xilinx_dmais_idle() checks and will use Chan->idle check across all the IP's. Will fix it v2... > > > @@ -1110,6 +1116,7 @@ static void xilinx_vdma_start_transfer(struct > > xilinx_dma_chan *chan) vdma_desc_write(chan, XILINX_DMA_REG_VSIZE, > > last->hw.vsize); > > } > > > > + chan->idle = false; > > (and this too) Will fix in v2... Regards, Kedar.