Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3771264ybz; Mon, 20 Apr 2020 09:09:04 -0700 (PDT) X-Google-Smtp-Source: APiQypJ0LcnS0h426KMTRuQMDQTIvNj1lD1V5fRbwFEkcP/IayFzgKV2BH+9UBhgKiAlAK+RlATA X-Received: by 2002:a05:6402:1296:: with SMTP id w22mr6318962edv.364.1587398944578; Mon, 20 Apr 2020 09:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587398944; cv=none; d=google.com; s=arc-20160816; b=0NQz+B6g8+yTk9D32k05baktwBqmupZfMGsGM8SguZMpAhjtlUUZxg0h9FVPGPT23l IEquP1bqcZNCsXUCjs/Dk7fIsSujwvEL2+bC7rCWKGYWxmtZnIvRPzC1nuVIeRmTUNV3 JXK+JKE+BQb2ajgtQHSvuprKpaaGdX9XRdGnO5MDM+CZnNOQcY9Gpoe8JrBLJmLLV+Bx PvyctISh//1M52V1ZvzCKugwVyfY6g1pb6+ZDR3oV0ucEXithZNV6bHtrgYy96LnL6On jwOQ1zIPQtVSs4QX9flB+YqSLI4rokFDNWqULRvrjZfAFJXNjGl4+oaSW+5azvOct3U/ tHHQ== 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=Dw9r3dYDe32eNopDitcAqNIpiN0el0jUX6kvW1sbYuc=; b=kRL3ZwEGM8UoUK243ZmqmWt1Or6xqJoJ1pV6xy20daNRHPBQxjPTz0ZWepF7QGsFUc Iem9LDxNN1Lf/ZGEI09CFzgevqTzg4Ax0ByPdaMesgtryUUWlfLAflolZqsif84XBnT4 k2brVIRcxBUZIWkrS3FKx+eDKwy+7EK4MlmEWYI+wiGHWROwwxv9cN+q04vGN+7H98rF PfUIuBg7RuJvGnb8TIM0dpY9FdLPy9SLm4g0vF/fwEi8BxMgw8B48VjJ02ysNJrkte58 iq/ZYW2SK4mqkZh56NYNbjUGCeDW7OSK/mwZm4fnCNpncR/EHjDGhhnqAbKzQVBhHv1m VjTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="J0/O3QfW"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si788376edt.576.2020.04.20.09.08.41; Mon, 20 Apr 2020 09:09:04 -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=@ti.com header.s=ti-com-17Q1 header.b="J0/O3QfW"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728287AbgDTQHk (ORCPT + 99 others); Mon, 20 Apr 2020 12:07:40 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54354 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbgDTQHg (ORCPT ); Mon, 20 Apr 2020 12:07:36 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 03KG7URC089894; Mon, 20 Apr 2020 11:07:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1587398850; bh=Dw9r3dYDe32eNopDitcAqNIpiN0el0jUX6kvW1sbYuc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=J0/O3QfWwzL9EqpSzz2sqYku+9y3nbHvWrIDwiWFnfEkmn+jU8aqbVlGWw437L1Ko yUfbiNrrxTlH1Br4hAZfSK+XrsololdoC7nonogcFiCB2YvmaIL1ObP7rScsQFuTuD IYVK16v1E/1W5hpVk0NwuJDfo8K6uus/LfEeYNPQ= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 03KG7Uaj004069; Mon, 20 Apr 2020 11:07:30 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 20 Apr 2020 11:06:10 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE104.ent.ti.com (157.170.170.34) 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; Mon, 20 Apr 2020 11:06:10 -0500 Received: from fllv0103.dal.design.ti.com (fllv0103.dal.design.ti.com [10.247.120.73]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 03KG6A7a093324; Mon, 20 Apr 2020 11:06:10 -0500 Received: from localhost ([10.250.70.56]) by fllv0103.dal.design.ti.com (8.14.7/8.14.7) with ESMTP id 03KG6A69128230; Mon, 20 Apr 2020 11:06:10 -0500 From: Suman Anna To: Bjorn Andersson CC: Mathieu Poirier , Arnaud Pouliquen , Loic Pallardy , Tero Kristo , , , Suman Anna Subject: [PATCH v3 2/2] remoteproc: Fix and restore the parenting hierarchy for vdev Date: Mon, 20 Apr 2020 11:06:00 -0500 Message-ID: <20200420160600.10467-3-s-anna@ti.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200420160600.10467-1-s-anna@ti.com> References: <20200420160600.10467-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 Reviewed-by: Mathieu Poirier Acked-by: Arnaud Pouliquen --- v3: No changes v2: https://patchwork.kernel.org/patch/11447653/ 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 e12a54e67588..be15aace9b3c 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -517,7 +517,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.26.0