From patchwork Tue Jun 16 15:34:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 188077 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3792535ilo; Tue, 16 Jun 2020 09:16:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhsZYrQM8TT0S7iRJlOn5c/Z/V4omgK1fjH4YVNM2wEg4Dw6E9nfbJLBvoE9RxaJM77rnf X-Received: by 2002:a05:6402:228d:: with SMTP id cw13mr3473361edb.150.1592324209353; Tue, 16 Jun 2020 09:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592324209; cv=none; d=google.com; s=arc-20160816; b=COIB06/lUR7nPRiAc8LHxqwoqQmMBH/y+h+1Q1wjVWsiUv9Ek9HnjsTIShSRVrVlND g+q+1sTZdrYKq0wMunZfapsGzAYTFBioSldScR85zJsZdqsMlZXYu5CjcgMzKcI25lSk jG0WzeutBc4di/InA7dQ+2eVgtmATFJqhPNLT/vgFMppMyZitXNGJLnoHHnqWZebKovx sSSELlaKl+6TM2QcIDkNmtyDVwXUzszUj18ICvaUwuN7M3ZUXR4jOiqtQCx8wcAbfAfQ ryPUv/gWtFBZ0pSiECVxOELL1WOkVoquLdFp5ORvIXCk7sM0NNwotN6tswSngNR+B4Zs V2uQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u8jrZmjjtVJtFM+LIdHM/8dpp+ytex/9Fvy4N8dA4s4=; b=nCaO0ThABpdNFpBQ8Tqaa9mtij/9TytYav1jOBMgLEzUhVLK6Yh2GxcXof+cF1gK6+ 0Uz3HdkhBOgrabOUglRe6tO2eM2uCZwf76W0L4giSegiAwEYQo9mmL9yV3H7IhjY8DYP DrEUZcV62MHNRlijYa9Tq5eZR7FRJRu37EgmlL+og9C89j17J/AqTFmKPSh3c31dWJgk 6Lcri6FTuU1rjWRM9cN1KshgJhykN23W7cNIHoC0h2cu2MsN3e6tYDluHP/2IPIFUi/1 anyaxfw6k4jASB2/K+OVgrdavW8beGcjxCUc+/WlLBJ9Z0XRngjjsutY1w3W2xxEl3xQ gupg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xh/6mFD7"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn20si11528530ejb.367.2020.06.16.09.16.48; Tue, 16 Jun 2020 09:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@kernel.org header.s=default header.b="xh/6mFD7"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731069AbgFPQQk (ORCPT + 15 others); Tue, 16 Jun 2020 12:16:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:54102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730235AbgFPPkB (ORCPT ); Tue, 16 Jun 2020 11:40:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64D5B2151B; Tue, 16 Jun 2020 15:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322000; bh=A9MywORo5DzhV7UiSGjj7qcOeGCCpNhsfllbrSIvsZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xh/6mFD7vNZlXaxHhJwep49E7osEzDcJbjJYowdXO5TGhMSYvj9Pp2pO7B94OX6zz PBcjpV5ysJJ1HSbqL2MImR8xa4Zz6sUNsseW3szdUn4oQYhT6Xx7ayBzPqSeJQxyUd VD3Ml5T5tCw8mHvc4NbwDIK8xzKUlrDoXMukzyQU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suman Anna , Mathieu Poirier , Arnaud Pouliquen , Bjorn Andersson Subject: [PATCH 5.4 097/134] remoteproc: Fix and restore the parenting hierarchy for vdev Date: Tue, 16 Jun 2020 17:34:41 +0200 Message-Id: <20200616153105.428551223@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153100.633279950@linuxfoundation.org> References: <20200616153100.633279950@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Suman Anna commit c774ad010873bb89dcc0cdcb1e96aef6664d8caf upstream. 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). Cc: stable@vger.kernel.org Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Suman Anna Reviewed-by: Mathieu Poirier Acked-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20200420160600.10467-3-s-anna@ti.com Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/remoteproc/remoteproc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -511,7 +511,7 @@ static int rproc_handle_vdev(struct rpro /* 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);