All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Sergei Shtylyov
	<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>,
	Tuomas Tynkkynen <tuomas.tynkkynen-X3B1VOXEql0@public.gmane.org>,
	Tuomas Tynkkynen
	<ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mikko Perttunen
	<mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 2/2] ARM: dts: USB for Tegra114 Dalmore
Date: Thu, 15 Aug 2013 12:54:05 +0200	[thread overview]
Message-ID: <20130815105404.GA14301@ulmo> (raw)
In-Reply-To: <51F99DE4.7010503-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1895 bytes --]

On Wed, Jul 31, 2013 at 05:29:40PM -0600, Stephen Warren wrote:
> On 07/31/2013 04:20 PM, Sergei Shtylyov wrote:
> > On 08/01/2013 02:06 AM, Stephen Warren wrote:
> ...
> >>>     That's really horrible design.
> >>
> >> Yup. Both USB PHY and EHCI controller registers really are interleaved
> >> in one range.
> > 
> >    But the standard EHCI register space has no holes IIRC, so they can't
> > be really that much interleaved as you're describing (unless you have
> > some non-standard registers of course)...
> 
> Yes, there are certainly non-standard registers.
> 
> ...
> >>>     Don't they cause numerous resource conflicts while device nodes
> >>> being
> >>> instantiated as the platform devices?
> > 
> >> No; the driver knows that the HW is screwy and there's lots of
> >> register-range sharing going on, so it simply maps the registers, rather
> >> than reserving the physical address range and mapping it.
> > 
> >    Yes, it's clear that the driver should take special measures, I was
> > asking about the platform device creation phase. What do you see in
> > /proc/iomem?
> 
> The drivers don't request the memory region since doing so would cause
> conflicts. Hence, the regions don't show up in /proc/iomem.
> 
> This actually isn't that uncommon for DT-based drivers anyway; many use
> e.g. of_iomap() which IIRC just looks up the resource and maps it
> without registering the usage.

Not being uncommon isn't a good argument. The problem with doing this is
that it sets a bad example and makes it easier for others to do the same
thing. I can see that for some drivers providing a proper abstraction or
encapsulation might be more complicated than necessary. But I've also
seen this kind of shortcut taken quite often lately and especially often
in DT-based drivers.

Am I the only one concerned about this development?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
	Tuomas Tynkkynen <ttynkkynen@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org,
	Mikko Perttunen <mperttunen@nvidia.com>
Subject: Re: [PATCH 2/2] ARM: dts: USB for Tegra114 Dalmore
Date: Thu, 15 Aug 2013 12:54:05 +0200	[thread overview]
Message-ID: <20130815105404.GA14301@ulmo> (raw)
In-Reply-To: <51F99DE4.7010503@wwwdotorg.org>

[-- Attachment #1: Type: text/plain, Size: 1895 bytes --]

On Wed, Jul 31, 2013 at 05:29:40PM -0600, Stephen Warren wrote:
> On 07/31/2013 04:20 PM, Sergei Shtylyov wrote:
> > On 08/01/2013 02:06 AM, Stephen Warren wrote:
> ...
> >>>     That's really horrible design.
> >>
> >> Yup. Both USB PHY and EHCI controller registers really are interleaved
> >> in one range.
> > 
> >    But the standard EHCI register space has no holes IIRC, so they can't
> > be really that much interleaved as you're describing (unless you have
> > some non-standard registers of course)...
> 
> Yes, there are certainly non-standard registers.
> 
> ...
> >>>     Don't they cause numerous resource conflicts while device nodes
> >>> being
> >>> instantiated as the platform devices?
> > 
> >> No; the driver knows that the HW is screwy and there's lots of
> >> register-range sharing going on, so it simply maps the registers, rather
> >> than reserving the physical address range and mapping it.
> > 
> >    Yes, it's clear that the driver should take special measures, I was
> > asking about the platform device creation phase. What do you see in
> > /proc/iomem?
> 
> The drivers don't request the memory region since doing so would cause
> conflicts. Hence, the regions don't show up in /proc/iomem.
> 
> This actually isn't that uncommon for DT-based drivers anyway; many use
> e.g. of_iomap() which IIRC just looks up the resource and maps it
> without registering the usage.

Not being uncommon isn't a good argument. The problem with doing this is
that it sets a bad example and makes it easier for others to do the same
thing. I can see that for some drivers providing a proper abstraction or
encapsulation might be more complicated than necessary. But I've also
seen this kind of shortcut taken quite often lately and especially often
in DT-based drivers.

Am I the only one concerned about this development?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-08-15 10:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 17:42 [PATCH 0/2] Device tree changes for Tegra30 and Tegra114 USB Host support Tuomas Tynkkynen
2013-07-31 17:42 ` Tuomas Tynkkynen
2013-07-31 17:42 ` [PATCH 1/2] ARM: DTS: tegra: Add USB entries for Tegra30 Tuomas Tynkkynen
2013-07-31 17:42   ` Tuomas Tynkkynen
     [not found]   ` <1375292543-7896-2-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-07-31 22:13     ` Stephen Warren
2013-07-31 22:13       ` Stephen Warren
     [not found]       ` <51F98C27.40904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-01 15:15         ` Tuomas Tynkkynen
2013-08-01 15:15           ` Tuomas Tynkkynen
2013-07-31 17:42 ` [PATCH 2/2] ARM: dts: USB for Tegra114 Dalmore Tuomas Tynkkynen
2013-07-31 17:42   ` Tuomas Tynkkynen
     [not found]   ` <1375292543-7896-3-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-07-31 18:18     ` Sergei Shtylyov
2013-07-31 18:18       ` Sergei Shtylyov
2013-07-31 19:31       ` Tuomas Tynkkynen
     [not found]         ` <51F9660C.6090604-X3B1VOXEql0@public.gmane.org>
2013-07-31 19:53           ` Sergei Shtylyov
2013-07-31 19:53             ` Sergei Shtylyov
     [not found]             ` <51F96B48.10209-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-07-31 22:06               ` Stephen Warren
2013-07-31 22:06                 ` Stephen Warren
     [not found]                 ` <51F98A78.9060309-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-07-31 22:20                   ` Sergei Shtylyov
2013-07-31 22:20                     ` Sergei Shtylyov
     [not found]                     ` <51F98D92.3010607-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-07-31 23:29                       ` Stephen Warren
2013-07-31 23:29                         ` Stephen Warren
     [not found]                         ` <51F99DE4.7010503-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-01 12:37                           ` Sergei Shtylyov
2013-08-01 12:37                             ` Sergei Shtylyov
2013-08-15 10:54                           ` Thierry Reding [this message]
2013-08-15 10:54                             ` Thierry Reding

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=20130815105404.GA14301@ulmo \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=tuomas.tynkkynen-X3B1VOXEql0@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.