Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6169813ybf; Thu, 5 Mar 2020 14:41:56 -0800 (PST) X-Google-Smtp-Source: ADFU+vvDXtTwG92z6bv581Hvyen76pwH9qoPLvWgi9XWBhI3s4+R0m58C+iguAg6VjjJqrI46VyZ X-Received: by 2002:a05:6830:103:: with SMTP id i3mr147488otp.270.1583448116163; Thu, 05 Mar 2020 14:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583448116; cv=none; d=google.com; s=arc-20160816; b=bO2V6qITXSV5tlkgSxH0UcwpzsRDzL/IOIT6tuJPqifTxLPRSBcTFhU6pqbxGc15VN mTQW33aX7AklEhVSL2wHT1BBkfhKYl+5k6VtnUyl7rk9VjvPOLIg0mR/7yEj0CfSBm8x 8paWQp6zOPPjri/tTx5owv8x0CEQElCaH6Njs6+y8E4yqPXgUSg2ik9OHHFcvS0l1aoE dV8BaEdNAqpxvG2CRY75ol6xpHupoCPKFBflDn1NVR91Zol83dyD6BkDnz8F0sJodgH5 7ePRy9anF7WQXhrnul1/be8iJxV2QoO/yROcXo+TqvsylI+bL1rET50/1g6IDasTBdee 00jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xLnhFXjcntooqJEdFx6nrAVNHWk6LDOKQ7ZIRr8tZrc=; b=IMbqrzMTBGRzBjVEUPURWeidJIDyOTcZfFu3lRvXp/tIquObEplLcWAvN0x35U710J sbTD9uL2d5ivH7v9zSkAFP6vjogWDKz7C+q9mL/r/SbWsPeA58nb4JN38AtssoDHkPPQ vKDD5BGQvnyUXYY3PYFsQE5ATEyXnaIuyx+5ki9u/S+7GDZb8Kpat+kjMLSK9AJ2Td6m EjmVjc+LUNZl36R47e1CpnfbC4ip3DGz7kr3nXEGFIT5xGCU2pfH+0In6Rbl78/8ZB2W hWwkmUgqtIVCABAVA/BNr5RprhCtaCQBDvgkzCEB8WZv38lAN3uy0dAqJ+hYCzxDCTG+ lfHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HkYQcweB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si189133otc.192.2020.03.05.14.41.44; Thu, 05 Mar 2020 14:41:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HkYQcweB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726400AbgCEWlX (ORCPT + 99 others); Thu, 5 Mar 2020 17:41:23 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:49160 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgCEWlU (ORCPT ); Thu, 5 Mar 2020 17:41:20 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 025MfHC2128546; Thu, 5 Mar 2020 16:41:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1583448077; bh=xLnhFXjcntooqJEdFx6nrAVNHWk6LDOKQ7ZIRr8tZrc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HkYQcweBCpizFmpL+mWD/faZrLtKoAIhAHEm7TvhfOt6zz6UG2Qv/Jv3/Z3u8XMEY SNzC2FMGpncnvBYLl9Fii3xhanZABmHXeoj6DfUtd5mouU+voMWO7GxUibLgGwEAKm r+my3HLz8qrRyJT919dttANLC15T4joHumQ7t/8U= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 025MfHb3027248 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 5 Mar 2020 16:41:17 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 5 Mar 2020 16:41:16 -0600 Received: from localhost.localdomain (10.64.41.19) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 5 Mar 2020 16:41:16 -0600 Received: from lelv0597.itg.ti.com (lelv0597.itg.ti.com [10.181.64.32]) by localhost.localdomain (8.15.2/8.15.2) with ESMTP id 025MfG0c003914; Thu, 5 Mar 2020 16:41:16 -0600 Received: from localhost (irmo.dhcp.ti.com [128.247.81.254]) by lelv0597.itg.ti.com (8.14.7/8.14.7) with ESMTP id 025MfGog098953; Thu, 5 Mar 2020 16:41:16 -0600 From: Suman Anna To: Bjorn Andersson , Loic Pallardy CC: Mathieu Poirier , Arnaud Pouliquen , Tero Kristo , , , Suman Anna Subject: [PATCH 2/2] remoteproc: Fix and restore the parenting hierarchy for vdev Date: Thu, 5 Mar 2020 16:41:08 -0600 Message-ID: <20200305224108.21351-3-s-anna@ti.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200305224108.21351-1-s-anna@ti.com> References: <20200305224108.21351-1-s-anna@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") has introduced a new vdev subdevice for each vdev declared in the firmware resource table and made it as the parent for the created virtio rpmsg devices instead of the previous remoteproc device. This changed the overall parenting hierarchy for the rpmsg devices, which were children of virtio devices, and does not allow the corresponding rpmsg drivers to retrieve the parent rproc device through the rproc_get_by_child() API. Fix this by restoring the remoteproc device as the parent. The new vdev subdevice can continue to inherit the DMA attributes from the remoteproc's parent device (actual platform device). Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Suman Anna --- 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 097f33e4f1f3..ba18f32bd0c4 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -510,7 +510,7 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, /* Initialise vdev subdevice */ snprintf(name, sizeof(name), "vdev%dbuffer", rvdev->index); - rvdev->dev.parent = rproc->dev.parent; + rvdev->dev.parent = &rproc->dev; rvdev->dev.dma_pfn_offset = rproc->dev.parent->dma_pfn_offset; rvdev->dev.release = rproc_rvdev_release; dev_set_name(&rvdev->dev, "%s#%s", dev_name(rvdev->dev.parent), name); -- 2.23.0