From patchwork Fri Mar 24 19:22:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaying Liang X-Patchwork-Id: 9643885 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 11A4D601E9 for ; Fri, 24 Mar 2017 19:29:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F38D827D16 for ; Fri, 24 Mar 2017 19:29:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E846527E5A; Fri, 24 Mar 2017 19:29:35 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E7F527D16 for ; Fri, 24 Mar 2017 19:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967009AbdCXT3f (ORCPT ); Fri, 24 Mar 2017 15:29:35 -0400 Received: from mail-sn1nam01on0044.outbound.protection.outlook.com ([104.47.32.44]:9568 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935982AbdCXT3b (ORCPT ); Fri, 24 Mar 2017 15:29:31 -0400 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=H/ds/xXOwKBPLqDZmfi/quBeY1XvsrykcbEN4f+z/VQ=; b=eUtnUQioDJxbYhUViZ4/hgfEaG5MIjoWyWsFZCg8tmy1a+/EbWJyXEo1Hh7/ITz9yU1IFDKbJrOvLZskH+oQou63X6au4wnRWGABryCuCIUswF6DDTT9qDgKBJsZCp+Oa/0cv1zT2TkQ5ox8htEsmxjUziDwu14mMY6icVB5Vh8= Received: from BN1PR02CA0047.namprd02.prod.outlook.com (10.141.56.47) by CY1PR0201MB0714.namprd02.prod.outlook.com (10.160.141.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Fri, 24 Mar 2017 19:29:29 +0000 Received: from BL2NAM02FT051.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BN1PR02CA0047.outlook.office365.com (2a01:111:e400:2a::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 19:29:28 +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 BL2NAM02FT051.mail.protection.outlook.com (10.152.76.181) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 19:29:27 +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 1crUtq-0006HI-LQ; Fri, 24 Mar 2017 12:29:26 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1crUtq-0002hs-IU; Fri, 24 Mar 2017 12:29:26 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v2OJTOxS008412; Fri, 24 Mar 2017 12:29:24 -0700 Received: from [172.19.2.167] (helo=xsjjliang50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1crUto-0002hG-6y; Fri, 24 Mar 2017 12:29:24 -0700 From: Wendy Liang To: CC: , , "Wendy Liang" , Wendy Liang , Michal Simek Subject: [RFC LINUX PATCH 3/3] remoteproc: Release DMA declare mem when cleanup rsc Date: Fri, 24 Mar 2017 12:22:16 -0700 Message-ID: <1490383336-23117-4-git-send-email-jliang@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490383336-23117-1-git-send-email-jliang@xilinx.com> References: <1490383336-23117-1-git-send-email-jliang@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-22962.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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(356003)(305945005)(5660300001)(33646002)(2351001)(106466001)(107886003)(4326008)(76176999)(50986999)(9786002)(50466002)(8936002)(8676002)(81166006)(5003940100001)(38730400002)(110136004)(36386004)(47776003)(50226002)(2906002)(77096006)(54906002)(2950100002)(6916009)(6666003)(189998001)(48376002)(36756003)(107986001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0714; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT051; 1:FNgxAuNRHoCRsPdZiEOUVw9bZWmzlhhWm7kt8+Zv3RdF1Lp80N3EUnQHzDQgCNXT54x9SbXqg6WZVx2KTT5Tc07dN4pEHvzZzz6NA7wQgm72Bnx1SaXWuL5GX9medT4dT5PxtpqZupGBn+0CiPF2nQgz0Nbj9RXLF5eg9HJIssgYgd12/Nb1jkTjU0D7kfwbaT2ZByNmvmDuvqOSeDwoX4Ozk0IqLZQDzBtU1HJIFy0CSrzhCW8kCXsbWWFzKp12Ff9V6JctCIqVvfml9cv9mFtirmNJpzOMheOxT8++fj0lyN4WXEw62mx0UJmB5PaNFLBXGlhYNo00mYKKdQ4bR8ztg6tZf6u0U2AmSqO2OLixRwS5KudpKIC/NXrhyQ+PEFF9r2LCqn3tK9fBnpeJy+0DZoAb9t4ApBhM5nDhJTXrcs4fiiOybOMsFeJ2aajwV/FMDdIqetZVGfgHDKHh3h7GD/2P1uqUBydm/fL10yyDloTZHvNmk+y2ysIaAC5L4ZcXW8MuElBSQ2o5cDSZmUoAzLQD73fQDFQArmJCLRUt6yrQ/ZRsoL4B3MNL1nanUW+Yj4yhLiNjgch/oyEBKw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 244b7c2e-71d1-4b2b-7c6a-08d472ec163e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075); SRVR:CY1PR0201MB0714; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0714; 3:JvSp242cfJdsWjZ1DoUzFzRulprGFkMoS5JA5meoe+vwRbAsZKejEOc41+rmH8dMjDtlnBC5231zrpRO0geZKAB7kfn4nD9AYE5NQ2eOg40bmKsqV6XL/X6/aUMepTGdpWMVVwCAmRJ4t8gu8V1ClVADMfQPKuATMCdEgiyH9a+/BYQ2TDaGEwOiIaXFhZux8yNWmeZYW2AsBUI4TrdFGTGmUDt5MwQwQGcesiBP5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VdpAm9H7+eDB6Cup7iln3MHIwODW4076L7cAJsUo9GeGWADDmDCtBYwU7d3lqPF0u5ptx4Osrms366r8U2HH/JjPB+7dWdwl6atWG/Ict2DDqoioiUDPkzOdDt5zp/jfX7w18Io3B04V/5oLnrNFvJ2S9P/yXltX33hZB4pnn7EtKEpFMucZAGvqgoP8e2hJOLQQftBJBwOgJXdt27GOKjCQk47BxF89AgWmL8vdWuLfJegjfr0jYeosghOMdrnJ+uei12DwbMzLKNd4vOvovjfpFNd+du1YKSKH2N1CtWt9WM8EAAkPhKaCOabPZDYfA2OUv0thSEkYiomQm7nWfyz0nukpKchxAH8XorGWcVjnArdxdSKL7gdSYqeJINwagJ+zw9cIVBLpSLFdunHn 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)(13024025)(8121501046)(13015025)(13017025)(5005006)(13018025)(13023025)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:CY1PR0201MB0714; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0714; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0714; 4:Px7MI79z6ZWcl46fF+W9Jl2N2L2oihU/XAkDmdsXF268Af0v0EvljGSc6Y2NCqxxFZkpc5jEh1jKnux4ZyVtIQf564GDQy0p5yEtAk0UeydZhrQUhiZzDJre4WP4hU1dyKNH7uBYessXhE6dvElUVC1Z5Nq3QVm4tuaPrj3Jby7pS2dT9N7BmaskbjciBdH7eXLfGX1s4I0CnQwudua05Tj25Fi4rrPpDcrIeRa+ZHMtpj7yM/zoTHfnk3WHeosP+zs6qKYwfHhpFv5Mb1Z1y0l1BMlXl8RGjVIdBbIaWnWUjTVK4kXuJqs7WN2ZwXoMsL9+zte+STPq4eFRXqOVcgMFUfVO2vqPofIe6QktbQZaSeVnA3COp4A4MreLWKADnLfkYESvUZQ3yODuzYZ1z5jOnq8HCZN+X2SMGRZjp2bdXIiyfaeMwQgSG74KTKrx0iBx2FZ71hxxaRy4+Ki3VJYTXHIYf8EMNV9AIGAPXI99xA7iiNRJ0eRT/IW3HlXZZ+RGBoDqrfWKRk+Gucr/I2CSDjmPKD3iAsBHYChl/rgL7ylH9XjiticCsSs8jKoqS6YO4twSwVSwvD+ScCIy8nYw2uq0ujkdXX20nyhg3RFD2fi8YQalHMa8QGK0LmPS2bFbEjCOetiB4ey30/cxpM7EsGoY3W11VO5gS6gWDRdieMFYaq/FJgA/BjbqBYZftabIxLnLcChDCpxXCFDvqyrdRPx3eML6+GO4ZBc4N0GUmKktbZ8JHL2Z82XZE+PS X-Forefront-PRVS: 0256C18696 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB0714; 23:w+FtvzNFCKpzaWmqnI7/5ohBJCmBcMhGygTT0U3?= =?us-ascii?Q?PE328gWuQDalReNQ779B7FLdi0RLoMNuw02pO/oRtv0V70h8fgsz5WfRJK3e?= =?us-ascii?Q?VgVwhdyCOBawRzP9eIOYJ8pjQB8UVk/bzEduy8zy1HbZ6oexiqE4ms2LKlhg?= =?us-ascii?Q?AGZAIkZxTH8B8m3VADbm8/SUKGxpl4CT8qMBa83w+FJa65voY74jw2O+6BHJ?= =?us-ascii?Q?Oe857sRUCA81aueYf+OdmRptXnHvaZjoTfp2tNc5xyXya8dkKvNB1ryBVuk8?= =?us-ascii?Q?E02afiTYZp8hu+l5SWg60ovELYwRnEDri9uUpPMHu1IFcFttBhNLQ5rJQcwg?= =?us-ascii?Q?k9taXQOgGYakcRDapsq1O8XO3VemhVRWz2dTBfOAZ7hv392U26+Ei3N79fy8?= =?us-ascii?Q?IaqH0oC93aSkZ7INT1KBeLkQvYp8DOE0boS+773MEZVFEzZaa5wCTNFZDdwB?= =?us-ascii?Q?UVXoGQcbYzCRW2nt3EriE6+tGO+QCOT/fgi/WHJ/B1WXkgSa2xA2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gy6zmC4rHqc1w0ftkFIMGd7iJm1NwoGkXqDLv28Obr40mr/vqKxqU7MDG5wLNkMooNQLS4xdLHnfKX7x654B+cMrv2627e3aIA7uiP8EJNRA2ZnqVWWGJ5jAUU=; 5:2MSwtRYWgEg4swGjCyyMlWJMRvEJzt8/mfhbMbPreyPw9EfNH6V8DMe7LY2Xt83giST/raM1sw0deVnukSxh+tXIqsCJ/dXju6uuUH3dGw9VfjeuseDs40AaIK6P395DWL4UHqsQ7ox1ksZACYYU2g==; 24:8x3nts/XumkahwCEHbAIudXBQoGluLn098H3aGz+qA0eP8jeVDmHyjKBofP9hm1S3WpKcdPsmQU/YgPLzfqkz8CGuSrXTJ7KTjWXOS8MueI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0714; 7:HfjyA6Efdher/5kAwEJaNIMu8bUkSZb+FTM0BIJ/X4h78CfPI2lpKiWXwyZO27Lq/2VQPoF2piJnwJYuh1fp1tEmt8qL4S312Xd1yTjNlmKnYEOxFDk74qgBML6xV+SY3WPnp098TyZI1VU/akzfxEQBfN5lvzwGl7ncAS7xdpaUtiZZYpoGW7+Wyifj0INbqUwgZO5sdYpydbT719DgLBXuZu/7yyq9lUUV8nIEW1P+WoucxNj0NbvSO0162uBnt9pEiHH9m/xslM2P7GGChaCW73WKBAENwCvn08V5aFgU404fHBF0v55DPyfWxBCqSY3GyaY3hVUoqna4ocKbVA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 19:29:27.5249 (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: CY1PR0201MB0714 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wendy Liang Release the declared DMA memory in the end of resource cleanup. Signed-off-by: Wendy Liang Signed-off-by: Michal Simek --- drivers/remoteproc/remoteproc_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 0ffd9dc..9d32737 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -882,6 +882,9 @@ static void rproc_resource_cleanup(struct rproc *rproc) /* clean up remote vdev entries */ list_for_each_entry_safe(rvdev, rvtmp, &rproc->rvdevs, node) kref_put(&rvdev->refcount, rproc_vdev_release); + + /* Release declared DMA memory */ + dma_release_declared_memory(dev->parent); } /*