Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp629087iof; Mon, 6 Jun 2022 09:38:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEZADB1arUTe2gAMI68rA9zsvKFundNfxb1bg3GLjPmegxcMPftvQVpgK9vf/PpyiXlh4G X-Received: by 2002:a17:90a:bd89:b0:1e3:50de:5ccf with SMTP id z9-20020a17090abd8900b001e350de5ccfmr27516826pjr.104.1654533510641; Mon, 06 Jun 2022 09:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654533510; cv=none; d=google.com; s=arc-20160816; b=t7r2VdfZhnU4ubTLc9ENvF2ZxndqY78hH57WAmIaS/Pnib36RUw5Wn0cgrabeZFTTE WovNWbRKBnpZemfRGSRBfLgAt7T/ajC8LtKWzwakxaaU/woAQCT1oUC4ofT+s2/+459M n6Q46k0KV3QikGpL7PtnCd24qqyAVaZgnTWoEiZik72gieaLHIG8YmIJpLGICM6kxUnr JpWBGGTieh2JU/L/xrJD9uQo6PJalrfH/Qe/s5tqX9UrsMQHDRhiCSzeGFKM217jTJmj xDQbyqAi2ljK6Wj8UlMRSW+JkCBdjOHLUsKz6wQ+fVm1w3m/CxPUm7Lr1mM3aWEGAtFP gdoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=12UkLhNWmn2NlSuxlr6S4i7rRJBFRzlnkvu5nBhtCdk=; b=i0U46jl3rA/SrMCpDuC5ABLscKU+4sDd4J9088uNBXBRXK3gDz3XaZgae/eRPyL4Xy FTSZ79xCPPr6SXOYZ/sznr8miTvK0D1oz4bDYtVxDrVJpKDAVoGs71OqqZeIWtO8IkGC 4mH3IIkXsbfkOcVflqkWTfCCCrQ7vPIB7UE7ghcFdH0noqFTjRz41qzPXC5hG6uhOH1A X4lo+085qoat4bhnKlqh9bSUgk+XHRwu3ME+ksuVhBWwnAM7Dx5x9dU0QsvcELfHR8FL d4VtXA0vwSsicoB3n8409aW1Mn1/DD5w2FtIeuaC2jbCFvzK7aSihvvq/kHBf+aPafSx Xlgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DFflpyIF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o17-20020a639211000000b003fa4c5f1a23si22574112pgd.253.2022.06.06.09.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 09:38:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DFflpyIF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 542652D898C; Mon, 6 Jun 2022 09:21:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241737AbiFFQU4 (ORCPT + 99 others); Mon, 6 Jun 2022 12:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241688AbiFFQUz (ORCPT ); Mon, 6 Jun 2022 12:20:55 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 831C32B2BAF for ; Mon, 6 Jun 2022 09:20:54 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id q1so29955913ejz.9 for ; Mon, 06 Jun 2022 09:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=12UkLhNWmn2NlSuxlr6S4i7rRJBFRzlnkvu5nBhtCdk=; b=DFflpyIFsZnXHHqmPDg2ed5oqgbXienQBXEPLAaCN/Rw/SD9GDpUQKli40bGJQrMvW d+mCUp9VxvOfdf5J0RrlUNq7WdkjaSStwDF4au+pvldwh621urWTtklhLgROAMxL6Zb0 /12gojX0eluv6wl7sIV3Cb+6xpuA68WDLF4eopEzoDyz1FilA1N40+ZRysXVjgyBZ3my ydGPh5FvCWvFpOCLtzcbqk1eabc01zfqE3A8+cy9O7r2XTkvpDje1arAnkuTEpgT1OSO yFNMJa5+XiBnHZB/lCCWXGKcmG1hqtTH6eIHfuRHNkrVZDoQFvKPEhqaMSY6JBMtn0pc 3Hng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=12UkLhNWmn2NlSuxlr6S4i7rRJBFRzlnkvu5nBhtCdk=; b=DedX4EGRk6AOnPDxv6maLdp3S6bvM0xDxJBR5/ieLjqQ0wom6UWlv09MPI2KLuiOhY wggqiJbyYSqa4y0jLTrpkjmxNn4p6M8P2tHE/NP6k9U4H9VeWNY3RChSB2g+H5oUd5kw cagnR/7fTEhkWL0cVSR/Y3pqYYHo/rgbeP79Uns51SrUmJVyTdvwjlrME8E5DmJNR56B /w1LvewKgLaMq6TXqXizo4iFswl0WrnEYQM3dfhRNag8xAcbmdLxC0K8SGebOlnJxAvJ xfCwlUY10sTIKjqN2eA72Lc89mjeJf06y9l8vpqZ9RnrXXsLKoflWzVjH/6UNO6OF5I3 wFkA== X-Gm-Message-State: AOAM532nE6KbeXBA+oCWd39sGOspvfJzjPVhBqak3zJlZDXyZqBLEnIC L6ZDWkxmYXgSxxLPYtmHMfsF/Jgags+9xyavI9m2Ww== X-Received: by 2002:a17:907:c22:b0:711:dc95:3996 with SMTP id ga34-20020a1709070c2200b00711dc953996mr396834ejc.62.1654532453015; Mon, 06 Jun 2022 09:20:53 -0700 (PDT) MIME-Version: 1.0 References: <20220406095446.1187968-1-arnaud.pouliquen@foss.st.com> <20220406095446.1187968-3-arnaud.pouliquen@foss.st.com> <20220601174159.GD531268@p14s> In-Reply-To: From: Mathieu Poirier Date: Mon, 6 Jun 2022 10:20:41 -0600 Message-ID: Subject: Re: [RFC PATCH v5 2/4] remoteproc: core: Introduce rproc_register_rvdev function To: Arnaud POULIQUEN Cc: Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Rob Herring , Christoph Hellwig , Stefano Stabellini , Bruce Ashfield Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Jun 2022 at 05:54, Arnaud POULIQUEN wrote: > > Hello Mathieu, > > On 6/1/22 19:41, Mathieu Poirier wrote: > > On Wed, Apr 06, 2022 at 11:54:44AM +0200, Arnaud Pouliquen wrote: > >> The rproc structure contains a list of registered rproc_vdev structure. > > > > This should be rproc_rvdev. > > Thanks for your review! > > I will send a new version according to your comments except > this one. > The structure name rproc_vdev is the good one, or > or maybe I'm missing something? > You are correct - I had the name of the variable, i.e rvdev, found in rproc_handle_vdev() in my head. You can forget this comment. > Thanks, > Arnaud > > > > >> To be able to move the management of the rproc_vdev structure in > >> remoteproc_virtio.c (i.e rproc_rvdev_add_device and > >> rproc_rvdev_remove_device functions), introduce the rproc_register_rvdev > >> and rproc_unregister_rvdev functions. > > > > The name of those functions doesn't match the content of the patch. > > > >> > >> Signed-off-by: Arnaud Pouliquen > >> --- > >> drivers/remoteproc/remoteproc_core.c | 16 ++++++++++++++-- > >> 1 file changed, 14 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > >> index 3a469220ac73..081bea39daf4 100644 > >> --- a/drivers/remoteproc/remoteproc_core.c > >> +++ b/drivers/remoteproc/remoteproc_core.c > >> @@ -484,6 +484,18 @@ static int copy_dma_range_map(struct device *to, struct device *from) > >> return 0; > >> } > >> > >> +static void rproc_add_rvdev(struct rproc *rproc, struct rproc_vdev *rvdev) > >> +{ > >> + if (rvdev && rproc) > >> + list_add_tail(&rvdev->node, &rproc->rvdevs); > >> +} > >> + > >> +static void rproc_remove_rvdev(struct rproc_vdev *rvdev) > >> +{ > >> + if (rvdev) > >> + list_del(&rvdev->node); > >> +} > >> + > >> static struct rproc_vdev * > >> rproc_rvdev_add_device(struct rproc *rproc, struct rproc_vdev_data *rvdev_data) > >> { > >> @@ -547,7 +559,7 @@ rproc_rvdev_add_device(struct rproc *rproc, struct rproc_vdev_data *rvdev_data) > >> goto unwind_vring_allocations; > >> } > >> > >> - list_add_tail(&rvdev->node, &rproc->rvdevs); > >> + rproc_add_rvdev(rproc, rvdev); > >> > >> rvdev->subdev.start = rproc_vdev_do_start; > >> rvdev->subdev.stop = rproc_vdev_do_stop; > >> @@ -576,7 +588,7 @@ static void rproc_rvdev_remove_device(struct rproc_vdev *rvdev) > >> } > >> > >> rproc_remove_subdev(rproc, &rvdev->subdev); > >> - list_del(&rvdev->node); > >> + rproc_remove_rvdev(rvdev); > > > > With the above: > > > > Reviewed-by: Mathieu Poirier > > > >> device_unregister(&rvdev->dev); > >> } > >> > >> -- > >> 2.25.1 > >>