Message ID | 20200504092611.9798-27-laurent.pinchart@ideasonboard.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1jVXKP-00AuBY-68; Mon, 04 May 2020 09:23:57 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728427AbgEDJ0t (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 4 May 2020 05:26:49 -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 S1728419AbgEDJ0s (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 4 May 2020 05:26:48 -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 E38701209; Mon, 4 May 2020 11:26:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588584405; bh=ZDaZRct1RVy7xs8SPv417jYteulvJrltZo++xeluApo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9EzMyaZO9E1/CyaameloyaYAVfGKnxD4o5bp0clvEkdOkMU4e976ZR30+MlQox3t IObbuh2xmUOpXAhG3WxQhCdNZjxhGGLU//u8eowobqZxHQHfEQYLaL1+5ix/CQKQwm ZeCe0Q99ngZ1JOCt4CL2o5PHcHQLYbZ8MSBDpiiw= From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> To: linux-media@vger.kernel.org Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>, Jacopo Mondi <jacopo@jmondi.org>, =?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>, Naushir Patuck <naush@raspberrypi.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Dave Stevenson <dave.stevenson@raspberrypi.org> Subject: [PATCH v2 26/34] staging: vchiq_arm: Set up dma ranges on child devices Date: Mon, 4 May 2020 12:26:03 +0300 Message-Id: <20200504092611.9798-27-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: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
Drivers for the BCM283x CSI-2/CCP2 receiver and ISP
|
|
Commit Message
Laurent Pinchart
May 4, 2020, 9:26 a.m. UTC
From: Dave Stevenson <dave.stevenson@raspberrypi.org> The VCHIQ driver now loads the audio, camera, codec, and vc-sm drivers as platform drivers. However they were not being given the correct DMA configuration. Call of_dma_configure with the parent (VCHIQ) parameters to be inherited by the child. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++++++ 1 file changed, 6 insertions(+)
Comments
On Mon, 2020-05-04 at 12:26 +0300, Laurent Pinchart wrote: > From: Dave Stevenson <dave.stevenson@raspberrypi.org> > > The VCHIQ driver now loads the audio, camera, codec, and vc-sm > drivers as platform drivers. However they were not being given > the correct DMA configuration. > > Call of_dma_configure with the parent (VCHIQ) parameters to be > inherited by the child. > > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > --- > .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > 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 c5c7af28c1c8..15ccd624aaab 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -2733,6 +2733,12 @@ vchiq_register_child(struct platform_device *pdev, > const char *name) > child = NULL; > } > > + /* > + * We want the dma-ranges etc to be copied from the parent VCHIQ device > + * to be passed on to the children too. > + */ > + of_dma_configure(&new_dev->dev, pdev->dev.of_node, true); I think you could use struct platform_device_info's of_node_reused. See patch 908f6fc3a1405 ('usb: musb: sunxi: propagate devicetree node to glue pdev') for an example. AFAIK of_dma_configure() is only to be used in bus code, and there has been a huge effort in the past to make sure it says as such. With a proper fwnode set of_dma_configure() will be called during the device's probe. Regards, Nicolas
Hi Nicolas, Phil, I'm in the process of sending a v2 of this series, trying to reduce the patch count by only picking what's required to support the ISP. This patch and [30/34] puzzles me a bit, so I'll ask a few questions. On Mon, May 04, 2020 at 06:54:32PM +0200, Nicolas Saenz Julienne wrote: > On Mon, 2020-05-04 at 12:26 +0300, Laurent Pinchart wrote: > > From: Dave Stevenson <dave.stevenson@raspberrypi.org> > > > > The VCHIQ driver now loads the audio, camera, codec, and vc-sm > > drivers as platform drivers. However they were not being given > > the correct DMA configuration. > > > > Call of_dma_configure with the parent (VCHIQ) parameters to be > > inherited by the child. > > > > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > --- > > .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > 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 c5c7af28c1c8..15ccd624aaab 100644 > > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > @@ -2733,6 +2733,12 @@ vchiq_register_child(struct platform_device *pdev, > > const char *name) > > child = NULL; > > } > > > > + /* > > + * We want the dma-ranges etc to be copied from the parent VCHIQ device > > + * to be passed on to the children too. > > + */ > > + of_dma_configure(&new_dev->dev, pdev->dev.of_node, true); > > I think you could use struct platform_device_info's of_node_reused. See patch > 908f6fc3a1405 ('usb: musb: sunxi: propagate devicetree node to glue pdev') for > an example. AFAIK of_dma_configure() is only to be used in bus code, and there > has been a huge effort in the past to make sure it says as such. With a proper > fwnode set of_dma_configure() will be called during the device's probe. I just tried giving to the children devices the parent's fwnode and set of_node_reused as done in 908f6fc3a1405 to avoid usage of of_dma_configure, and now I have the parent being probed 4 times, one per each children :) I guess that was not the expected result... What is in your opinions the best course of actions for this and patch [30/34] ? Can we live with 'of_dma_configure()' ? [1] I am assuming currently the vchiq children are manually registered as there are no entries in the DTS for them, so I'm kind of missing the point of having [30/34] in. What am I missing ? Thanks j [1] There are a few things that are not clear to me though, possible due to my rather poor understanding of this core parts. In particular, as the dma-ranges are assigned to the parent 'soc' node, and I assume propagated to the children such as the 'vchiq' node, isnt' setting the 'parent' field of each newly created platform device enough to have the property propagated ? > > Regards, > Nicolas >
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 c5c7af28c1c8..15ccd624aaab 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2733,6 +2733,12 @@ vchiq_register_child(struct platform_device *pdev, const char *name) child = NULL; } + /* + * We want the dma-ranges etc to be copied from the parent VCHIQ device + * to be passed on to the children too. + */ + of_dma_configure(&new_dev->dev, pdev->dev.of_node, true); + return child; }