From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Thierry Reding
<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: Reparenting a platform device
Date: Thu, 05 Apr 2012 12:36:55 -0600 [thread overview]
Message-ID: <4F7DE647.7060409@wwwdotorg.org> (raw)
In-Reply-To: <20120405162318.GA10628-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
On 04/05/2012 10:23 AM, Thierry Reding wrote:
> * Stephen Warren wrote:
>> On 04/05/2012 02:42 AM, Thierry Reding wrote:
>>> Hi,
>>>
>>> I have a device tree where I have a GART device and a DRM device which uses
>>> the GART. The GART is implemented by an IOMMU driver (tegra-gart) and
>>> requires the user device to be a child of the GART device (it explicitly
>>> checks for this when the user device is attached).
>>
>> Isn't this wrong?
>>
>> I would expect the device parent/child relationship to reflect the
>> CPU-initiated register access bus topology.
>>
>> A device's interaction with an IOMMU is an aspect of a device's
>> initiating accesses itself, not CPU-initiated register accesses.
>
> Actually I have no idea why this was made a requirement. Maybe Hiroshi can
> comment on this. The driver really only needs this to basically obtain a
> pointer to itself. The MSM I/O MMU implementation does something similar,
> though, and goes on to register actual child devices (they are instantiated
> in arch/arm/mach-msm/devices-iommu.c). Each of those devices is then assigned
> a specific memory area it seems.
>
>>> I've tried two alternatives to achieve this: create the GART device in the
>>> user driver's .probe() function and explicitly set the DRM device's parent
>>> to the resulting platform device like so:
>>>
>>> gart = platform_device_alloc(...);
>>> ...
>>> pdev->dev.parent = &gart->dev;
>>
>> I guess that won't work when there's more than one device affected by
>> the IOMMU?
>
> I don't think having more than one device using the IOMMU will work properly
> anyway in the context of the Tegra GART driver because there is not means to
> allocate specific regions of the GART aperture to individual devices. So
> really the one and only client actually needs to manage the allocations from
> the GART aperture.
>
> I'm also not sure if it makes much sense to use the GART from anything other
> than the DRM driver.
I was thinking about this mostly from a Tegra30 perspective, where there
are multiple devices affected by the SMMU, which is more capable that
the Tegra20 GART, and can presumably support these multiple clients
pretty independently. For Tegra20, I wouldn't be surprised if the DRM
driver was the only client.
next prev parent reply other threads:[~2012-04-05 18:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 8:42 Reparenting a platform device Thierry Reding
[not found] ` <20120405084258.GA19798-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-05 15:40 ` Stephen Warren
[not found] ` <4F7DBCEE.9080400-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-05 16:23 ` Thierry Reding
[not found] ` <20120405162318.GA10628-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-05 18:08 ` Thierry Reding
[not found] ` <20120405180805.GB11601-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-05 19:21 ` Stephen Warren
[not found] ` <4F7DF0B3.4050500-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-06 7:20 ` Thierry Reding
[not found] ` <20120406072014.GA14250-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-04-06 16:37 ` Stephen Warren
[not found] ` <4F7F1BCB.7070608-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-08 14:21 ` Thierry Reding
[not found] ` <20120408142141.GA25303-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-10 8:25 ` Hiroshi Doyu
2012-04-05 18:36 ` Stephen Warren [this message]
2012-04-07 2:24 ` Grant Likely
2012-04-07 11:35 ` Thierry Reding
[not found] ` <20120407113510.GA22116-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-04-20 2:26 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F7DE647.7060409@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).