linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: andy.green@linaro.org,
	Jaswinder Singh <jaswinder.singh@linaro.org>,
	Linux USB list <linux-usb@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	arnd@arndb.de, broonie@opensource.wolfsonmicro.com,
	roger.quadros@nokia.com, greg@kroah.com,
	grant.likely@secretlab.ca
Subject: Re: RFC: Platform data for onboard USB assets
Date: Wed, 23 Mar 2011 00:21:41 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.1103222336030.11889@xanadu.home> (raw)
In-Reply-To: <1300850595.2402.320.camel@pasglop>

On Wed, 23 Mar 2011, Benjamin Herrenschmidt wrote:

> I think the technical aspects have been essentially answered. The
> important part of the thread is what the "right" approach to identifying
> the on-board device (vs. an equivalent device being hot-plugged), and I
> think we all agreed this has to be the physical port "path" (in case
> there's hubs or switches on the way).

Yes, no one appears to disagree there.

> The argument boils down to should we encourage adding an additional
> in-kernel platform_data based hooks for dynamically probed busses such
> as USB as well ? or go for a udev based solution for the time being
> which would probably work as well in practice and focus on getting the
> device-tree based solution for the long term instead.

The udev solution has its set of drawbacks.  Using udev is perfect for 
arbitrary user policies.  But here we're talking about a particular 
device which happens to be soldered on a particular board, and adding 
that knowledge to udev which is a separately maintained piece of 
software from the kernel is rather redundant while the kernel already 
knows perfectly well on which hardware it is running.  And as Andy 
pointed out, the kernel's job is to abstract hardware peculiarities, not 
to force them to user space.

> > With regards to DT on ARM I'm rather "softly" convinced this is a good 
> > thing.  However seeing a persisting lack of truly technical answers to 
> > Andy's questions is rather disturbing, and makes me wish for much more 
> > than the current hype around DT which appears to fall flat when 
> > challenged.
> 
> I don't think any technical answer is missing. Dynamic platform data is
> possible and in fact the platform could do it today using bus notifiers
> and "hooking up" the platform data on the fly if needed I suppose.

... or even perform the needed intra-kernel API call to do the desired 
change to the registered device if possible, such as overriding the 
random MAC that the driver creates.

> Does it make sense however to add platform data for generic probed
> devices ? I don't think so.

Generally speaking, this wouldn't make sense.  but this is a case where 
a generically probed device happens to be used in a very specific 
hardware design with its own quirks.  in that very particular case then 
it certainly makes some sense.

But if a standard notifier callback can be invoked once the device has 
been probed and before udev is invoked, and if that notifier callback 
can modify the defaults that were set by the generic drivers, then I 
don't think there would be a need for any additional infrastructure that 
only a very few oddball devices would use anyway.

> For some reason Andy doesn't seem to consider the lack of type
> information as a problem, Grant and I do, I don't know where we can go
> from there, it's a very technical argument and I don't feel like I need
> to teach people on this list what are the drawbacks on relying on void *
> pointers to structures attached to devices like that that -will- go
> wrong.

Still, as Andy said, the void pointer is quickly converted to a fully 
typed structure, and then it is rather hard to have a driver working if 
the platform data structure is mismatched between the driver and the 
actual device registration.  So, while this is true that there is a 
possibility for misuse, in practice this is rather unlikely to go very 
far without being noticed, and therefore this argument alone is rather 
weak in support of a significant world order change.

> I simply believe that this is the wrong solution for the problem. I
> would very much prefer having a way for the driver to retrieve "platform
> attributes".

No dispute there.  But some of us also would prefer a more pragmatic 
solution in the mean time, given DT is not there yet.

> This is essentially what the name/value properties of the device-tree
> provide, but it could be abstracted in a way that doesn't require the
> device-tree and allows drivers to be unchanged whether the thing is
> backed with a DT or by platform callbacks as long as there's a minimum
> amount of thought given to naming the property reasonably.
> 
> For some reason I didn't find Andy answers conductive to a reasonable
> discussion and indeed I admit I probably switched to dismiss/troll mode
> a bit too quickly, so let's the heat go down a bit here and see if we
> can find a common ground.

I don't think Andy is rejecting any alternatives, given it is practical 
in the short term.  That unfortunately pretty much rules out DT for the 
time being.

> If you guys can agree on my above proposal, we could maybe come up with
> some "get_device_attribute(dev, name)" kind of interface, that would
> then boild down to platform calls or device-tree transparently (or arch
> calls optionally populated by generic device-tree based helpers
> etc....).

I wholeheartedly agree with that idea.  One thing that bothers me about DT 
is its tendency to show up deep into the guts of kernel code all over 
the place.  If a generic abstraction can be put in place, such as this 
get_device_attribute() example, then it is far more convenient to use 
DT, or _eventually_ use DT, or even _not_ use it in some cases but 
something else, without battling over the actual interface.

> This would be much better I believe that having those random structures
> hooked up to void * pointers floating around and also generally more
> flexible vs. platforms that provide or don't provide some of this
> information (platforms might provide a subset etc...)

Agreed.

> > There is one hard fact that no one can ignore: DT support on ARM still 
> > has a long way to go before it is truly usable.  The world just can't 
> > stop turning until this is ready.
> 
> Right but more efforts could be put into making that happen :-)

Indeed.  But that would be a discussion for another thread.


Nicolas

  reply	other threads:[~2011-03-23  4:21 UTC|newest]

Thread overview: 156+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  9:50 RFC: Platform data for onboard USB assets Andy Green
2011-03-11 12:31 ` Arnd Bergmann
2011-03-11 12:44   ` Andy Green
2011-03-11 14:42     ` Roger Quadros
2011-03-11 15:12       ` Roger Quadros
2011-03-11 15:22       ` Arnd Bergmann
2011-03-11 15:50         ` Roger Quadros
2011-03-11 15:55           ` Arnd Bergmann
2011-03-11 15:29   ` Mark Brown
2011-03-11 15:54     ` Arnd Bergmann
2011-03-11 16:03       ` Mark Brown
2011-03-11 16:14         ` Greg KH
2011-03-11 16:27           ` Mark Brown
2011-03-11 16:35             ` Greg KH
2011-03-11 16:48               ` Mark Brown
2011-03-11 16:56                 ` Greg KH
2011-03-11 17:08                   ` Mark Brown
2011-03-11 17:23                     ` Greg KH
2011-03-11 17:41                       ` Mark Brown
2011-03-17  2:14                       ` Nicolas Pitre
2011-03-17 20:13                         ` Greg KH
2011-03-17 20:18                           ` Mark Brown
2011-03-17 20:26                             ` Greg KH
2011-03-17 21:24                               ` Mark Brown
2011-03-17 21:31                                 ` Greg KH
2011-03-17 21:40                                   ` Mark Brown
2011-03-17 21:47                                     ` Greg KH
2011-03-17 22:33                                       ` Arnd Bergmann
2011-03-17 22:53                                         ` Greg KH
2011-03-17 23:18                                           ` Andy Green
2011-03-17 23:25                                             ` Greg KH
2011-03-18  7:42                                               ` Andy Green
2011-03-18 22:54                                                 ` Benjamin Herrenschmidt
2011-03-18 22:57                                                   ` Andy Green
2011-03-18  4:54                                             ` Grant Likely
2011-03-18  8:19                                               ` Arnd Bergmann
2011-03-17 23:22                                         ` Andy Green
2011-03-18 15:00                                           ` Arnd Bergmann
2011-03-18 15:15                                             ` Mark Brown
2011-03-18 17:52                                             ` Andy Green
2011-03-18 18:20                                               ` David Anders
2011-03-18 18:25                                                 ` Mark Brown
2011-03-18 20:02                                                   ` Andy Green
2011-03-18 21:11                                                     ` Arnd Bergmann
2011-03-18 21:17                                                       ` Andy Green
2011-03-18 20:06                                               ` Arnd Bergmann
2011-03-18 21:33                                                 ` Andy Green
2011-03-18 23:25                                                   ` Mark Brown
2011-03-18 23:33                                                     ` Andy Green
2011-03-18 21:36                                                 ` Grant Likely
2011-03-18 22:47                                                 ` Benjamin Herrenschmidt
2011-03-18 21:28                                               ` Grant Likely
2011-03-18 23:04                                                 ` Andy Green
2011-03-18 22:37                                           ` Benjamin Herrenschmidt
2011-03-18 22:39                                             ` Andy Green
2011-03-17 23:27                                         ` Grant Likely
2011-03-18  7:49                                           ` Andy Green
2011-03-18  8:25                                             ` Arnd Bergmann
2011-03-18  8:38                                               ` Andy Green
2011-03-17 22:11                               ` Arnd Bergmann
2011-03-17 22:20                                 ` Greg KH
2011-03-18  8:42                                 ` Roger Quadros
2011-03-18  9:01                                   ` Arnd Bergmann
2011-03-18  9:55                                     ` Roger Quadros
2011-03-18 10:09                                       ` Andy Green
2011-03-17 21:03                           ` Nicolas Pitre
2011-03-17 21:32                             ` Greg KH
2011-03-11 16:26         ` Andy Green
2011-03-11 16:45           ` Alan Stern
2011-03-11 16:51             ` Andy Green
2011-03-11 17:08               ` Greg KH
2011-03-11 18:09                 ` Andy Green
2011-03-11 19:12                   ` Alan Stern
2011-03-11 20:05                     ` Andy Green
2011-03-11 20:21                       ` Greg KH
2011-03-11 21:07                         ` Andy Green
2011-03-11 21:44                           ` Greg KH
2011-03-11 22:24                             ` Andy Green
2011-03-12 16:00                             ` Alan Stern
2011-03-12 23:02                               ` Andy Green
2011-03-11 19:37                   ` Greg KH
2011-03-11 16:53             ` Mark Brown
2011-03-11 16:08 ` Greg KH
2011-03-11 16:20   ` Andy Green
2011-03-11 16:36     ` Greg KH
2011-03-11 16:41       ` Andy Green
2011-03-11 22:07         ` Benjamin Herrenschmidt
2011-03-11 21:52 ` Benjamin Herrenschmidt
2011-03-11 22:45 ` Grant Likely
2011-03-11 22:47   ` Andy Green
2011-03-11 23:39     ` Grant Likely
2011-03-14 14:54   ` Arnd Bergmann
2011-03-22 15:05 ` Jaswinder Singh
2011-03-22 16:04   ` Andy Green
2011-03-22 18:19     ` Jaswinder Singh
2011-03-22 18:37       ` Andy Green
2011-03-22 18:59         ` Jaswinder Singh
2011-03-22 19:35           ` Andy Green
     [not found] ` <AANLkTim=ezye=1fQP_1a2SWbPnbENP9B+k27Z3AkS=zf@mail.gmail.com>
2011-03-22 15:12   ` Mark Brown
2011-03-22 15:23     ` Jaswinder Singh
2011-03-24 18:56     ` Grant Likely
2011-03-22 21:08   ` Benjamin Herrenschmidt
2011-03-22 22:37     ` Andy Green
2011-03-23  1:03       ` Benjamin Herrenschmidt
2011-03-23  2:26         ` Nicolas Pitre
2011-03-23  3:23           ` Benjamin Herrenschmidt
2011-03-23  4:21             ` Nicolas Pitre [this message]
2011-03-23  4:56               ` Greg KH
2011-03-23  5:44               ` Benjamin Herrenschmidt
2011-03-23  9:38               ` Alan Cox
2011-03-23 10:53                 ` Mark Brown
2011-03-23 15:04                   ` Greg KH
2011-03-23 15:10                     ` Mark Brown
2011-03-23 15:24                     ` Andy Green
2011-03-23 15:45                       ` Arnd Bergmann
2011-03-23 15:38                     ` Nicolas Pitre
2011-03-23  9:31             ` Andy Green
2011-03-23  9:47               ` Alan Cox
2011-03-23 10:06                 ` Andy Green
2011-03-23 10:32                   ` Arnd Bergmann
2011-03-23 10:39                     ` Andy Green
2011-03-23 10:56                       ` Alan Cox
2011-03-23 11:13                         ` Andy Green
2011-03-23 11:34                           ` Alan Cox
2011-03-23 12:02                             ` Andy Green
2011-03-23 15:08                     ` Greg KH
2011-03-23 16:12                       ` Arnd Bergmann
2011-03-23 16:22                         ` Greg KH
2011-03-23 16:34                           ` Andy Green
2011-03-23 16:56                           ` [RFC] usbnet: use eth%d name for known ethernet devices Arnd Bergmann
2011-03-23 17:04                             ` Andy Green
2011-03-23 17:11                               ` Arnd Bergmann
2011-03-24 10:45                                 ` Andy Green
2011-03-23 17:13                             ` Arnd Bergmann
2011-03-23 17:54                               ` David Anders
2011-03-23 18:46                             ` Greg KH
2011-03-23 19:35                               ` Arnd Bergmann
     [not found]                                 ` <AANLkTim7hPfTv3gDYnh+jGxHBg0OvX=r1FKYoHnH7H_o@mail.gmail.com>
2011-03-23 19:57                                   ` Arnd Bergmann
2011-03-23 19:59                                     ` Randy Dunlap
2011-03-23 23:17                                       ` Michal Nazarewicz
2011-03-23 23:19                                         ` Randy Dunlap
2011-03-23 23:38                                         ` Steve Calfee
2011-03-24  0:01                                           ` Ben Hutchings
2011-03-24 13:13                                             ` Arnd Bergmann
2011-03-24 13:15                                               ` Arnd Bergmann
2011-03-24 13:44                                                 ` Andy Green
2011-03-24 13:56                                                 ` Alan Stern
2011-03-24 17:20                                                 ` Alexey Orishko
2011-03-25 11:57                                                   ` Arnd Bergmann
2011-03-25 16:26                                                     ` Alexey Orishko
2011-03-25 16:43                                                       ` Arnd Bergmann
2011-03-24 19:17                   ` RFC: Platform data for onboard USB assets Grant Likely
2011-03-24 20:10                     ` Andy Green
2011-03-23 14:55                 ` Nicolas Pitre
2011-03-23 10:22               ` Benjamin Herrenschmidt
2011-03-23 15:11                 ` Nicolas Pitre

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=alpine.LFD.2.00.1103222336030.11889@xanadu.home \
    --to=nicolas.pitre@linaro.org \
    --cc=andy.green@linaro.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=greg@kroah.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=roger.quadros@nokia.com \
    /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).