Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-14 Thread H. Peter Anvin
On 08/13/2013 06:49 PM, Guenter Roeck wrote:
>
>> That is one aspect (hardware standardization)... but it is more to it
>> than that.
>
> I have to deal with lots of embedded / non-PC x86 based systems. Worst one
> I encountered so far was a board where the VGA memory space was re-used
> for an eeprom. The upcoming next generation hardware I'll have to support
> is so far off-standard that I'll probably have to define a new platform
> type (similar to OLPC or CE4100).
> 
> No, it is not all PC. Not anymore. Intel has started to sell into
> the embedded space, where PC compatibility is not a requirement.
> 

We try to encourage vendors to do the right thing, where "the right
thing" means, among other things, not to do gratuitously different
things.  With increasing amounts of the platform moving into the CPU and
PCH this is of course also becoming more and more rare.

Even on actual PCs we have seen some truly "special" facepalms.  There
was the Olivetti machine which used the GPIO for "fast A20" to control
the screen backlight, for example.  That one was fun to deal with.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-14 Thread H. Peter Anvin
On 08/13/2013 06:49 PM, Guenter Roeck wrote:

 That is one aspect (hardware standardization)... but it is more to it
 than that.

 I have to deal with lots of embedded / non-PC x86 based systems. Worst one
 I encountered so far was a board where the VGA memory space was re-used
 for an eeprom. The upcoming next generation hardware I'll have to support
 is so far off-standard that I'll probably have to define a new platform
 type (similar to OLPC or CE4100).
 
 No, it is not all PC. Not anymore. Intel has started to sell into
 the embedded space, where PC compatibility is not a requirement.
 

We try to encourage vendors to do the right thing, where the right
thing means, among other things, not to do gratuitously different
things.  With increasing amounts of the platform moving into the CPU and
PCH this is of course also becoming more and more rare.

Even on actual PCs we have seen some truly special facepalms.  There
was the Olivetti machine which used the GPIO for fast A20 to control
the screen backlight, for example.  That one was fun to deal with.

-hpa

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-13 Thread Guenter Roeck

On 08/13/2013 04:32 PM, H. Peter Anvin wrote:

On 08/01/2013 08:50 PM, David Gibson wrote:

On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com
wrote:

On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
 wrote:

On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com

wrote:

[snip]

Alternatively you may be of the belief that it is impossible to
get rid of the board specific code. But x86 doesn't have any of
it, why should ARM?


Sure x86 has board specific code.  It's just that x86 basically
only has one board - PC.



That is one aspect (hardware standardization)... but it is more to it
than that.


I have to deal with lots of embedded / non-PC x86 based systems. Worst one
I encountered so far was a board where the VGA memory space was re-used
for an eeprom. The upcoming next generation hardware I'll have to support
is so far off-standard that I'll probably have to define a new platform
type (similar to OLPC or CE4100).

No, it is not all PC. Not anymore. Intel has started to sell into
the embedded space, where PC compatibility is not a requirement.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-13 Thread H. Peter Anvin
On 08/01/2013 08:50 PM, David Gibson wrote:
> On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com
> wrote:
>> On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux 
>>  wrote:
>>> On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com
>> wrote:
> [snip]
>> Alternatively you may be of the belief that it is impossible to
>> get rid of the board specific code. But x86 doesn't have any of
>> it, why should ARM?
> 
> Sure x86 has board specific code.  It's just that x86 basically
> only has one board - PC.
> 

That is one aspect (hardware standardization)... but it is more to it
than that.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-13 Thread H. Peter Anvin
On 08/01/2013 08:50 PM, David Gibson wrote:
 On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com
 wrote:
 On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux 
 li...@arm.linux.org.uk wrote:
 On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com
 wrote:
 [snip]
 Alternatively you may be of the belief that it is impossible to
 get rid of the board specific code. But x86 doesn't have any of
 it, why should ARM?
 
 Sure x86 has board specific code.  It's just that x86 basically
 only has one board - PC.
 

That is one aspect (hardware standardization)... but it is more to it
than that.

-hpa

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-13 Thread Guenter Roeck

On 08/13/2013 04:32 PM, H. Peter Anvin wrote:

On 08/01/2013 08:50 PM, David Gibson wrote:

On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com
wrote:

On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:

On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com

wrote:

[snip]

Alternatively you may be of the belief that it is impossible to
get rid of the board specific code. But x86 doesn't have any of
it, why should ARM?


Sure x86 has board specific code.  It's just that x86 basically
only has one board - PC.



That is one aspect (hardware standardization)... but it is more to it
than that.


I have to deal with lots of embedded / non-PC x86 based systems. Worst one
I encountered so far was a board where the VGA memory space was re-used
for an eeprom. The upcoming next generation hardware I'll have to support
is so far off-standard that I'll probably have to define a new platform
type (similar to OLPC or CE4100).

No, it is not all PC. Not anymore. Intel has started to sell into
the embedded space, where PC compatibility is not a requirement.

Guenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-02 Thread Tony Lindgren
* Russell King - ARM Linux  [130731 13:22]:
> On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
> > On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
> > > 
> > > I showed you two example solutions that could handle this use case 
> > > without 
> > > stable binding ABI, just to prove that b) is not the only option (even if 
> > > it's the best one, which I continue to agree on, don't get me wrong).
> > 
> > You only showed *one* solution (b) that satisfies the use case. The
> > use case was:
> > 
> >User acquires a machine running ARM Linux version 3.x, with u-boot
> >and dtb in a read only flash partition. The board boots and works just
> > ^
> >fine. However, for his application, the user requires a new kernel
> >feature that appeared in version 3.y where y > x. He compiles the new
> >kernel, and it also works.
> > 
> > But you suggested:
> > 
> >  a) using DT as direct replacement for board files - this means that you
> > are free to say that DTSes are strictly coupled with kernel version
> > and you are free to modify the bindings - see the analogy to board
> > files, where you could modify the platform data structures and could
> > not directly copy board file from one kernel version to another,
> > 
> > In the use case, the kernel is upgraded, but not the DTB. So this
> > solution makes no sense.
> 
> That's also crap for another reason.  DT on the whole is _supposed_ to
> describe what the hardware is, and how it is wired up in a WELL DEFINED
> and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
> - having this /chosen node in DT which gets used for "software"
> configuration - eg, the command line and so forth.
> 
> That was a mistake because it means that the DT isn't purely a
> description of the hardware.  Such stuff should have been left in ATAGs,
> and DT should have been placed into its own ATAG entry.  There would
> not have been any conflict between ATAGs and DT, because ATAGs generally
> don't deal with hardware configuration - the only real bit of hardware
> configuration conveyed via ATAGs is the location of memory and size of
> memory.

This I completely agree with. And I'd go a bit further requiring the DT
binding should describe the _types_ of registers the hardware has so the
device driver does not have to contain data for each similar supported
register instances for things like clocks and muxes and timers.

In the worst case, platform_data is just being replaced by device tree
and driver hacks in a confusing way that requires constant updating of
both the .dts files and the device driver.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-02 Thread Tony Lindgren
* Russell King - ARM Linux li...@arm.linux.org.uk [130731 13:22]:
 On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
  On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
   
   I showed you two example solutions that could handle this use case 
   without 
   stable binding ABI, just to prove that b) is not the only option (even if 
   it's the best one, which I continue to agree on, don't get me wrong).
  
  You only showed *one* solution (b) that satisfies the use case. The
  use case was:
  
 User acquires a machine running ARM Linux version 3.x, with u-boot
 and dtb in a read only flash partition. The board boots and works just
  ^
 fine. However, for his application, the user requires a new kernel
 feature that appeared in version 3.y where y  x. He compiles the new
 kernel, and it also works.
  
  But you suggested:
  
   a) using DT as direct replacement for board files - this means that you
  are free to say that DTSes are strictly coupled with kernel version
  and you are free to modify the bindings - see the analogy to board
  files, where you could modify the platform data structures and could
  not directly copy board file from one kernel version to another,
  
  In the use case, the kernel is upgraded, but not the DTB. So this
  solution makes no sense.
 
 That's also crap for another reason.  DT on the whole is _supposed_ to
 describe what the hardware is, and how it is wired up in a WELL DEFINED
 and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
 - having this /chosen node in DT which gets used for software
 configuration - eg, the command line and so forth.
 
 That was a mistake because it means that the DT isn't purely a
 description of the hardware.  Such stuff should have been left in ATAGs,
 and DT should have been placed into its own ATAG entry.  There would
 not have been any conflict between ATAGs and DT, because ATAGs generally
 don't deal with hardware configuration - the only real bit of hardware
 configuration conveyed via ATAGs is the location of memory and size of
 memory.

This I completely agree with. And I'd go a bit further requiring the DT
binding should describe the _types_ of registers the hardware has so the
device driver does not have to contain data for each similar supported
register instances for things like clocks and muxes and timers.

In the worst case, platform_data is just being replaced by device tree
and driver hacks in a confusing way that requires constant updating of
both the .dts files and the device driver.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread David Gibson
On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com wrote:
> On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
>  wrote:
> > On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com
> wrote:
[snip]
> Alternatively you may be of the belief that it is impossible to get
> rid of the board specific code. But x86 doesn't have any of it, why
> should ARM?

Sure x86 has board specific code.  It's just that x86 basically only
has one board - PC.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpI6NfGqsPfk.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Rob Herring
On 08/01/2013 05:18 AM, David Woodhouse wrote:
> On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
>> Alternatively you may be of the belief that it is impossible to get
>> rid of the board specific code. But x86 doesn't have any of it, why
>> should ARM?
> 
> The reason x86 doesn't have it is because it carries three decades worth
> of legacy baggage so that it can still look like a 1980s IBM PC when
> necessary.
> 
> There *have* been some x86 platforms which abandon that legacy crap, and
> for those we *do* have board-specific code. (Is James still maintaining
> Voyager support? It feels very strange to talk about Voyager with it
> *not* being the 'legacy crap' in question...)
> 
> We've even seen *recent* attempts to abandon the legacy crap in the
> embedded x86 space, which backtracked and added it all back again — in
> part because x86 lacked any sane way to describe the hardware if it
> wasn't pretending to be a PC. ACPI doesn't cut it, and DT "wasn't
> invented here"...
>
> Unless you want the ARM world to settle on a strategy of "all the world
> is an Assabet", I'd be careful what you wish for...

There is some level of belief that ACPI will enable running this years
OS on next years h/w. This idea is completely flawed as long as ARM
vendors don't design for compatibility, spin the Si for compatibility
issues, and have some mechanism to emulate legacy h/w. All the
discussions and issues around DT bindings and processes will apply to
ACPI bindings as well.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread jonsm...@gmail.com
On Thu, Aug 1, 2013 at 9:34 AM, jonsm...@gmail.com  wrote:
> On Thu, Aug 1, 2013 at 6:18 AM, David Woodhouse  wrote:
>> On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
>>> Alternatively you may be of the belief that it is impossible to get
>>> rid of the board specific code. But x86 doesn't have any of it, why
>>> should ARM?
>>
>> The reason x86 doesn't have it is because it carries three decades worth
>> of legacy baggage so that it can still look like a 1980s IBM PC when
>> necessary.
>>
>> There *have* been some x86 platforms which abandon that legacy crap, and
>> for those we *do* have board-specific code. (Is James still maintaining
>> Voyager support? It feels very strange to talk about Voyager with it
>> *not* being the 'legacy crap' in question...)
>>
>> We've even seen *recent* attempts to abandon the legacy crap in the
>> embedded x86 space, which backtracked and added it all back again — in
>> part because x86 lacked any sane way to describe the hardware if it
>> wasn't pretending to be a PC. ACPI doesn't cut it, and DT "wasn't
>> invented here"...
>>
>> Unless you want the ARM world to settle on a strategy of "all the world
>> is an Assabet", I'd be careful what you wish for...
>
> So there should be shades for gray in this area. Try to eliminate all
> of the board specific code you can, and then only if that fails add
> board specific support to the kernel.
>
> But you take device trees pretty far. I believe Grant has even used
> one to describe an FPGA that he can dynamically load code into and
> change its function.  Not sure how he did it, I wasn't paying too
> close of attention when he was talking about it.
>
> I do believe a great deal of this simple plumbing can be eliminated.
> Like how to hook up GPIO, I2C, SPI, etc. We're pretty far down that
> road.
>
> A path like this seems like it would be beneficial...
> 1) Implement DT schemas. Use those to enforce as much regularity as
> possible into the device tree descriptions for common classes of
> things (controllers especially - DMA, I2C, I2S, SPI, Uarts, etc)..
> Form a group to review any changes to the common schema.
> 2) Cleaning up the controller classes is going to cause some DT churn.
> Hide backward compatibility in a quirks layer.
> 3) Continue the process of removing all possible board specific code
> that can be reasonably covered in device trees.
> 4) There will be some board specific code left at the end of this
> process. But anyone who looks at should agree that the functions
> handled by the code are something that is unreasonable to address in
> the DT system.

5) this scheme supports future improvements in the DT schema. Lets say
initially we had punted power management to board specific code.
Then in a later kernel version implemented it using device trees. The
quirk system lets you delete the board specific code and replace it
with a DT quirk. That DT quirk will see your deployed DTs at boot time
and add in the new, fancy power management DT attributes.  The new
generic DT based power power management code will see these attributes
added by the quirk and do the right thing. This gives us a way to
slowly remove move board specific code if we choose to.



>
>
>>
>> --
>> dwmw2
>>
>
>
>
> --
> Jon Smirl
> jonsm...@gmail.com



-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread jonsm...@gmail.com
On Thu, Aug 1, 2013 at 6:18 AM, David Woodhouse  wrote:
> On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
>> Alternatively you may be of the belief that it is impossible to get
>> rid of the board specific code. But x86 doesn't have any of it, why
>> should ARM?
>
> The reason x86 doesn't have it is because it carries three decades worth
> of legacy baggage so that it can still look like a 1980s IBM PC when
> necessary.
>
> There *have* been some x86 platforms which abandon that legacy crap, and
> for those we *do* have board-specific code. (Is James still maintaining
> Voyager support? It feels very strange to talk about Voyager with it
> *not* being the 'legacy crap' in question...)
>
> We've even seen *recent* attempts to abandon the legacy crap in the
> embedded x86 space, which backtracked and added it all back again — in
> part because x86 lacked any sane way to describe the hardware if it
> wasn't pretending to be a PC. ACPI doesn't cut it, and DT "wasn't
> invented here"...
>
> Unless you want the ARM world to settle on a strategy of "all the world
> is an Assabet", I'd be careful what you wish for...

So there should be shades for gray in this area. Try to eliminate all
of the board specific code you can, and then only if that fails add
board specific support to the kernel.

But you take device trees pretty far. I believe Grant has even used
one to describe an FPGA that he can dynamically load code into and
change its function.  Not sure how he did it, I wasn't paying too
close of attention when he was talking about it.

I do believe a great deal of this simple plumbing can be eliminated.
Like how to hook up GPIO, I2C, SPI, etc. We're pretty far down that
road.

A path like this seems like it would be beneficial...
1) Implement DT schemas. Use those to enforce as much regularity as
possible into the device tree descriptions for common classes of
things (controllers especially - DMA, I2C, I2S, SPI, Uarts, etc)..
Form a group to review any changes to the common schema.
2) Cleaning up the controller classes is going to cause some DT churn.
Hide backward compatibility in a quirks layer.
3) Continue the process of removing all possible board specific code
that can be reasonably covered in device trees.
4) There will be some board specific code left at the end of this
process. But anyone who looks at should agree that the functions
handled by the code are something that is unreasonable to address in
the DT system.


>
> --
> dwmw2
>



-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread David Woodhouse
On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
> Alternatively you may be of the belief that it is impossible to get
> rid of the board specific code. But x86 doesn't have any of it, why
> should ARM?

The reason x86 doesn't have it is because it carries three decades worth
of legacy baggage so that it can still look like a 1980s IBM PC when
necessary.

There *have* been some x86 platforms which abandon that legacy crap, and
for those we *do* have board-specific code. (Is James still maintaining
Voyager support? It feels very strange to talk about Voyager with it
*not* being the 'legacy crap' in question...)

We've even seen *recent* attempts to abandon the legacy crap in the
embedded x86 space, which backtracked and added it all back again — in
part because x86 lacked any sane way to describe the hardware if it
wasn't pretending to be a PC. ACPI doesn't cut it, and DT "wasn't
invented here"...

Unless you want the ARM world to settle on a strategy of "all the world
is an Assabet", I'd be careful what you wish for...

-- 
dwmw2



smime.p7s
Description: S/MIME cryptographic signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Mark Brown
On Thu, Aug 01, 2013 at 11:57:43AM +0200, Arend van Spriel wrote:
> On 07/31/2013 11:26 PM, jonsm...@gmail.com wrote:

> >Alternatively you may be of the belief that it is impossible to get
> >rid of the board specific code. But x86 doesn't have any of it, why
> >should ARM?

> Well, I am curious whether that will stay that way once x86 is truly
> moving into the embedded arena (if ever).

There's shipping phones using x86, they do actually have board code due
to their use of SFI.


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Arend van Spriel

On 07/31/2013 11:26 PM, jonsm...@gmail.com wrote:

Alternatively you may be of the belief that it is impossible to get
rid of the board specific code. But x86 doesn't have any of it, why
should ARM?


Well, I am curious whether that will stay that way once x86 is truly 
moving into the embedded arena (if ever).


Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Arend van Spriel

On 07/31/2013 11:26 PM, jonsm...@gmail.com wrote:

Alternatively you may be of the belief that it is impossible to get
rid of the board specific code. But x86 doesn't have any of it, why
should ARM?


Well, I am curious whether that will stay that way once x86 is truly 
moving into the embedded arena (if ever).


Regards,
Arend

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Mark Brown
On Thu, Aug 01, 2013 at 11:57:43AM +0200, Arend van Spriel wrote:
 On 07/31/2013 11:26 PM, jonsm...@gmail.com wrote:

 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?

 Well, I am curious whether that will stay that way once x86 is truly
 moving into the embedded arena (if ever).

There's shipping phones using x86, they do actually have board code due
to their use of SFI.


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread David Woodhouse
On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?

The reason x86 doesn't have it is because it carries three decades worth
of legacy baggage so that it can still look like a 1980s IBM PC when
necessary.

There *have* been some x86 platforms which abandon that legacy crap, and
for those we *do* have board-specific code. (Is James still maintaining
Voyager support? It feels very strange to talk about Voyager with it
*not* being the 'legacy crap' in question...)

We've even seen *recent* attempts to abandon the legacy crap in the
embedded x86 space, which backtracked and added it all back again — in
part because x86 lacked any sane way to describe the hardware if it
wasn't pretending to be a PC. ACPI doesn't cut it, and DT wasn't
invented here...

Unless you want the ARM world to settle on a strategy of all the world
is an Assabet, I'd be careful what you wish for...

-- 
dwmw2



smime.p7s
Description: S/MIME cryptographic signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread jonsm...@gmail.com
On Thu, Aug 1, 2013 at 6:18 AM, David Woodhouse dw...@infradead.org wrote:
 On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?

 The reason x86 doesn't have it is because it carries three decades worth
 of legacy baggage so that it can still look like a 1980s IBM PC when
 necessary.

 There *have* been some x86 platforms which abandon that legacy crap, and
 for those we *do* have board-specific code. (Is James still maintaining
 Voyager support? It feels very strange to talk about Voyager with it
 *not* being the 'legacy crap' in question...)

 We've even seen *recent* attempts to abandon the legacy crap in the
 embedded x86 space, which backtracked and added it all back again — in
 part because x86 lacked any sane way to describe the hardware if it
 wasn't pretending to be a PC. ACPI doesn't cut it, and DT wasn't
 invented here...

 Unless you want the ARM world to settle on a strategy of all the world
 is an Assabet, I'd be careful what you wish for...

So there should be shades for gray in this area. Try to eliminate all
of the board specific code you can, and then only if that fails add
board specific support to the kernel.

But you take device trees pretty far. I believe Grant has even used
one to describe an FPGA that he can dynamically load code into and
change its function.  Not sure how he did it, I wasn't paying too
close of attention when he was talking about it.

I do believe a great deal of this simple plumbing can be eliminated.
Like how to hook up GPIO, I2C, SPI, etc. We're pretty far down that
road.

A path like this seems like it would be beneficial...
1) Implement DT schemas. Use those to enforce as much regularity as
possible into the device tree descriptions for common classes of
things (controllers especially - DMA, I2C, I2S, SPI, Uarts, etc)..
Form a group to review any changes to the common schema.
2) Cleaning up the controller classes is going to cause some DT churn.
Hide backward compatibility in a quirks layer.
3) Continue the process of removing all possible board specific code
that can be reasonably covered in device trees.
4) There will be some board specific code left at the end of this
process. But anyone who looks at should agree that the functions
handled by the code are something that is unreasonable to address in
the DT system.



 --
 dwmw2




-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread jonsm...@gmail.com
On Thu, Aug 1, 2013 at 9:34 AM, jonsm...@gmail.com jonsm...@gmail.com wrote:
 On Thu, Aug 1, 2013 at 6:18 AM, David Woodhouse dw...@infradead.org wrote:
 On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?

 The reason x86 doesn't have it is because it carries three decades worth
 of legacy baggage so that it can still look like a 1980s IBM PC when
 necessary.

 There *have* been some x86 platforms which abandon that legacy crap, and
 for those we *do* have board-specific code. (Is James still maintaining
 Voyager support? It feels very strange to talk about Voyager with it
 *not* being the 'legacy crap' in question...)

 We've even seen *recent* attempts to abandon the legacy crap in the
 embedded x86 space, which backtracked and added it all back again — in
 part because x86 lacked any sane way to describe the hardware if it
 wasn't pretending to be a PC. ACPI doesn't cut it, and DT wasn't
 invented here...

 Unless you want the ARM world to settle on a strategy of all the world
 is an Assabet, I'd be careful what you wish for...

 So there should be shades for gray in this area. Try to eliminate all
 of the board specific code you can, and then only if that fails add
 board specific support to the kernel.

 But you take device trees pretty far. I believe Grant has even used
 one to describe an FPGA that he can dynamically load code into and
 change its function.  Not sure how he did it, I wasn't paying too
 close of attention when he was talking about it.

 I do believe a great deal of this simple plumbing can be eliminated.
 Like how to hook up GPIO, I2C, SPI, etc. We're pretty far down that
 road.

 A path like this seems like it would be beneficial...
 1) Implement DT schemas. Use those to enforce as much regularity as
 possible into the device tree descriptions for common classes of
 things (controllers especially - DMA, I2C, I2S, SPI, Uarts, etc)..
 Form a group to review any changes to the common schema.
 2) Cleaning up the controller classes is going to cause some DT churn.
 Hide backward compatibility in a quirks layer.
 3) Continue the process of removing all possible board specific code
 that can be reasonably covered in device trees.
 4) There will be some board specific code left at the end of this
 process. But anyone who looks at should agree that the functions
 handled by the code are something that is unreasonable to address in
 the DT system.

5) this scheme supports future improvements in the DT schema. Lets say
initially we had punted power management to board specific code.
Then in a later kernel version implemented it using device trees. The
quirk system lets you delete the board specific code and replace it
with a DT quirk. That DT quirk will see your deployed DTs at boot time
and add in the new, fancy power management DT attributes.  The new
generic DT based power power management code will see these attributes
added by the quirk and do the right thing. This gives us a way to
slowly remove move board specific code if we choose to.






 --
 dwmw2




 --
 Jon Smirl
 jonsm...@gmail.com



-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread Rob Herring
On 08/01/2013 05:18 AM, David Woodhouse wrote:
 On Wed, 2013-07-31 at 17:26 -0400, jonsm...@gmail.com wrote:
 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?
 
 The reason x86 doesn't have it is because it carries three decades worth
 of legacy baggage so that it can still look like a 1980s IBM PC when
 necessary.
 
 There *have* been some x86 platforms which abandon that legacy crap, and
 for those we *do* have board-specific code. (Is James still maintaining
 Voyager support? It feels very strange to talk about Voyager with it
 *not* being the 'legacy crap' in question...)
 
 We've even seen *recent* attempts to abandon the legacy crap in the
 embedded x86 space, which backtracked and added it all back again — in
 part because x86 lacked any sane way to describe the hardware if it
 wasn't pretending to be a PC. ACPI doesn't cut it, and DT wasn't
 invented here...

 Unless you want the ARM world to settle on a strategy of all the world
 is an Assabet, I'd be careful what you wish for...

There is some level of belief that ACPI will enable running this years
OS on next years h/w. This idea is completely flawed as long as ARM
vendors don't design for compatibility, spin the Si for compatibility
issues, and have some mechanism to emulate legacy h/w. All the
discussions and issues around DT bindings and processes will apply to
ACPI bindings as well.

Rob
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-08-01 Thread David Gibson
On Wed, Jul 31, 2013 at 05:26:47PM -0400, jonsm...@gmail.com wrote:
 On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com
 wrote:
[snip]
 Alternatively you may be of the belief that it is impossible to get
 rid of the board specific code. But x86 doesn't have any of it, why
 should ARM?

Sure x86 has board specific code.  It's just that x86 basically only
has one board - PC.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpI6NfGqsPfk.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread jonsm...@gmail.com
On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
 wrote:
> On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com wrote:
>> On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
>>  wrote:
>> > However, if we go back to the idea that DT is supposed to describe the
>> > hardware, _and_ that the way to describe that hardware is well defined
>> > and _stable_ (as it should be) then there should be no reason what so
>> > ever that your old DT blob should not continue working in later kernels.
>> > If it doesn't, then the contract that DT promised when we first moved
>> > over to using DT has been _broken_.
>>
>> Suppose your DT predates PINCTRL and the CPU needs the pins set to
>> function.  But setting the pins up is a board specific function. How
>> is this going to get implemented in a generic kernel that doesn't have
>> any board specific code in it?
>>
>> I would propose that we only need to worry about DTs that got put into
>> boot loaders and not worry about ones that were only used when
>> appended to a kernel.
>
> That is - again - our mistake.  We should have made it clear from the
> start that the use of an _appended_ DT, or a DT provided with the kernel
> being booted was more or less mandatory for the time being.  We actually
> did exactly the opposite - we advertised the appended DT as a stop-gap
> measure just to allow a DT kernel to be booted with a boot loader which
> didn't support DT.
>
> That in itself _encouraged_ boot loader support for DT on ARM (which in
> itself is not a bad thing) but also leads people down the path of
> potentially separating the DT from the kernel.
>
> Had we encouraged the use of an appended DT instead, but still encouraged
> boot loaders to update, and also made a clear statement that DT is
> unstable (which everyone can see - for example by making our DT stuff
> depend on CONFIG_EXPERIMENTAL when it existed) then everyone would have
> been clear about its status.
>
> The fact that we did not - the fact that we ignored this process means
> that it is _our_ problem that people like Richard are blowing up such a
> storm over this.  We need to admit that we got it wrong, and commit to
> doing it the right way in future.  What that means is starting off today
> with a commitment to keep as much of the stuff which works today working
> _tomorrow_, and the day after, and so forth.

What do you think about using a quirk layer to decouple deployed DTs
from whatever is implemented in the kernel? I still think there is
going to be volatility in the the kernel DT usage simply because we
haven't figured out all of the issues with it yet.  For example
defining a global schema system is going to expose a lot of irregular
DT syntax when you line up all of the platform DTs in a system where
it is easy to compare them. One the plus side the kernel is certainly
evolving to a point where this volatility will stop in the future, we
just aren't there yet.  If we don't use a quirk fixup system, then
board specific code is going to continue to exist scattered around in
the arch directories.

My preference would be to contain the board specific DT fixup code
inside a quirk system and have the goal of making the arch directories
free of board specific code. Any new board would have a good enough DT
that they don't need any board specific DT fixup code. Of course
there's quite a ways to go before reaching that goal.

Alternatively you may be of the belief that it is impossible to get
rid of the board specific code. But x86 doesn't have any of it, why
should ARM?

-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Russell King - ARM Linux
On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com wrote:
> On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
>  wrote:
> > However, if we go back to the idea that DT is supposed to describe the
> > hardware, _and_ that the way to describe that hardware is well defined
> > and _stable_ (as it should be) then there should be no reason what so
> > ever that your old DT blob should not continue working in later kernels.
> > If it doesn't, then the contract that DT promised when we first moved
> > over to using DT has been _broken_.
> 
> Suppose your DT predates PINCTRL and the CPU needs the pins set to
> function.  But setting the pins up is a board specific function. How
> is this going to get implemented in a generic kernel that doesn't have
> any board specific code in it?
> 
> I would propose that we only need to worry about DTs that got put into
> boot loaders and not worry about ones that were only used when
> appended to a kernel.

That is - again - our mistake.  We should have made it clear from the
start that the use of an _appended_ DT, or a DT provided with the kernel
being booted was more or less mandatory for the time being.  We actually
did exactly the opposite - we advertised the appended DT as a stop-gap
measure just to allow a DT kernel to be booted with a boot loader which
didn't support DT.

That in itself _encouraged_ boot loader support for DT on ARM (which in
itself is not a bad thing) but also leads people down the path of
potentially separating the DT from the kernel.

Had we encouraged the use of an appended DT instead, but still encouraged
boot loaders to update, and also made a clear statement that DT is
unstable (which everyone can see - for example by making our DT stuff
depend on CONFIG_EXPERIMENTAL when it existed) then everyone would have
been clear about its status.

The fact that we did not - the fact that we ignored this process means
that it is _our_ problem that people like Richard are blowing up such a
storm over this.  We need to admit that we got it wrong, and commit to
doing it the right way in future.  What that means is starting off today
with a commitment to keep as much of the stuff which works today working
_tomorrow_, and the day after, and so forth.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread jonsm...@gmail.com
On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
 wrote:
> On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
>> On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
>> >
>> > I showed you two example solutions that could handle this use case without
>> > stable binding ABI, just to prove that b) is not the only option (even if
>> > it's the best one, which I continue to agree on, don't get me wrong).
>>
>> You only showed *one* solution (b) that satisfies the use case. The
>> use case was:
>>
>>User acquires a machine running ARM Linux version 3.x, with u-boot
>>and dtb in a read only flash partition. The board boots and works just
>> ^
>>fine. However, for his application, the user requires a new kernel
>>feature that appeared in version 3.y where y > x. He compiles the new
>>kernel, and it also works.
>>
>> But you suggested:
>>
>>  a) using DT as direct replacement for board files - this means that you
>> are free to say that DTSes are strictly coupled with kernel version
>> and you are free to modify the bindings - see the analogy to board
>> files, where you could modify the platform data structures and could
>> not directly copy board file from one kernel version to another,
>>
>> In the use case, the kernel is upgraded, but not the DTB. So this
>> solution makes no sense.
>
> That's also crap for another reason.  DT on the whole is _supposed_ to
> describe what the hardware is, and how it is wired up in a WELL DEFINED
> and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
> - having this /chosen node in DT which gets used for "software"
> configuration - eg, the command line and so forth.
>
> That was a mistake because it means that the DT isn't purely a
> description of the hardware.  Such stuff should have been left in ATAGs,
> and DT should have been placed into its own ATAG entry.  There would
> not have been any conflict between ATAGs and DT, because ATAGs generally
> don't deal with hardware configuration - the only real bit of hardware
> configuration conveyed via ATAGs is the location of memory and size of
> memory.
>
> However, if we go back to the idea that DT is supposed to describe the
> hardware, _and_ that the way to describe that hardware is well defined
> and _stable_ (as it should be) then there should be no reason what so
> ever that your old DT blob should not continue working in later kernels.
> If it doesn't, then the contract that DT promised when we first moved
> over to using DT has been _broken_.

Suppose your DT predates PINCTRL and the CPU needs the pins set to
function.  But setting the pins up is a board specific function. How
is this going to get implemented in a generic kernel that doesn't have
any board specific code in it?

I would propose that we only need to worry about DTs that got put into
boot loaders and not worry about ones that were only used when
appended to a kernel.

For those deployed bootloader based DTs we'd use a quirk system to
catch them at early boot time and add in the missing PINCTRL
information.  The function of this quirk system is to update deployed
DTs with the needed information to allow a completely generic kernel
to run.

Now we can have a very clean generic kernel with all of the board
specific fixups localized to a single spot - the quirk for those
deployed DTs. And hopefully new boards won't need any quirks.

>
> Quite frankly, the fact that this discussion has gone on soo far, and
> everyone is saying that the existing DT descriptions to date (for what,
> two years) are all unstable is really extremely sad.
>
> I've stated in my previous postings what I think very clearly - and it
> comes down to the fact that every DT binding which is in existence in
> a released kernel _is_ by that very nature a stable binding.  If it
> wasn't a stable binding, it should have been clearly marked as such
> and been subject to CONFIG_EXPERIMENTAL (when it existed) or
> CONFIG_STAGING or similar.
>
> We even went as far as creating documentation for the bindings - directly
> along side the documentation for PPC bindings, with no distinction.
>
> Given all that, it's down right insulting to those who have been using
> ARM kernels to now start off a discussion about making these things
> stable.  Those people who think that these bindings are not stable need
> to wake up to reality - we have USERS of this stuff over the last two
> years.  It's found its way into products.  If we're going to keep this
> stuff "unstable" then we are actively _hurting_ our users.
>
> I'll say it again: if a binding has been in a final kernel, it is by
> definition a *stable* binding, and compatibility with that binding
> *must* be maintained.
>
> If we're not going to do that, then we owe all the users of the ARM
> kernel a VERY BIG apology.
>
> ___
> linux-arm-kernel mailing list
> 

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Russell King - ARM Linux
On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
> On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
> > 
> > I showed you two example solutions that could handle this use case without 
> > stable binding ABI, just to prove that b) is not the only option (even if 
> > it's the best one, which I continue to agree on, don't get me wrong).
> 
> You only showed *one* solution (b) that satisfies the use case. The
> use case was:
> 
>User acquires a machine running ARM Linux version 3.x, with u-boot
>and dtb in a read only flash partition. The board boots and works just
> ^
>fine. However, for his application, the user requires a new kernel
>feature that appeared in version 3.y where y > x. He compiles the new
>kernel, and it also works.
> 
> But you suggested:
> 
>  a) using DT as direct replacement for board files - this means that you
> are free to say that DTSes are strictly coupled with kernel version
> and you are free to modify the bindings - see the analogy to board
> files, where you could modify the platform data structures and could
> not directly copy board file from one kernel version to another,
> 
> In the use case, the kernel is upgraded, but not the DTB. So this
> solution makes no sense.

That's also crap for another reason.  DT on the whole is _supposed_ to
describe what the hardware is, and how it is wired up in a WELL DEFINED
and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
- having this /chosen node in DT which gets used for "software"
configuration - eg, the command line and so forth.

That was a mistake because it means that the DT isn't purely a
description of the hardware.  Such stuff should have been left in ATAGs,
and DT should have been placed into its own ATAG entry.  There would
not have been any conflict between ATAGs and DT, because ATAGs generally
don't deal with hardware configuration - the only real bit of hardware
configuration conveyed via ATAGs is the location of memory and size of
memory.

However, if we go back to the idea that DT is supposed to describe the
hardware, _and_ that the way to describe that hardware is well defined
and _stable_ (as it should be) then there should be no reason what so
ever that your old DT blob should not continue working in later kernels.
If it doesn't, then the contract that DT promised when we first moved
over to using DT has been _broken_.

Quite frankly, the fact that this discussion has gone on soo far, and
everyone is saying that the existing DT descriptions to date (for what,
two years) are all unstable is really extremely sad.

I've stated in my previous postings what I think very clearly - and it
comes down to the fact that every DT binding which is in existence in
a released kernel _is_ by that very nature a stable binding.  If it
wasn't a stable binding, it should have been clearly marked as such
and been subject to CONFIG_EXPERIMENTAL (when it existed) or
CONFIG_STAGING or similar.

We even went as far as creating documentation for the bindings - directly
along side the documentation for PPC bindings, with no distinction.

Given all that, it's down right insulting to those who have been using
ARM kernels to now start off a discussion about making these things
stable.  Those people who think that these bindings are not stable need
to wake up to reality - we have USERS of this stuff over the last two
years.  It's found its way into products.  If we're going to keep this
stuff "unstable" then we are actively _hurting_ our users.

I'll say it again: if a binding has been in a final kernel, it is by
definition a *stable* binding, and compatibility with that binding
*must* be maintained.

If we're not going to do that, then we owe all the users of the ARM
kernel a VERY BIG apology.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
> 
> I showed you two example solutions that could handle this use case without 
> stable binding ABI, just to prove that b) is not the only option (even if 
> it's the best one, which I continue to agree on, don't get me wrong).

You only showed *one* solution (b) that satisfies the use case. The
use case was:

   User acquires a machine running ARM Linux version 3.x, with u-boot
   and dtb in a read only flash partition. The board boots and works just
^
   fine. However, for his application, the user requires a new kernel
   feature that appeared in version 3.y where y > x. He compiles the new
   kernel, and it also works.

But you suggested:

 a) using DT as direct replacement for board files - this means that you
are free to say that DTSes are strictly coupled with kernel version
and you are free to modify the bindings - see the analogy to board
files, where you could modify the platform data structures and could
not directly copy board file from one kernel version to another,

In the use case, the kernel is upgraded, but not the DTB. So this
solution makes no sense.

> I also added that the use case is not fully valid,

The use case *is* valid.  I am not inventing this just to be a pain.
There are plenty of people unable or unwilling to upgrade their boot
loader or DTB.  You can say that you won't support it, but it is a use
case from actual real life.

> because you can't 
> magically define bindings for all future hardware, which means you can't 
> support the hardware using a DTB made before stable bindings for that 
> hardware have ever been introduced.

Surely it is possible to develop and release a stable kernel and DT
ABI for a given hardware? Once this is present, it is reasonable for
users to expect forward compatibility from the DT system.
 
> With all of this, I agreed that a DTB made for kernel 3.x, when used with 
> kernel 3.y (y > x) should provide the same or greater feature set than 
> used with kernel 3.x, in other words, this should cause no regressions. 
> Still, for new features, you will likely need to update the DTB.

Yes, that is the idea.

> So, again, to summarize, my view on this is as follows:
>  - there is a list of best practices for binding design and existing 
>stable bindings that can be used to help for designing new bindings,
>  - new bindings go through review process,
>  - after positive review, such bindings gets staging status, i.e. they are 
>marked as something that could change,
>  - after some period of time (we need to define this precisely) they get 
>frozen and can't be changed in a way that breaks compatibility any
>more. In other words, they become ABI.
> 
> What do you think?

Sounds okay to me, but why bother with this marking business? Why not
just have staging or development trees like every other subsystem?

Thanks,
Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 21:12:09 Richard Cochran wrote:
> On Wed, Jul 31, 2013 at 05:23:35PM +0200, Tomasz Figa wrote:
> > I said it many, many times, that a) and b) I proposed are just two
> > extremes. It is unlikely that an extreme solution will be the best
> > option to choose. I am strongly for something in the middle, just
> > like I wrote in several of my previous replies.
> > 
> > This is something that should be commented, not those extreme options.
> 
> We are saying that pursuing a) is useless because it adds pain and
> complexity without adding benefit. I simply don't buy your argument
> that DT makes a better platform data, but that is besides the point.
> 
> I had said, think about the users.  You said, what users?  I wrote a
> clear and concise use case.  You said, lets think about a) and b) and
> all the shades of gray in between.

I showed you two example solutions that could handle this use case without 
stable binding ABI, just to prove that b) is not the only option (even if 
it's the best one, which I continue to agree on, don't get me wrong).

I also added that the use case is not fully valid, because you can't 
magically define bindings for all future hardware, which means you can't 
support the hardware using a DTB made before stable bindings for that 
hardware have ever been introduced.

With all of this, I agreed that a DTB made for kernel 3.x, when used with 
kernel 3.y (y > x) should provide the same or greater feature set than 
used with kernel 3.x, in other words, this should cause no regressions. 
Still, for new features, you will likely need to update the DTB.

> In order to support the use case, you will have to provide a stable
> ABI. You can't have a compromise solution. At the end of the day,
> either you have a stable ABI, or you don't.
> 
> It was apparent to me that the arm/dt thing has been meandering around
> since its inception, but what was surprising is that people were doing
> this on purpose, and now they are defending this. Why can't we get a
> firm commitment on having a stable ABI?

This is exactly what are we trying to do right now. But you don't get 
stable things right away. You need some kind of process, for design, 
review, staging, stabilization, etc. Without all of this we will again 
surely end up with something pretending to be good and stable, while being 
completely useless and only a burden to support in new code.

So, again, to summarize, my view on this is as follows:
 - there is a list of best practices for binding design and existing 
   stable bindings that can be used to help for designing new bindings,
 - new bindings go through review process,
 - after positive review, such bindings gets staging status, i.e. they are 
   marked as something that could change,
 - after some period of time (we need to define this precisely) they get 
   frozen and can't be changed in a way that breaks compatibility any
   more. In other words, they become ABI.

What do you think?

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 05:23:35PM +0200, Tomasz Figa wrote:
> 
> I said it many, many times, that a) and b) I proposed are just two extremes. 
> It is unlikely that an extreme solution will be the best option to choose. I 
> am strongly for something in the middle, just like I wrote in several of my 
> previous replies.
> 
> This is something that should be commented, not those extreme options.

We are saying that pursuing a) is useless because it adds pain and
complexity without adding benefit. I simply don't buy your argument
that DT makes a better platform data, but that is besides the point.

I had said, think about the users.  You said, what users?  I wrote a
clear and concise use case.  You said, lets think about a) and b) and
all the shades of gray in between.

In order to support the use case, you will have to provide a stable
ABI. You can't have a compromise solution. At the end of the day,
either you have a stable ABI, or you don't.

It was apparent to me that the arm/dt thing has been meandering around
since its inception, but what was surprising is that people were doing
this on purpose, and now they are defending this. Why can't we get a
firm commitment on having a stable ABI?

Thanks,
Richard


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 17:07:19 Richard Cochran wrote:
> On Wed, Jul 31, 2013 at 12:59:59PM +0200, Tomasz Figa wrote:
> > On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
> > > Board files are C code anyone has the skill to edit/understand/refactor.
> > > Moving to DT and keep them in tree tightly coupled with the kernel
> > > version just adds another layer of indirection for *no purpose*.
> 
> +1
> 
> That is exactly what I tried to say.

I agree with you to some extent. Don't be so extreme though. As I already 
said, this is not entirely "no purpose", as there are more benefits of having 
device tree than just separation from kernel tree.

> > > Linus started the whole thing some years ago by refusing to pull ARM
> > > tree [1]. Reread his post, what he wants is clearly b).
> > > 
> > > Going a) does not solve any problem. You are just moving churn to
> > > somewhere else. We had board files churn, then defconfigs churn, DTS
> > > files (and associated drivers) will be next.
> 
> And at this rate, we are headed for another Linus ultimatum, sooner or
> later.

(see end of the message)

> > > DT is self inflicted pain. It has to be for the greater good.
> > 
> > It has several benefits over board files that I mentioned above, possible
> > without fully separating them from kernel tree.
> 
> Every time a criticism is voiced about DT, the DT people stick their
> fingers in their ears and say, "NAH, NAH, NAH, I CAN'T HEAR YOU!"

I won't comment this...

> WRT to DT-as-platform-device, we would rather stick with the C code,
> please. Just pushing the configuration tables into an external form
> does not simplify the problem. In fact, it creates new problems by
> inviting the possibility of a bootloader/DT/kernel mismatch.

Care to stop ignoring my points other than those defending ideas (nowhere 
stated as good or bad) from extreme opinions?

I said it many, many times, that a) and b) I proposed are just two extremes. 
It is unlikely that an extreme solution will be the best option to choose. I 
am strongly for something in the middle, just like I wrote in several of my 
previous replies.

This is something that should be commented, not those extreme options.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 12:59:59PM +0200, Tomasz Figa wrote:
> On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
> > 
> > Board files are C code anyone has the skill to edit/understand/refactor.
> > Moving to DT and keep them in tree tightly coupled with the kernel
> > version just adds another layer of indirection for *no purpose*.

+1

That is exactly what I tried to say.

> > Linus started the whole thing some years ago by refusing to pull ARM
> > tree [1]. Reread his post, what he wants is clearly b).
> > 
> > Going a) does not solve any problem. You are just moving churn to
> > somewhere else. We had board files churn, then defconfigs churn, DTS
> > files (and associated drivers) will be next.

And at this rate, we are headed for another Linus ultimatum, sooner or
later.

> > DT is self inflicted pain. It has to be for the greater good.
> 
> It has several benefits over board files that I mentioned above, possible 
> without fully separating them from kernel tree.

Every time a criticism is voiced about DT, the DT people stick their
fingers in their ears and say, "NAH, NAH, NAH, I CAN'T HEAR YOU!"

WRT to DT-as-platform-device, we would rather stick with the C code,
please. Just pushing the configuration tables into an external form
does not simplify the problem. In fact, it creates new problems by
inviting the possibility of a bootloader/DT/kernel mismatch.

Thanks,
Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
> On Sat, 2013-07-27 at 11:51 -0700, Tomasz Figa wrote:
> > Well, it depends on how we use the DT. There are (at least) two possible
> > 
> > usage scenarios:
> >  a) using DT as direct replacement for board files - this means that you
> >  
> > are free to say that DTSes are strictly coupled with kernel version
> > and you are free to modify the bindings - see the analogy to board
> > files, where you could modify the platform data structures and could
> > not directly copy board file from one kernel version to another,
> 
> I'm shocked to see this as a possible option.
> 
> Board files are C code anyone has the skill to edit/understand/refactor.
> Moving to DT and keep them in tree tightly coupled with the kernel
> version just adds another layer of indirection for *no purpose*.

Well, I agree that it's not the most fortunate scenario, but it is not that 
bad as it might seem. It still has the benefit of separating hardware data 
(including board-specific data) from kernel code and has all the benefits of 
DT, 
e.g. easy way to specify relations between devices (phandles), no need to 
manually register any resources, platform data or platform devices, in other 
words, when describing hardware you just care about the hardware, not how the 
kernel works.

> The fact that we loose compiler syntax/type checking (as highlighted
> somewhere else in this thread) even looks like a regression.

Syntax checking is already there. We don't have semantic checking yet, but we 
are working on this.

> >  b) using DT as an ABI - this is the original way, i.e. define stable
> >  
> > bindings and make sure that anu DTB built for older kernel will
> > 
> > work, with equal or greater set of functionality on newer kernels.
> 
> Linus started the whole thing some years ago by refusing to pull ARM
> tree [1]. Reread his post, what he wants is clearly b).
> 
> Going a) does not solve any problem. You are just moving churn to
> somewhere else. We had board files churn, then defconfigs churn, DTS
> files (and associated drivers) will be next.
> 
> DT is self inflicted pain. It has to be for the greater good.

It has several benefits over board files that I mentioned above, possible 
without fully separating them from kernel tree.

> Going b) *might* allow what some people here dream about, a kernel free
> of hardware knowledge. A new board could boot a kernel compiled before
> it was even designed.

This is very unlikely to happen. You can already see problems with defining 
bindings for existing hardware and what to say about hardware that is not even 
designed yet? Unless all the board uses is a set of already supported 
components, that have bindings defined and drivers merged, you would still need 
to provide remaining drivers and bindings for them.

> Now since I do "embedded" stuff everyday, I don't think b) can apply to
> the whole ARM world. There is just to much hardware peculiarity.

That's why I think we need a hybrid solution. Staging bindings could use a) 
and those stable one would use b). Staging bindings would be fixed over time if 
needed and if they turn out to be fine, they can be stabilized and move to b).

So basically, you can get all the stable functionality with one DTB on any 
kernel released after the functionality got stable, but during development of 
some functionality you might need to change the DTB to test the development.

Best regards,
Tomasz
 
> [1] https://lkml.org/lkml/2011/3/30/525
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Maxime Bizon

On Sat, 2013-07-27 at 11:51 -0700, Tomasz Figa wrote:

> Well, it depends on how we use the DT. There are (at least) two possible 
> usage scenarios:
> 
>  a) using DT as direct replacement for board files - this means that you 
> are free to say that DTSes are strictly coupled with kernel version 
> and you are free to modify the bindings - see the analogy to board 
> files, where you could modify the platform data structures and could 
> not directly copy board file from one kernel version to another,

I'm shocked to see this as a possible option.

Board files are C code anyone has the skill to edit/understand/refactor.
Moving to DT and keep them in tree tightly coupled with the kernel
version just adds another layer of indirection for *no purpose*.

The fact that we loose compiler syntax/type checking (as highlighted
somewhere else in this thread) even looks like a regression.


>  b) using DT as an ABI - this is the original way, i.e. define stable 
> bindings and make sure that anu DTB built for older kernel will
> work, with equal or greater set of functionality on newer kernels.
> 
Linus started the whole thing some years ago by refusing to pull ARM
tree [1]. Reread his post, what he wants is clearly b).

Going a) does not solve any problem. You are just moving churn to
somewhere else. We had board files churn, then defconfigs churn, DTS
files (and associated drivers) will be next.

DT is self inflicted pain. It has to be for the greater good.

Going b) *might* allow what some people here dream about, a kernel free
of hardware knowledge. A new board could boot a kernel compiled before
it was even designed.

Now since I do "embedded" stuff everyday, I don't think b) can apply to
the whole ARM world. There is just to much hardware peculiarity.


[1] https://lkml.org/lkml/2011/3/30/525

-- 
Maxime


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Maxime Bizon

On Sat, 2013-07-27 at 11:51 -0700, Tomasz Figa wrote:

 Well, it depends on how we use the DT. There are (at least) two possible 
 usage scenarios:
 
  a) using DT as direct replacement for board files - this means that you 
 are free to say that DTSes are strictly coupled with kernel version 
 and you are free to modify the bindings - see the analogy to board 
 files, where you could modify the platform data structures and could 
 not directly copy board file from one kernel version to another,

I'm shocked to see this as a possible option.

Board files are C code anyone has the skill to edit/understand/refactor.
Moving to DT and keep them in tree tightly coupled with the kernel
version just adds another layer of indirection for *no purpose*.

The fact that we loose compiler syntax/type checking (as highlighted
somewhere else in this thread) even looks like a regression.


  b) using DT as an ABI - this is the original way, i.e. define stable 
 bindings and make sure that anu DTB built for older kernel will
 work, with equal or greater set of functionality on newer kernels.
 
Linus started the whole thing some years ago by refusing to pull ARM
tree [1]. Reread his post, what he wants is clearly b).

Going a) does not solve any problem. You are just moving churn to
somewhere else. We had board files churn, then defconfigs churn, DTS
files (and associated drivers) will be next.

DT is self inflicted pain. It has to be for the greater good.

Going b) *might* allow what some people here dream about, a kernel free
of hardware knowledge. A new board could boot a kernel compiled before
it was even designed.

Now since I do embedded stuff everyday, I don't think b) can apply to
the whole ARM world. There is just to much hardware peculiarity.


[1] https://lkml.org/lkml/2011/3/30/525

-- 
Maxime


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
 On Sat, 2013-07-27 at 11:51 -0700, Tomasz Figa wrote:
  Well, it depends on how we use the DT. There are (at least) two possible
  
  usage scenarios:
   a) using DT as direct replacement for board files - this means that you
   
  are free to say that DTSes are strictly coupled with kernel version
  and you are free to modify the bindings - see the analogy to board
  files, where you could modify the platform data structures and could
  not directly copy board file from one kernel version to another,
 
 I'm shocked to see this as a possible option.
 
 Board files are C code anyone has the skill to edit/understand/refactor.
 Moving to DT and keep them in tree tightly coupled with the kernel
 version just adds another layer of indirection for *no purpose*.

Well, I agree that it's not the most fortunate scenario, but it is not that 
bad as it might seem. It still has the benefit of separating hardware data 
(including board-specific data) from kernel code and has all the benefits of 
DT, 
e.g. easy way to specify relations between devices (phandles), no need to 
manually register any resources, platform data or platform devices, in other 
words, when describing hardware you just care about the hardware, not how the 
kernel works.

 The fact that we loose compiler syntax/type checking (as highlighted
 somewhere else in this thread) even looks like a regression.

Syntax checking is already there. We don't have semantic checking yet, but we 
are working on this.

   b) using DT as an ABI - this is the original way, i.e. define stable
   
  bindings and make sure that anu DTB built for older kernel will
  
  work, with equal or greater set of functionality on newer kernels.
 
 Linus started the whole thing some years ago by refusing to pull ARM
 tree [1]. Reread his post, what he wants is clearly b).
 
 Going a) does not solve any problem. You are just moving churn to
 somewhere else. We had board files churn, then defconfigs churn, DTS
 files (and associated drivers) will be next.
 
 DT is self inflicted pain. It has to be for the greater good.

It has several benefits over board files that I mentioned above, possible 
without fully separating them from kernel tree.

 Going b) *might* allow what some people here dream about, a kernel free
 of hardware knowledge. A new board could boot a kernel compiled before
 it was even designed.

This is very unlikely to happen. You can already see problems with defining 
bindings for existing hardware and what to say about hardware that is not even 
designed yet? Unless all the board uses is a set of already supported 
components, that have bindings defined and drivers merged, you would still need 
to provide remaining drivers and bindings for them.

 Now since I do embedded stuff everyday, I don't think b) can apply to
 the whole ARM world. There is just to much hardware peculiarity.

That's why I think we need a hybrid solution. Staging bindings could use a) 
and those stable one would use b). Staging bindings would be fixed over time if 
needed and if they turn out to be fine, they can be stabilized and move to b).

So basically, you can get all the stable functionality with one DTB on any 
kernel released after the functionality got stable, but during development of 
some functionality you might need to change the DTB to test the development.

Best regards,
Tomasz
 
 [1] https://lkml.org/lkml/2011/3/30/525
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 12:59:59PM +0200, Tomasz Figa wrote:
 On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
  
  Board files are C code anyone has the skill to edit/understand/refactor.
  Moving to DT and keep them in tree tightly coupled with the kernel
  version just adds another layer of indirection for *no purpose*.

+1

That is exactly what I tried to say.

  Linus started the whole thing some years ago by refusing to pull ARM
  tree [1]. Reread his post, what he wants is clearly b).
  
  Going a) does not solve any problem. You are just moving churn to
  somewhere else. We had board files churn, then defconfigs churn, DTS
  files (and associated drivers) will be next.

And at this rate, we are headed for another Linus ultimatum, sooner or
later.

  DT is self inflicted pain. It has to be for the greater good.
 
 It has several benefits over board files that I mentioned above, possible 
 without fully separating them from kernel tree.

Every time a criticism is voiced about DT, the DT people stick their
fingers in their ears and say, NAH, NAH, NAH, I CAN'T HEAR YOU!

WRT to DT-as-platform-device, we would rather stick with the C code,
please. Just pushing the configuration tables into an external form
does not simplify the problem. In fact, it creates new problems by
inviting the possibility of a bootloader/DT/kernel mismatch.

Thanks,
Richard

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 17:07:19 Richard Cochran wrote:
 On Wed, Jul 31, 2013 at 12:59:59PM +0200, Tomasz Figa wrote:
  On Wednesday 31 of July 2013 12:37:37 Maxime Bizon wrote:
   Board files are C code anyone has the skill to edit/understand/refactor.
   Moving to DT and keep them in tree tightly coupled with the kernel
   version just adds another layer of indirection for *no purpose*.
 
 +1
 
 That is exactly what I tried to say.

I agree with you to some extent. Don't be so extreme though. As I already 
said, this is not entirely no purpose, as there are more benefits of having 
device tree than just separation from kernel tree.

   Linus started the whole thing some years ago by refusing to pull ARM
   tree [1]. Reread his post, what he wants is clearly b).
   
   Going a) does not solve any problem. You are just moving churn to
   somewhere else. We had board files churn, then defconfigs churn, DTS
   files (and associated drivers) will be next.
 
 And at this rate, we are headed for another Linus ultimatum, sooner or
 later.

(see end of the message)

   DT is self inflicted pain. It has to be for the greater good.
  
  It has several benefits over board files that I mentioned above, possible
  without fully separating them from kernel tree.
 
 Every time a criticism is voiced about DT, the DT people stick their
 fingers in their ears and say, NAH, NAH, NAH, I CAN'T HEAR YOU!

I won't comment this...

 WRT to DT-as-platform-device, we would rather stick with the C code,
 please. Just pushing the configuration tables into an external form
 does not simplify the problem. In fact, it creates new problems by
 inviting the possibility of a bootloader/DT/kernel mismatch.

Care to stop ignoring my points other than those defending ideas (nowhere 
stated as good or bad) from extreme opinions?

I said it many, many times, that a) and b) I proposed are just two extremes. 
It is unlikely that an extreme solution will be the best option to choose. I 
am strongly for something in the middle, just like I wrote in several of my 
previous replies.

This is something that should be commented, not those extreme options.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 05:23:35PM +0200, Tomasz Figa wrote:
 
 I said it many, many times, that a) and b) I proposed are just two extremes. 
 It is unlikely that an extreme solution will be the best option to choose. I 
 am strongly for something in the middle, just like I wrote in several of my 
 previous replies.
 
 This is something that should be commented, not those extreme options.

We are saying that pursuing a) is useless because it adds pain and
complexity without adding benefit. I simply don't buy your argument
that DT makes a better platform data, but that is besides the point.

I had said, think about the users.  You said, what users?  I wrote a
clear and concise use case.  You said, lets think about a) and b) and
all the shades of gray in between.

In order to support the use case, you will have to provide a stable
ABI. You can't have a compromise solution. At the end of the day,
either you have a stable ABI, or you don't.

It was apparent to me that the arm/dt thing has been meandering around
since its inception, but what was surprising is that people were doing
this on purpose, and now they are defending this. Why can't we get a
firm commitment on having a stable ABI?

Thanks,
Richard


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Tomasz Figa
On Wednesday 31 of July 2013 21:12:09 Richard Cochran wrote:
 On Wed, Jul 31, 2013 at 05:23:35PM +0200, Tomasz Figa wrote:
  I said it many, many times, that a) and b) I proposed are just two
  extremes. It is unlikely that an extreme solution will be the best
  option to choose. I am strongly for something in the middle, just
  like I wrote in several of my previous replies.
  
  This is something that should be commented, not those extreme options.
 
 We are saying that pursuing a) is useless because it adds pain and
 complexity without adding benefit. I simply don't buy your argument
 that DT makes a better platform data, but that is besides the point.
 
 I had said, think about the users.  You said, what users?  I wrote a
 clear and concise use case.  You said, lets think about a) and b) and
 all the shades of gray in between.

I showed you two example solutions that could handle this use case without 
stable binding ABI, just to prove that b) is not the only option (even if 
it's the best one, which I continue to agree on, don't get me wrong).

I also added that the use case is not fully valid, because you can't 
magically define bindings for all future hardware, which means you can't 
support the hardware using a DTB made before stable bindings for that 
hardware have ever been introduced.

With all of this, I agreed that a DTB made for kernel 3.x, when used with 
kernel 3.y (y  x) should provide the same or greater feature set than 
used with kernel 3.x, in other words, this should cause no regressions. 
Still, for new features, you will likely need to update the DTB.

 In order to support the use case, you will have to provide a stable
 ABI. You can't have a compromise solution. At the end of the day,
 either you have a stable ABI, or you don't.
 
 It was apparent to me that the arm/dt thing has been meandering around
 since its inception, but what was surprising is that people were doing
 this on purpose, and now they are defending this. Why can't we get a
 firm commitment on having a stable ABI?

This is exactly what are we trying to do right now. But you don't get 
stable things right away. You need some kind of process, for design, 
review, staging, stabilization, etc. Without all of this we will again 
surely end up with something pretending to be good and stable, while being 
completely useless and only a burden to support in new code.

So, again, to summarize, my view on this is as follows:
 - there is a list of best practices for binding design and existing 
   stable bindings that can be used to help for designing new bindings,
 - new bindings go through review process,
 - after positive review, such bindings gets staging status, i.e. they are 
   marked as something that could change,
 - after some period of time (we need to define this precisely) they get 
   frozen and can't be changed in a way that breaks compatibility any
   more. In other words, they become ABI.

What do you think?

Best regards,
Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Richard Cochran
On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
 
 I showed you two example solutions that could handle this use case without 
 stable binding ABI, just to prove that b) is not the only option (even if 
 it's the best one, which I continue to agree on, don't get me wrong).

You only showed *one* solution (b) that satisfies the use case. The
use case was:

   User acquires a machine running ARM Linux version 3.x, with u-boot
   and dtb in a read only flash partition. The board boots and works just
^
   fine. However, for his application, the user requires a new kernel
   feature that appeared in version 3.y where y  x. He compiles the new
   kernel, and it also works.

But you suggested:

 a) using DT as direct replacement for board files - this means that you
are free to say that DTSes are strictly coupled with kernel version
and you are free to modify the bindings - see the analogy to board
files, where you could modify the platform data structures and could
not directly copy board file from one kernel version to another,

In the use case, the kernel is upgraded, but not the DTB. So this
solution makes no sense.

 I also added that the use case is not fully valid,

The use case *is* valid.  I am not inventing this just to be a pain.
There are plenty of people unable or unwilling to upgrade their boot
loader or DTB.  You can say that you won't support it, but it is a use
case from actual real life.

 because you can't 
 magically define bindings for all future hardware, which means you can't 
 support the hardware using a DTB made before stable bindings for that 
 hardware have ever been introduced.

Surely it is possible to develop and release a stable kernel and DT
ABI for a given hardware? Once this is present, it is reasonable for
users to expect forward compatibility from the DT system.
 
 With all of this, I agreed that a DTB made for kernel 3.x, when used with 
 kernel 3.y (y  x) should provide the same or greater feature set than 
 used with kernel 3.x, in other words, this should cause no regressions. 
 Still, for new features, you will likely need to update the DTB.

Yes, that is the idea.

 So, again, to summarize, my view on this is as follows:
  - there is a list of best practices for binding design and existing 
stable bindings that can be used to help for designing new bindings,
  - new bindings go through review process,
  - after positive review, such bindings gets staging status, i.e. they are 
marked as something that could change,
  - after some period of time (we need to define this precisely) they get 
frozen and can't be changed in a way that breaks compatibility any
more. In other words, they become ABI.
 
 What do you think?

Sounds okay to me, but why bother with this marking business? Why not
just have staging or development trees like every other subsystem?

Thanks,
Richard

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Russell King - ARM Linux
On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
 On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
  
  I showed you two example solutions that could handle this use case without 
  stable binding ABI, just to prove that b) is not the only option (even if 
  it's the best one, which I continue to agree on, don't get me wrong).
 
 You only showed *one* solution (b) that satisfies the use case. The
 use case was:
 
User acquires a machine running ARM Linux version 3.x, with u-boot
and dtb in a read only flash partition. The board boots and works just
 ^
fine. However, for his application, the user requires a new kernel
feature that appeared in version 3.y where y  x. He compiles the new
kernel, and it also works.
 
 But you suggested:
 
  a) using DT as direct replacement for board files - this means that you
 are free to say that DTSes are strictly coupled with kernel version
 and you are free to modify the bindings - see the analogy to board
 files, where you could modify the platform data structures and could
 not directly copy board file from one kernel version to another,
 
 In the use case, the kernel is upgraded, but not the DTB. So this
 solution makes no sense.

That's also crap for another reason.  DT on the whole is _supposed_ to
describe what the hardware is, and how it is wired up in a WELL DEFINED
and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
- having this /chosen node in DT which gets used for software
configuration - eg, the command line and so forth.

That was a mistake because it means that the DT isn't purely a
description of the hardware.  Such stuff should have been left in ATAGs,
and DT should have been placed into its own ATAG entry.  There would
not have been any conflict between ATAGs and DT, because ATAGs generally
don't deal with hardware configuration - the only real bit of hardware
configuration conveyed via ATAGs is the location of memory and size of
memory.

However, if we go back to the idea that DT is supposed to describe the
hardware, _and_ that the way to describe that hardware is well defined
and _stable_ (as it should be) then there should be no reason what so
ever that your old DT blob should not continue working in later kernels.
If it doesn't, then the contract that DT promised when we first moved
over to using DT has been _broken_.

Quite frankly, the fact that this discussion has gone on soo far, and
everyone is saying that the existing DT descriptions to date (for what,
two years) are all unstable is really extremely sad.

I've stated in my previous postings what I think very clearly - and it
comes down to the fact that every DT binding which is in existence in
a released kernel _is_ by that very nature a stable binding.  If it
wasn't a stable binding, it should have been clearly marked as such
and been subject to CONFIG_EXPERIMENTAL (when it existed) or
CONFIG_STAGING or similar.

We even went as far as creating documentation for the bindings - directly
along side the documentation for PPC bindings, with no distinction.

Given all that, it's down right insulting to those who have been using
ARM kernels to now start off a discussion about making these things
stable.  Those people who think that these bindings are not stable need
to wake up to reality - we have USERS of this stuff over the last two
years.  It's found its way into products.  If we're going to keep this
stuff unstable then we are actively _hurting_ our users.

I'll say it again: if a binding has been in a final kernel, it is by
definition a *stable* binding, and compatibility with that binding
*must* be maintained.

If we're not going to do that, then we owe all the users of the ARM
kernel a VERY BIG apology.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread jonsm...@gmail.com
On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Wed, Jul 31, 2013 at 10:00:17PM +0200, Richard Cochran wrote:
 On Wed, Jul 31, 2013 at 09:29:35PM +0200, Tomasz Figa wrote:
 
  I showed you two example solutions that could handle this use case without
  stable binding ABI, just to prove that b) is not the only option (even if
  it's the best one, which I continue to agree on, don't get me wrong).

 You only showed *one* solution (b) that satisfies the use case. The
 use case was:

User acquires a machine running ARM Linux version 3.x, with u-boot
and dtb in a read only flash partition. The board boots and works just
 ^
fine. However, for his application, the user requires a new kernel
feature that appeared in version 3.y where y  x. He compiles the new
kernel, and it also works.

 But you suggested:

  a) using DT as direct replacement for board files - this means that you
 are free to say that DTSes are strictly coupled with kernel version
 and you are free to modify the bindings - see the analogy to board
 files, where you could modify the platform data structures and could
 not directly copy board file from one kernel version to another,

 In the use case, the kernel is upgraded, but not the DTB. So this
 solution makes no sense.

 That's also crap for another reason.  DT on the whole is _supposed_ to
 describe what the hardware is, and how it is wired up in a WELL DEFINED
 and STABLE manner.  Unfortunately, there's a *BIG* mistake that was made
 - having this /chosen node in DT which gets used for software
 configuration - eg, the command line and so forth.

 That was a mistake because it means that the DT isn't purely a
 description of the hardware.  Such stuff should have been left in ATAGs,
 and DT should have been placed into its own ATAG entry.  There would
 not have been any conflict between ATAGs and DT, because ATAGs generally
 don't deal with hardware configuration - the only real bit of hardware
 configuration conveyed via ATAGs is the location of memory and size of
 memory.

 However, if we go back to the idea that DT is supposed to describe the
 hardware, _and_ that the way to describe that hardware is well defined
 and _stable_ (as it should be) then there should be no reason what so
 ever that your old DT blob should not continue working in later kernels.
 If it doesn't, then the contract that DT promised when we first moved
 over to using DT has been _broken_.

Suppose your DT predates PINCTRL and the CPU needs the pins set to
function.  But setting the pins up is a board specific function. How
is this going to get implemented in a generic kernel that doesn't have
any board specific code in it?

I would propose that we only need to worry about DTs that got put into
boot loaders and not worry about ones that were only used when
appended to a kernel.

For those deployed bootloader based DTs we'd use a quirk system to
catch them at early boot time and add in the missing PINCTRL
information.  The function of this quirk system is to update deployed
DTs with the needed information to allow a completely generic kernel
to run.

Now we can have a very clean generic kernel with all of the board
specific fixups localized to a single spot - the quirk for those
deployed DTs. And hopefully new boards won't need any quirks.


 Quite frankly, the fact that this discussion has gone on soo far, and
 everyone is saying that the existing DT descriptions to date (for what,
 two years) are all unstable is really extremely sad.

 I've stated in my previous postings what I think very clearly - and it
 comes down to the fact that every DT binding which is in existence in
 a released kernel _is_ by that very nature a stable binding.  If it
 wasn't a stable binding, it should have been clearly marked as such
 and been subject to CONFIG_EXPERIMENTAL (when it existed) or
 CONFIG_STAGING or similar.

 We even went as far as creating documentation for the bindings - directly
 along side the documentation for PPC bindings, with no distinction.

 Given all that, it's down right insulting to those who have been using
 ARM kernels to now start off a discussion about making these things
 stable.  Those people who think that these bindings are not stable need
 to wake up to reality - we have USERS of this stuff over the last two
 years.  It's found its way into products.  If we're going to keep this
 stuff unstable then we are actively _hurting_ our users.

 I'll say it again: if a binding has been in a final kernel, it is by
 definition a *stable* binding, and compatibility with that binding
 *must* be maintained.

 If we're not going to do that, then we owe all the users of the ARM
 kernel a VERY BIG apology.

 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Jon Smirl

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread Russell King - ARM Linux
On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com wrote:
 On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  However, if we go back to the idea that DT is supposed to describe the
  hardware, _and_ that the way to describe that hardware is well defined
  and _stable_ (as it should be) then there should be no reason what so
  ever that your old DT blob should not continue working in later kernels.
  If it doesn't, then the contract that DT promised when we first moved
  over to using DT has been _broken_.
 
 Suppose your DT predates PINCTRL and the CPU needs the pins set to
 function.  But setting the pins up is a board specific function. How
 is this going to get implemented in a generic kernel that doesn't have
 any board specific code in it?
 
 I would propose that we only need to worry about DTs that got put into
 boot loaders and not worry about ones that were only used when
 appended to a kernel.

That is - again - our mistake.  We should have made it clear from the
start that the use of an _appended_ DT, or a DT provided with the kernel
being booted was more or less mandatory for the time being.  We actually
did exactly the opposite - we advertised the appended DT as a stop-gap
measure just to allow a DT kernel to be booted with a boot loader which
didn't support DT.

That in itself _encouraged_ boot loader support for DT on ARM (which in
itself is not a bad thing) but also leads people down the path of
potentially separating the DT from the kernel.

Had we encouraged the use of an appended DT instead, but still encouraged
boot loaders to update, and also made a clear statement that DT is
unstable (which everyone can see - for example by making our DT stuff
depend on CONFIG_EXPERIMENTAL when it existed) then everyone would have
been clear about its status.

The fact that we did not - the fact that we ignored this process means
that it is _our_ problem that people like Richard are blowing up such a
storm over this.  We need to admit that we got it wrong, and commit to
doing it the right way in future.  What that means is starting off today
with a commitment to keep as much of the stuff which works today working
_tomorrow_, and the day after, and so forth.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-31 Thread jonsm...@gmail.com
On Wed, Jul 31, 2013 at 4:48 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Wed, Jul 31, 2013 at 04:37:36PM -0400, jonsm...@gmail.com wrote:
 On Wed, Jul 31, 2013 at 4:14 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  However, if we go back to the idea that DT is supposed to describe the
  hardware, _and_ that the way to describe that hardware is well defined
  and _stable_ (as it should be) then there should be no reason what so
  ever that your old DT blob should not continue working in later kernels.
  If it doesn't, then the contract that DT promised when we first moved
  over to using DT has been _broken_.

 Suppose your DT predates PINCTRL and the CPU needs the pins set to
 function.  But setting the pins up is a board specific function. How
 is this going to get implemented in a generic kernel that doesn't have
 any board specific code in it?

 I would propose that we only need to worry about DTs that got put into
 boot loaders and not worry about ones that were only used when
 appended to a kernel.

 That is - again - our mistake.  We should have made it clear from the
 start that the use of an _appended_ DT, or a DT provided with the kernel
 being booted was more or less mandatory for the time being.  We actually
 did exactly the opposite - we advertised the appended DT as a stop-gap
 measure just to allow a DT kernel to be booted with a boot loader which
 didn't support DT.

 That in itself _encouraged_ boot loader support for DT on ARM (which in
 itself is not a bad thing) but also leads people down the path of
 potentially separating the DT from the kernel.

 Had we encouraged the use of an appended DT instead, but still encouraged
 boot loaders to update, and also made a clear statement that DT is
 unstable (which everyone can see - for example by making our DT stuff
 depend on CONFIG_EXPERIMENTAL when it existed) then everyone would have
 been clear about its status.

 The fact that we did not - the fact that we ignored this process means
 that it is _our_ problem that people like Richard are blowing up such a
 storm over this.  We need to admit that we got it wrong, and commit to
 doing it the right way in future.  What that means is starting off today
 with a commitment to keep as much of the stuff which works today working
 _tomorrow_, and the day after, and so forth.

What do you think about using a quirk layer to decouple deployed DTs
from whatever is implemented in the kernel? I still think there is
going to be volatility in the the kernel DT usage simply because we
haven't figured out all of the issues with it yet.  For example
defining a global schema system is going to expose a lot of irregular
DT syntax when you line up all of the platform DTs in a system where
it is easy to compare them. One the plus side the kernel is certainly
evolving to a point where this volatility will stop in the future, we
just aren't there yet.  If we don't use a quirk fixup system, then
board specific code is going to continue to exist scattered around in
the arch directories.

My preference would be to contain the board specific DT fixup code
inside a quirk system and have the goal of making the arch directories
free of board specific code. Any new board would have a good enough DT
that they don't need any board specific DT fixup code. Of course
there's quite a ways to go before reaching that goal.

Alternatively you may be of the belief that it is impossible to get
rid of the board specific code. But x86 doesn't have any of it, why
should ARM?

-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread John W. Linville
On Tue, Jul 30, 2013 at 10:30:45AM -0600, Stephen Warren wrote:
> On 07/29/2013 08:15 PM, jonsm...@gmail.com wrote:
> > On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
> >  wrote:
> ...
> >> I also think we should consider the option of having a simple and
> >> straightforward schema language which handles, say, 80% of cases with
> >> a fall back to C for the 20% of curly cases.  That might actually be
> >> simpler to work with in practice than a schema language which can
> >> express absolutely anything, at the cost of being awkward for simple
> >> cases or difficult to get your head around.
> > 
> > Would C++ work? You can use operating overloading and templates to
> > change the syntax into something that doesn't even resemble C any
> > more.
> 
> From my perspective, that's precisely why C++ should /not/ be used.

Amen.

-- 
John W. LinvilleSomeday the world will need a hero, and you
linvi...@tuxdriver.com  might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Stephen Warren
On 07/29/2013 07:44 PM, David Gibson wrote:
...
> So, by way of investigation, let me propose an alternative
> expression of schemas, that I'm also not convinced we should do,
> but is possible and expressive.  It's illustrative, because it's
> kind of the polar opposite approach to XSD: just use C.

That actually sounds reasonable.

But, I think there's a difference between a schema, which defines
what's legal in an abstract fashion, and a validator, which defines
that the data conforms to the schema.

I can see that codding a validator in C would be pretty easy, and even
potentially quite simple/clean given a suitable set of library
functions as you say.

However, I'm not so convinced that expressing the schema itself as C
would work out so well. I think the code/data-structures would end up
being pretty stylized so they could actually be read as a schema. At
that point, a specific schema language would probably be simpler? Of
course, this is all somewhat conjecture; perhaps the only way to tell
would be to prototype various ideas and see how well they work.

Equally, I'm not sure I want to bind the schema definition to a
particular language. I'd like to be able to programatically generate
or manipulate *.dts files in arbitrary languages. Integrating a C
interpreter into those languages in order to handle the schema would
be annoying, whereas directly handling a special-purpose schema
language seems like it'd be more tangible.

As an aside, in the past I toyed with the idea of using Python data
structures as a *.dts syntax, and hence allowing
macros/auto-generation using custom Python code, and I'm sure Forth
will come up sometime in this thread:-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Stephen Warren
On 07/29/2013 08:15 PM, jonsm...@gmail.com wrote:
> On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
>  wrote:
...
>> I also think we should consider the option of having a simple and
>> straightforward schema language which handles, say, 80% of cases with
>> a fall back to C for the 20% of curly cases.  That might actually be
>> simpler to work with in practice than a schema language which can
>> express absolutely anything, at the cost of being awkward for simple
>> cases or difficult to get your head around.
> 
> Would C++ work? You can use operating overloading and templates to
> change the syntax into something that doesn't even resemble C any
> more.

>From my perspective, that's precisely why C++ should /not/ be used.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Maxime Ripard
On Mon, Jul 29, 2013 at 10:35:03PM -0600, Grant Likely wrote:
> >> User acquires a machine running ARM Linux version 3.x, with u-boot
> >> and dtb in a read only flash partition. The board boots and works just
> >> fine. However, for his application, the user requires a new kernel
> >> feature that appeared in version 3.y where y > x. He compiles the new
> >> kernel, and it also works.
> >
> > I'm afraid this kind of use case will never be properly supported, DT
> > stable ABI or not.
> 
> Why? New kernel features should be no problem at all.
> 
> New driver features /might/ not be available, but only if the new
> feature requires additional data that isn't present in the tree and
> cannot be obtained elsewhere.
> 
> >
> > Think about this: what kernel will actually be shipped in that board?
> > Most likely, it will be a BSP kernel from the vendor. Does the vendor
> > will have made that commitment to have a stable ABI for the DT? Will it
> > use the same bindings than mainline? Do we want to support all the crazy
> > bindings every vendor will come up with?
> 
> That's not a DT issue. That an out-of-tree board/SoC support issue. DT
> doesn't make that any better or worse.

Yet, with the DT switch, the two are bound together.

Before the DT, the only convention we had basically was that we had to
be loaded in memory and executed.

Now, the bootloader has to pass a complex data structure to the kernel.
If this data structure doesn't follow the same convention than we do, we
are screwed, and if we can't update either the bootloader or the DT that
is loaded by it, we end up screwed.

One example that comes to my mind right now is this one: we've been
arguing over spidev probing for quite some time. The easy solution would
be to add a "linux,spidev" compatible. Obviously, this has been ruled
out numerous time. Yet, in the beaglebone black out-of-tree kernel,
there is actually a patch that adds this compatible, that is later used
in the DTs.

These spidev part of the DTs will never work with vanilla. And if you
can't update the DT and want to use mainline, you'll never ever have the
same feature set.

That's of course just a small example, with not much impact on a system,
but that could be way worse.

But saying that vendors will follow the same convention we do is just
unrealistic. I mean, even us haven't be able to work out a stable ABI
for more than 2 years now, yet we should expect anyone else to do it?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Maxime Ripard
On Mon, Jul 29, 2013 at 10:35:03PM -0600, Grant Likely wrote:
  User acquires a machine running ARM Linux version 3.x, with u-boot
  and dtb in a read only flash partition. The board boots and works just
  fine. However, for his application, the user requires a new kernel
  feature that appeared in version 3.y where y  x. He compiles the new
  kernel, and it also works.
 
  I'm afraid this kind of use case will never be properly supported, DT
  stable ABI or not.
 
 Why? New kernel features should be no problem at all.
 
 New driver features /might/ not be available, but only if the new
 feature requires additional data that isn't present in the tree and
 cannot be obtained elsewhere.
 
 
  Think about this: what kernel will actually be shipped in that board?
  Most likely, it will be a BSP kernel from the vendor. Does the vendor
  will have made that commitment to have a stable ABI for the DT? Will it
  use the same bindings than mainline? Do we want to support all the crazy
  bindings every vendor will come up with?
 
 That's not a DT issue. That an out-of-tree board/SoC support issue. DT
 doesn't make that any better or worse.

Yet, with the DT switch, the two are bound together.

Before the DT, the only convention we had basically was that we had to
be loaded in memory and executed.

Now, the bootloader has to pass a complex data structure to the kernel.
If this data structure doesn't follow the same convention than we do, we
are screwed, and if we can't update either the bootloader or the DT that
is loaded by it, we end up screwed.

One example that comes to my mind right now is this one: we've been
arguing over spidev probing for quite some time. The easy solution would
be to add a linux,spidev compatible. Obviously, this has been ruled
out numerous time. Yet, in the beaglebone black out-of-tree kernel,
there is actually a patch that adds this compatible, that is later used
in the DTs.

These spidev part of the DTs will never work with vanilla. And if you
can't update the DT and want to use mainline, you'll never ever have the
same feature set.

That's of course just a small example, with not much impact on a system,
but that could be way worse.

But saying that vendors will follow the same convention we do is just
unrealistic. I mean, even us haven't be able to work out a stable ABI
for more than 2 years now, yet we should expect anyone else to do it?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Stephen Warren
On 07/29/2013 08:15 PM, jonsm...@gmail.com wrote:
 On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
 da...@gibson.dropbear.id.au wrote:
...
 I also think we should consider the option of having a simple and
 straightforward schema language which handles, say, 80% of cases with
 a fall back to C for the 20% of curly cases.  That might actually be
 simpler to work with in practice than a schema language which can
 express absolutely anything, at the cost of being awkward for simple
 cases or difficult to get your head around.
 
 Would C++ work? You can use operating overloading and templates to
 change the syntax into something that doesn't even resemble C any
 more.

From my perspective, that's precisely why C++ should /not/ be used.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread Stephen Warren
On 07/29/2013 07:44 PM, David Gibson wrote:
...
 So, by way of investigation, let me propose an alternative
 expression of schemas, that I'm also not convinced we should do,
 but is possible and expressive.  It's illustrative, because it's
 kind of the polar opposite approach to XSD: just use C.

That actually sounds reasonable.

But, I think there's a difference between a schema, which defines
what's legal in an abstract fashion, and a validator, which defines
that the data conforms to the schema.

I can see that codding a validator in C would be pretty easy, and even
potentially quite simple/clean given a suitable set of library
functions as you say.

However, I'm not so convinced that expressing the schema itself as C
would work out so well. I think the code/data-structures would end up
being pretty stylized so they could actually be read as a schema. At
that point, a specific schema language would probably be simpler? Of
course, this is all somewhat conjecture; perhaps the only way to tell
would be to prototype various ideas and see how well they work.

Equally, I'm not sure I want to bind the schema definition to a
particular language. I'd like to be able to programatically generate
or manipulate *.dts files in arbitrary languages. Integrating a C
interpreter into those languages in order to handle the schema would
be annoying, whereas directly handling a special-purpose schema
language seems like it'd be more tangible.

As an aside, in the past I toyed with the idea of using Python data
structures as a *.dts syntax, and hence allowing
macros/auto-generation using custom Python code, and I'm sure Forth
will come up sometime in this thread:-)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-30 Thread John W. Linville
On Tue, Jul 30, 2013 at 10:30:45AM -0600, Stephen Warren wrote:
 On 07/29/2013 08:15 PM, jonsm...@gmail.com wrote:
  On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
  da...@gibson.dropbear.id.au wrote:
 ...
  I also think we should consider the option of having a simple and
  straightforward schema language which handles, say, 80% of cases with
  a fall back to C for the 20% of curly cases.  That might actually be
  simpler to work with in practice than a schema language which can
  express absolutely anything, at the cost of being awkward for simple
  cases or difficult to get your head around.
  
  Would C++ work? You can use operating overloading and templates to
  change the syntax into something that doesn't even resemble C any
  more.
 
 From my perspective, that's precisely why C++ should /not/ be used.

Amen.

-- 
John W. LinvilleSomeday the world will need a hero, and you
linvi...@tuxdriver.com  might be all we have.  Be ready.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Grant Likely
On Mon, Jul 29, 2013 at 1:31 AM, Maxime Ripard
 wrote:
> Hi,
>
> On Sun, Jul 28, 2013 at 03:19:03PM +0200, Richard Cochran wrote:
>> On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:
>>
>> > I'm not really sure what effect on users this has. Maybe you should define
>> > "users".
>>
>> ...
>>
>> > Care to explain this reasoning?
>>
>> Use Case
>> 
>>
>> User acquires a machine running ARM Linux version 3.x, with u-boot
>> and dtb in a read only flash partition. The board boots and works just
>> fine. However, for his application, the user requires a new kernel
>> feature that appeared in version 3.y where y > x. He compiles the new
>> kernel, and it also works.
>
> I'm afraid this kind of use case will never be properly supported, DT
> stable ABI or not.

Why? New kernel features should be no problem at all.

New driver features /might/ not be available, but only if the new
feature requires additional data that isn't present in the tree and
cannot be obtained elsewhere.

>
> Think about this: what kernel will actually be shipped in that board?
> Most likely, it will be a BSP kernel from the vendor. Does the vendor
> will have made that commitment to have a stable ABI for the DT? Will it
> use the same bindings than mainline? Do we want to support all the crazy
> bindings every vendor will come up with?

That's not a DT issue. That an out-of-tree board/SoC support issue. DT
doesn't make that any better or worse.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 10:15:12PM -0400, jonsm...@gmail.com wrote:
> On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
>  wrote:
> > On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
> >> On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
> >> > On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely 
> >> >  wrote:
> >> > > On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com 
> >> > >  wrote:
> >> > >> On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
> >> > >>  wrote:
> >> > >>> On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel 
> >> > >>>  wrote:
> >> >  Let's see how many people go and scream if I say this: Too bad .dts 
> >> >  files
> >> >  are not done using XML format as DT bindings could be described 
> >> >  using XML
> >> >  Schema.
> >> > >>>
> >> > >>> Draft an example and show us how it would look!  :-)  There is
> >> > >>> absolutely nothing preventing us from expressing a DT in XML format,
> >> > >>> or even using XSLT to define DT schema while still using our current
> >> > >>> .dts syntax. It would be trivial to do lossless translation between
> >> > >>> .dts syntax and xml.
> >> > >>>
> >> > >>> The problem that I have with XML and XSLT is that it is very verbose
> >> > >>> and not entirely friendly to mere-mortals. However, I'm more than
> >> > >>> willing to be proved wrong on this point.
> >> > >>
> >> > >> I considered this approach a while ago and discarded it. It would work
> >> > >> but it is just too much of a Frankenstein monster.
> >> > >>
> >> > >> Much cleaner to modify dtc to take a schema as part of the compilation
> >> > >> process. The schema language itself has no requirement to look like
> >> > >> DTS syntax. Whoever wrote dtc probably has a favorite language that
> >> > >> would be good for writing schemas in.
> >> > >
> >> > > Making it part of dtc is a required feature as far as I'm concerned.
> >> > > Using XML/XSLT and dtc-integration are not mutually exclusive, but I
> >> > > digress.
> >> >
> >> > Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
> >> > discussion of schema. Sorry for the noise.
> >>
> >> XSLT is a transform language ... you'd use it say to transform xml to
> >> dtc, so it would be an integral component of an xml/xslt based schema.
> >>
> >> If you want actually to describe and have validated the xml schema
> >> itself, then you'd use xsd (XML schema description language) and its
> >> associated tools.
> >>
> >> I'm not saying you *should* do this, just that it's possible (plus I've
> >> just blown my kernel cred by knowing about xml, sigh).
> >
> > Heh.  So, it was said in jest, but that actually raises an important
> > point.
> >
> > There are basically two criteria to keep in mind for our
> > representation of schemas:
> >1) Adequate expressiveness to validate a sufficiently large part,
> > of a sufficiently large number of bindings to be useful.
> >2) Ease of use and ease of learning **for the target audience**.
> >
> > To the best of my knowledge xsd would do well on (1), but I'm not
> > convinced it does very well on (2).  In an environment where XML was
> > already widely used, XSD would make perfect sense.  Here, I think it
> > would be pretty ugly to wire onto the existing DT tools and
> > infrastructure, and unpleasantly unfamiliar for many kernel and board
> > developers trying to work with DT schemas.
> >
> >
> > So, by way of investigation, let me propose an alternative expression
> > of schemas, that I'm also not convinced we should do, but is possible
> > and expressive.  It's illustrative, because it's kind of the polar
> > opposite approach to XSD: just use C.
> >
> > dtc already has a (so far limited) "checks" mechanism which verifies
> > various aspects of DT content.  These are implemented by C functions
> > in checks.c.  There's obviously ample expressiveness - you can express
> > any constraint you want that way.  It can be pretty verbose, and
> > fiddly.  A good library of helper functions can mitigate that, but
> > it's not clear how much.  On the other hand, a very good fraction of
> > people working with this will already be familiar with C, which is a
> > big plus.  This is, after all, the reason that the dts syntax is
> > chiefly C inspired.
> >
> > Now, in practice, I think we will want a more convenient schema
> > language (just as we wanted dts, rather than manually constructing
> > FDTs as C structures).  But I absolutely do think, that the schema
> > handling should be handled as plugins to the checks mechanism -
> > basically we'd have a validate_schemas() check function.
> >
> > I also think we should consider the option of having a simple and
> > straightforward schema language which handles, say, 80% of cases with
> > a fall back to C for the 20% of curly cases.  That might actually be
> > simpler to work with in practice than a schema language which can
> > express absolutely anything, at the cost of being awkward for simple
> > cases or difficult to get 

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread jonsm...@gmail.com
On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
 wrote:
> On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
>> On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
>> > On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely  
>> > wrote:
>> > > On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com  
>> > > wrote:
>> > >> On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
>> > >>  wrote:
>> > >>> On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel  
>> > >>> wrote:
>> >  Let's see how many people go and scream if I say this: Too bad .dts 
>> >  files
>> >  are not done using XML format as DT bindings could be described using 
>> >  XML
>> >  Schema.
>> > >>>
>> > >>> Draft an example and show us how it would look!  :-)  There is
>> > >>> absolutely nothing preventing us from expressing a DT in XML format,
>> > >>> or even using XSLT to define DT schema while still using our current
>> > >>> .dts syntax. It would be trivial to do lossless translation between
>> > >>> .dts syntax and xml.
>> > >>>
>> > >>> The problem that I have with XML and XSLT is that it is very verbose
>> > >>> and not entirely friendly to mere-mortals. However, I'm more than
>> > >>> willing to be proved wrong on this point.
>> > >>
>> > >> I considered this approach a while ago and discarded it. It would work
>> > >> but it is just too much of a Frankenstein monster.
>> > >>
>> > >> Much cleaner to modify dtc to take a schema as part of the compilation
>> > >> process. The schema language itself has no requirement to look like
>> > >> DTS syntax. Whoever wrote dtc probably has a favorite language that
>> > >> would be good for writing schemas in.
>> > >
>> > > Making it part of dtc is a required feature as far as I'm concerned.
>> > > Using XML/XSLT and dtc-integration are not mutually exclusive, but I
>> > > digress.
>> >
>> > Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
>> > discussion of schema. Sorry for the noise.
>>
>> XSLT is a transform language ... you'd use it say to transform xml to
>> dtc, so it would be an integral component of an xml/xslt based schema.
>>
>> If you want actually to describe and have validated the xml schema
>> itself, then you'd use xsd (XML schema description language) and its
>> associated tools.
>>
>> I'm not saying you *should* do this, just that it's possible (plus I've
>> just blown my kernel cred by knowing about xml, sigh).
>
> Heh.  So, it was said in jest, but that actually raises an important
> point.
>
> There are basically two criteria to keep in mind for our
> representation of schemas:
>1) Adequate expressiveness to validate a sufficiently large part,
> of a sufficiently large number of bindings to be useful.
>2) Ease of use and ease of learning **for the target audience**.
>
> To the best of my knowledge xsd would do well on (1), but I'm not
> convinced it does very well on (2).  In an environment where XML was
> already widely used, XSD would make perfect sense.  Here, I think it
> would be pretty ugly to wire onto the existing DT tools and
> infrastructure, and unpleasantly unfamiliar for many kernel and board
> developers trying to work with DT schemas.
>
>
> So, by way of investigation, let me propose an alternative expression
> of schemas, that I'm also not convinced we should do, but is possible
> and expressive.  It's illustrative, because it's kind of the polar
> opposite approach to XSD: just use C.
>
> dtc already has a (so far limited) "checks" mechanism which verifies
> various aspects of DT content.  These are implemented by C functions
> in checks.c.  There's obviously ample expressiveness - you can express
> any constraint you want that way.  It can be pretty verbose, and
> fiddly.  A good library of helper functions can mitigate that, but
> it's not clear how much.  On the other hand, a very good fraction of
> people working with this will already be familiar with C, which is a
> big plus.  This is, after all, the reason that the dts syntax is
> chiefly C inspired.
>
> Now, in practice, I think we will want a more convenient schema
> language (just as we wanted dts, rather than manually constructing
> FDTs as C structures).  But I absolutely do think, that the schema
> handling should be handled as plugins to the checks mechanism -
> basically we'd have a validate_schemas() check function.
>
> I also think we should consider the option of having a simple and
> straightforward schema language which handles, say, 80% of cases with
> a fall back to C for the 20% of curly cases.  That might actually be
> simpler to work with in practice than a schema language which can
> express absolutely anything, at the cost of being awkward for simple
> cases or difficult to get your head around.

Would C++ work? You can use operating overloading and templates to
change the syntax into something that doesn't even resemble C any
more.

>
> Remember, a schema language is only a win if it is - for the target
> audience - more convenient to 

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
> On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
> > On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely  
> > wrote:
> > > On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com  
> > > wrote:
> > >> On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
> > >>  wrote:
> > >>> On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel  
> > >>> wrote:
> >  Let's see how many people go and scream if I say this: Too bad .dts 
> >  files
> >  are not done using XML format as DT bindings could be described using 
> >  XML
> >  Schema.
> > >>>
> > >>> Draft an example and show us how it would look!  :-)  There is
> > >>> absolutely nothing preventing us from expressing a DT in XML format,
> > >>> or even using XSLT to define DT schema while still using our current
> > >>> .dts syntax. It would be trivial to do lossless translation between
> > >>> .dts syntax and xml.
> > >>>
> > >>> The problem that I have with XML and XSLT is that it is very verbose
> > >>> and not entirely friendly to mere-mortals. However, I'm more than
> > >>> willing to be proved wrong on this point.
> > >>
> > >> I considered this approach a while ago and discarded it. It would work
> > >> but it is just too much of a Frankenstein monster.
> > >>
> > >> Much cleaner to modify dtc to take a schema as part of the compilation
> > >> process. The schema language itself has no requirement to look like
> > >> DTS syntax. Whoever wrote dtc probably has a favorite language that
> > >> would be good for writing schemas in.
> > >
> > > Making it part of dtc is a required feature as far as I'm concerned.
> > > Using XML/XSLT and dtc-integration are not mutually exclusive, but I
> > > digress.
> > 
> > Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
> > discussion of schema. Sorry for the noise.
> 
> XSLT is a transform language ... you'd use it say to transform xml to
> dtc, so it would be an integral component of an xml/xslt based schema.
> 
> If you want actually to describe and have validated the xml schema
> itself, then you'd use xsd (XML schema description language) and its
> associated tools.
> 
> I'm not saying you *should* do this, just that it's possible (plus I've
> just blown my kernel cred by knowing about xml, sigh).

Heh.  So, it was said in jest, but that actually raises an important
point.

There are basically two criteria to keep in mind for our
representation of schemas:
   1) Adequate expressiveness to validate a sufficiently large part,
of a sufficiently large number of bindings to be useful.
   2) Ease of use and ease of learning **for the target audience**.

To the best of my knowledge xsd would do well on (1), but I'm not
convinced it does very well on (2).  In an environment where XML was
already widely used, XSD would make perfect sense.  Here, I think it
would be pretty ugly to wire onto the existing DT tools and
infrastructure, and unpleasantly unfamiliar for many kernel and board
developers trying to work with DT schemas.


So, by way of investigation, let me propose an alternative expression
of schemas, that I'm also not convinced we should do, but is possible
and expressive.  It's illustrative, because it's kind of the polar
opposite approach to XSD: just use C.

dtc already has a (so far limited) "checks" mechanism which verifies
various aspects of DT content.  These are implemented by C functions
in checks.c.  There's obviously ample expressiveness - you can express
any constraint you want that way.  It can be pretty verbose, and
fiddly.  A good library of helper functions can mitigate that, but
it's not clear how much.  On the other hand, a very good fraction of
people working with this will already be familiar with C, which is a
big plus.  This is, after all, the reason that the dts syntax is
chiefly C inspired.

Now, in practice, I think we will want a more convenient schema
language (just as we wanted dts, rather than manually constructing
FDTs as C structures).  But I absolutely do think, that the schema
handling should be handled as plugins to the checks mechanism -
basically we'd have a validate_schemas() check function.

I also think we should consider the option of having a simple and
straightforward schema language which handles, say, 80% of cases with
a fall back to C for the 20% of curly cases.  That might actually be
simpler to work with in practice than a schema language which can
express absolutely anything, at the cost of being awkward for simple
cases or difficult to get your head around.

Remember, a schema language is only a win if it is - for the target
audience - more convenient to express schemas in than C.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpB1pAGHvvqM.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 05:14:25PM -0600, Jason Gunthorpe wrote:
> On Tue, Jul 30, 2013 at 08:20:39AM +1000, David Gibson wrote:
> 
> > > Clearly general purpose systems (eg servers, workstations, etc) with
> > > *full featured firmware* fall into category b. Linux already basically
> > > has stable DT for those systems - but the firmware is expected to do
> > > lots of work and hide all the low level details from the
> > > kernel.  Basically, the DT should stick to approximately ePAR and
> > > everything else is hidden by the firmware.
> > 
> > No.  With the exception of the hypervisor/virtualization extensions,
> > ePAPR describes (for now) an entirely passive firmware interface.
> > That is, once the handover to the OS has happened, there is *no*
> > further firmware interaction.  It is not capable of hiding any details
> > from the OS, except those which can be done by one-time
> > initialization.
> 
> Well, one-time initialization details are actually exactly one of the
> areas I am thinking about. Some of the embedded SOCs have extensive
> one time initization code in the kernel that is highly SOC specific
> and on x86 it would live in the firmware.
> 
> But I see what you mean, ePAPR was the wrong reference, I didn't
> carefully check it. I ment the kind of DT use we've seen in SPARC,
> POWER servers, Apple stuff, etc - systems explicitly designed so that
> new hardware will boot old OSs.

Yeah, and at least for POWER servers and Apples, like every other
attempt at this, ever, it at best sorta-kinda worked.  It's not *as*
bad as the mess of broken BIOSes on x86 (mostly due to smaller
variety), but there's still plenty of broken crap in Apple workstation
and IBM server firmwares and device trees.

You see a clear line between "full featured" and "minimal" firmwares
where none exists.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpR_NbTqfEwq.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Jason Gunthorpe
On Tue, Jul 30, 2013 at 08:20:39AM +1000, David Gibson wrote:

> > Clearly general purpose systems (eg servers, workstations, etc) with
> > *full featured firmware* fall into category b. Linux already basically
> > has stable DT for those systems - but the firmware is expected to do
> > lots of work and hide all the low level details from the
> > kernel.  Basically, the DT should stick to approximately ePAR and
> > everything else is hidden by the firmware.
> 
> No.  With the exception of the hypervisor/virtualization extensions,
> ePAPR describes (for now) an entirely passive firmware interface.
> That is, once the handover to the OS has happened, there is *no*
> further firmware interaction.  It is not capable of hiding any details
> from the OS, except those which can be done by one-time
> initialization.

Well, one-time initialization details are actually exactly one of the
areas I am thinking about. Some of the embedded SOCs have extensive
one time initization code in the kernel that is highly SOC specific
and on x86 it would live in the firmware.

But I see what you mean, ePAPR was the wrong reference, I didn't
carefully check it. I ment the kind of DT use we've seen in SPARC,
POWER servers, Apple stuff, etc - systems explicitly designed so that
new hardware will boot old OSs.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 12:05:13PM -0600, Jason Gunthorpe wrote:
> On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
> 
> > Well, it depends on how we use the DT. There are (at least) two possible 
> > usage scenarios:
> > 
> >  a) using DT as direct replacement for board files - this means that you 
> > are free to say that DTSes are strictly coupled with kernel version 
> > and you are free to modify the bindings - see the analogy to board 
> > files, where you could modify the platform data structures and could 
> > not directly copy board file from one kernel version to another,
> > 
> >  b) using DT as an ABI - this is the original way, i.e. define stable 
> > bindings and make sure that anu DTB built for older kernel will work,
> > with equal or greater set of functionality on newer kernels.
> > 
> > Now I believe in this thread the point whether we should use a) or b) or a 
> > combination of both has been raised.
> 
> Right, and I think it is very important to consider that different
> systems can legitimately fall into those categories.
> 
> Clearly general purpose systems (eg servers, workstations, etc) with
> *full featured firmware* fall into category b. Linux already basically
> has stable DT for those systems - but the firmware is expected to do
> lots of work and hide all the low level details from the
> kernel.  Basically, the DT should stick to approximately ePAR and
> everything else is hidden by the firmware.

No.  With the exception of the hypervisor/virtualization extensions,
ePAPR describes (for now) an entirely passive firmware interface.
That is, once the handover to the OS has happened, there is *no*
further firmware interaction.  It is not capable of hiding any details
from the OS, except those which can be done by one-time
initialization.

In fact, a guiding principle of ePAPR's design was that except in
cases where it's *much* easier for the firmware to do things, the OS
should be expected to do it, because the OS is usually easier to fix
than the firmware.

> This is essentially how x86
> works and achieves its compatibility.
> 
> Systems that have minimalist firmware, where firmware functions are
> pushed into the kernel and the DT is now required to describe
> intricate and unique SOC specific functions are clearly very
> different, and I think it makes sense to encourage those environments
> to be case 'a'.
> 
> Basically, minimalist firmware should have a boot process design that
> *can* couple the DT and kernel, while full featured firmware should
> keep them seperate. IMHO that should be the clear message to people
> implementing this stuff.
> 
> After enough time the DT for 'a' should become stable and churn free,
> but expecting/demanding that from day 0 is not helping anyone, IMHO.
> 
> Jason

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpmLdvucEcrS.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Richard Cochran
On Mon, Jul 29, 2013 at 08:38:52PM +0200, Richard Cochran wrote:
> 
> Right, we can and should do better. I got the beaglebone Ethernet
> working in mainline (not by writing the driver, but by complaining
> over and over again). I except that it will continue to work and not
  ^^
expect

> fall victim to some random DT change.

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Richard Cochran
On Mon, Jul 29, 2013 at 09:31:23AM +0200, Maxime Ripard wrote:
> 
> I'm afraid this kind of use case will never be properly supported, DT
> stable ABI or not.
> 
> Think about this: what kernel will actually be shipped in that board?
> Most likely, it will be a BSP kernel from the vendor. Does the vendor
> will have made that commitment to have a stable ABI for the DT? Will it
> use the same bindings than mainline? Do we want to support all the crazy
> bindings every vendor will come up with?
> 
> I'm afraid the answer to these three questions will most of the time be
> "no.".

Yes, I know, and it is sad but true.
 
We can't stop the vendors from shipping half-baked BSPs. I really
don't mind that they do that. After all, they want to get *something*
working when they launch their chips.

> That doesn't mean we shouldn't aim for *mainline* having a stable DT
> ABI, but that kind of use case doesn't seem very realistic to me.

Right, we can and should do better. I got the beaglebone Ethernet
working in mainline (not by writing the driver, but by complaining
over and over again). I except that it will continue to work and not
fall victim to some random DT change.

Thanks,
Richard




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Russell King - ARM Linux
On Mon, Jul 29, 2013 at 12:05:13PM -0600, Jason Gunthorpe wrote:
> Clearly general purpose systems (eg servers, workstations, etc) with
> *full featured firmware* fall into category b. Linux already basically
> has stable DT for those systems - but the firmware is expected to do
> lots of work and hide all the low level details from the
> kernel. Basically, the DT should stick to approximately ePAR and
> everything else is hidden by the firmware. This is essentially how x86
> works and achieves its compatibility.

and the downside of placing that trust in firmware is that it very often
leads to bugs which can't be solved.

I have a set of patches for my laptop/docking station which gets the
serial/printer ports working.  I've had them for many years now - and
I thought I had a problem sorted.  I was wrong - the nice helpful ACPI
reports on dock that the serial port is enabled, but the port is
actually disabled in hardware.

If I have ACPI/PNP stuff setup to always believe that this port is
disabled, then on boot with the docking station connected, it comes up
initially as ttyS0, and then, because the port is "disabled", the
resources are busy so it gets reassigned to a different IO port.
Undocking/redocking works because the port is now properly re-enabled
after a dock event.

If I report the ACPI status to the kernel, then on boot, it correctly
remains as ttyS0.  However, after an undock/redock event, Linux
believes that the port is back, but any attempt to use it gets the
"LSR safety check engaged" message, because the port is actually
disabled.  The only way to get it working again is to manually unbind
the device and rebind it - so the ACPI disable + enable methods get
called.

I've had this problem for years, and it's basically unfixable for me -
it's only fixable if you are IBM and can reflash the BIOS with alternative
ACPI tables which are correct.  And I won't submit these patches all the
time that I don't know they work correctly.

That's the problem with "compatible systems" - you give away trust that
someone else will do the right thing, and if they don't, you may be
screwed in a way that is can not be worked around by quirks or similar
- just like the above.

Firmware is swings and roundabouts.  You give up some control to a
third party so you don't have to think about XYZ, and you hope that
they get it right.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Jason Gunthorpe
On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:

> Well, it depends on how we use the DT. There are (at least) two possible 
> usage scenarios:
> 
>  a) using DT as direct replacement for board files - this means that you 
> are free to say that DTSes are strictly coupled with kernel version 
> and you are free to modify the bindings - see the analogy to board 
> files, where you could modify the platform data structures and could 
> not directly copy board file from one kernel version to another,
> 
>  b) using DT as an ABI - this is the original way, i.e. define stable 
> bindings and make sure that anu DTB built for older kernel will work,
> with equal or greater set of functionality on newer kernels.
> 
> Now I believe in this thread the point whether we should use a) or b) or a 
> combination of both has been raised.

Right, and I think it is very important to consider that different
systems can legitimately fall into those categories.

Clearly general purpose systems (eg servers, workstations, etc) with
*full featured firmware* fall into category b. Linux already basically
has stable DT for those systems - but the firmware is expected to do
lots of work and hide all the low level details from the
kernel. Basically, the DT should stick to approximately ePAR and
everything else is hidden by the firmware. This is essentially how x86
works and achieves its compatibility.

Systems that have minimalist firmware, where firmware functions are
pushed into the kernel and the DT is now required to describe
intricate and unique SOC specific functions are clearly very
different, and I think it makes sense to encourage those environments
to be case 'a'.

Basically, minimalist firmware should have a boot process design that
*can* couple the DT and kernel, while full featured firmware should
keep them seperate. IMHO that should be the clear message to people
implementing this stuff.

After enough time the DT for 'a' should become stable and churn free,
but expecting/demanding that from day 0 is not helping anyone, IMHO.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Matt Porter
On Fri, Jul 26, 2013 at 08:49:43AM -0700, Olof Johansson wrote:
> On Fri, Jul 26, 2013 at 7:10 AM, Mark Brown  wrote:
> > On Fri, Jul 26, 2013 at 03:09:29PM +0200, Richard Cochran wrote:
> >
> >> Unless I totally misunderstood, the thread is talking about letting
> >> established bindings change with each new kernel version.  I am
> >> opposed to that.
> >
> > No, nobody is really saying that is a particularly good idea.  There is
> > some debate about how we work out what an established binding is but
> > there's no serious suggestion that we don't want stable bindings.
> 
> Yes, what Mark said -- _today_ all bindings are subject to change and
> can be changed in lockstep with the kernel. This has been necessary as
> part of development to sort out all of the various bootstrapping
> issues across platforms.

However, we still have people arguing that we can't (or should not) change
a binding right now even to fix inconsistency issues that are discovered
after the fact. I'm hearing a different story depending on who is
telling it at the moment.

Getting quickly to a definitive answer on the criteria for an
"established" binding is will help end ongoing discussions as to whether
we can fix a currently broken one or just have to leave it.

> What we're talking about is to end that mode of operation, and moving
> over to locking in bindings. Device tree contents, as mentioned
> elsewhere, might still be changed just like code is -- bugs are fixed,
> etc. But it's time to start locking down the bindings, in particular
> no longer change the established ones.
> 
> Long term, final goal is likely to be close to what Russell is saying
> -- nothing should go into the kernel tree unless the binding is in a
> fully stable state. However, we have a transitional period between now
> and then, and even when we're at the final state there will be need to
> have some sort of sandbox for development and test of future bindings.
> Dealing with all that, as well as the actual process for locking in
> bindings, is what needs to be sorted out.
> 
> I think we're all in agreement that bindings that change over time are
> nothing but pain, but we're arguing that in circles anyway.

+1

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Matt Porter
On Fri, Jul 26, 2013 at 03:40:47PM +0100, Mark Brown wrote:
> On Fri, Jul 26, 2013 at 03:21:40PM +0100, Russell King - ARM Linux wrote:
> 
> > So this is why I'm seeing patches just a short time ago removing existing
> > compatible strings from the DT descriptions and associated driver, and
> > replacing them with new ones... meaning that the old DT files won't work
> > with newer kernels.
> 
> The big question is if you're seeing such patches merged.  People making
> mistakes on submissions is totally normal.

Over in the bcm53xx thread, we've discussed such a patch to fix
inconsistencies. The problem here is that there is no canonical answer
to what a mistake is. I can make a strong argument that the support for
these parts is in such an early stage that the bindings (in this case
specifically the two different compatible strings for one vendor) should
be considered unstable and ok to fix the consistency issue. Mark Rutland
suggests we should change nothing and possibly add a third vendor prefix
for new bindings. I'm having trouble accepting that just because these
bindings made it into a final kernel during a period where
scrutinization of these things was not very high that we need to forever
carry this inconsistency in the "specification".

http://www.spinics.net/lists/arm-kernel/msg262059.html

> 
> If it's the case I think you mean TBH I'm not sure anyone cares, I don't
> think anyone is using that stuff in production yet as those chips go
> almost exclusively into Android phones.

At least the bcm281xx stuff falls into this category as you describe.
There's simply nobody that would be upset if its bindings changed from
bcm-> as there's just nobody using the DT-based upstream
work except for internal Broadcom and a couple people external working
closely with them.

This situation seems to illustrate the strong need for an unstable
binding period that's longer than just inclusion in a final kernel
release.

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Arend van Spriel

On 07/29/2013 11:19 AM, Arend van Spriel wrote:

On 07/27/2013 10:01 PM, jonsm...@gmail.com wrote:

On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely
 wrote:

On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel
 wrote:

Let's see how many people go and scream if I say this: Too bad .dts
files
are not done using XML format as DT bindings could be described
using XML
Schema.


Draft an example and show us how it would look!  :-)  There is
absolutely nothing preventing us from expressing a DT in XML format,
or even using XSLT to define DT schema while still using our current
.dts syntax. It would be trivial to do lossless translation between
.dts syntax and xml.

The problem that I have with XML and XSLT is that it is very verbose
and not entirely friendly to mere-mortals. However, I'm more than
willing to be proved wrong on this point.


I considered this approach a while ago and discarded it. It would work
but it is just too much of a Frankenstein monster.


Ah, but he is so cute. At least I do not think it is more monstrous as
the bindings files. I just browsed through a couple of arm binding files
as I felt challenged to come up with an example. I did not get the
impression that there is some kind of template in place to get consitent
bindings descriptions.


Much cleaner to modify dtc to take a schema as part of the compilation
process. The schema language itself has no requirement to look like
DTS syntax. Whoever wrote dtc probably has a favorite language that
would be good for writing schemas in.


Not sure if I can follow here. I guess you mean the dts compilation,
right? There are tools freely available to validate XML files against
XSD specification files. As an example libxml2 has support for it. I
suspect it is not desired to have a dependency for DTC with an
out-of-tree library, but it could be incorporated and have DTC spew the
validation results.


crap. Probably not as libxml2 has MIT-license.

Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Arend van Spriel

On 07/27/2013 10:01 PM, jonsm...@gmail.com wrote:

On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely  wrote:

On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel  wrote:

Let's see how many people go and scream if I say this: Too bad .dts files
are not done using XML format as DT bindings could be described using XML
Schema.


Draft an example and show us how it would look!  :-)  There is
absolutely nothing preventing us from expressing a DT in XML format,
or even using XSLT to define DT schema while still using our current
.dts syntax. It would be trivial to do lossless translation between
.dts syntax and xml.

The problem that I have with XML and XSLT is that it is very verbose
and not entirely friendly to mere-mortals. However, I'm more than
willing to be proved wrong on this point.


I considered this approach a while ago and discarded it. It would work
but it is just too much of a Frankenstein monster.


Ah, but he is so cute. At least I do not think it is more monstrous as 
the bindings files. I just browsed through a couple of arm binding files 
as I felt challenged to come up with an example. I did not get the 
impression that there is some kind of template in place to get consitent 
bindings descriptions.



Much cleaner to modify dtc to take a schema as part of the compilation
process. The schema language itself has no requirement to look like
DTS syntax. Whoever wrote dtc probably has a favorite language that
would be good for writing schemas in.


Not sure if I can follow here. I guess you mean the dts compilation, 
right? There are tools freely available to validate XML files against 
XSD specification files. As an example libxml2 has support for it. I 
suspect it is not desired to have a dependency for DTC with an 
out-of-tree library, but it could be incorporated and have DTC spew the 
validation results.


Regards,
Arend


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Maxime Ripard
Hi,

On Sun, Jul 28, 2013 at 03:19:03PM +0200, Richard Cochran wrote:
> On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:
> 
> > I'm not really sure what effect on users this has. Maybe you should define 
> > "users".
> 
> ...
> 
> > Care to explain this reasoning?
> 
> Use Case
> 
> 
> User acquires a machine running ARM Linux version 3.x, with u-boot
> and dtb in a read only flash partition. The board boots and works just
> fine. However, for his application, the user requires a new kernel
> feature that appeared in version 3.y where y > x. He compiles the new
> kernel, and it also works.

I'm afraid this kind of use case will never be properly supported, DT
stable ABI or not.

Think about this: what kernel will actually be shipped in that board?
Most likely, it will be a BSP kernel from the vendor. Does the vendor
will have made that commitment to have a stable ABI for the DT? Will it
use the same bindings than mainline? Do we want to support all the crazy
bindings every vendor will come up with?

I'm afraid the answer to these three questions will most of the time be
"no.".

That doesn't mean we shouldn't aim for *mainline* having a stable DT
ABI, but that kind of use case doesn't seem very realistic to me.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Maxime Ripard
Hi,

On Sun, Jul 28, 2013 at 03:19:03PM +0200, Richard Cochran wrote:
 On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:
 
  I'm not really sure what effect on users this has. Maybe you should define 
  users.
 
 ...
 
  Care to explain this reasoning?
 
 Use Case
 
 
 User acquires a machine running ARM Linux version 3.x, with u-boot
 and dtb in a read only flash partition. The board boots and works just
 fine. However, for his application, the user requires a new kernel
 feature that appeared in version 3.y where y  x. He compiles the new
 kernel, and it also works.

I'm afraid this kind of use case will never be properly supported, DT
stable ABI or not.

Think about this: what kernel will actually be shipped in that board?
Most likely, it will be a BSP kernel from the vendor. Does the vendor
will have made that commitment to have a stable ABI for the DT? Will it
use the same bindings than mainline? Do we want to support all the crazy
bindings every vendor will come up with?

I'm afraid the answer to these three questions will most of the time be
no..

That doesn't mean we shouldn't aim for *mainline* having a stable DT
ABI, but that kind of use case doesn't seem very realistic to me.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Arend van Spriel

On 07/27/2013 10:01 PM, jonsm...@gmail.com wrote:

On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely grant.lik...@secretlab.ca wrote:

On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel ar...@broadcom.com wrote:

Let's see how many people go and scream if I say this: Too bad .dts files
are not done using XML format as DT bindings could be described using XML
Schema.


Draft an example and show us how it would look!  :-)  There is
absolutely nothing preventing us from expressing a DT in XML format,
or even using XSLT to define DT schema while still using our current
.dts syntax. It would be trivial to do lossless translation between
.dts syntax and xml.

The problem that I have with XML and XSLT is that it is very verbose
and not entirely friendly to mere-mortals. However, I'm more than
willing to be proved wrong on this point.


I considered this approach a while ago and discarded it. It would work
but it is just too much of a Frankenstein monster.


Ah, but he is so cute. At least I do not think it is more monstrous as 
the bindings files. I just browsed through a couple of arm binding files 
as I felt challenged to come up with an example. I did not get the 
impression that there is some kind of template in place to get consitent 
bindings descriptions.



Much cleaner to modify dtc to take a schema as part of the compilation
process. The schema language itself has no requirement to look like
DTS syntax. Whoever wrote dtc probably has a favorite language that
would be good for writing schemas in.


Not sure if I can follow here. I guess you mean the dts compilation, 
right? There are tools freely available to validate XML files against 
XSD specification files. As an example libxml2 has support for it. I 
suspect it is not desired to have a dependency for DTC with an 
out-of-tree library, but it could be incorporated and have DTC spew the 
validation results.


Regards,
Arend


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Arend van Spriel

On 07/29/2013 11:19 AM, Arend van Spriel wrote:

On 07/27/2013 10:01 PM, jonsm...@gmail.com wrote:

On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely
grant.lik...@secretlab.ca wrote:

On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel
ar...@broadcom.com wrote:

Let's see how many people go and scream if I say this: Too bad .dts
files
are not done using XML format as DT bindings could be described
using XML
Schema.


Draft an example and show us how it would look!  :-)  There is
absolutely nothing preventing us from expressing a DT in XML format,
or even using XSLT to define DT schema while still using our current
.dts syntax. It would be trivial to do lossless translation between
.dts syntax and xml.

The problem that I have with XML and XSLT is that it is very verbose
and not entirely friendly to mere-mortals. However, I'm more than
willing to be proved wrong on this point.


I considered this approach a while ago and discarded it. It would work
but it is just too much of a Frankenstein monster.


Ah, but he is so cute. At least I do not think it is more monstrous as
the bindings files. I just browsed through a couple of arm binding files
as I felt challenged to come up with an example. I did not get the
impression that there is some kind of template in place to get consitent
bindings descriptions.


Much cleaner to modify dtc to take a schema as part of the compilation
process. The schema language itself has no requirement to look like
DTS syntax. Whoever wrote dtc probably has a favorite language that
would be good for writing schemas in.


Not sure if I can follow here. I guess you mean the dts compilation,
right? There are tools freely available to validate XML files against
XSD specification files. As an example libxml2 has support for it. I
suspect it is not desired to have a dependency for DTC with an
out-of-tree library, but it could be incorporated and have DTC spew the
validation results.


crap. Probably not as libxml2 has MIT-license.

Regards,
Arend

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Matt Porter
On Fri, Jul 26, 2013 at 03:40:47PM +0100, Mark Brown wrote:
 On Fri, Jul 26, 2013 at 03:21:40PM +0100, Russell King - ARM Linux wrote:
 
  So this is why I'm seeing patches just a short time ago removing existing
  compatible strings from the DT descriptions and associated driver, and
  replacing them with new ones... meaning that the old DT files won't work
  with newer kernels.
 
 The big question is if you're seeing such patches merged.  People making
 mistakes on submissions is totally normal.

Over in the bcm53xx thread, we've discussed such a patch to fix
inconsistencies. The problem here is that there is no canonical answer
to what a mistake is. I can make a strong argument that the support for
these parts is in such an early stage that the bindings (in this case
specifically the two different compatible strings for one vendor) should
be considered unstable and ok to fix the consistency issue. Mark Rutland
suggests we should change nothing and possibly add a third vendor prefix
for new bindings. I'm having trouble accepting that just because these
bindings made it into a final kernel during a period where
scrutinization of these things was not very high that we need to forever
carry this inconsistency in the specification.

http://www.spinics.net/lists/arm-kernel/msg262059.html

 
 If it's the case I think you mean TBH I'm not sure anyone cares, I don't
 think anyone is using that stuff in production yet as those chips go
 almost exclusively into Android phones.

At least the bcm281xx stuff falls into this category as you describe.
There's simply nobody that would be upset if its bindings changed from
bcm-something_else as there's just nobody using the DT-based upstream
work except for internal Broadcom and a couple people external working
closely with them.

This situation seems to illustrate the strong need for an unstable
binding period that's longer than just inclusion in a final kernel
release.

-Matt
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Matt Porter
On Fri, Jul 26, 2013 at 08:49:43AM -0700, Olof Johansson wrote:
 On Fri, Jul 26, 2013 at 7:10 AM, Mark Brown broo...@kernel.org wrote:
  On Fri, Jul 26, 2013 at 03:09:29PM +0200, Richard Cochran wrote:
 
  Unless I totally misunderstood, the thread is talking about letting
  established bindings change with each new kernel version.  I am
  opposed to that.
 
  No, nobody is really saying that is a particularly good idea.  There is
  some debate about how we work out what an established binding is but
  there's no serious suggestion that we don't want stable bindings.
 
 Yes, what Mark said -- _today_ all bindings are subject to change and
 can be changed in lockstep with the kernel. This has been necessary as
 part of development to sort out all of the various bootstrapping
 issues across platforms.

However, we still have people arguing that we can't (or should not) change
a binding right now even to fix inconsistency issues that are discovered
after the fact. I'm hearing a different story depending on who is
telling it at the moment.

Getting quickly to a definitive answer on the criteria for an
established binding is will help end ongoing discussions as to whether
we can fix a currently broken one or just have to leave it.

 What we're talking about is to end that mode of operation, and moving
 over to locking in bindings. Device tree contents, as mentioned
 elsewhere, might still be changed just like code is -- bugs are fixed,
 etc. But it's time to start locking down the bindings, in particular
 no longer change the established ones.
 
 Long term, final goal is likely to be close to what Russell is saying
 -- nothing should go into the kernel tree unless the binding is in a
 fully stable state. However, we have a transitional period between now
 and then, and even when we're at the final state there will be need to
 have some sort of sandbox for development and test of future bindings.
 Dealing with all that, as well as the actual process for locking in
 bindings, is what needs to be sorted out.
 
 I think we're all in agreement that bindings that change over time are
 nothing but pain, but we're arguing that in circles anyway.

+1

-Matt
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Jason Gunthorpe
On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:

 Well, it depends on how we use the DT. There are (at least) two possible 
 usage scenarios:
 
  a) using DT as direct replacement for board files - this means that you 
 are free to say that DTSes are strictly coupled with kernel version 
 and you are free to modify the bindings - see the analogy to board 
 files, where you could modify the platform data structures and could 
 not directly copy board file from one kernel version to another,
 
  b) using DT as an ABI - this is the original way, i.e. define stable 
 bindings and make sure that anu DTB built for older kernel will work,
 with equal or greater set of functionality on newer kernels.
 
 Now I believe in this thread the point whether we should use a) or b) or a 
 combination of both has been raised.

Right, and I think it is very important to consider that different
systems can legitimately fall into those categories.

Clearly general purpose systems (eg servers, workstations, etc) with
*full featured firmware* fall into category b. Linux already basically
has stable DT for those systems - but the firmware is expected to do
lots of work and hide all the low level details from the
kernel. Basically, the DT should stick to approximately ePAR and
everything else is hidden by the firmware. This is essentially how x86
works and achieves its compatibility.

Systems that have minimalist firmware, where firmware functions are
pushed into the kernel and the DT is now required to describe
intricate and unique SOC specific functions are clearly very
different, and I think it makes sense to encourage those environments
to be case 'a'.

Basically, minimalist firmware should have a boot process design that
*can* couple the DT and kernel, while full featured firmware should
keep them seperate. IMHO that should be the clear message to people
implementing this stuff.

After enough time the DT for 'a' should become stable and churn free,
but expecting/demanding that from day 0 is not helping anyone, IMHO.

Jason
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Russell King - ARM Linux
On Mon, Jul 29, 2013 at 12:05:13PM -0600, Jason Gunthorpe wrote:
 Clearly general purpose systems (eg servers, workstations, etc) with
 *full featured firmware* fall into category b. Linux already basically
 has stable DT for those systems - but the firmware is expected to do
 lots of work and hide all the low level details from the
 kernel. Basically, the DT should stick to approximately ePAR and
 everything else is hidden by the firmware. This is essentially how x86
 works and achieves its compatibility.

and the downside of placing that trust in firmware is that it very often
leads to bugs which can't be solved.

I have a set of patches for my laptop/docking station which gets the
serial/printer ports working.  I've had them for many years now - and
I thought I had a problem sorted.  I was wrong - the nice helpful ACPI
reports on dock that the serial port is enabled, but the port is
actually disabled in hardware.

If I have ACPI/PNP stuff setup to always believe that this port is
disabled, then on boot with the docking station connected, it comes up
initially as ttyS0, and then, because the port is disabled, the
resources are busy so it gets reassigned to a different IO port.
Undocking/redocking works because the port is now properly re-enabled
after a dock event.

If I report the ACPI status to the kernel, then on boot, it correctly
remains as ttyS0.  However, after an undock/redock event, Linux
believes that the port is back, but any attempt to use it gets the
LSR safety check engaged message, because the port is actually
disabled.  The only way to get it working again is to manually unbind
the device and rebind it - so the ACPI disable + enable methods get
called.

I've had this problem for years, and it's basically unfixable for me -
it's only fixable if you are IBM and can reflash the BIOS with alternative
ACPI tables which are correct.  And I won't submit these patches all the
time that I don't know they work correctly.

That's the problem with compatible systems - you give away trust that
someone else will do the right thing, and if they don't, you may be
screwed in a way that is can not be worked around by quirks or similar
- just like the above.

Firmware is swings and roundabouts.  You give up some control to a
third party so you don't have to think about XYZ, and you hope that
they get it right.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Richard Cochran
On Mon, Jul 29, 2013 at 09:31:23AM +0200, Maxime Ripard wrote:
 
 I'm afraid this kind of use case will never be properly supported, DT
 stable ABI or not.
 
 Think about this: what kernel will actually be shipped in that board?
 Most likely, it will be a BSP kernel from the vendor. Does the vendor
 will have made that commitment to have a stable ABI for the DT? Will it
 use the same bindings than mainline? Do we want to support all the crazy
 bindings every vendor will come up with?
 
 I'm afraid the answer to these three questions will most of the time be
 no..

Yes, I know, and it is sad but true.
 
We can't stop the vendors from shipping half-baked BSPs. I really
don't mind that they do that. After all, they want to get *something*
working when they launch their chips.

 That doesn't mean we shouldn't aim for *mainline* having a stable DT
 ABI, but that kind of use case doesn't seem very realistic to me.

Right, we can and should do better. I got the beaglebone Ethernet
working in mainline (not by writing the driver, but by complaining
over and over again). I except that it will continue to work and not
fall victim to some random DT change.

Thanks,
Richard




--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Richard Cochran
On Mon, Jul 29, 2013 at 08:38:52PM +0200, Richard Cochran wrote:
 
 Right, we can and should do better. I got the beaglebone Ethernet
 working in mainline (not by writing the driver, but by complaining
 over and over again). I except that it will continue to work and not
  ^^
expect

 fall victim to some random DT change.

Thanks,
Richard
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 12:05:13PM -0600, Jason Gunthorpe wrote:
 On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
 
  Well, it depends on how we use the DT. There are (at least) two possible 
  usage scenarios:
  
   a) using DT as direct replacement for board files - this means that you 
  are free to say that DTSes are strictly coupled with kernel version 
  and you are free to modify the bindings - see the analogy to board 
  files, where you could modify the platform data structures and could 
  not directly copy board file from one kernel version to another,
  
   b) using DT as an ABI - this is the original way, i.e. define stable 
  bindings and make sure that anu DTB built for older kernel will work,
  with equal or greater set of functionality on newer kernels.
  
  Now I believe in this thread the point whether we should use a) or b) or a 
  combination of both has been raised.
 
 Right, and I think it is very important to consider that different
 systems can legitimately fall into those categories.
 
 Clearly general purpose systems (eg servers, workstations, etc) with
 *full featured firmware* fall into category b. Linux already basically
 has stable DT for those systems - but the firmware is expected to do
 lots of work and hide all the low level details from the
 kernel.  Basically, the DT should stick to approximately ePAR and
 everything else is hidden by the firmware.

No.  With the exception of the hypervisor/virtualization extensions,
ePAPR describes (for now) an entirely passive firmware interface.
That is, once the handover to the OS has happened, there is *no*
further firmware interaction.  It is not capable of hiding any details
from the OS, except those which can be done by one-time
initialization.

In fact, a guiding principle of ePAPR's design was that except in
cases where it's *much* easier for the firmware to do things, the OS
should be expected to do it, because the OS is usually easier to fix
than the firmware.

 This is essentially how x86
 works and achieves its compatibility.
 
 Systems that have minimalist firmware, where firmware functions are
 pushed into the kernel and the DT is now required to describe
 intricate and unique SOC specific functions are clearly very
 different, and I think it makes sense to encourage those environments
 to be case 'a'.
 
 Basically, minimalist firmware should have a boot process design that
 *can* couple the DT and kernel, while full featured firmware should
 keep them seperate. IMHO that should be the clear message to people
 implementing this stuff.
 
 After enough time the DT for 'a' should become stable and churn free,
 but expecting/demanding that from day 0 is not helping anyone, IMHO.
 
 Jason

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpmLdvucEcrS.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Jason Gunthorpe
On Tue, Jul 30, 2013 at 08:20:39AM +1000, David Gibson wrote:

  Clearly general purpose systems (eg servers, workstations, etc) with
  *full featured firmware* fall into category b. Linux already basically
  has stable DT for those systems - but the firmware is expected to do
  lots of work and hide all the low level details from the
  kernel.  Basically, the DT should stick to approximately ePAR and
  everything else is hidden by the firmware.
 
 No.  With the exception of the hypervisor/virtualization extensions,
 ePAPR describes (for now) an entirely passive firmware interface.
 That is, once the handover to the OS has happened, there is *no*
 further firmware interaction.  It is not capable of hiding any details
 from the OS, except those which can be done by one-time
 initialization.

Well, one-time initialization details are actually exactly one of the
areas I am thinking about. Some of the embedded SOCs have extensive
one time initization code in the kernel that is highly SOC specific
and on x86 it would live in the firmware.

But I see what you mean, ePAPR was the wrong reference, I didn't
carefully check it. I ment the kind of DT use we've seen in SPARC,
POWER servers, Apple stuff, etc - systems explicitly designed so that
new hardware will boot old OSs.

Jason
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 05:14:25PM -0600, Jason Gunthorpe wrote:
 On Tue, Jul 30, 2013 at 08:20:39AM +1000, David Gibson wrote:
 
   Clearly general purpose systems (eg servers, workstations, etc) with
   *full featured firmware* fall into category b. Linux already basically
   has stable DT for those systems - but the firmware is expected to do
   lots of work and hide all the low level details from the
   kernel.  Basically, the DT should stick to approximately ePAR and
   everything else is hidden by the firmware.
  
  No.  With the exception of the hypervisor/virtualization extensions,
  ePAPR describes (for now) an entirely passive firmware interface.
  That is, once the handover to the OS has happened, there is *no*
  further firmware interaction.  It is not capable of hiding any details
  from the OS, except those which can be done by one-time
  initialization.
 
 Well, one-time initialization details are actually exactly one of the
 areas I am thinking about. Some of the embedded SOCs have extensive
 one time initization code in the kernel that is highly SOC specific
 and on x86 it would live in the firmware.
 
 But I see what you mean, ePAPR was the wrong reference, I didn't
 carefully check it. I ment the kind of DT use we've seen in SPARC,
 POWER servers, Apple stuff, etc - systems explicitly designed so that
 new hardware will boot old OSs.

Yeah, and at least for POWER servers and Apples, like every other
attempt at this, ever, it at best sorta-kinda worked.  It's not *as*
bad as the mess of broken BIOSes on x86 (mostly due to smaller
variety), but there's still plenty of broken crap in Apple workstation
and IBM server firmwares and device trees.

You see a clear line between full featured and minimal firmwares
where none exists.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpR_NbTqfEwq.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
 On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
  On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely grant.lik...@secretlab.ca 
  wrote:
   On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com jonsm...@gmail.com 
   wrote:
   On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
   grant.lik...@secretlab.ca wrote:
   On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel ar...@broadcom.com 
   wrote:
   Let's see how many people go and scream if I say this: Too bad .dts 
   files
   are not done using XML format as DT bindings could be described using 
   XML
   Schema.
  
   Draft an example and show us how it would look!  :-)  There is
   absolutely nothing preventing us from expressing a DT in XML format,
   or even using XSLT to define DT schema while still using our current
   .dts syntax. It would be trivial to do lossless translation between
   .dts syntax and xml.
  
   The problem that I have with XML and XSLT is that it is very verbose
   and not entirely friendly to mere-mortals. However, I'm more than
   willing to be proved wrong on this point.
  
   I considered this approach a while ago and discarded it. It would work
   but it is just too much of a Frankenstein monster.
  
   Much cleaner to modify dtc to take a schema as part of the compilation
   process. The schema language itself has no requirement to look like
   DTS syntax. Whoever wrote dtc probably has a favorite language that
   would be good for writing schemas in.
  
   Making it part of dtc is a required feature as far as I'm concerned.
   Using XML/XSLT and dtc-integration are not mutually exclusive, but I
   digress.
  
  Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
  discussion of schema. Sorry for the noise.
 
 XSLT is a transform language ... you'd use it say to transform xml to
 dtc, so it would be an integral component of an xml/xslt based schema.
 
 If you want actually to describe and have validated the xml schema
 itself, then you'd use xsd (XML schema description language) and its
 associated tools.
 
 I'm not saying you *should* do this, just that it's possible (plus I've
 just blown my kernel cred by knowing about xml, sigh).

Heh.  So, it was said in jest, but that actually raises an important
point.

There are basically two criteria to keep in mind for our
representation of schemas:
   1) Adequate expressiveness to validate a sufficiently large part,
of a sufficiently large number of bindings to be useful.
   2) Ease of use and ease of learning **for the target audience**.

To the best of my knowledge xsd would do well on (1), but I'm not
convinced it does very well on (2).  In an environment where XML was
already widely used, XSD would make perfect sense.  Here, I think it
would be pretty ugly to wire onto the existing DT tools and
infrastructure, and unpleasantly unfamiliar for many kernel and board
developers trying to work with DT schemas.


So, by way of investigation, let me propose an alternative expression
of schemas, that I'm also not convinced we should do, but is possible
and expressive.  It's illustrative, because it's kind of the polar
opposite approach to XSD: just use C.

dtc already has a (so far limited) checks mechanism which verifies
various aspects of DT content.  These are implemented by C functions
in checks.c.  There's obviously ample expressiveness - you can express
any constraint you want that way.  It can be pretty verbose, and
fiddly.  A good library of helper functions can mitigate that, but
it's not clear how much.  On the other hand, a very good fraction of
people working with this will already be familiar with C, which is a
big plus.  This is, after all, the reason that the dts syntax is
chiefly C inspired.

Now, in practice, I think we will want a more convenient schema
language (just as we wanted dts, rather than manually constructing
FDTs as C structures).  But I absolutely do think, that the schema
handling should be handled as plugins to the checks mechanism -
basically we'd have a validate_schemas() check function.

I also think we should consider the option of having a simple and
straightforward schema language which handles, say, 80% of cases with
a fall back to C for the 20% of curly cases.  That might actually be
simpler to work with in practice than a schema language which can
express absolutely anything, at the cost of being awkward for simple
cases or difficult to get your head around.

Remember, a schema language is only a win if it is - for the target
audience - more convenient to express schemas in than C.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpB1pAGHvvqM.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread jonsm...@gmail.com
On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
da...@gibson.dropbear.id.au wrote:
 On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
 On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
  On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely grant.lik...@secretlab.ca 
  wrote:
   On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com jonsm...@gmail.com 
   wrote:
   On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
   grant.lik...@secretlab.ca wrote:
   On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel ar...@broadcom.com 
   wrote:
   Let's see how many people go and scream if I say this: Too bad .dts 
   files
   are not done using XML format as DT bindings could be described using 
   XML
   Schema.
  
   Draft an example and show us how it would look!  :-)  There is
   absolutely nothing preventing us from expressing a DT in XML format,
   or even using XSLT to define DT schema while still using our current
   .dts syntax. It would be trivial to do lossless translation between
   .dts syntax and xml.
  
   The problem that I have with XML and XSLT is that it is very verbose
   and not entirely friendly to mere-mortals. However, I'm more than
   willing to be proved wrong on this point.
  
   I considered this approach a while ago and discarded it. It would work
   but it is just too much of a Frankenstein monster.
  
   Much cleaner to modify dtc to take a schema as part of the compilation
   process. The schema language itself has no requirement to look like
   DTS syntax. Whoever wrote dtc probably has a favorite language that
   would be good for writing schemas in.
  
   Making it part of dtc is a required feature as far as I'm concerned.
   Using XML/XSLT and dtc-integration are not mutually exclusive, but I
   digress.
 
  Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
  discussion of schema. Sorry for the noise.

 XSLT is a transform language ... you'd use it say to transform xml to
 dtc, so it would be an integral component of an xml/xslt based schema.

 If you want actually to describe and have validated the xml schema
 itself, then you'd use xsd (XML schema description language) and its
 associated tools.

 I'm not saying you *should* do this, just that it's possible (plus I've
 just blown my kernel cred by knowing about xml, sigh).

 Heh.  So, it was said in jest, but that actually raises an important
 point.

 There are basically two criteria to keep in mind for our
 representation of schemas:
1) Adequate expressiveness to validate a sufficiently large part,
 of a sufficiently large number of bindings to be useful.
2) Ease of use and ease of learning **for the target audience**.

 To the best of my knowledge xsd would do well on (1), but I'm not
 convinced it does very well on (2).  In an environment where XML was
 already widely used, XSD would make perfect sense.  Here, I think it
 would be pretty ugly to wire onto the existing DT tools and
 infrastructure, and unpleasantly unfamiliar for many kernel and board
 developers trying to work with DT schemas.


 So, by way of investigation, let me propose an alternative expression
 of schemas, that I'm also not convinced we should do, but is possible
 and expressive.  It's illustrative, because it's kind of the polar
 opposite approach to XSD: just use C.

 dtc already has a (so far limited) checks mechanism which verifies
 various aspects of DT content.  These are implemented by C functions
 in checks.c.  There's obviously ample expressiveness - you can express
 any constraint you want that way.  It can be pretty verbose, and
 fiddly.  A good library of helper functions can mitigate that, but
 it's not clear how much.  On the other hand, a very good fraction of
 people working with this will already be familiar with C, which is a
 big plus.  This is, after all, the reason that the dts syntax is
 chiefly C inspired.

 Now, in practice, I think we will want a more convenient schema
 language (just as we wanted dts, rather than manually constructing
 FDTs as C structures).  But I absolutely do think, that the schema
 handling should be handled as plugins to the checks mechanism -
 basically we'd have a validate_schemas() check function.

 I also think we should consider the option of having a simple and
 straightforward schema language which handles, say, 80% of cases with
 a fall back to C for the 20% of curly cases.  That might actually be
 simpler to work with in practice than a schema language which can
 express absolutely anything, at the cost of being awkward for simple
 cases or difficult to get your head around.

Would C++ work? You can use operating overloading and templates to
change the syntax into something that doesn't even resemble C any
more.


 Remember, a schema language is only a win if it is - for the target
 audience - more convenient to express schemas in than C.

 --
 David Gibson| I'll have my music baroque, and my code
 david AT gibson.dropbear.id.au  | minimalist, 

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 10:15:12PM -0400, jonsm...@gmail.com wrote:
 On Mon, Jul 29, 2013 at 9:44 PM, David Gibson
 da...@gibson.dropbear.id.au wrote:
  On Sat, Jul 27, 2013 at 10:11:16PM -0700, James Bottomley wrote:
  On Sat, 2013-07-27 at 21:28 -0600, Grant Likely wrote:
   On Sat, Jul 27, 2013 at 2:25 PM, Grant Likely 
   grant.lik...@secretlab.ca wrote:
On Sat, Jul 27, 2013 at 2:01 PM, jonsm...@gmail.com 
jonsm...@gmail.com wrote:
On Sat, Jul 27, 2013 at 3:45 PM, Grant Likely 
grant.lik...@secretlab.ca wrote:
On Sat, Jul 27, 2013 at 4:59 AM, Arend van Spriel 
ar...@broadcom.com wrote:
Let's see how many people go and scream if I say this: Too bad .dts 
files
are not done using XML format as DT bindings could be described 
using XML
Schema.
   
Draft an example and show us how it would look!  :-)  There is
absolutely nothing preventing us from expressing a DT in XML format,
or even using XSLT to define DT schema while still using our current
.dts syntax. It would be trivial to do lossless translation between
.dts syntax and xml.
   
The problem that I have with XML and XSLT is that it is very verbose
and not entirely friendly to mere-mortals. However, I'm more than
willing to be proved wrong on this point.
   
I considered this approach a while ago and discarded it. It would work
but it is just too much of a Frankenstein monster.
   
Much cleaner to modify dtc to take a schema as part of the compilation
process. The schema language itself has no requirement to look like
DTS syntax. Whoever wrote dtc probably has a favorite language that
would be good for writing schemas in.
   
Making it part of dtc is a required feature as far as I'm concerned.
Using XML/XSLT and dtc-integration are not mutually exclusive, but I
digress.
  
   Oops, ignore the XSLT bit. XSLT isn't schema and has no bearing on the
   discussion of schema. Sorry for the noise.
 
  XSLT is a transform language ... you'd use it say to transform xml to
  dtc, so it would be an integral component of an xml/xslt based schema.
 
  If you want actually to describe and have validated the xml schema
  itself, then you'd use xsd (XML schema description language) and its
  associated tools.
 
  I'm not saying you *should* do this, just that it's possible (plus I've
  just blown my kernel cred by knowing about xml, sigh).
 
  Heh.  So, it was said in jest, but that actually raises an important
  point.
 
  There are basically two criteria to keep in mind for our
  representation of schemas:
 1) Adequate expressiveness to validate a sufficiently large part,
  of a sufficiently large number of bindings to be useful.
 2) Ease of use and ease of learning **for the target audience**.
 
  To the best of my knowledge xsd would do well on (1), but I'm not
  convinced it does very well on (2).  In an environment where XML was
  already widely used, XSD would make perfect sense.  Here, I think it
  would be pretty ugly to wire onto the existing DT tools and
  infrastructure, and unpleasantly unfamiliar for many kernel and board
  developers trying to work with DT schemas.
 
 
  So, by way of investigation, let me propose an alternative expression
  of schemas, that I'm also not convinced we should do, but is possible
  and expressive.  It's illustrative, because it's kind of the polar
  opposite approach to XSD: just use C.
 
  dtc already has a (so far limited) checks mechanism which verifies
  various aspects of DT content.  These are implemented by C functions
  in checks.c.  There's obviously ample expressiveness - you can express
  any constraint you want that way.  It can be pretty verbose, and
  fiddly.  A good library of helper functions can mitigate that, but
  it's not clear how much.  On the other hand, a very good fraction of
  people working with this will already be familiar with C, which is a
  big plus.  This is, after all, the reason that the dts syntax is
  chiefly C inspired.
 
  Now, in practice, I think we will want a more convenient schema
  language (just as we wanted dts, rather than manually constructing
  FDTs as C structures).  But I absolutely do think, that the schema
  handling should be handled as plugins to the checks mechanism -
  basically we'd have a validate_schemas() check function.
 
  I also think we should consider the option of having a simple and
  straightforward schema language which handles, say, 80% of cases with
  a fall back to C for the 20% of curly cases.  That might actually be
  simpler to work with in practice than a schema language which can
  express absolutely anything, at the cost of being awkward for simple
  cases or difficult to get your head around.
 
 Would C++ work? You can use operating overloading and templates to
 change the syntax into something that doesn't even resemble C any
 more.

Well, in theory.  But given that dtc and the kernel are both in plain
C, I don't think 

Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-29 Thread Grant Likely
On Mon, Jul 29, 2013 at 1:31 AM, Maxime Ripard
maxime.rip...@free-electrons.com wrote:
 Hi,

 On Sun, Jul 28, 2013 at 03:19:03PM +0200, Richard Cochran wrote:
 On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:

  I'm not really sure what effect on users this has. Maybe you should define
  users.

 ...

  Care to explain this reasoning?

 Use Case
 

 User acquires a machine running ARM Linux version 3.x, with u-boot
 and dtb in a read only flash partition. The board boots and works just
 fine. However, for his application, the user requires a new kernel
 feature that appeared in version 3.y where y  x. He compiles the new
 kernel, and it also works.

 I'm afraid this kind of use case will never be properly supported, DT
 stable ABI or not.

Why? New kernel features should be no problem at all.

New driver features /might/ not be available, but only if the new
feature requires additional data that isn't present in the tree and
cannot be obtained elsewhere.


 Think about this: what kernel will actually be shipped in that board?
 Most likely, it will be a BSP kernel from the vendor. Does the vendor
 will have made that commitment to have a stable ABI for the DT? Will it
 use the same bindings than mainline? Do we want to support all the crazy
 bindings every vendor will come up with?

That's not a DT issue. That an out-of-tree board/SoC support issue. DT
doesn't make that any better or worse.

g.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread David Gibson
On Sun, Jul 28, 2013 at 05:35:46PM +0200, Richard Cochran wrote:
> On Sun, Jul 28, 2013 at 10:09:57AM -0400, jonsm...@gmail.com wrote:
> > 
> > 3.z kernel is free to alter the schema. But it will have to supply the
> > necessary quirks needed to keep those old dtb's functioning.
> 
> The quirks idea sounds okay to me, if it can really provide forward
> compatibility. In practice, I doubt anyone will really spend the
> effort to make this work. I think it would be much easier to make sure
> the bindings are "future proof" in the first place.

I should clarify.  The idea of DT quirks is not to remove the need to
properly design and review bindings.  It's to limit the damage when
there are, inevitably, failings in that process.  And when, also
inevitably, firmware vendors ship DTs that don't follow the bindings
correctly, even when there is a good one available.

I think it's more likely that people will create, and get right, a
well localized bit of quirk code, than they will get backwards compat
code correct for every place in which a driver wants info from the
device tree.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


pgpXkvbcj28C1.pgp
Description: PGP signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Mark Brown
On Sun, Jul 28, 2013 at 11:50:19AM -0400, jonsm...@gmail.com wrote:

> "furture proof" is much easier to say that it is to do. We've been
> messing around with the audio bindings for three years and still don't
> have a really good scheme. It is pretty easy to come up with the first
> 90% of a device tree. It is really hard to work out that last 10%.

I wouldn't say that for audio - we've got a pretty solid idea of what's
going on and little if any churn.  If some more of the subsystems that
we rely on were working well we could do a bit more but it's mostly just
extensions of where we're at now.


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread jonsm...@gmail.com
On Sun, Jul 28, 2013 at 11:35 AM, Richard Cochran
 wrote:
> On Sun, Jul 28, 2013 at 10:09:57AM -0400, jonsm...@gmail.com wrote:
>>
>> 3.z kernel is free to alter the schema. But it will have to supply the
>> necessary quirks needed to keep those old dtb's functioning.
>
> The quirks idea sounds okay to me, if it can really provide forward
> compatibility. In practice, I doubt anyone will really spend the
> effort to make this work. I think it would be much easier to make sure
> the bindings are "future proof" in the first place.

"furture proof" is much easier to say that it is to do. We've been
messing around with the audio bindings for three years and still don't
have a really good scheme. It is pretty easy to come up with the first
90% of a device tree. It is really hard to work out that last 10%.

You can easily get the chips into the tree. Doing that will load the
correct device drivers. But now how are these chips wired together? Is
the appropriate button, LED, etc attached to all the IO pins offered
by the chip? Those answers vary by the PCB the chip was used in..
Trying to figure out a scheme for this has lead to some volatility in
the device trees.  The whole concept of pin mapping was missing from
the early device trees.


>
> Thanks,
> Richard



-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Richard Cochran
On Sun, Jul 28, 2013 at 10:09:57AM -0400, jonsm...@gmail.com wrote:
> 
> 3.z kernel is free to alter the schema. But it will have to supply the
> necessary quirks needed to keep those old dtb's functioning.

The quirks idea sounds okay to me, if it can really provide forward
compatibility. In practice, I doubt anyone will really spend the
effort to make this work. I think it would be much easier to make sure
the bindings are "future proof" in the first place.

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Richard Cochran
On Sun, Jul 28, 2013 at 03:39:56PM +0200, Tomasz Figa wrote:
 
> There are many possible options:

...

Wow, you totally ignored the use case.

> Please note, though, I'm _not_ trying to convince you that this kind of 
> solutions is good, as I'm not convinced either. That's why we are 
> discussing this.

And next you are going to convince me that updating my BIOS is a
normal, expected, and necessary step in upgrading my kernel.

No, thank you.

Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread jonsm...@gmail.com
On Sun, Jul 28, 2013 at 9:39 AM, Tomasz Figa  wrote:
> On Sunday 28 of July 2013 15:19:03 Richard Cochran wrote:
>> On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:
>> > I'm not really sure what effect on users this has. Maybe you should
>> > define "users".
>>
>> ...
>>
>> > Care to explain this reasoning?
>>
>> Use Case
>> 
>>
>> User acquires a machine running ARM Linux version 3.x, with u-boot
>> and dtb in a read only flash partition. The board boots and works just
>> fine. However, for his application, the user requires a new kernel
>> feature that appeared in version 3.y where y > x. He compiles the new
>> kernel, and it also works.
>
> Generally the user does not care where the dtb is stored. He just want to
> upgrade the kernel without thinking about internals.
>
> There are many possible options:
>
> a) The BSP packaging script he received from board vendor, or even kernel
> build system, builds dtb from kernel sources and appends it to built
> zImage. He just flashes the zImage and everything is working correctly.
>
>   This is pretty common case today, as many boards still use legacy
>   bootloaders without native support for DT. See the analogy to board
>   files, being compiled as a part of kernel sources.
>
> b) The user always compiles the kernel and dtb and flashes both at the
> same time.
>
>   This does not differ at all to flashing the kernel alone, except two
>   files, not one, need to be flashed.

c) Use a quirk system to map ROM based DTB's.

3.x kernel was matched to dtb that is flashed into boot rom.
Everything was initially ok.

The 3.y kernel is built with init time quirks that map the dtb from
3.x format  into the 3.y format. These quirks can be easily built
since we know the generic schema from both 3.x and 3.y. Mapping ten
year old power PC dtbs may involve more code.

These quirks aren't going to be large, it's not like the entire schema
is going to change on each kernel release.  They are just going to
make a best effort to map the dtb in ROM into something the 3.y kernel
can understand. Owners of these ROMs will complain loudly if the
quirks aren't right.

3.z kernel is free to alter the schema. But it will have to supply the
necessary quirks needed to keep those old dtb's functioning.

>
> By the way, in use case you are describing, changes that dtb wouldn't have
> to be updated are very low, unless the one present in read only memory of
> the board is complete, i.e. fully describes all the available hardware,
> which is unlikely for a dtb built at time of 3.x availability, whenever
> the feature showed up in 3.y (y > x). The user will most likely have to
> update the dtb anyway.
>
> Please note, though, I'm _not_ trying to convince you that this kind of
> solutions is good, as I'm not convinced either. That's why we are
> discussing this.
>
> Best regards,
> Tomasz
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
Jon Smirl
jonsm...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Tomasz Figa
On Sunday 28 of July 2013 15:19:03 Richard Cochran wrote:
> On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:
> > I'm not really sure what effect on users this has. Maybe you should
> > define "users".
> 
> ...
> 
> > Care to explain this reasoning?
> 
> Use Case
> 
> 
> User acquires a machine running ARM Linux version 3.x, with u-boot
> and dtb in a read only flash partition. The board boots and works just
> fine. However, for his application, the user requires a new kernel
> feature that appeared in version 3.y where y > x. He compiles the new
> kernel, and it also works.

Generally the user does not care where the dtb is stored. He just want to 
upgrade the kernel without thinking about internals.

There are many possible options:

a) The BSP packaging script he received from board vendor, or even kernel 
build system, builds dtb from kernel sources and appends it to built 
zImage. He just flashes the zImage and everything is working correctly.

  This is pretty common case today, as many boards still use legacy 
  bootloaders without native support for DT. See the analogy to board 
  files, being compiled as a part of kernel sources.

b) The user always compiles the kernel and dtb and flashes both at the 
same time.

  This does not differ at all to flashing the kernel alone, except two 
  files, not one, need to be flashed.

By the way, in use case you are describing, changes that dtb wouldn't have 
to be updated are very low, unless the one present in read only memory of 
the board is complete, i.e. fully describes all the available hardware, 
which is unlikely for a dtb built at time of 3.x availability, whenever 
the feature showed up in 3.y (y > x). The user will most likely have to 
update the dtb anyway.

Please note, though, I'm _not_ trying to convince you that this kind of 
solutions is good, as I'm not convinced either. That's why we are 
discussing this.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Richard Cochran
On Sun, Jul 28, 2013 at 11:12:53AM +0200, Tomasz Figa wrote:

> I'm not really sure what effect on users this has. Maybe you should define 
> "users".

...

> Care to explain this reasoning?

Use Case


User acquires a machine running ARM Linux version 3.x, with u-boot
and dtb in a read only flash partition. The board boots and works just
fine. However, for his application, the user requires a new kernel
feature that appeared in version 3.y where y > x. He compiles the new
kernel, and it also works.

Thanks,
Richard



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Mark Brown
On Sat, Jul 27, 2013 at 08:07:54PM +0200, Richard Cochran wrote:
> On Sat, Jul 27, 2013 at 12:36:02PM +0100, Mark Brown wrote:

> Yes, lets, and remember the question was, why do I say that dealing
> with DT is such a PITA.

There are definite issues with DT (getting a good process for quality
bindings together being the major one, and we're still working on some
of the subsystem bindings) but we shouldn't conflate other things with
those.  What you and others are saying about the need for a stable ABI
for DT is correct but we're going off on tangents here.

My read on what you're saying is that it's more to do with bleeding edge
stuff being painful than it is to do with DT itself; DT gets mentioned a
lot because it is an active area of development and gets used a lot
during bringup but it's not the cause.

> > >   http://www.spinics.net/lists/arm-kernel/msg198431.html

> > This actually sounds pretty good - glancing over the thread it seems you
> > were trying to boot a shiny new board that people were in the process of
> > trying to upstream support for and were just a bit too early.  Device
> > tree doesn't seem to have made a difference either way here.

> Did you miss the part about CONFIG_ARM_APPENDED_DTB?

It didn't seem terribly relevant - it's a feature if people and/or
systems want to use it.

> > >   http://www.spinics.net/lists/linux-omap/msg79731.html

> > Paul's reply here seems fairly clear - someone had merged a driver which
> > had been developed in an out of tree or pre-DT environment without DT
> > support so they just hadn't added DT support.  Sadly doing that is new
> > feature development and so not appropriate for the stabalisation phase
> > of development.

> This is me asking for maintainers to take patches to fix a driver in
> version v3.7 where the driver merged in v3.4. 

> The patches contain the missing DT part, and the maintainer rejects
> them, saying, no new features!

> Q: What the heck kind of process is that?
> A: DT process.

No, this is nothing to do with DT - this is just the general kernel
development process.  DT was a new feature for that driver (which
would've been merged a year or so before we got our first DT only ARM
platform...), it's unfortunate that you needed it for your system since
it was a DT only system but it's still a new feature with respect to the
driver.

> Seriously, why is it too hard for y'all to insist on merging drivers
> only when they are really, truly ready (and don't forget the DT part,
> please).

There's a couple of things there.  One is that subsystem maintainers
have no real way of telling if a driver actually works unless they
happen to have a system they can test it on.  For the most part that's
just not the case so we have to trust that someone will say something if
there's a problem.  We can spot some problems through review but there's
a huge set that just won't be obvious without knowledge of the hardware.

The other is that a partially featured driver in the kernel tends to be
a better thing for development than something out of tree - if it's
useful for someone that's great and it provides a starting point for
someone else to come along and add more features.  So long as it's not
causing problems at a subsystem level it's generally better to have it
than not, that way other people can come along and incrementally improve
the driver without having to work out some way of collaborating out of
tree.

You mention DT specifically here - obviously a lot of platforms don't
require DT (only some architectures use it at all) so it can't be a
requirement for drivers and if someone's done the work to get the
hardware working it seems more useful to get that merged and then let
someone who cares about DT add the bindings later.

> > > * When people try in good faith to conduct methodical boot tests,
> > >   DT is working against them.

> > >   http://www.spinics.net/lists/linux-omap/msg79960.html

> > Again I don't see anything particularly related to DT here but instead
> > do with using a SoC and board that are in the early phases of mainline
> > integration.

> It is ring around the rosie, DT, boot loader, and kernel.

> Understandably, Paul doesn't want to upgrade his boot loader. He says
> he is "not interested" in testing the boot loader, just the kernel.
> And, if you follow the sage of Paul's test reports, you will find him
> being told to update his boot loader and not to forget the delete old
> dtb files.

> So, like I said, it is a pity PITA.

New systems especially those using new SoCs generally are a pain; had
the issues not mentioned DT they might well have been something else
like missing pinmux in the bootloader, some bit of kernel functionality
not being merged yet or something else.  The flow of discussion there
looks very familiar to me from way before DT was talked about for ARM -
it reminds me a bit of some work I did before even PowerPC adopted DT!


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Mark Brown
On Sat, Jul 27, 2013 at 07:37:48PM +0200, Richard Cochran wrote:
> On Sat, Jul 27, 2013 at 11:40:18AM +0100, Mark Brown wrote:

> > We did have exactly the same discussion when the DT transition was
> > started - this isn't something that people only just realised might be
> > an issue.  There was a deliberate decision to focus on getting the
> > technology deployed to the point where it could be used as a straight
> > replacement for board files and accept that sometimes the results won't
> > be perfect and that we may need to rework as a result.

> Can you tell a bit more about this decision? When was it made? Who
> made it? How was it made public?

I honestly can't remember exactly - it was part of the discussion about
keeping the .dtb files in the kernel IIRC.  Given the timing and the
fact that I remember it it'd have been a mailing list discussion but I
couldn't point you at it without searching for a needle in a haystack,
sorry.  Perhaps there's a LWN writeup or something.

It's not the "we don't care" that you're seeing, it's more a product of
"we're not sure what we're doing yet, let's give ourselves a pass if we
mess things up while we're still learning" so it's probably buried in
some thread.


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Tomasz Figa
On Sunday 28 of July 2013 10:56:52 Richard Cochran wrote:
> On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
> > On Saturday 27 of July 2013 20:31:01 Richard Cochran wrote:
> > > Frankly, I am really surprised and shocked at the cavalier attitude
> > > expressed here WRT DT bindings in released kernels. Think about the
> > > *users* of this code. Not everyone working with ARM Linux is a
> > > kernel
> > > developer or a DT guru. There is really no indication at all that
> > > the
> > > ARM Linux DT stuff released so far are not stable and trustworthy.
> 
> Read the above again, please.

I'm not really sure what effect on users this has. Maybe you should define 
"users".

Sure, if you don't like the fact that it is not cleary said, whether we 
use a) or b) (see below), then it's hard to disagree with you - it should 
have been said. We are trying to fix this now.

> > Well, it depends on how we use the DT. There are (at least) two
> > possible> 
> > usage scenarios:
> >  a) using DT as direct replacement for board files - this means that
> >  you
> >  
> > are free to say that DTSes are strictly coupled with kernel
> > version
> > and you are free to modify the bindings - see the analogy to board
> > files, where you could modify the platform data structures and
> > could
> > not directly copy board file from one kernel version to another,
> >  
> >  b) using DT as an ABI - this is the original way, i.e. define stable
> >  
> > bindings and make sure that anu DTB built for older kernel will
> > work,
> > with equal or greater set of functionality on newer kernels.
> > 
> > Now I believe in this thread the point whether we should use a) or b)
> > or a combination of both has been raised.
> 
> If you seriously want to pursue a) then you are thinking only of
> yourself.
> 
> Please consider the needs of the people trying to use your code in
> actual practice.

Care to explain this reasoning?

Let's say I'm not strongly for neither of above and I'd like you to 
convince me to one of the options.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Richard Cochran
On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
> On Saturday 27 of July 2013 20:31:01 Richard Cochran wrote:
> > 
> > Frankly, I am really surprised and shocked at the cavalier attitude
> > expressed here WRT DT bindings in released kernels. Think about the
> > *users* of this code. Not everyone working with ARM Linux is a kernel
> > developer or a DT guru. There is really no indication at all that the
> > ARM Linux DT stuff released so far are not stable and trustworthy.

Read the above again, please.

> Well, it depends on how we use the DT. There are (at least) two possible 
> usage scenarios:
> 
>  a) using DT as direct replacement for board files - this means that you 
> are free to say that DTSes are strictly coupled with kernel version 
> and you are free to modify the bindings - see the analogy to board 
> files, where you could modify the platform data structures and could 
> not directly copy board file from one kernel version to another,
> 
>  b) using DT as an ABI - this is the original way, i.e. define stable 
> bindings and make sure that anu DTB built for older kernel will work,
> with equal or greater set of functionality on newer kernels.
> 
> Now I believe in this thread the point whether we should use a) or b) or a 
> combination of both has been raised.

If you seriously want to pursue a) then you are thinking only of
yourself.

Please consider the needs of the people trying to use your code in
actual practice.

Thanks,
Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Richard Cochran
On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
 On Saturday 27 of July 2013 20:31:01 Richard Cochran wrote:
  
  Frankly, I am really surprised and shocked at the cavalier attitude
  expressed here WRT DT bindings in released kernels. Think about the
  *users* of this code. Not everyone working with ARM Linux is a kernel
  developer or a DT guru. There is really no indication at all that the
  ARM Linux DT stuff released so far are not stable and trustworthy.

Read the above again, please.

 Well, it depends on how we use the DT. There are (at least) two possible 
 usage scenarios:
 
  a) using DT as direct replacement for board files - this means that you 
 are free to say that DTSes are strictly coupled with kernel version 
 and you are free to modify the bindings - see the analogy to board 
 files, where you could modify the platform data structures and could 
 not directly copy board file from one kernel version to another,
 
  b) using DT as an ABI - this is the original way, i.e. define stable 
 bindings and make sure that anu DTB built for older kernel will work,
 with equal or greater set of functionality on newer kernels.
 
 Now I believe in this thread the point whether we should use a) or b) or a 
 combination of both has been raised.

If you seriously want to pursue a) then you are thinking only of
yourself.

Please consider the needs of the people trying to use your code in
actual practice.

Thanks,
Richard

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Tomasz Figa
On Sunday 28 of July 2013 10:56:52 Richard Cochran wrote:
 On Sat, Jul 27, 2013 at 11:51:06AM -0700, Tomasz Figa wrote:
  On Saturday 27 of July 2013 20:31:01 Richard Cochran wrote:
   Frankly, I am really surprised and shocked at the cavalier attitude
   expressed here WRT DT bindings in released kernels. Think about the
   *users* of this code. Not everyone working with ARM Linux is a
   kernel
   developer or a DT guru. There is really no indication at all that
   the
   ARM Linux DT stuff released so far are not stable and trustworthy.
 
 Read the above again, please.

I'm not really sure what effect on users this has. Maybe you should define 
users.

Sure, if you don't like the fact that it is not cleary said, whether we 
use a) or b) (see below), then it's hard to disagree with you - it should 
have been said. We are trying to fix this now.

  Well, it depends on how we use the DT. There are (at least) two
  possible 
  usage scenarios:
   a) using DT as direct replacement for board files - this means that
   you
   
  are free to say that DTSes are strictly coupled with kernel
  version
  and you are free to modify the bindings - see the analogy to board
  files, where you could modify the platform data structures and
  could
  not directly copy board file from one kernel version to another,
   
   b) using DT as an ABI - this is the original way, i.e. define stable
   
  bindings and make sure that anu DTB built for older kernel will
  work,
  with equal or greater set of functionality on newer kernels.
  
  Now I believe in this thread the point whether we should use a) or b)
  or a combination of both has been raised.
 
 If you seriously want to pursue a) then you are thinking only of
 yourself.
 
 Please consider the needs of the people trying to use your code in
 actual practice.

Care to explain this reasoning?

Let's say I'm not strongly for neither of above and I'd like you to 
convince me to one of the options.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Mark Brown
On Sat, Jul 27, 2013 at 07:37:48PM +0200, Richard Cochran wrote:
 On Sat, Jul 27, 2013 at 11:40:18AM +0100, Mark Brown wrote:

  We did have exactly the same discussion when the DT transition was
  started - this isn't something that people only just realised might be
  an issue.  There was a deliberate decision to focus on getting the
  technology deployed to the point where it could be used as a straight
  replacement for board files and accept that sometimes the results won't
  be perfect and that we may need to rework as a result.

 Can you tell a bit more about this decision? When was it made? Who
 made it? How was it made public?

I honestly can't remember exactly - it was part of the discussion about
keeping the .dtb files in the kernel IIRC.  Given the timing and the
fact that I remember it it'd have been a mailing list discussion but I
couldn't point you at it without searching for a needle in a haystack,
sorry.  Perhaps there's a LWN writeup or something.

It's not the we don't care that you're seeing, it's more a product of
we're not sure what we're doing yet, let's give ourselves a pass if we
mess things up while we're still learning so it's probably buried in
some thread.


signature.asc
Description: Digital signature


Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?]

2013-07-28 Thread Mark Brown
On Sat, Jul 27, 2013 at 08:07:54PM +0200, Richard Cochran wrote:
 On Sat, Jul 27, 2013 at 12:36:02PM +0100, Mark Brown wrote:

 Yes, lets, and remember the question was, why do I say that dealing
 with DT is such a PITA.

There are definite issues with DT (getting a good process for quality
bindings together being the major one, and we're still working on some
of the subsystem bindings) but we shouldn't conflate other things with
those.  What you and others are saying about the need for a stable ABI
for DT is correct but we're going off on tangents here.

My read on what you're saying is that it's more to do with bleeding edge
stuff being painful than it is to do with DT itself; DT gets mentioned a
lot because it is an active area of development and gets used a lot
during bringup but it's not the cause.

 http://www.spinics.net/lists/arm-kernel/msg198431.html

  This actually sounds pretty good - glancing over the thread it seems you
  were trying to boot a shiny new board that people were in the process of
  trying to upstream support for and were just a bit too early.  Device
  tree doesn't seem to have made a difference either way here.

 Did you miss the part about CONFIG_ARM_APPENDED_DTB?

It didn't seem terribly relevant - it's a feature if people and/or
systems want to use it.

 http://www.spinics.net/lists/linux-omap/msg79731.html

  Paul's reply here seems fairly clear - someone had merged a driver which
  had been developed in an out of tree or pre-DT environment without DT
  support so they just hadn't added DT support.  Sadly doing that is new
  feature development and so not appropriate for the stabalisation phase
  of development.

 This is me asking for maintainers to take patches to fix a driver in
 version v3.7 where the driver merged in v3.4. 

 The patches contain the missing DT part, and the maintainer rejects
 them, saying, no new features!

 Q: What the heck kind of process is that?
 A: DT process.

No, this is nothing to do with DT - this is just the general kernel
development process.  DT was a new feature for that driver (which
would've been merged a year or so before we got our first DT only ARM
platform...), it's unfortunate that you needed it for your system since
it was a DT only system but it's still a new feature with respect to the
driver.

 Seriously, why is it too hard for y'all to insist on merging drivers
 only when they are really, truly ready (and don't forget the DT part,
 please).

There's a couple of things there.  One is that subsystem maintainers
have no real way of telling if a driver actually works unless they
happen to have a system they can test it on.  For the most part that's
just not the case so we have to trust that someone will say something if
there's a problem.  We can spot some problems through review but there's
a huge set that just won't be obvious without knowledge of the hardware.

The other is that a partially featured driver in the kernel tends to be
a better thing for development than something out of tree - if it's
useful for someone that's great and it provides a starting point for
someone else to come along and add more features.  So long as it's not
causing problems at a subsystem level it's generally better to have it
than not, that way other people can come along and incrementally improve
the driver without having to work out some way of collaborating out of
tree.

You mention DT specifically here - obviously a lot of platforms don't
require DT (only some architectures use it at all) so it can't be a
requirement for drivers and if someone's done the work to get the
hardware working it seems more useful to get that merged and then let
someone who cares about DT add the bindings later.

   * When people try in good faith to conduct methodical boot tests,
 DT is working against them.

 http://www.spinics.net/lists/linux-omap/msg79960.html

  Again I don't see anything particularly related to DT here but instead
  do with using a SoC and board that are in the early phases of mainline
  integration.

 It is ring around the rosie, DT, boot loader, and kernel.

 Understandably, Paul doesn't want to upgrade his boot loader. He says
 he is not interested in testing the boot loader, just the kernel.
 And, if you follow the sage of Paul's test reports, you will find him
 being told to update his boot loader and not to forget the delete old
 dtb files.

 So, like I said, it is a pity PITA.

New systems especially those using new SoCs generally are a pain; had
the issues not mentioned DT they might well have been something else
like missing pinmux in the bootloader, some bit of kernel functionality
not being merged yet or something else.  The flow of discussion there
looks very familiar to me from way before DT was talked about for ARM -
it reminds me a bit of some work I did before even PowerPC adopted DT!


signature.asc
Description: Digital signature


  1   2   3   >