devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Yong Deng <yong.deng-+3dxTMOEIRNWk0Htik3J/w@public.gmane.org>,
	Mauro Carvalho Chehab
	<mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Hans Verkuil
	<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Stanimir Varbanov
	<stanimir.varbanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Hugues Fruchet <hugues.fruchet-qxv4g6HH51o@public.gmane.org>,
	Yannick Fertre <yannick.fertre-qxv4g6HH51o@public.gmane.org>,
	Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Benjamin Gaignard
	<benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Ramesh Shanmugasundaram
	<ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>,
	Sakari Ailus
	<sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Rick Chang <rick.chang@mediatek>
Subject: Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI.
Date: Mon, 29 Jan 2018 15:34:02 +0100	[thread overview]
Message-ID: <CAK8P3a2HmPOTHAzqBnmim388pcWOE=fG50mG5HJifT=vzKOaTg@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdYAGwUjr2C-w5U+WuG48pZAOUcnxFjznLbdF6Lmy1uZuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Jan 29, 2018 at 10:25 AM, Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Mon, Jan 29, 2018 at 9:25 AM, Maxime Ripard
> <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>> On Sat, Jan 27, 2018 at 05:14:26PM +0100, Linus Walleij wrote:
>> However, in DT systems, that
>> field is filled only with the parent's node dma-ranges property. In
>> our case, and since the DT parenthood is based on the "control" bus,
>> and not the "data" bus, our parent node would be the AXI bus, and not
>> the memory bus that enforce those constraints.
>>
>> And other devices doing DMA through regular DMA accesses won't have
>> that mapping, so we definitely shouldn't enforce it for all the
>> devices there, but only the one connected to the separate memory bus.
>>
>> tl; dr: the DT is not really an option to store that info.
>>
>> I suggested setting dma_pfn_offset at probe, but Arnd didn't seem too
>> fond of that approach either at the time.
>>
>> So, well, I guess we could do better. We just have no idea how :)
>
> Usually of Arnd cannot suggest something smart, neither can I :(
>
> If some aspect of the memory layout of the system *really* doesn't
> fit into DT because of the assumptions that DT is doing about
> how systems work, we have a problem.
>
> Is the problem that DT's model assumes that devices have one and
> only one data port to the system memory, and that is how it
> populates the Linux devices?
>
> I guess, if nothing else works, I would use auxdata in the board file.
> It is our definitive last resort when DT doesn't hold.
>
> I.e. I would go into struct of_dev_auxdata
> (from <linux/of_platform.h>) and add a
> dma_pfn_offset field that gets set into the device's dma_pfn_offset
> in drivers/of/platform.c overriding anything else and use that to hammer
> it down in the boardfile.
>
> But I bet some DT people are going to have other ideas.

At one point we had discussed adding a 'dma-masters' property that
lists all the buses on which a device can be a dma master, and
the respective properties of those masters (iommu, coherency,
offset, ...).

IIRC at the time we decided that we could live without that complexity,
but perhaps we cannot.

Another local hack that we can do here is to have two separate
device nodes and let the device driver bind to one device and then
look up the other one through a phandle to look up a platform_device
for it, which it can then use with the DMA mapping interface.

      Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-29 14:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  8:18 [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI Yong Deng
2018-01-26  0:04 ` kbuild test robot
     [not found]   ` <201801260759.RyNhDZz4%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-01-26  1:46     ` Yong
2018-01-26  3:00       ` Yong
2018-01-26  8:10         ` Maxime Ripard
     [not found]           ` <20180126081000.hy7g57zp5dv6ug2g-ZC1Zs529Oq4@public.gmane.org>
2018-01-28  2:19             ` [linux-sunxi] " Yong
     [not found]               ` <20180128101903.fbaec083c787bda30aeb05ef-+3dxTMOEIRNWk0Htik3J/w@public.gmane.org>
2018-01-29  8:16                 ` Maxime Ripard
     [not found]         ` <20180126110041.f89848325b9ecfb07df387ca-+3dxTMOEIRNWk0Htik3J/w@public.gmane.org>
2018-01-31  3:08           ` Liviu Dudau
2018-01-31  3:24             ` [linux-sunxi] " Chen-Yu Tsai
     [not found]             ` <20180131030807.GA19945-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
2018-01-31  7:42               ` Maxime Ripard
     [not found]                 ` <20180131074212.7hvb3nqkt22h2chg-ZC1Zs529Oq4@public.gmane.org>
2018-01-31 14:47                   ` Liviu Dudau
2018-02-01  8:32                     ` [linux-sunxi] " Maxime Ripard
2018-02-01  9:20                       ` Arnd Bergmann
     [not found]                         ` <CAK8P3a01DqmVJKt6J2i_okVoeELJCUW0voW0r52EzBY7iF74xQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-01 11:34                           ` Liviu Dudau
     [not found]                             ` <20180201113442.GC19945-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
2018-02-01 15:54                               ` Maxime Ripard
2018-01-27 15:51 ` kbuild test robot
     [not found] ` <1516695531-23349-1-git-send-email-yong.deng-+3dxTMOEIRNWk0Htik3J/w@public.gmane.org>
2018-01-27 16:14   ` Linus Walleij
     [not found]     ` <CACRpkdan52UB7HOyH1gnHWg4CDke_VQxAdq8cBgwUroibE59Ow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-28  2:39       ` Yong
2018-01-29  8:25     ` Maxime Ripard
2018-01-29  8:28       ` [linux-sunxi] " icenowy
     [not found]       ` <20180129082533.6edmqgbauo6q5dgz-ZC1Zs529Oq4@public.gmane.org>
2018-01-29  9:25         ` Linus Walleij
     [not found]           ` <CACRpkdYAGwUjr2C-w5U+WuG48pZAOUcnxFjznLbdF6Lmy1uZuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-29 14:34             ` Arnd Bergmann [this message]
2018-01-30  7:54               ` Maxime Ripard
     [not found]                 ` <20180130075441.rqxzkwero6sdfak6-ZC1Zs529Oq4@public.gmane.org>
2018-01-30  9:24                   ` Arnd Bergmann
2018-01-30  9:59                     ` Thierry Reding
2018-01-30 10:01                       ` Thierry Reding
2018-01-31  7:29                         ` Maxime Ripard
     [not found]                           ` <20180131072910.ajp3jc5dmetsjtf2-ZC1Zs529Oq4@public.gmane.org>
2018-01-31  9:37                             ` Arnd Bergmann
     [not found]                               ` <CAK8P3a0X2bpLjKE6xKehG1junZoG1N_DjepOBQ+SZetKf6sgfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-01 15:29                                 ` Maxime Ripard
2018-02-01 15:36                                   ` Arnd Bergmann
2018-02-01 16:31                                 ` Robin Murphy

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='CAK8P3a2HmPOTHAzqBnmim388pcWOE=fG50mG5HJifT=vzKOaTg@mail.gmail.com' \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=hugues.fruchet-qxv4g6HH51o@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org \
    --cc=rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=rick.chang@mediatek \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=stanimir.varbanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    --cc=yannick.fertre-qxv4g6HH51o@public.gmane.org \
    --cc=yong.deng-+3dxTMOEIRNWk0Htik3J/w@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).