From patchwork Wed Jan 4 13:35:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 9497957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C8357606DD for ; Wed, 4 Jan 2017 22:24:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE9027BFC for ; Wed, 4 Jan 2017 22:24:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A046B28210; Wed, 4 Jan 2017 22:24:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09FC927BFC for ; Wed, 4 Jan 2017 22:24:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cOtxv-0008Io-Ul; Wed, 04 Jan 2017 22:23:27 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOsq8-0007q6-1X for linux-arm-kernel@bombadil.infradead.org; Wed, 04 Jan 2017 21:11:20 +0000 Received: from mail-sn1nam01on0056.outbound.protection.outlook.com ([104.47.32.56] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOlkO-0000IW-7V for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 13:36:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1JJjOw/d/cgf9ygpPIUdri/kEfZv8PcaRyY33k1BkQA=; b=KEQZ51G0mn71jxe2l+c7pkTqJcqBmmgsZ1v6dqyNWVmzWU5i3RN3LmUYuoIS62CDa8dX41U3z2uL0LcSGPr/TulckvlH3+kZgBFPVh07JbtoNm71c69qZYxuhBh+zpVB24bWqhHBIv1AryrkQeV0gsEIx9MlKKA1dj4NUJKMJSE= Received: from BY2PR02CA0122.namprd02.prod.outlook.com (10.163.44.176) by CO1PR02MB207.namprd02.prod.outlook.com (10.242.165.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Wed, 4 Jan 2017 13:36:10 +0000 Received: from CY1NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by BY2PR02CA0122.outlook.office365.com (2a01:111:e400:5261::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Wed, 4 Jan 2017 13:36:09 +0000 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; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT018.mail.protection.outlook.com (10.152.75.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Wed, 4 Jan 2017 13:36:08 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1cOljc-0007pu-BM; Wed, 04 Jan 2017 05:36:08 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cOljc-0002zF-7d; Wed, 04 Jan 2017 05:36:08 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v04DZvxf018610; Wed, 4 Jan 2017 05:35:57 -0800 Received: from [172.23.64.208] (helo=xhdrdevl6.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cOljQ-0002v4-OV; Wed, 04 Jan 2017 05:35:57 -0800 Received: by xhdrdevl6.xilinx.com (Postfix, from userid 13614) id D56DFF20014; Wed, 4 Jan 2017 19:05:55 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , , , Subject: [PATCH v4 1/3] dmaengine: xilinx_dma: Check for channel idle state before submitting dma descriptor Date: Wed, 4 Jan 2017 19:05:52 +0530 Message-ID: <1483536954-27203-2-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1483536954-27203-1-git-send-email-appanad@xilinx.com> References: <1483536954-27203-1-git-send-email-appanad@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22802.006 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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39840400002)(39850400002)(39860400002)(39410400002)(2980300002)(438002)(199003)(189002)(5003940100001)(42186005)(4326007)(38730400001)(106466001)(626004)(2906002)(6666003)(63266004)(103686003)(5001770100001)(50226002)(7416002)(47776003)(45336002)(81156014)(36386004)(36756003)(8676002)(81166006)(8936002)(76176999)(50466002)(90966002)(2201001)(46386002)(52956003)(54906002)(2950100002)(48376002)(305945005)(92566002)(33646002)(356003)(5660300001)(189998001)(50986999)(107986001)(921003)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB207; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT018; 1:TdbL1FYgE4UWOKPLEBphngWRIWqHQ1yTCJSYa5Oooxj6lYWAlIFbCo+hP5XTVEWC732qxSV2oBhEpI41Qs9qugMTm96aIiV3bztRUhpigJ4ap5oV1MxcKk7LqI2i3y46+F9E11hEXpSbULIc4M2nNxXo0MgA46t9Z1UcFtMeDaTySW5Cr8MnDQuGgZtOYIqE5wBJIbwiPXYGPNxsZzCLLQgducxhGcA/kQWWSi8jhdY4dzmM1IJ0ReikgaIFdOZuQl4/pyaVY6wQ2wN/Pewax1Ec1CvM82DU6cfcsgG6oRC0ryRKUKoNU0rA05ogYxBVvFVuQls+EIl3JgJ5gXYKuOD6y+U0ZRSW2U5nhB922l8dZ2UAyPrQ0WI3GoCfu3hA+rzvNc5rxGBiQWuVIRhCto/EhCTIpcnYRFzb3VEbLaThJPM57A4sv48ns7ikYy0PzZvOmrxpKAXtT7DdslzEhaQs4oc/U0Dt4pQXaY0H5agEhiNit5C9C5DZfI0t50q9Q8yQ2gh2irXKRte6rYxME/m89mhBB8tUPmSBznIG4CyalhdWmVLDneqXpd/acd4vjopl9OhV2MI/BHUXrWgRaPDnI7Q0t+BTjZDham2nrAIrV8Rk9LgsIzsyM4omqqW1IqMuk4HqjtXQs2bPRniflw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d7031509-be87-4731-a708-08d434a6a472 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CO1PR02MB207; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 3:wqzlHQrWjGbPu6A13fApg41hYdOcLsPYfq5WNVWB6EcO8UfqgfTWpddFP7JQy/c6TFsYd64O8qCBN3ui6qLe/Q4BBRmxkKZ1OyP48JJ+YyyKi10Vi0PAcvNAVq6V7So80nVSrSKipy4vlrbovi28vYpw1qro1rv3GF9ol4Q7cOFbULR+I3m+8zjWZX26ve+/NMX2z3G5HUx/Vo/8a0ETP1OonrQ+2eC/8va8/CRn+7f91aJZYuitfn3/lCyIMJwZTXR698LJ8SACglMZGYCI7QfKGEqoahJlQBF+IKrwy1S9GcEmIipnTrQhXaSDJ/oybclEbK2lhykbkR/FqPDu0bdL2TdIStcjGCwIKgoI988pQjx+XEewqRuVGSTwGOXsA5L7YSQ6JQnnz+h0qyvU5Q== X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 25:U3g+fRVfMrHPOKySJ/BHg17rfML2IZn2iy1Mc9wRZkNDthcc84rsxe2Soy4sMreuocRGDk95ILyc7e2IMpQyldXm6EV7JhUDmCy5Ip8TvzvOOcBOQ6QItM7ubhyyCMxFSKUn9odyj0HRDZCp35TpKmsrDUlE2gC25OL9zHV7u67HFLJQZ4213H72BR3uuBEPiXsGXF0ZH1HDhRTqn1kRXU86HZ97ssLrvY4E7HHZOtI80Mq2aUGGXNSOkXD7LpGrtmbCUY1jziBQy8lINwwMnFfl0xhbcH7r9fwpnk7mASL/3z7fbOtweSu2RVmZGIE9kDSnSDcaMVjix7pwg/O9hmjHhbWXXTKf57Ru6ex7ymK0I0HSESy3yYm+GGnJyAATjoiMgmQUolDxo1hXeypiadWPiBH8w/SDAnWggLFbUWAMlosYqaokJphAbaqA2tW5iceF6bMRc8sQCpW7F/jwuHHK+vN8KGlVu0gejaeys2bJX1MvU8Fij8nYCO0+b3KnWlJZuRbvL4s1+9eU3iClBWmfZFP9uQEfKiH/K3uYOBTvGw3KXpYQ+VIbD2YCJNgtbWygC+5lc92gSogNh7LvbY2xjSPuAZ56SqfUCj6NZgwRzJJfYzeZx8I2bnQCUgaL15x4cR4lNVAhL4Kk8GKnoI+aA3cIiwRfCNZbJ8ZFLwmp2wxhY/KMUge8V5OTs3v61y+f8yC69mzc8uvB9qsgY0wraE9Xu87ZwUs/fQYXbwfD/nPd2TB52JOrxWEJ6aOnZ3o9xKZ7ejq98RdJqq8tKHqf/ZHfZ/1t0gS6l1yHP4m6ZDSwCY5n2qq4pJJhi6r7nLR1QDEt5f196K+RDSttVGfV28jbB5wYxnGKH0qeja0= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 31:u2VTPrDuS7hM6BkauFZYwuBomScErkWjl2yU7R5MNT4s1I6gFvMlx/cGdOd9G8utP25e+fmreLi+51xG6bjN5GtocBaYAMZ1d8jf2rL/YwcCB6hoLJ5F7djm2onD2fEdZQawtzdl4f8S4eApGXOVhL4kKo2fE5/RMKTw91PzHX1qZETL2/0z6FE4UDYr4ZhMYg7eb8HZ+HDgShV977yVvgqGXdF+75KthQHIgXQa+schxXUnIwrTqsU/Ey2tjEY9k7pgDcVVXLn30CNCk7hr8A==; 20:0ADDCDxt2T4RvVxkmDacwQKr/hYGF3z1Vx8GVTtoS/y9MuZJv8bU/9BJ2BkLNil+9IiTz5pWpKnBBkrldJGE5ol0VxSQEahG1R+u5U0hcFrfstPSxBxeVLw+ctl3QAEBd9/MZIvx9bpP0s0j+MsG+reQOeGgnkhYysH8SStcHR/jnuLktT6vT2P+tVf6mKPQZujko8L3457JpIZ4k0vpgReX7ut6UVKHapfMedUf29MW5pCp1Hjkc7Pyaabnq60VU090Yh0+8qfKC6wpKKD9Dot8TDqcZtEJDkVoC+2822S6mUyRcMf0A6v8W40ANlAPugEZOIdBI/oRpLt+7Evt/wr0KqmCeX4yEepy/NoAgcYnPeVr3jX9qWNdO9bnq8n82bilI/hUKAhyRLlQGG5fE9mG6BHFysb0O/35JzirVZs0QdPxTRvMK8ZcXhN9+DJWRW/JPHE15af0fKbiAgEWPqJVbV+bo5M7Vg9Kl1HTzc/c9gHTr5kPeedrcqDxjUNk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CO1PR02MB207; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB207; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 4:SINlqHSz0GWIqcQbHLlfDCFF2XSjHGEDY/hTM8hk+OBndt+BMJwphf00OKK9JLLtrUybzA2RTPxA9hbLDWsQqYvGSX7NKOxPeK0PjUaD356/fCrIB+k4Swobn3KIjhxlGj6g7ibTgSNbdr5tEytpB+X69gNzY0TbRqSiPIqmvLu21+2fOgZU91xTw0p7uMInG/h/t6agE6k9rrePL1RIh35HDj9zykD6WtTmPJbvxenNKEylOexyMbu1Cwms+VVFQCws1LIAOMIDXyrB9ONBPXPLqJ+PUOWSJiHVuDNKCoC22JmPgS4SyvmIX1kbo/RYag814RVEjdQOPhHFB4Am+tVQ7fcQ18Egj8/k+yt9I9ArM4SCobuvSblLD31N7rEHf22W1CZktOvh/Y2z1bc0FO0vSw+SyVNSy9gmfuRZYChaW+eUJkuf145CQXyp0NrJvQT3RVbj8l+rlHK9uo6OFaUdr4mPrfKpvMYkEx6+ZuZ1aMprAYT2vJv1peFWzoINyK4I6dOf1GyX7nm1tlGlDIDzfH0ix9nizMKgLBiDS84IBskn9P2gj0pAtiH5BIoAq4wVWkYpsbGVueHXNgscv8Za/d4kEiOPVzmEwUTp0LTPsRgnttiVRiInjsou4dM8dUv/7cwu789iSpu26hiYH8kx1cmOWYxglsuUEduJJmUM7pErilqHt4FzIjUihaUCr3OnoI37EeBVB0AeJJy3Ji+abvarHhOPplVdpgmeN1Y= X-Forefront-PRVS: 0177904E6B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR02MB207; 23:qMfQ27yFFe46GHSY3eLtFHoEzRNzemmcNki2q86vgT?= =?us-ascii?Q?+MJg9B9x5Ry3VHmcD5bC1Aph9kRw6cY2tPn8x7BxUzBcIh3Nv6WeALKvPLe7?= =?us-ascii?Q?qMzTaxAwswMay+LFJ0lTVXHuDv/yVu4x0V8UxOUuv0DP4CSCTrKdf5yzh0Ad?= =?us-ascii?Q?sSRNdSrgaFy5BDu5fRRseJD9py6uu/EaK2dqmstFKyKwL8uEz60T/v9Vkhsn?= =?us-ascii?Q?b6wflnTbNgTaBkgLlHG+tt40G6JUHkYn+7d/isNK0EXSVt4MwpXltj4kIft2?= =?us-ascii?Q?ga2TVE2KEgC86PWT8lmbtJwoODdmF222EnILm7Ah2CeoUD5MI86M6cMk7CRN?= =?us-ascii?Q?eFnw7n1xmi1Qm2qSmSZZqaIQ/iN8Arb3D4rjlaBt3ryAaL6HLFiR37bdOpxG?= =?us-ascii?Q?WXCt5KFoWmht2wRl5MYgQqID1gPQvS+dvULKjP9a3ReIEngKvs61Em9LDefq?= =?us-ascii?Q?5BwYlz0AEiU+wrLn0WF6ASz8ifyp9uSQ0o2F4o0q2VnAGSkztXYZ0tWG/eTx?= =?us-ascii?Q?jFQfTDFyqh5/WfQlrfeiVTEq4O79tejWWxEkEXKKQfi186VSHA05Bz6EHakh?= =?us-ascii?Q?q4Snrranj/DklG8R3gdmHrLuc/qNUK7CuAaKFaM+5gAblqimXHkCGdJEZLw2?= =?us-ascii?Q?KalKAu9EU9N7Upb5QSqsXitPDbNcXklwNbKDXCj/0F7IWYLcA+NZn/za2v9q?= =?us-ascii?Q?o2tSb5AzB65VxDeO7s4awM6nxHqipAqR+aoIJS5E/cQpqoN+8hmDDn25dvQe?= =?us-ascii?Q?iGocGMQa3unw3r51YPLVr+SYd5OZJYnLhJm5No6oJoiO7h2i4eUE0e7A2sO+?= =?us-ascii?Q?GF0jJ8fd6zmCZoIyVatJeBfai41U2/xmvrQRJZhPNCYO8tASgFh59x9cMjFQ?= =?us-ascii?Q?J1kA+lxkBfN+m0a7R1JgH3dvlNZjOUkTRF8fXfCINqKNjgaxkcqSSHlo97Jm?= =?us-ascii?Q?Mi8jK4YZVoYO9TCDN6+gpKHb+c5ExH8xMc8zG0h8IZGV/BUJYDzBEyx2vP4/?= =?us-ascii?Q?7plE5P541riAkyBBwjh+5bFthB8RwBkyEyuoI7BqlBqjcoyp6RS88qxa76+4?= =?us-ascii?Q?sXgU3CchHYLXcJ4vOjb7shWvM4G09I9D8x0D9iMrtkKyEYli5Jib43wRE8YV?= =?us-ascii?Q?yQBFqVWfTTQTACMxfANxuZxAwst+kP+0EkomTZam3H8M/Bm4weLFmW8KUfFU?= =?us-ascii?Q?vff7JfNpYtIP9mdRzv8DrG51zKpviKjR7xBDBFbpdlrmCeGlB/0Tm88kJJBU?= =?us-ascii?Q?phLRkB5HjliVoB+QYkHS9m4c7fmF7hsKO48txrMR7PugaukEin6ankyz5S4w?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 6:2PiDNcjwwykt5hgbIaKC0Pc5iuJZaXdVal0iNtI4Ldb5z6ezfwezX39DzesHC9ol+s00Nv8qIH0fmEHOWdL2qB8TV78Oa8uCDiCVF1ykYVHoMW2CNvTSNzlOXOAsgLH/hDyooJEKyT5RHkm2+13LgbIFQHyB5lpb7830rOrWWEisyUoojSOYyI7da2kX6oclDtnisg5lSoMvaVqoBKs9LFVO5tz4+YGzJ8+BK5drU8PmlnriLmw8TxBZIkSdX1NsQrLlSfaXy0FihamEKqulLVQt30kupxvjkpHOFHg2cWRACSC6T163nWTLhJu7LfIqqihYHj5hSyUnna57EhuHgHFe7CZOLXuCZ6G7u9dkVMncGtJ6pkglaK4bHryXbVdQtfQ55R5TOh4hVCEE5xBVtDpsHJ3pppUUp4vUNIADmr0JUI8EdzImjQdtON1NMB+rFB02NGJD5XiG8q6W1pcgUA==; 5:gqH1PSS3eGrkZCMkKUboGLivObmX1VDpwiOr1VK6Yd35fZr73Ffa3nLpt42r/SOvrWRhH37h/E0gsSYWze8+O3nWid5O67HW9bxWcLXS2RrlkO98X9pAyYeHSBJ2LSFmNOkWs7w81CeMHHoQLOFETsbC6N3iKyMnaurU7NoFjqo=; 24:PzqSWZoCfIqP7DZlkBoehVl8yHoF7U8P3uszdjKs4gYq/qPVB84C32/RaOpq6k6s7ODcjntDQKQZgOFcaCEEJWtgA0+p1KhViRaCwU7lgqk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB207; 7:UCObegHuaqSJkvhgzdSh3BBfRaqbyD/quSTZxylG1R2dSIbpgtAWxUWOZBP0EteK8mr6q9Rvr+yFx1gLVV5LeNF9hMWFD2lbmLifXVGCn9H7QLqoE9/zSn5gMRh+TyecYWMybNqahM0dqdqXmnCreLdr1RdW0NlN/u/ZG903TazzXrpaNnz+muaE2ipk78SHr6xO/8Pvn7d8mwxY3JY20hBVZ1Ay5ejvw+/mqf0GkEi+vcmd0UM/psjaxP3J8hUfZLtImCfoWCxWDlBfPGsch3bkTrXsAaF6yG1NYAj8ZzQIeQJGpfPDxk6e0qF2g2sUpzq9oQrG/Hpx4ejD2NYGOM2EJfB6NRt3u/EnEQUZasFf5i6zrcmsNl4C2HVS+lSzllv9NzHRiygSqsdlcSxYN75SYATJV2f/rbFUDBdRp1ZnRycTZk7dFRxN9GZFxSzvbHiT+PkK0E3G94CBm8dPow== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 13:36:08.6462 (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: CO1PR02MB207 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_133656_535781_102EA936 X-CRM114-Status: GOOD ( 16.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add channel idle state to ensure that dma descriptor is not submitted when VDMA engine is in progress. Reviewed-by: Jose Abreu Signed-off-by: Kedareswara rao Appana --- Changes for v3: ---> None. Changes for v2: ---> Add idle check in the reset as suggested by Jose Abreu ---> Removed xilinx_dma_is_running/xilinx_dma_is_idle checks in the driver and used common idle checks across the driver as suggested by Laurent Pinchart. drivers/dma/xilinx/xilinx_dma.c | 56 +++++++++++++---------------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 8288fe4..be7eb41 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -321,6 +321,7 @@ struct xilinx_dma_tx_descriptor { * @cyclic: Check for cyclic transfers. * @genlock: Support genlock mode * @err: Channel has errors + * @idle: Check for channel idle * @tasklet: Cleanup work after irq * @config: Device configuration info * @flush_on_fsync: Flush on Frame sync @@ -351,6 +352,7 @@ struct xilinx_dma_chan { bool cyclic; bool genlock; bool err; + bool idle; struct tasklet_struct tasklet; struct xilinx_vdma_config config; bool flush_on_fsync; @@ -920,32 +922,6 @@ static enum dma_status xilinx_dma_tx_status(struct dma_chan *dchan, } /** - * xilinx_dma_is_running - Check if DMA channel is running - * @chan: Driver specific DMA channel - * - * Return: '1' if running, '0' if not. - */ -static bool xilinx_dma_is_running(struct xilinx_dma_chan *chan) -{ - return !(dma_ctrl_read(chan, XILINX_DMA_REG_DMASR) & - XILINX_DMA_DMASR_HALTED) && - (dma_ctrl_read(chan, XILINX_DMA_REG_DMACR) & - XILINX_DMA_DMACR_RUNSTOP); -} - -/** - * xilinx_dma_is_idle - Check if DMA channel is idle - * @chan: Driver specific DMA channel - * - * Return: '1' if idle, '0' if not. - */ -static bool xilinx_dma_is_idle(struct xilinx_dma_chan *chan) -{ - return dma_ctrl_read(chan, XILINX_DMA_REG_DMASR) & - XILINX_DMA_DMASR_IDLE; -} - -/** * xilinx_dma_halt - Halt DMA channel * @chan: Driver specific DMA channel */ @@ -966,6 +942,7 @@ static void xilinx_dma_halt(struct xilinx_dma_chan *chan) chan, dma_ctrl_read(chan, XILINX_DMA_REG_DMASR)); chan->err = true; } + chan->idle = true; } /** @@ -1007,6 +984,9 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan) if (chan->err) return; + if (!chan->idle) + return; + if (list_empty(&chan->pending_list)) return; @@ -1018,13 +998,6 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan) tail_segment = list_last_entry(&tail_desc->segments, struct xilinx_vdma_tx_segment, node); - /* If it is SG mode and hardware is busy, cannot submit */ - if (chan->has_sg && xilinx_dma_is_running(chan) && - !xilinx_dma_is_idle(chan)) { - dev_dbg(chan->dev, "DMA controller still busy\n"); - return; - } - /* * If hardware is idle, then all descriptors on the running lists are * done, start new transfers @@ -1110,6 +1083,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; if (!chan->has_sg) { list_del(&desc->node); list_add_tail(&desc->node, &chan->active_list); @@ -1136,6 +1110,9 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan) if (chan->err) return; + if (!chan->idle) + return; + if (list_empty(&chan->pending_list)) return; @@ -1181,6 +1158,7 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan) list_splice_tail_init(&chan->pending_list, &chan->active_list); chan->desc_pendingcount = 0; + chan->idle = false; } /** @@ -1196,15 +1174,11 @@ static void xilinx_dma_start_transfer(struct xilinx_dma_chan *chan) if (chan->err) return; - if (list_empty(&chan->pending_list)) + if (!chan->idle) return; - /* If it is SG mode and hardware is busy, cannot submit */ - if (chan->has_sg && xilinx_dma_is_running(chan) && - !xilinx_dma_is_idle(chan)) { - dev_dbg(chan->dev, "DMA controller still busy\n"); + if (list_empty(&chan->pending_list)) return; - } head_desc = list_first_entry(&chan->pending_list, struct xilinx_dma_tx_descriptor, node); @@ -1302,6 +1276,7 @@ static void xilinx_dma_start_transfer(struct xilinx_dma_chan *chan) list_splice_tail_init(&chan->pending_list, &chan->active_list); chan->desc_pendingcount = 0; + chan->idle = false; } /** @@ -1366,6 +1341,7 @@ static int xilinx_dma_reset(struct xilinx_dma_chan *chan) } chan->err = false; + chan->idle = true; return err; } @@ -1447,6 +1423,7 @@ static irqreturn_t xilinx_dma_irq_handler(int irq, void *data) if (status & XILINX_DMA_DMASR_FRM_CNT_IRQ) { spin_lock(&chan->lock); xilinx_dma_complete_descriptor(chan); + chan->idle = true; chan->start_transfer(chan); spin_unlock(&chan->lock); } @@ -2327,6 +2304,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, chan->has_sg = xdev->has_sg; chan->desc_pendingcount = 0x0; chan->ext_addr = xdev->ext_addr; + chan->idle = true; spin_lock_init(&chan->lock); INIT_LIST_HEAD(&chan->pending_list);