Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp238744ybb; Tue, 24 Mar 2020 21:23:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt+VdchhBzaclbfONykdGmdos+V2SPSwHVJrypO0xCtubI2hxwqCtb8Wn+cDWa6/BKTlKP4 X-Received: by 2002:a9d:42f:: with SMTP id 44mr1093770otc.236.1585110221312; Tue, 24 Mar 2020 21:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585110221; cv=none; d=google.com; s=arc-20160816; b=GqgBe4GQelUf5JHhk0s6CE++G0Yal9gfnSXHdDtnm54RHIZHXtLj/xLxdlh7li3Ygb IYoFytQ2n8vl52SLla5dkklgpj6nXJX9iWg8Jmkw5Lc0jRW+m0+dWnn6LZkYOL1Y1no/ Q1GJjwxZPyFXF3dhk5zumCV5usOG4mlLbwCAYQb4ILw2E7etgEJrnVsKbkUaFbdRZ2n/ Y3nvChJWGNAvuQg1libA6jL2on1HKDDm5JeZO381tQMAnoLHsvhG5b/WIggo78EG8CsA 78l8+TwqlH5O27uhsxCkdzikoxiPBS1ZtE3Np0j/BExHBm/TTyP7icDT55za13lRo+QO /LEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QPnMD9tlQfz+kYNVjKX+0BbvWV7yF+fxot/1nuirqCc=; b=T0qbSg3g173l+DwE+2O0fDziaFCnYtheSCmdfD9l04oB6HOEowZzRXlOcRuuyn0F3q ddBOPQNk7KCNlaErUhyciALK2fIFCS8Me3y7zMXQrC9IQPFZoWc7Jx1fLFqLkhd708tz tj3Sg6gaGTy8b2crFA1vb/Gerr0qICdarkkiY4R8VYCRJO+TnrOPaSNkEein5ERLqEKt ghBtp3c4YpzNoJ7xOitvCt15WolJo8vRB97kjFwUy2pwYYOlPxX9i6xYJTFgGYBYn8/P /C1koVsv+ioDsKhYwddoxWjPW1z+VzUKgfUbaBE1tCinoqIVDjU4LfEmaTTNdscFKyaD hBFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TPqXq3uH; 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 h7si10644049oia.277.2020.03.24.21.23.28; Tue, 24 Mar 2020 21:23:41 -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=TPqXq3uH; 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 S1726086AbgCYEXB (ORCPT + 99 others); Wed, 25 Mar 2020 00:23:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33406 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725263AbgCYEXB (ORCPT ); Wed, 25 Mar 2020 00:23:01 -0400 Received: by mail-pf1-f193.google.com with SMTP id j1so443475pfe.0 for ; Tue, 24 Mar 2020 21:23:01 -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; bh=QPnMD9tlQfz+kYNVjKX+0BbvWV7yF+fxot/1nuirqCc=; b=TPqXq3uHr1WbFxIUHYMgl0ESfVkxf0unJLqC/SSONUpKLvbUMrenvUqx6gpV/52ZAa LcidMqP1UQEfE5YjI4FueaNbmcGRGdtKrV/yw18z1SYN0+wLQ8fiXRSZKq36+hLmj/p+ LA3PHiJ+3PVOXVivFkvlEi4K4VvTpMJ1r/HPeAQXQNJF44eTxQ8bgH7pmtjPrgNd8tkt /eglxIj1FrmE/HfKAPGFfFEAS2HBtrX+fIimo/HU5l9n0Ayppiihk5YqoI50h4Nsp3Pl w+C+W0qUuI0WaZWLyuP10ECvC+58jkOY58W3JnlHULr4wdZmUIy+wEquAcCCU7+0Rpus 3G9Q== 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; bh=QPnMD9tlQfz+kYNVjKX+0BbvWV7yF+fxot/1nuirqCc=; b=lii63TSW0sUVGqtg9qoBXhL/stbtUTmac9D6btuZUT/rOhru0TtwAd3h3qYREJnumX jLKPqiwL4bJ+LeuHG6jfzg3b9Zti7OaVHS5VctjDZWqDWs+cwHKKuBnhBv4lChifAomO kpcXKeefNiXhZg1s0IyQoYyQjN5FLIWhW11UePD7WITvtuj8XH56iU+DCFPqvccsblXD jOeSdlejj/75ArBDT2HEBgMv2J6cz6aMzQEbJ4SFlFSaMEqVf/j4Kqbmo627zZaygPgn IO7xX0ks36htD0OngHw6db5cqTSeRi4GluPh4Zaco/HQHxWVN5BGLeun3kKgCNbiNlHg AEgA== X-Gm-Message-State: ANhLgQ3yEn7Ha/N/fVNJIPYTU+Pkw8Lb0hoNpaduCUCJjqUzfU7piN/q 6A/Pw+ioGpeYrKy0Du/WCDBgIa6Yn/s= X-Received: by 2002:aa7:850f:: with SMTP id v15mr1276859pfn.119.1585110180316; Tue, 24 Mar 2020 21:23:00 -0700 (PDT) Received: from yoga (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id i197sm17689386pfe.137.2020.03.24.21.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 21:22:59 -0700 (PDT) Date: Tue, 24 Mar 2020 21:22:57 -0700 From: Bjorn Andersson To: Rishabh Bhatnagar Cc: linux-remoteproc-owner@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, psodagud@codeaurora.org, tsoni@codeaurora.org, sidgup@codeaurora.org Subject: Re: [PATCH 2/2] remoteproc: core: Register the character device interface Message-ID: <20200325042257.GF522435@yoga> References: <1584747377-14824-1-git-send-email-rishabhb@codeaurora.org> <1584747377-14824-3-git-send-email-rishabhb@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1584747377-14824-3-git-send-email-rishabhb@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 20 Mar 16:36 PDT 2020, 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 "subsys_" string. > > Signed-off-by: Rishabh Bhatnagar > --- > drivers/remoteproc/remoteproc_core.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 097f33e..48a3932 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, "subsys_%s", rproc->name); Afaict there's no guarantee that rproc->name is unique and I wonder if this will break any userspace expectations. Please repost this to remoteproc@ so we can get further input on this. And if we can do this, I would like it to be "rproc-%s". Regards, Bjorn > > atomic_set(&rproc->power, 0); > > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project