From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: andersson@kernel.org, arnaud.pouliquen@foss.st.com,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
shengjiu.wang@gmail.com
Subject: Re: [PATCH v2] remoteproc: core: Auto select rproc-virtio device id
Date: Mon, 17 Oct 2022 11:45:14 -0600 [thread overview]
Message-ID: <20221017174514.GB121862@p14s> (raw)
In-Reply-To: <1665718851-22341-1-git-send-email-shengjiu.wang@nxp.com>
Hey guys,
On Fri, Oct 14, 2022 at 11:40:51AM +0800, Shengjiu Wang wrote:
> With multiple remoteproc device, there will below error:
>
> sysfs: cannot create duplicate filename '/bus/platform/devices/rproc-virtio.0'
>
> The rvdev_data.index is duplicate, that cause issue, so
> need to use the PLATFORM_DEVID_AUTO instead. After fixing
> device name it becomes something like:
> /bus/platform/devices/rproc-virtio.2.auto
>
> Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the remoteproc_virtio")
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
> Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
> Tested-by: Peng Fan <peng.fan@nxp.com>
> ---
> changes in v2:
> - update commit message
>
> drivers/remoteproc/remoteproc_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 8768cb64f560..03a26498e879 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -509,7 +509,7 @@ static int rproc_handle_vdev(struct rproc *rproc, void *ptr,
> rvdev_data.rsc_offset = offset;
> rvdev_data.rsc = rsc;
>
> - pdev = platform_device_register_data(dev, "rproc-virtio", rvdev_data.index, &rvdev_data,
> + pdev = platform_device_register_data(dev, "rproc-virtio", PLATFORM_DEVID_AUTO, &rvdev_data,
> sizeof(rvdev_data));
Just to clarify here... This condition happens on systems where there is more
than one remote processor. In those cases we get dupliation in sysfs because
virtio devices on each seperate instances of "rproc" are getting the same
rproc->nb_vdev number.
If that is the case, please add a comment in the code that clearly highlight
this condition.
Thanks,
Mathieu
> if (IS_ERR(pdev)) {
> dev_err(dev, "failed to create rproc-virtio device\n");
> --
> 2.34.1
>
prev parent reply other threads:[~2022-10-17 17:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 3:40 [PATCH v2] remoteproc: core: Auto select rproc-virtio device id Shengjiu Wang
2022-10-17 17:45 ` Mathieu Poirier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221017174514.GB121862@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox