From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27ABAC433E0 for ; Thu, 30 Jul 2020 17:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04CAE22B3F for ; Thu, 30 Jul 2020 17:07:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="upLJW/xo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730194AbgG3RH1 (ORCPT ); Thu, 30 Jul 2020 13:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgG3RH0 (ORCPT ); Thu, 30 Jul 2020 13:07:26 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86B88C061574 for ; Thu, 30 Jul 2020 10:07:26 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t15so5104892pjq.5 for ; Thu, 30 Jul 2020 10:07:26 -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=BrrFi53izKwosuWkfkeFHip15csxCCcTUoGMUdNgzIE=; b=upLJW/xoau1GH4gHQU9IpMBZeZOp3GkQWfyPRsOVW6ELiK775/dkgcSzKDDsBLUK00 VZTO5NQc4kOLT+ta1IDw7PBqMLmTMR2tTUfkTyyAavqcvf2GHe4nqloQdoYEjV7eYLmk R1xXRoU+zmI65QO0iPp43p88hvcg7lKwbe1Qz3VEMOq+rsjFetVkNnbXXyt6do3+ZcBj G4+IYg1SaBnZu6u/NwCorANwQ1++l+/nko7ytjQzwJOxXGYZ9OiLj8Ec1eUiABJvXvOX TMeJm7a/jEjaUiSSmAHo+GfToUCssYizLmCNRVkwzZ0wT455H99++JzLQ5dAY2DA21XM T9Ew== 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=BrrFi53izKwosuWkfkeFHip15csxCCcTUoGMUdNgzIE=; b=JZCB23MQk38TX9/El3/blqqor5NRmeuvouiv0sOK7yFCjo9KsqtDOJVgshiqhPUonc 1QXvmuU/os+0z/+jaMl3CZ0dgvJYBaKdBpXh7wVd6abn9o70CARnPVBnoDBZSSWhu38z +U5HH3L7g6VJC/z4WXxPSkANI81neYkehtWmsbURtyF/ZH2Zn4F51is4gsbeLKUoav74 Emjk+VMpyiB7bDy37zHPMFYz0chxVrl99cL3/K4NqVCfRR05tJDPMUt9QslDzdZzG5QP Vz8MBDIHPYzWlK3KfFdnSxfRgJ8+LdxJodnWmymCsEAIKTkRVDqI/6HriblC1fYDEhjM cC8Q== X-Gm-Message-State: AOAM531GBXR1sBO91Ajt9ieP7YDydx5WDL1NeM5Qgdav/MDP/GUPI5Pk 6pNU7mWi7NldbOpayU+x8WMbPw== X-Google-Smtp-Source: ABdhPJwvawgZdhNUFWl2ijm5c7x8BwzYl4UjT3262yWGEl9IresjaGvjO+BENkxYlNNrvWq61lPn1Q== X-Received: by 2002:aa7:9f46:: with SMTP id h6mr4273416pfr.321.1596128846055; Thu, 30 Jul 2020 10:07:26 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 190sm227969pfe.174.2020.07.30.10.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 10:07:25 -0700 (PDT) Date: Thu, 30 Jul 2020 11:07:23 -0600 From: Mathieu Poirier To: Siddharth Gupta Cc: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, corbet@lwn.net, 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: Re: [PATCH v5 2/2] remoteproc: core: Register the character device interface Message-ID: <20200730170723.GB3155400@xps15> References: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org On Wed, Jul 29, 2020 at 10:40:01AM -0700, Siddharth Gupta 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 > Signed-off-by: Siddharth Gupta Reviewed-by: Mathieu Poirier > --- > 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43BFFC433E0 for ; Thu, 30 Jul 2020 17:09:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11C5B2082E for ; Thu, 30 Jul 2020 17:09:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k2uzpCaI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="upLJW/xo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11C5B2082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=leNU/zPxn77MC/1Nf58PWsj2txFHekVa8OZawnMQrHc=; b=k2uzpCaI5ffgoUiwGgUCDUH/8 YiElqc5QVBGBBfC/P2KNvfJqVg2e4OwC+Fl3pwbvzXUeyRHgkzXQCxuvF85GrDJWi3+wxruFZ46Ld +u5Q1tDEQOnQap2G1BQvmGAt+OYynhSpqrF0zkestWBVJOdSZFGoUoXMpMQ8xthZ4BUcGtv9BXFf2 2nY4WyxHDcKI0+Vevnd28qoeDvr/xcPJjyvIH4GKJuiZZom0/jT6i+SxDTJqcmVDmrdiE/ObOkdby 2rK7uh7fe8gzTbAc0Z6PILMUuEN92QEV4d6/1mFLgct8vTbgeF6S/zS9s9M2rBhs52Y+UsOa9pzxl TtlIHLxsw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1C1s-000195-1z; Thu, 30 Jul 2020 17:07:40 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1C1g-000157-4z for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2020 17:07:29 +0000 Received: by mail-pl1-x643.google.com with SMTP id b9so14721840plx.6 for ; Thu, 30 Jul 2020 10:07:27 -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=BrrFi53izKwosuWkfkeFHip15csxCCcTUoGMUdNgzIE=; b=upLJW/xoau1GH4gHQU9IpMBZeZOp3GkQWfyPRsOVW6ELiK775/dkgcSzKDDsBLUK00 VZTO5NQc4kOLT+ta1IDw7PBqMLmTMR2tTUfkTyyAavqcvf2GHe4nqloQdoYEjV7eYLmk R1xXRoU+zmI65QO0iPp43p88hvcg7lKwbe1Qz3VEMOq+rsjFetVkNnbXXyt6do3+ZcBj G4+IYg1SaBnZu6u/NwCorANwQ1++l+/nko7ytjQzwJOxXGYZ9OiLj8Ec1eUiABJvXvOX TMeJm7a/jEjaUiSSmAHo+GfToUCssYizLmCNRVkwzZ0wT455H99++JzLQ5dAY2DA21XM T9Ew== 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=BrrFi53izKwosuWkfkeFHip15csxCCcTUoGMUdNgzIE=; b=Zm4XxUeeZ143tHD9qCuOQglDy6s5se6yNAk7Y+Lc1Y+UABGc71vJ9NN3qnb9DuvdrD X1bGFCiY26KAFmgs77a3Msni7EqvZ7CbBsGS6aTfVJc6HP+Vdi6EOkVDUV+CTav151v2 I0bCOxRwq2XKcwIHzy71sBcH+pHiP6Q9SZn//ibc12FmWAisfEm3zkkN9kY2QEPFpjvb YOvz2oKomt9nc770Y12+ccvxeLalzRAotsWbpz5nROYlhsXX119oS+n5OEMdKVSOECWs yAdQsX5a9Cg71nrz6ZCUXqSqLeYpNt6esDHphiTHyEj/VOHsh6brQSHg+li5w1xH577G qKlw== X-Gm-Message-State: AOAM532zgkayz/7wzI4XRqNwFeLl2mGH437ppqKfEgdc+xsIwarRhHaq wKMCSfBFB1E6xzfqzZLb0f+nIg== X-Google-Smtp-Source: ABdhPJwvawgZdhNUFWl2ijm5c7x8BwzYl4UjT3262yWGEl9IresjaGvjO+BENkxYlNNrvWq61lPn1Q== X-Received: by 2002:aa7:9f46:: with SMTP id h6mr4273416pfr.321.1596128846055; Thu, 30 Jul 2020 10:07:26 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 190sm227969pfe.174.2020.07.30.10.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 10:07:25 -0700 (PDT) Date: Thu, 30 Jul 2020 11:07:23 -0600 From: Mathieu Poirier To: Siddharth Gupta Subject: Re: [PATCH v5 2/2] remoteproc: core: Register the character device interface Message-ID: <20200730170723.GB3155400@xps15> References: <1596044401-22083-1-git-send-email-sidgup@codeaurora.org> <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1596044401-22083-3-git-send-email-sidgup@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_130728_242395_1E62E2C9 X-CRM114-Status: GOOD ( 21.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ohad@wizery.com, tsoni@codeaurora.org, corbet@lwn.net, linux-arm-msm@vger.kernel.org, linux-doc@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, agross@kernel.org, rishabhb@codeaurora.org, psodagud@codeaurora.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 29, 2020 at 10:40:01AM -0700, Siddharth Gupta 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 > Signed-off-by: Siddharth Gupta Reviewed-by: Mathieu Poirier > --- > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel