Re: Interfacing devices with multiple parents within newbus

2012-07-09 Thread John Baldwin
On Friday, July 06, 2012 4:45:55 pm Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote:

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Lukasz Wojcik
On 07/06/12 22:45, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombelacom...@gmail.com wrote: That's neither correct nor

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Stefan Bethke
Am 06.07.2012 um 17:33 schrieb Arnaud Lacombe: I assume you are talking about devclass_get_device()/device_find_child(). That's neither correct nor robust in a couple of way: 1) you have no guarantee a device unit will always give you the same resource. 2) there is no reference counting on

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Warner Losh
On Jul 7, 2012, at 6:25 AM, Stefan Bethke wrote: Am 06.07.2012 um 17:33 schrieb Arnaud Lacombe: I assume you are talking about devclass_get_device()/device_find_child(). That's neither correct nor robust in a couple of way: 1) you have no guarantee a device unit will always give you the

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Warner Losh
On Jul 6, 2012, at 1:09 PM, Ian Lepore wrote: Just blue-sky dreaming here on the fly... what we really have is a resource-management problem. A device comes along that needs a GPIO resource, how does it find and use that resource? I rather like that idea. The connection between devices is

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Ian Lepore
On Fri, 2012-07-06 at 16:45 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote: That's

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Arnaud Lacombe
Hi, On Sat, Jul 7, 2012 at 2:47 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 16:45 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi,

Re: Interfacing devices with multiple parents within newbus

2012-07-07 Thread Warner Losh
On Jul 7, 2012, at 9:45 PM, Arnaud Lacombe wrote: Hi, On Sat, Jul 7, 2012 at 2:47 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 16:45 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri,

Re: Interfacing devices with multiple parents within newbus

2012-07-06 Thread Arnaud Lacombe
Hi, On Fri, Jul 6, 2012 at 1:04 AM, Warner Losh i...@bsdimp.com wrote: On Jul 5, 2012, at 5:14 PM, Arnaud Lacombe wrote: Hi folks, The problem has been raised in the last BSDCan during a talk, but no clear answer has been given. Some (pseudo-)devices might require resources from multiple

Re: Interfacing devices with multiple parents within newbus

2012-07-06 Thread Arnaud Lacombe
Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote: That's neither correct nor robust in a couple of way: 1) you have no guarantee a device unit will always give you the same resource. this raises the following question: how can a device, today, figure out which

Re: Interfacing devices with multiple parents within newbus

2012-07-06 Thread Warner Losh
On Jul 6, 2012, at 12:46 PM, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote: That's neither correct nor robust in a couple of way: 1) you have no guarantee a device unit will always give you the same resource. this raises the following

Re: Interfacing devices with multiple parents within newbus

2012-07-06 Thread Ian Lepore
On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote: That's neither correct nor robust in a couple of way: 1) you have no guarantee a device unit will always give you the same resource. this raises the

Re: Interfacing devices with multiple parents within newbus

2012-07-06 Thread Arnaud Lacombe
Hi, On Fri, Jul 6, 2012 at 3:09 PM, Ian Lepore free...@damnhippie.dyndns.org wrote: On Fri, 2012-07-06 at 14:46 -0400, Arnaud Lacombe wrote: Hi, On Fri, Jul 6, 2012 at 11:33 AM, Arnaud Lacombe lacom...@gmail.com wrote: That's neither correct nor robust in a couple of way: 1) you have no

Interfacing devices with multiple parents within newbus

2012-07-05 Thread Arnaud Lacombe
Hi folks, The problem has been raised in the last BSDCan during a talk, but no clear answer has been given. Some (pseudo-)devices might require resources from multiple other (pseudo-)devices. For example, a device is sitting on an SMBus, but need to access a software controlled LED, sitting on a

Re: Interfacing devices with multiple parents within newbus

2012-07-05 Thread Warner Losh
On Jul 5, 2012, at 5:14 PM, Arnaud Lacombe wrote: Hi folks, The problem has been raised in the last BSDCan during a talk, but no clear answer has been given. Some (pseudo-)devices might require resources from multiple other (pseudo-)devices. For example, a device is sitting on an SMBus,