From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40A65C47258 for ; Mon, 4 May 2020 09:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2183921974 for ; Mon, 4 May 2020 09:26:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JwSyiJmV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbgEDJ0v (ORCPT ); Mon, 4 May 2020 05:26:51 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56720 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728425AbgEDJ0u (ORCPT ); Mon, 4 May 2020 05:26:50 -0400 Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7DFC5121D; Mon, 4 May 2020 11:26:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588584405; bh=V5vv4x5wKJ6hQdH/FUQfwW3D36Z91fOws36otLzl6f4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JwSyiJmVRFA5RcwUsB4NyOVsMs8GegaAgfcq3rOgvK9sa2EQCYWNlEVs8tOtpQUKQ nxcUOFErAwWwuMAwK7RGbrNJ4e7YR8XCAxYgmQqubj7XU4f3WPeyCxvNYuJFR7VFdr Go+HRTKdwq2IlkdF1T7ReAfM8mGNS0BQGAR/IhTQ= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Kieran Bingham , Jacopo Mondi , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Naushir Patuck , Dave Stevenson , Dave Stevenson Subject: [PATCH v2 27/34] staging: vchiq: Use the old dma controller for OF config on platform devices Date: Mon, 4 May 2020 12:26:04 +0300 Message-Id: <20200504092611.9798-28-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> References: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dave Stevenson vchiq on Pi4 is no longer under the soc node, therefore it doesn't get the dma-ranges for the VPU. Switch to using the configuration of the old dma controller as that will set the dma-ranges correctly. Signed-off-by: Dave Stevenson Signed-off-by: Jacopo Mondi --- .../interface/vchiq_arm/vchiq_arm.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 15ccd624aaab..d1a556f16499 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2719,6 +2719,7 @@ vchiq_register_child(struct platform_device *pdev, const char *name) { struct platform_device_info pdevinfo; struct platform_device *child; + struct device_node *np; memset(&pdevinfo, 0, sizeof(pdevinfo)); @@ -2734,10 +2735,20 @@ vchiq_register_child(struct platform_device *pdev, const char *name) } /* - * We want the dma-ranges etc to be copied from the parent VCHIQ device - * to be passed on to the children too. + * We want the dma-ranges etc to be copied from a device with the + * correct dma-ranges for the VPU. + * VCHIQ on Pi4 is now under scb which doesn't get those dma-ranges. + * Take the "dma" node as going to be suitable as it sees the world + * through the same eyes as the VPU. */ - of_dma_configure(&new_dev->dev, pdev->dev.of_node, true); + np = of_find_node_by_path("dma"); + if (!np) + np = pdev->dev.of_node; + + of_dma_configure(&child->dev, np, true); + + if (np != pdev->dev.of_node) + of_node_put(np); return child; } -- Regards, Laurent Pinchart