From patchwork Fri Mar 24 19:22:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaying Liang X-Patchwork-Id: 9643913 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 B0206601E9 for ; Fri, 24 Mar 2017 19:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DADE27D16 for ; Fri, 24 Mar 2017 19:31:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 926C627E5A; Fri, 24 Mar 2017 19:31:25 +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 CD2BD27D16 for ; Fri, 24 Mar 2017 19:31:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966990AbdCXTbU (ORCPT ); Fri, 24 Mar 2017 15:31:20 -0400 Received: from mail-sn1nam01on0054.outbound.protection.outlook.com ([104.47.32.54]:11399 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S967073AbdCXTaJ (ORCPT ); Fri, 24 Mar 2017 15:30:09 -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=332KAy0fegYk1XnCrIFJHsGRVEZeUtVFw062uLssrt0=; b=PlfphwlXLxxdRnjQiZ2ljpBZtJFfaT6XLiEWh9KhOZQVPSjNNFqbidue8wb1x/iIC/EGVupGoLKgHaw9abtGxKoQX7fFyWyn9RauSF5TL0e1KrmxUnzedoe/SNNrGDgFlwgPGBBv3T2NMm8QxNiQHC+duw0/IVhuD8U0Dy0Nvg0= Received: from MWHPR02CA0056.namprd02.prod.outlook.com (10.164.133.45) by DM2PR02MB1385.namprd02.prod.outlook.com (10.161.143.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Fri, 24 Mar 2017 19:30:00 +0000 Received: from BL2NAM02FT024.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by MWHPR02CA0056.outlook.office365.com (2603:10b6:301:60::45) 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:30:00 +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 BL2NAM02FT024.mail.protection.outlook.com (10.152.77.62) 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:59 +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 1crUuM-0006Ju-SZ; Fri, 24 Mar 2017 12:29:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1crUuM-0002mW-OW; Fri, 24 Mar 2017 12:29:58 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v2OJTlTT022949; Fri, 24 Mar 2017 12:29:47 -0700 Received: from [172.19.2.167] (helo=xsjjliang50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1crUuA-0002jg-SP; Fri, 24 Mar 2017 12:29:46 -0700 From: Wendy Liang To: CC: , , "Wendy Liang" , Wendy Liang , Michal Simek Subject: [RFC LINUX PATCH 11/19] remoteproc: Add rproc_idr_alloc/remove wrapper Date: Fri, 24 Mar 2017 12:22:27 -0700 Message-ID: <1490383355-23176-12-git-send-email-jliang@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490383355-23176-1-git-send-email-jliang@xilinx.com> References: <1490383355-23176-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)(39450400003)(39840400002)(39410400002)(39860400002)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(48376002)(305945005)(356003)(6666003)(189998001)(2950100002)(50466002)(6916009)(5660300001)(2906002)(33646002)(36386004)(8936002)(2351001)(110136004)(8676002)(50986999)(36756003)(81166006)(107886003)(47776003)(50226002)(106466001)(5003940100001)(76176999)(77096006)(38730400002)(9786002)(54906002)(4326008)(107986001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1385; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT024; 1:j14VT3vFAlKGcviOFAVhb47YfgqBx23qWW18i/Hj28HBxUmOWMh4v1/e3JM2rXduitE3iIvJaSNxT6JVCGNf5VMElfs1+C/mhlEJVL1v74IemModqiWEnwiCaCE27ZF7O1rX8tOCRYamiyLryvrzBTOk5gGLJC4XgkR5X5bxUqYbEreXzgdh/r9H/67K0h3kb8rwLN5D8tVsLaC1NlHu6Pt1iRXANm+OuHd4PcYc8w+6BDIvFpgCFeubfINyw46t8BmTC6LMAVpX3mKp9+hZjXN3ebK58uHtWQkyBwFO6BGgdLwoFjt0M6DA8BkOOKGG6suDsLJATPUSMf1D+0I7TqtKuHTEuS1Wm6lwINffQ5v2eqQPEUilNRSu3y4PWyZE3Nep86dc1LSjpOIstYWmMmg4HOAkNTcxQTXKwQwdfSkRhb3OmrveKlRMFwYDwLE6XY85s2Gxsv0wgGS7Cjeds0mrMVkcGR/cIk+gK8p3sho3NHVHymDJdORSITJCy+yZxkEbvXHqXqgB/rTgJ1dcUtV01JnYiy7FDXwHb2HOt2mGiew1aV3oaLR3YBUNKkZ7aawlY1Ah8Ln2rI2F07a2Mw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 11d55f41-dcb8-4582-c4c4-08d472ec2945 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075); SRVR:DM2PR02MB1385; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1385; 3:kIK8sc2U60kJ6FA8dOsEMBsCLukmqpahFPpfV8Z0f5giBhXqW279B2e7ArulkOtWO3ezli55rM9jQNo6uraQjDGZ3h1sp4MZ116u43d3Qd29FBibT+0MyxtWlcRRlFSjksgD1+h7qyIXF1/Rms9uzdrW+CnCDZIaUeJtiwdez6a1ezAToivY9aJLk84Zd33wPvh20Bj3S2+qxiGUuVrwLa6+M1SO5x7Z/ba0c8WuILhCrnSDIlW8e4B1TVr4txXY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z8TNIeP9g1UGhF/hPgYnlOf5z/0vzfDd8V1IH5PMNpHQT07vP8qZtMlUsiqCBbOr/PbKEgejI/6ODCeuvs6/kRqHrUL19btme90Lq3oM6gmqTmjTr9gn0PwA2kr8HEpHa1jksWDRSY/i2ze05JM68mo5BLV4Av+CTpjckgOciP1m5cN1o2qsg9dVgi7AwcXIyHrtPsvFTB9n8TldX7X0uCq6tdTnpWM3lKbMtrx073sTbKElSz2dtX+TUikDwj7U2NogxGkHxU3FKDh2BerlfSjGfmbMetLYxyS6T06mWhEY91f5i8nTXXnH7GA7OqLVq5LtF6d7MIgMx8AwzqwtDHQeSc7u/p0UOAiE0oWhXxLOIzfejjZjQmXp3/K3gIj5DND1xqKxu0UgkMzVAjl+Sd9DPKXbuY9yiewsos9wpc+GApV8PwHGc 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)(13015025)(13024025)(5005006)(13018025)(13023025)(8121501046)(13017025)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558025)(20161123562025)(20161123560025)(20161123555025)(6072148); SRVR:DM2PR02MB1385; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB1385; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1385; 4:AWzYq2gr0BN3clbPacbFQmMP37kNvqy7JRLtl3mdWzyqU3Mddt/XW6+PQXyJFX+sNNUbli9Ql30FGC0qzE2Vu53PV/tmYzG4cGGAwVuh4hacyDwMQqNZlgrFufwv9EeQ1VHIRe8pvc5RKx/fYQ+EXz0v4tXnoyQ1/4ISQw7VrbZTmExn/4Zo5LMEStKCJCp4NCYgFEqe7GyU7naxiZ37GEX8R52KKYj7Zq+daMn7PmAstx6SFuK3EK8kuVLQyMXLA46KilUr9Ha8ZnONOj09zaptcPK0adu+WIKUU+n4YwpDKlqes+8OsRoWCLeAyZpHX2g41bFkjuiN8RYSBDc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C41f2KY/F2hchPL732aYI2fgKrOR5obWhyePeCxLgoab9w9XQT/R7aSE+BThOmsvFuEFMD4ac/O9p65gC4E7J3lwi9SlHvAXXin4JQ8Veuq7EsVbnuSiyYpuEYeywZ8kPIpvClyzxbqfYFZj+0/TOP+8Ig7tM4/imgUlNcvITlqx2XqSZPk6k36zPMnP6/56g=; 5:la9z2dexZspcXEdZ1JxAJzA2ZOQMmaGInMfX/lVaP3ZCLhXOfTxXbrkL4X04FZbK++SdxJ7M+mGxJRSBVnPI5/maonYtouvufdXRtAHUALNqeAhJXBlg0EDQjOF9m7EVpIXfCmyGHSmwdN19R+tU6g==; 24:1oa+v9QLSsSA4ygQLnHXi8qQQpmdGtR1LdVpPAPK/lke+JjS2CmClKX/enY24IOPvo2T75RIgBTqnQR5upIZDEwKwwcxnb6JG8cRlmjBw2Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1385; 7:r+OrzOiuKii7ZLsf8/1Slo750PQ64JV8b8DUfWZzAzsgiAD82gDTQJy4Wjbu6BrqWwIu1nm7qviZU98ZXVG4BbzXEnbJaeIamXPfs9kmFGY34peyaqwCZZFIgZ4Rd5ZtN+TSZ5GVLesdNvGOJRGtlcCdyg7aUOqzgRnygDU/nqlPj94gdNZYIHcQcHClaRBdz4uWGhZMRNATgsQ0TeAbUhLyaUgkWsBC0nWHYbf6fR8F92Ixh3GBug6iyGdaOMy5ZKfyDZ5F89YsVXjslbwz1F8ZPdNcs1cl/2bQRW1qdrjpj16XqxMspHhdYTuR7VO/2vBGiwrmNcmVUsGWXoJWGw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 19:29:59.3556 (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: DM2PR02MB1385 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 Add rproc_idr_alloc()/rproc_idr_remove() wrapper for id allocation/removal. Signed-off-by: Wendy Liang Signed-off-by: Michal Simek --- drivers/remoteproc/remoteproc_core.c | 46 ++++++++++++++++++++++++++++++++ drivers/remoteproc/remoteproc_internal.h | 6 +++++ 2 files changed, 52 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index e4fb289..d711345 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -140,6 +140,52 @@ static void rproc_disable_iommu(struct rproc *rproc) } /** + * rproc_idr_alloc() - allocate id with idr_alloc() + * @rproc: handle of a remote processor + * @ptr: pointer to the resource to allocate id for + * @rsc_type: type of the resource for which to allocate id + * @start: start id + * @end: end id + * + * This function returns an ID from idr_alloc() or negative number + * if it fails. + */ +int rproc_idr_alloc(struct rproc *rproc, void *ptr, unsigned int rsc_type, + int start, int end) +{ + struct rproc_id_rsc *rsc; + int ret; + + rsc = kzalloc(sizeof(*rsc), GFP_KERNEL); + if (!rsc) + return -ENOMEM; + + rsc->rsc_ptr = ptr; + rsc->rsc_type = rsc_type; + + ret = idr_alloc(&rproc->notifyids, rsc, start, end, GFP_KERNEL); + if (ret < 0) + kfree(rsc); + return ret; +} + +/** + * rproc_idr_remove() - remove id with idr_remove() + * @rproc: handle of a remote processor + * @id: id to remove + */ +void rproc_idr_remove(struct rproc *rproc, int id) +{ + struct rproc_id_rsc *rsc; + + rsc = idr_find(&rproc->notifyids, id); + if (!rsc) + return; + idr_remove(&rproc->notifyids, id); + kfree(rsc); +} + +/** * rproc_da_to_va() - lookup the kernel virtual address for a remoteproc address * @rproc: handle of a remote processor * @da: remoteproc device address to translate diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index 7e25621..865bd1c 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -94,6 +94,12 @@ struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc, int rproc_init_sysfs(void); void rproc_exit_sysfs(void); +/* rproc idr_alloc wrapper */ +int rproc_idr_alloc(struct rproc *rproc, void *ptr, unsigned int rsc_type, + int start, int end); +/* rproc idr_remove wrapper */ +void rproc_idr_remove(struct rproc *rproc, int id); + void rproc_free_vring(struct rproc_vring *rvring); int rproc_alloc_vring(struct rproc_vdev *rvdev, int i);