Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp690297pxb; Tue, 19 Oct 2021 10:54:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFUilmef336pNO/0OyKgvCepp64ghD0y7l7DkcJrpvnCLJau+EppL4o9jOqf+RezN49cg5 X-Received: by 2002:a17:906:5805:: with SMTP id m5mr40463812ejq.221.1634666055621; Tue, 19 Oct 2021 10:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634666055; cv=none; d=google.com; s=arc-20160816; b=arQcNig1sVHC3WHi56PxH4VgohqhyLUjiRsJGINhFdDtT83Eh4o+PBPBKSK38x/nPH 7VbBaUbl7YIFR+7UOk50PVvROklkbIo8iX0NaffOWAHOVaBBkKfMy4v0wOpSRvVn9X9W q1QdA+1NbbLtFJcaZGr0Kcyq0R2fpehj0RXamDVoGy6bgdb9ovl4Y7icx+fn4uvuFMQ+ fMqPVLxc3f6vCTkkbkcv98cGoANu40llUn+kzn+LInmY5WmykDcm3piZ8QIp+TcTJtk0 RPIhysAOlZojONQe4MVr3BdqHyyBmmbbnqz3ymZ3PgZGuFjuBV/x0WC6loRtZU3mWaVP ZlLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=89Q/XwlG7K9QjhGfCn1Wc1KjC2i0sRysqqYs+AmNUQE=; b=HB9Wp+FX4//eRrVD1kH0XnsoqJygM07V3WXIdRZDzlUkjqXtvpuV6KSDa4Gv4+dJf/ gbMYazMYzxijOWQPETbRH09dgQwALTRsYHBV6LgOUpsigRbVXfLkauyLRgWvplTEVamH VpLsHKyHhL4g52Dk28LIYrl6b/Ocq6x0Y+AWxbxBD6jpIUxhmU5RK/e2ED9st+Xa5b3k tyITY9V7lWGqLIqUGHifh0KJd57Z8cTIK1n1r0PrFx+DZg200+0YaSBt/gXwopyZMLb+ AD1bpQ9dXmJ0tSQUizq31eiFLXXVoqk+vEHMFmxxJew3RL6M3/QdSm6abuvMbDApWjow nzkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QqBZQ2oY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id x16si40200056edd.36.2021.10.19.10.53.51; Tue, 19 Oct 2021 10:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QqBZQ2oY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233916AbhJSRvd (ORCPT + 99 others); Tue, 19 Oct 2021 13:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233613AbhJSRvd (ORCPT ); Tue, 19 Oct 2021 13:51:33 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB76C061746 for ; Tue, 19 Oct 2021 10:49:20 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 187so592231pfc.10 for ; Tue, 19 Oct 2021 10:49:20 -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=89Q/XwlG7K9QjhGfCn1Wc1KjC2i0sRysqqYs+AmNUQE=; b=QqBZQ2oY0XncA0F2vWMKSAd1b02KZ1fZMpyo5zMWdEAftnVkOaBQWB/5RLU4FI1opi jkOZJlMz6WLfWBCeygXdJXIHT+cBGooxdY326qmmymUk5GdXZciETGT0RLsFAVmitW50 zxKEax9RktgHj28gpfInseMAVbJSpXae0a+sm1DtL6e6DeScdyyoSh7UEI1b8/ayZ9EZ 356fDv1e+rib82YPUwHA/Ucil+4Cv1gwWyhi4f3FoU7KMjzvagupwxUBCfrzpWuLKYMz /pMSPg3WhEKuEd8nmj+EQlFiiUPts8rBe4p3Yrk1yMiCiHN5tzWbRze+CplP2OC8noBL J2bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=89Q/XwlG7K9QjhGfCn1Wc1KjC2i0sRysqqYs+AmNUQE=; b=Up26OLrgjXcvwoo3r3eHnxF9xPUX1oFs0OYbjqGLO3SsmqdGWe5gf4M3oRbo8jVK/e 5uhnjLCqDH9GIFtsmKOGddTM5Lwnz729+TKN2lqSthFa7VmIYYOpdjIOFFYnfiyze9hu 0ro8t5ejzosSjuH1t36bY14v29ad73tpRYQJ2osmyCNaOEkl+5M9ovT4qkecg+Q7et9S 7vduDsuPDM+9cE3884HLP5IJQtrWkt/OcPe2ZUFVwWrMVF3J5Dze1lL17KQNr5J4bbnZ tI9bZihZCh+92cXv2+f1ow4/zJldY3NRU5JxX9J3iVW0ouUbTj7SgTW86NPUL/uqq0RF D04Q== X-Gm-Message-State: AOAM530l6kKcSVF3itg1ZxQCQNYIKYu6bGZSvGAHbMsaYOuFmx2sSPiF iLeQZCTrYif2+8QW0hQZGIIofg== X-Received: by 2002:a05:6a00:234f:b0:3eb:3ffd:6da2 with SMTP id j15-20020a056a00234f00b003eb3ffd6da2mr1252022pfj.15.1634665759796; Tue, 19 Oct 2021 10:49:19 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id s22sm16722906pfe.76.2021.10.19.10.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 10:49:18 -0700 (PDT) Date: Tue, 19 Oct 2021 11:49:16 -0600 From: Mathieu Poirier To: Arnaud Pouliquen Cc: Bjorn Andersson , Ohad Ben-Cohen , 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 Subject: Re: [RFC PATCH 4/7] remoteproc: create the REMOTEPROC_VIRTIO config Message-ID: <20211019174916.GB3340362@p14s> References: <20211001101234.4247-1-arnaud.pouliquen@foss.st.com> <20211001101234.4247-5-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211001101234.4247-5-arnaud.pouliquen@foss.st.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 01, 2021 at 12:12:31PM +0200, Arnaud Pouliquen wrote: > Create the config to associate to the remoteproc virtio. > > Notice that the REMOTEPROC_VIRTIO config can not set to m. the reason > is that it defines API that is used by the built-in remote proc core. > Functions such are rproc_add_virtio_dev can be called during the > Linux boot phase. > > Signed-off-by: Arnaud Pouliquen > --- > drivers/remoteproc/Kconfig | 11 +++++++++- > drivers/remoteproc/Makefile | 2 +- > drivers/remoteproc/remoteproc_internal.h | 28 ++++++++++++++++++++++++ > 3 files changed, 39 insertions(+), 2 deletions(-) > > diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig > index 9a6eedc3994a..f271552c0d84 100644 > --- a/drivers/remoteproc/Kconfig > +++ b/drivers/remoteproc/Kconfig > @@ -6,7 +6,7 @@ config REMOTEPROC > depends on HAS_DMA > select CRC32 > select FW_LOADER > - select VIRTIO > + select REMOTEPROC_VIRTIO > select WANT_DEV_COREDUMP > help > Support for remote processors (such as DSP coprocessors). These > @@ -14,6 +14,15 @@ config REMOTEPROC > > if REMOTEPROC > > +config REMOTEPROC_VIRTIO > + bool "Remoteproc virtio device " > + select VIRTIO > + help > + Say y here to have a virtio device support for the remoteproc > + communication. > + > + It's safe to say N if you don't use the virtio for the IPC. This one is weird but there is no need to comment further after reading your conversation with Bjorn. > + > config REMOTEPROC_CDEV > bool "Remoteproc character device interface" > help > diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile > index bb26c9e4ef9c..73d2384a76aa 100644 > --- a/drivers/remoteproc/Makefile > +++ b/drivers/remoteproc/Makefile > @@ -8,8 +8,8 @@ remoteproc-y := remoteproc_core.o > remoteproc-y += remoteproc_coredump.o > remoteproc-y += remoteproc_debugfs.o > remoteproc-y += remoteproc_sysfs.o > -remoteproc-y += remoteproc_virtio.o > remoteproc-y += remoteproc_elf_loader.o > +obj-$(CONFIG_REMOTEPROC_VIRTIO) += remoteproc_virtio.o > obj-$(CONFIG_REMOTEPROC_CDEV) += remoteproc_cdev.o > obj-$(CONFIG_IMX_REMOTEPROC) += imx_rproc.o > obj-$(CONFIG_INGENIC_VPU_RPROC) += ingenic_rproc.o > diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h > index 152fe2e8668a..4ce012c353c0 100644 > --- a/drivers/remoteproc/remoteproc_internal.h > +++ b/drivers/remoteproc/remoteproc_internal.h > @@ -30,10 +30,38 @@ int rproc_of_parse_firmware(struct device *dev, int index, > const char **fw_name); > > /* from remoteproc_virtio.c */ > +#if IS_ENABLED(CONFIG_REMOTEPROC_VIRTIO) > + > int rproc_rvdev_add_device(struct rproc_vdev *rvdev); > irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id); > void rproc_vdev_release(struct kref *ref); > > +#else > + > +int rproc_rvdev_add_device(struct rproc_vdev *rvdev) > +{ > + /* This shouldn't be possible */ > + WARN_ON(1); > + > + return -ENXIO; > +} > + > +static inline irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id) > +{ > + /* This shouldn't be possible */ > + WARN_ON(1); > + > + return IRQ_NONE; > +} > + > +static inline void rproc_vdev_release(struct kref *ref) > +{ > + /* This shouldn't be possible */ > + WARN_ON(1); > +} > + > +#endif > + > /* from remoteproc_debugfs.c */ > void rproc_remove_trace_file(struct dentry *tfile); > struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc, > -- > 2.17.1 >