Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp843272rwi; Thu, 13 Oct 2022 06:05:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41zebK/hu64s2nn0zU40y0rdSHdY9j4kJxmLFkGs+ItTz0PavE9xwnMBvN//8O8+iAL7Pg X-Received: by 2002:aa7:c144:0:b0:459:f897:793e with SMTP id r4-20020aa7c144000000b00459f897793emr32251522edp.8.1665666340411; Thu, 13 Oct 2022 06:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665666340; cv=none; d=google.com; s=arc-20160816; b=C891HoSHCsoLopTCuig93dTOdTV/MahChtIyPd5x1bnDmAJnSft7unRa/tshYEZvj9 4dYgmJuAYdJdjVgZqNitRRe9MIoL+FeQLyryKw9j7McGR9l6jsAr/QSycRG7a1zyk0Bn 83N+/lHcE5ltFcY5ciAd9lqB5pulB8o7gi9pi6NVomWSGnHvkVsH/fUb/SyhWN+edod2 hmK8elm7KPhw/1RElpYp0HY6FK1ZRK9vuJjEGx18cvFVNfiew6uR/O3dmeTb3XkVsNye 2BrCj6ImGm87rwmR6/vboah+I6Bddo95ZTVyoLTXsFcNFU6H5s3s9dtutwJzPsOWafSm 0nBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DDxHuzFElSkhLvRoAX2SUbrk2+xaF4zvbaesNAF5MwY=; b=bhjEV+Qz5xYaBNNOzla8/8/R82ahqmx6nADe5oTnl9rqovLGRYntNqhHhzOVw4AcVG LSxD8u6SV2s+MzBJTgBMPtFe2xAagvmLIuzSF0J8uzcoRiKPtPjZywoytlgEMuw1j0oI bDfYDyqkRbH6Ca3FWCrZelLbv727M7F6Xrs6ll7fyY7Nk4hzepuHCWcFsZ+jdZI4lHBe L6K1bysHZUMt1HcImREJiXrNeZX2bwmrbnEr7rU+78TWPPvYBYi3ye4jeLeW2jsQIVzI YfOB5uebVTQYzcE6T5rXsshD71idqdTv8wegA3CTRVRye39lm+MgpZRNgIomiSp+uMjt F1xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="kT0YjtD/"; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a1709060d8e00b00783d969f337si12704019eji.307.2022.10.13.06.05.02; Thu, 13 Oct 2022 06:05:40 -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=@quicinc.com header.s=qcdkim header.b="kT0YjtD/"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbiJMMmT (ORCPT + 99 others); Thu, 13 Oct 2022 08:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiJMMmR (ORCPT ); Thu, 13 Oct 2022 08:42:17 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41FD03F335; Thu, 13 Oct 2022 05:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1665664936; x=1697200936; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=DDxHuzFElSkhLvRoAX2SUbrk2+xaF4zvbaesNAF5MwY=; b=kT0YjtD/fiYkcFIug0FrNt6tiELzdb0UVNHqksML3rkSuqFTtD03gHkj FTcpGQOx0IFNCkiXykJ+wn1Dh0Gkyei9z5ehL7OoDHCH38rr1fE/5tXG5 u1AWQtDvLBKBuhTP5PVpNBqBf6Cd6sr7KB+fN5S+bTD5kehmbtrkGG4sk g=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 13 Oct 2022 05:42:15 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.45.79.139]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 05:42:15 -0700 Received: from [10.216.35.42] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 13 Oct 2022 05:42:12 -0700 Message-ID: <994c01b3-253c-9cc1-1a15-4f17226c2f7d@quicinc.com> Date: Thu, 13 Oct 2022 18:12:08 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH] remoteproc: core: avoid duplicated rproc-virtio.[x] device Content-Language: en-US To: "Peng Fan (OSS)" , , , , , CC: Peng Fan References: <20221013123214.750320-1-peng.fan@oss.nxp.com> From: Mukesh Ojha In-Reply-To: <20221013123214.750320-1-peng.fan@oss.nxp.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 Hi, On 10/13/2022 6:02 PM, Peng Fan (OSS) wrote: > From: Peng Fan > > When there are multiple remoteproc cores(i.MX8QM has dual CM4), there > will be duplicated platform device created. When 1st CM4 rproc got > probed, rproc-virtio.0 was registered. Then 2nd CM4 rproc continue > register rproc-virtio.o will report failure. > > So use PLATFORM_DEVID_AUTO here. Then the kernel log will has such: > rproc-virtio rproc-virtio.1.auto: registered virtio0 (type 7) > > Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the remoteproc_virtio") > Signed-off-by: Peng Fan > --- > > V1: > I think this issue will happen when more than one rproc, saying CM4 + DSP, > or CM4 + CM4. > I thought to add a index to rproc, then use > 'rproc->index * rvdev_data.index' as the id, but seems a bit complicated > compared with use PLATFORM_DEVID_AUTO. > > > 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)); > if (IS_ERR(pdev)) { > dev_err(dev, "failed to create rproc-virtio device\n"); Looks to be same as https://lore.kernel.org/lkml/1665628087-20829-1-git-send-email-shengjiu.wang@nxp.com/ -Mukesh