Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp960354ybb; Wed, 1 Apr 2020 12:53:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvFIgbT6ya/JvAfan5v3v2XLmmq53WrGhH0a1Q0O8pWC/7suPGRPuE7rjBxXrpMybHFK+B X-Received: by 2002:a9d:1b31:: with SMTP id l46mr16887266otl.95.1585770805187; Wed, 01 Apr 2020 12:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585770805; cv=none; d=google.com; s=arc-20160816; b=aMBiKzNPUuT2Z5W9q4rm3e/k7MWBWf5LmtxN11fpEqLxEW3FcTlqzT+qrEAgwwaRt+ OZJiG/83v5hAmsdW1lTrFWVGU1O0k49SWEOmBdNEMaHct8pVrF8e3ZEpGfbIMdPr7n1s pWz6YdmVC9322onsBwMfydK9eKvxwZvIItMItCXAqd64VR4hr8j+bhqwhmIyuZ2Vos4B B3YJbfyro40IlQQDnr6lSXAqdhsaga0yIbh7SA4juld5OosGrUo7DcGLaKe3p4WMn3xb XWoVtg7hqk6K/q3TMjuVHBM6RLg5Wt1bMNARc0emsooHit2qZ1GM/XzkC9XafpIps6Rb gYsw== 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=LsDMheC8SS62q9waKXWddWs2pH91G3pR665kWUXQLBM=; b=ql7K54UGwoERkF1WvZQJyKrmrmoZDrGpZm9YrI7FaIC753g1Xu+pMClD34fYSJfA00 cxjb1/ZaKZDJwptTbZGKhegBUTdtwO+tPvuR/NMWuAISfQ9vXepYXmuzrVpsrtAY/FdG EfBlFqmHMBjNdMFhmtMck3O1VWon5rVOylrZeYEAPq3Jnn+hxvMnMBl5CmdUieXzcXmO JCzCQtXoNgxWbVcHniZbJ386CsAjXWutBLdYEWH7dhCJesZhuR50EENfUeupbGF2AdzQ lWqt6Rqv5Qvy01UoSx5lZDjglvVcGiwB67ZnazpxzgzlK/dx0fzEJTrZV1yp5PCgpkBK n3tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qvi7+I0C; 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 z9si1260545oih.157.2020.04.01.12.53.12; Wed, 01 Apr 2020 12:53:25 -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=qvi7+I0C; 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 S1732695AbgDATwQ (ORCPT + 99 others); Wed, 1 Apr 2020 15:52:16 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:35196 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732537AbgDATwP (ORCPT ); Wed, 1 Apr 2020 15:52:15 -0400 Received: by mail-pj1-f67.google.com with SMTP id g9so530566pjp.0 for ; Wed, 01 Apr 2020 12:52:15 -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=LsDMheC8SS62q9waKXWddWs2pH91G3pR665kWUXQLBM=; b=qvi7+I0CwiG+b1dWM/ewIw01MXMuU2u/wTjiTt3mNr3fhIQUObT+bJnEdMS5Zn+ndh ugDvKS1ZN5nTm1Od948Yk0AKj+Ee8vRzdBdRxxlmROyfUxXK36YZaWsMdrUQEnaK8oNI rVjduDmIUqXK8r2jnljeTCi/0XBT55wIoBedpFiZBBIOdFyoNepbqyuwu9tvQ0thu5cO DCqn6cZKntk9hx7UVPSAW9fjszJxoJYXe/1+2OPpWSarYP2Mk+9W7Br50uLMgdU5XM7X 7bRU3KuPB/oovfPvyjflnASQvzgJQ5ge9rX/tNBaOOOq15CUwrWsxtKEwO69mFCYIZgh glZg== 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=LsDMheC8SS62q9waKXWddWs2pH91G3pR665kWUXQLBM=; b=EV3gwqgD4YXmn/KMlUhbdcvUgEtM8WONvK+OQSR98ACG9GrqilYeux4KjJniW6uoBw kkjMOqq+DHzdI95lX+sagavWmUB537NA8e50oRzzBFk31H97rFlHZU6+MFi70VzT8gb4 Olfrey5tNsz/WW6kox1e+3mT4MLqLbv34/dHq5G1hq6e5nWyEwb9bc4R2VOhzvGYaKT3 rnvjAKL9c/fJNp9l4gJVgU37wkfTIHBoh3q715vfFmarXN2o0LTEfZujOQjMojy+nX+Z JEil0oIy6Wq38IjvzrnVphQcl/f1+JXIbqFlciGFKsaM9UJT1I3REU3BweS37/MbDCab CgiA== X-Gm-Message-State: ANhLgQ0CXGCwttNjIPgaz85sYSxaPHBz5AdlqWazZz9OYX9sV0W0gxZH mL/zWRVTPYHMGPT1d9s1ZU4jxtR0QVI= X-Received: by 2002:a17:902:fe0f:: with SMTP id g15mr25314360plj.25.1585770734529; Wed, 01 Apr 2020 12:52:14 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k4sm2214701pfh.0.2020.04.01.12.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 12:52:13 -0700 (PDT) Date: Wed, 1 Apr 2020 12:52:11 -0700 From: Bjorn Andersson To: Rishabh Bhatnagar Cc: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, psodagud@codeaurora.org, tsoni@codeaurora.org, sidgup@codeaurora.org Subject: Re: [PATCH v2 2/2] remoteproc: core: Register the character device interface Message-ID: <20200401195211.GE267644@minitux> References: <1585699438-14394-1-git-send-email-rishabhb@codeaurora.org> <1585699438-14394-2-git-send-email-rishabhb@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585699438-14394-2-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 Tue 31 Mar 17:03 PDT 2020, Rishabh Bhatnagar wrote: > 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 > --- Reviewed-by: Bjorn Andersson Regards, Bjorn > drivers/remoteproc/remoteproc_core.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 097f33e..76ba171 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1916,6 +1916,13 @@ 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) { > + dev_err(dev, "Failed to add char dev for %s\n", rproc->name); > + return ret; > + } > + > /* if rproc is marked always-on, request it to boot */ > if (rproc->auto_boot) { > ret = rproc_trigger_auto_boot(rproc); > @@ -2137,6 +2144,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); > @@ -2220,6 +2228,7 @@ static int __init remoteproc_init(void) > { > rproc_init_sysfs(); > rproc_init_debugfs(); > + rproc_init_cdev(); > > return 0; > } > @@ -2231,6 +2240,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