Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6218744rwi; Tue, 18 Oct 2022 09:29:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NqpmicNnkw8ySRDN8PjQdCrGpIj8/dpfXWDFH0+m7ss67CoqwXPwAmSZRMGMhp7LH29yO X-Received: by 2002:a05:6402:8cc:b0:45c:a5c9:c0a with SMTP id d12-20020a05640208cc00b0045ca5c90c0amr3349637edz.135.1666110576320; Tue, 18 Oct 2022 09:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666110576; cv=none; d=google.com; s=arc-20160816; b=GgXNr7zb58jzJCpqdpC7iJyTbMv0FQrBGK1S3xoTHIIojoZ6IyBcoaruW1tEsr3zUw GVuqCdO8JyEe8eYUbZbWfFvSfQfJy+Trx1wGu6V2i49mB7SNhELBQnmY2f283Zz7GRxi XRylbxHt4xHdCtIIhOOgUg+wO40FBPUYrUBf3vNGQ/n4a1PhSSF8wejIuIx3RMpqhRM7 nLgkRYySHkwtUGSEvnWqgjRODu/+n28ImtY9gt0a27Khz8npexXO7nDp7+IxK8b7XUos eyx0v1IjF3d3Y2wx66fC9IGl1U4adOyELmt4YcFXjZOumTXf0CXfxfpb+ABQV2gzlzw5 eTuA== 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=/EuOApZthRai3b0FADROiybh4EfAASBFudp2TOSEve4=; b=O5I/doP1hGN2ERx9OrXFJbdfL+p8WoB5lw4ZwLgYzxD5n519Yp0a5Mft2SnIwk6P/A NlkyW0v/atWhRvo1wVL58j7SB98wuI4lc5pFy1ZkieIPx0Cvlz0M41xYCyQWVijeSfAW PAixkfT2cwlDuUPui0b6G4HktZkYECe4hjJw/M8Fzh8jXd6F3+M5pZa6pg+a+/ypusWU TljNVEvdHSF3Gh0Bo76utXYpEQY4s2e6p9EnWp8f0RYwzadj0As1zhMyN3SykgTcd337 41n8vLSfgrh7jhFdNCt/UZ2nOyurYYi/3S2fSyquQbTIH3st7D3jWX6ikd9oXiJN+Ez5 262w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TWFoANBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a05640217d200b0044ab43cbef1si10424467edy.450.2022.10.18.09.29.09; Tue, 18 Oct 2022 09:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TWFoANBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229711AbiJRPSf (ORCPT + 99 others); Tue, 18 Oct 2022 11:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiJRPSc (ORCPT ); Tue, 18 Oct 2022 11:18:32 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27CC8D18E3 for ; Tue, 18 Oct 2022 08:18:30 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id p16so11991063iod.6 for ; Tue, 18 Oct 2022 08:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/EuOApZthRai3b0FADROiybh4EfAASBFudp2TOSEve4=; b=TWFoANBzH/sj+Fx9lOxfEZxHXTc1kvvO63+V40elRNGzwYzB3IaGv0Noyd7q+9zaec oynm9VEUQ8S8xzn/BHmZ6SUTs4KO+uEVTC8KgDSU7nl8NkBlLWDolsltJjlSKPZGpi9L A29M7LrPTmqcb96oMUX/thsOCekivpfnuLm3kmO3vl8PW+dAQN0sLkBkdODf12pSrjvb uN+RQZCh8Nm0v4I36C8GnELZalX2AFc8WnP8xlWDfsQmS4nnNfExzhi+PIm3Ut4MvK21 Q770JWJcM5T61297QogozshI9k19SYZUhKKc2zSHWfAlIFKXvixOH/oDRTZi4npD8XDy Hbpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/EuOApZthRai3b0FADROiybh4EfAASBFudp2TOSEve4=; b=XSpccwm7QGiG0Xlm3T1gZUVKHVxwq6vwU28Di+3a+sTLk1cwMAwZYG0R7vxoUcFI/1 /AaiIAYcmsFnI5TPn73IJiJjslYsLX4HeeEo9apZ4dTfHP9Ugh7HJlpKKIEKwhRc6NTo 0MjZxbPj98Uk34mOsu3gMl9nY0YJRVYkgM4bYZbT8c2566QfppWAnuTes1Nqlg7vA5fv 0gurX9eqeDe7rdZ7RbDSXguRUn55myXBCOhvgqzSh7O7sHRGMUTcHRznyfbB3KO9wovI bYO8J6oTkoT+S7As1HPoQhUqcHxWpgeI2e3ThyzR5Bry3heVDb74Te3HEStAG2ynqYoo oSKg== X-Gm-Message-State: ACrzQf111apZSuDvugMCGLFu0Qe/XFNqkMzQvx86YnyUS4uETuPwm+Hu Soroc6oNmWQ6KYXxhP0xMIImyphTI7zNyFOV+SGzug== X-Received: by 2002:a02:290e:0:b0:35a:d680:7aad with SMTP id p14-20020a02290e000000b0035ad6807aadmr2047464jap.62.1666106309421; Tue, 18 Oct 2022 08:18:29 -0700 (PDT) MIME-Version: 1.0 References: <1666100644-27010-1-git-send-email-shengjiu.wang@nxp.com> In-Reply-To: <1666100644-27010-1-git-send-email-shengjiu.wang@nxp.com> From: Mathieu Poirier Date: Tue, 18 Oct 2022 09:18:18 -0600 Message-ID: Subject: Re: [PATCH v3] remoteproc: core: Auto select rproc-virtio device id To: Shengjiu Wang Cc: andersson@kernel.org, arnaud.pouliquen@foss.st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Tue, 18 Oct 2022 at 08:04, 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 > Reviewed-by: Arnaud Pouliquen > Reviewed-by: Mukesh Ojha > Tested-by: Peng Fan I will queue this on Monday when rc2 comes out. Thanks, Mathieu > --- > changes in v3: > - add comment in codec > > changes in v2: > - update commit message > > drivers/remoteproc/remoteproc_core.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 8768cb64f560..f9187e35b090 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -509,7 +509,13 @@ 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, > + /* > + * When there is more than one remote processor, rproc->nb_vdev number is > + * same for each separate instances of "rproc". If rvdev_data.index is used > + * as device id, then we get dupliation in sysfs, so need to use > + * PLATFORM_DEVID_AUTO to auto select device id. > + */ > + pdev = platform_device_register_data(dev, "rproc-virtio", PLATFORM_DEVID_AUTO, &rvdev_data, > sizeof(rvdev_data)); > if (IS_ERR(pdev)) { > dev_err(dev, "failed to create rproc-virtio device\n"); > -- > 2.34.1 >