Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1309156ybg; Wed, 29 Jul 2020 10:43:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgn+DkDvxfoyuDSbb0Kcpp9AHcEptGDnjOoSQyOJBNHmdNSEw7domvrL4Zw1fGc4cqqmQJ X-Received: by 2002:a05:6402:204f:: with SMTP id bc15mr30489665edb.70.1596044616979; Wed, 29 Jul 2020 10:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596044616; cv=none; d=google.com; s=arc-20160816; b=G0ajynEOmedzG5L2MvfRgwfR39GHFv0PiZQMN4p3bceLdniC7FvGXXZa7LeNEsqL9N hvK7ws/HX6yyaZEo8xSWeiSGURO5m6/6kEy+REcCQaDK9Z6aUG6JOp4RR7avucY4SIW7 +flg1KJ22Lv4zWtw+V4m4B+FrP6KB2jcET546qh2tdaFsHXZycNIBRe14MZYVJP+y6qp 0FD7/GkPTMl8/oSAoDHUGmHS8Uefh+ZCAl/c0c82fmuoxNpryRSoPn+bZfJrjirMFX2V 09uLIRSHlypUiKstz5c9RjfviumxclN2w+mQ0e/1CynhR3aEf1RCK1j8a1mwPZJ7gQMm hdow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=a8pbIaMcmccol9wdyUafwsFuwnvkkW/9i7k9bh+MNUk=; b=bbZStv8Vv73l/kcoU+YrHgU+BUeeoOqKwCMrduA2gK/MQoAKUYeNCxqylGicwyRCce YHv8SzUQUskFxMXGM+3DkHUtcZxz1N5arMns6/pUUz8m8a9s+A9lsEzh7bIeVkR7Q3JS 6y7bmyYevU5E4sKFB6eKtgNH5bdVTyE3MXULQ+j4382+yh46WBMf3HhMuUl2BMCg5qTl HjMj4RewryFaYahP69ch6tHkAxi31rMQ8Td/GlqF9vw7YkGA6ocecQ839mRsczlJeQxB D9EiedOeDqiphH5qC4b3tQ7GtK/m4ZG7xDqltrO7jz/1soD8fvodsPBcwtBRXNg33jRi A/cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=rwfiP2fY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs18si1596596edb.517.2020.07.29.10.43.14; Wed, 29 Jul 2020 10:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=rwfiP2fY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbgG2Rkm (ORCPT + 99 others); Wed, 29 Jul 2020 13:40:42 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:28014 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727055AbgG2Rkl (ORCPT ); Wed, 29 Jul 2020 13:40:41 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596044440; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=a8pbIaMcmccol9wdyUafwsFuwnvkkW/9i7k9bh+MNUk=; b=rwfiP2fYeIPgB41RWMo7eYo8u5/9v4CxfgfoRLd0wveB0XwlVmPz3haHPL9maT2aD9+4tJ4f xFYpvK++92xhSRQDw9uTzElqcvGRYD7V4X5TRxG023D/LgDFH1RDdEillCH8tOd9mEOiGIhT Sl+bCrTzAcRumjLGj4cGc5V20ks= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n08.prod.us-east-1.postgun.com with SMTP id 5f21b485ca55a5604c70e995 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 29 Jul 2020 17:40:21 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0B70CC433B2; Wed, 29 Jul 2020 17:40:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 05F6BC433AF; Wed, 29 Jul 2020 17:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 05F6BC433AF Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, corbet@lwn.net Cc: Siddharth Gupta , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org Subject: [PATCH v5 2/2] remoteproc: core: Register the character device interface Date: Wed, 29 Jul 2020 10:40:01 -0700 Message-Id: <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> References: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the character device during rproc_add. This would create a character device node at /dev/remoteproc. Userspace applications can interact with the remote processor using this interface. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Siddharth Gupta --- drivers/remoteproc/remoteproc_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 277d3bf..7f90eee 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1986,6 +1986,11 @@ int rproc_add(struct rproc *rproc) /* create debugfs entries */ rproc_create_debug_dir(rproc); + /* add char device for this remoteproc */ + ret = rproc_char_device_add(rproc); + if (ret < 0) + return ret; + /* * Remind ourselves the remote processor has been attached to rather * than booted by the remoteproc core. This is important because the @@ -2262,6 +2267,7 @@ int rproc_del(struct rproc *rproc) mutex_unlock(&rproc->lock); rproc_delete_debug_dir(rproc); + rproc_char_device_remove(rproc); /* the rproc is downref'ed as soon as it's removed from the klist */ mutex_lock(&rproc_list_mutex); @@ -2430,6 +2436,7 @@ static int __init remoteproc_init(void) { rproc_init_sysfs(); rproc_init_debugfs(); + rproc_init_cdev(); rproc_init_panic(); return 0; -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project