Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2893550ybb; Mon, 30 Mar 2020 15:26:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtYFxwlkg7WDDsJGtTg1pI/mH0Ug6r+w1fgrRumflthkv01oCs65fjZURKgPdI5D2LaPveJ X-Received: by 2002:a4a:9881:: with SMTP id a1mr11248720ooj.75.1585607186575; Mon, 30 Mar 2020 15:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585607186; cv=none; d=google.com; s=arc-20160816; b=QEejKPP5KOSoFsWnhbLyohH5GNP5qXX61+YNWZmJqWzafKw/U1UmF58NFuDkctGMl7 YA0ouJ1W5BU832pinAwtAGKBqMY+ON4ghXYqx4COCBB5mY8lNs9eGvjrk+9n3IllUe10 uCuER2QbOV8p9bbJK/ZJ37hhUwnPvszKHsmycf+UsaxmgIsr/eT/5U6tGzCWnKgItIhU AlWeNbQa2JwPSmUFt8LoZdDJAoXbAAllYSilcgTkKe6eUB9bK2nFobzHvnrNfL4yOmtg S+VGSS8YjZdP1KNuZrMc28H9IOLKHbR3isPUzS3VRf66J7TgUXp5TQvsfUuJYwODHuB/ IyHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=08rQs//ODvt7KiR3EZqxVq1yMbI+NkTP2UlfYy031ow=; b=uIdWFW1xnJHQccQFxqH0sRDFgSpqrtOdnpJwNAF5GDFCq8NStsd4sVLCJw3irbVwgQ fjSypG/8Zk/WGppUIQF0PPNe3/9mOrUo+C1bZVExPiNjYY6u0stEH00Qy7yqFCfuZr51 rUc/BeHIwnFHhPtczLQL2aSvl4/TMmnd6+ElZF2hgYGQ3mNpu66dMxJE3rB4SxaJM523 a1VozqBqSxCfRsxHghl7VJNPrwFDOKzZJxxzBpQBGaBrAsAu8Q75pmmlEvkMjuQkpUz0 BxHz1UM5/p/sEmSkeXqUR4jR7mbBnHAyexkOSY7nz9/tM+o7ksjmEvDk0olk7Bo6d+pX hj6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ep4cwmex; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si4152537oti.142.2020.03.30.15.26.14; Mon, 30 Mar 2020 15:26:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ep4cwmex; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729878AbgC3WNn (ORCPT + 99 others); Mon, 30 Mar 2020 18:13:43 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43467 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728987AbgC3WNn (ORCPT ); Mon, 30 Mar 2020 18:13:43 -0400 Received: by mail-pl1-f193.google.com with SMTP id v23so7297975ply.10 for ; Mon, 30 Mar 2020 15:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=08rQs//ODvt7KiR3EZqxVq1yMbI+NkTP2UlfYy031ow=; b=ep4cwmexueRwdEOhd3IlGYnx8BvGJ8Dt8/y6GoOBmiKy6RqVhxYf+u7yyklBxTz1MU F6p0FoiE1Ctui8aSaeOMFmtgyKFR5kEd5pmu6aodyaZGLUmZPPlhhLQ85I2X6mZsnrap yuOkkrDkDkNHUpXgaaKTsoWrd1h5s9GrH2eopuymPSwPUp3zMenGalQXwJ7OTAHCcyKd 5hF3tHyv4O39fMPJ6IamtTyckPVM+0lAYX+GrGgtJDFH7zrTACZ2hhRwoHgDd/dtXsAK BuFi9SHD3irHOgfSsvntDxdTe84t3kdH29hRO40RfWcgIZnr/59fWoUzBKFIFohCsgFY 3r+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=08rQs//ODvt7KiR3EZqxVq1yMbI+NkTP2UlfYy031ow=; b=e/bJi2cJm5051aRBjSD5QtwTZT3l6jvChInv7jb0LolyrHH/KiTqsS3X9EEFSD/F7O 9yFQ/VqdvLkxF/E1FskXNer7VP4moIfoo4qyFgXrxG509orlgy//5f1nNU74fBzpKacX pyYBDe4vY/Grl5COcgECf/r2Rij4laG+X7hRFa9s5aDBFywDiVB0Tvuj0Ahyo21fp5lA dQRu4oCMeXzlVpp07ChhYqq9ABlP7wuqVCr5JmrIcvIa2SZth4QSeBKhEzfyg5tlZN3q Npa5XMGJdGeQ0MqlYZk8RFO/0EjzFx3zPXUxtemhQhmrHo+UmVdFtv2YIHqp+xRu33pz j2TQ== X-Gm-Message-State: AGi0PubRYH6YH+v0oxrynz15GbdfQWv67ge3s/cXe9dk/6qCCjz2YYlr KB9J2ox8hpk4yaqzAeT9amsbQg== X-Received: by 2002:a17:90a:db02:: with SMTP id g2mr277462pjv.15.1585606421119; Mon, 30 Mar 2020 15:13:41 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id x188sm11252546pfx.198.2020.03.30.15.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 15:13:40 -0700 (PDT) Date: Mon, 30 Mar 2020 16:13:38 -0600 From: Mathieu Poirier To: Rishabh Bhatnagar Cc: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, psodagud@codeaurora.org, tsoni@codeaurora.org, sidgup@codeaurora.org Subject: Re: [PATCH 2/2] remoteproc: core: Register the character device interface Message-ID: <20200330221338.GB17782@xps15> References: <1585241440-7572-1-git-send-email-rishabhb@codeaurora.org> <1585241440-7572-3-git-send-email-rishabhb@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585241440-7572-3-git-send-email-rishabhb@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 09:50:40AM -0700, Rishabh Bhatnagar wrote: > Add the character device during rproc_add. This would create > a character device node at /dev/subsys_. Userspace > applications can interact with the remote processor using this > interface rather than using sysfs node. To distinguish between > different remote processor nodes the device name has been changed > to include the rproc name appended to "rproc_" string. > > Change-Id: I2114f77f8d2b5fd97e281021ec9905ef5c2fb54c > Signed-off-by: Rishabh Bhatnagar > --- > drivers/remoteproc/remoteproc_core.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 097f33e..f657983 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1907,6 +1907,12 @@ int rproc_add(struct rproc *rproc) > struct device *dev = &rproc->dev; > int ret; > > + ret = rproc_char_device_add(rproc); > + if (ret) { > + pr_err("error while adding character device\n"); > + return ret; > + } > + > ret = device_add(dev); > if (ret < 0) > return ret; > @@ -2044,7 +2050,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, > return NULL; > } > > - dev_set_name(&rproc->dev, "remoteproc%d", rproc->index); > + dev_set_name(&rproc->dev, "rproc_%s", rproc->name); Unfortunately you can't do that. The name of the remoteproc in sysfs is visible by users and a lot of scripts will fail because of this change. > > atomic_set(&rproc->power, 0); > > @@ -2220,6 +2226,7 @@ static int __init remoteproc_init(void) > { > rproc_init_sysfs(); > rproc_init_debugfs(); > + rproc_init_cdev(); > > return 0; > } > @@ -2231,6 +2238,7 @@ static void __exit remoteproc_exit(void) > > rproc_exit_debugfs(); > rproc_exit_sysfs(); > + rproc_exit_cdev(); > } > module_exit(remoteproc_exit); > > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project