All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: "Dr. H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Mark Rutland <mark.rutland@arm.com>, Pavel Machek <pavel@ucw.cz>,
	List for communicating with real GTA04 owners
	<gta04-owner@goldelico.com>, NeilBrown <neil@brown.name>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sebastian Reichel <sre@kernel.org>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	Jiri Slaby <jslaby@suse.cz>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Gta04-owner] [PATCH 0/3] tty slave device support - version 3.
Date: Thu, 07 May 2015 12:18:30 -0400	[thread overview]
Message-ID: <554B9056.4090904@hurleysoftware.com> (raw)
In-Reply-To: <05A9A4F3-79E8-48B1-B7EC-2C43E9643620@goldelico.com>

On 05/07/2015 11:11 AM, Dr. H. Nikolaus Schaller wrote:
> 
> Am 07.05.2015 um 16:30 schrieb Peter Hurley <peter@hurleysoftware.com>:
> 
>> On 05/07/2015 08:46 AM, Dr. H. Nikolaus Schaller wrote:
>>> Am 06.05.2015 um 19:18 schrieb Mark Rutland <mark.rutland@arm.com>:
>>>> On Wed, May 06, 2015 at 05:09:20PM +0100, Dr. H. Nikolaus Schaller wrote:
>>>>> Am 06.05.2015 um 16:15 schrieb Mark Rutland <mark.rutland@arm.com>:
>>>>>
>>>>>>>>>>> No, I am not playing devil’s advocate (which would imply that I am doing this
>>>>>>>>>>> for fun to tease the dog), but I feel I have to be the advocate of future board
>>>>>>>>>>> designers who want to easily import an existing board DT and overwrite device
>>>>>>>>>>> tree nodes to describe design changes, i.e. what slave device is connected to
>>>>>>>>>>> which uart.
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>>>> If this happens, you can move the slave device into a fragment that you
>>>>>>>> can include under the correct node. That's trivial.
>>>>>>>
>>>>>>> But less readable. And that is important as well.
>>>>>>
>>>>>> I disagree. The manipulation you have to perform to override properties
>>>>>> is at least as bad as including a file.
>>>>>
>>>>> What about:
>>>>>
>>>>> #include "omap3-beagle-xm.dts"
>>>>>
>>>>> / {
>>>>> 	/* HS USB Port 2 Power enable was inverted with the xM C */
>>>>> 	hsusb2_power: hsusb2_power_reg {
>>>>> 		enable-active-high;
>>>>> 	};
>>>>> };
>>>>>
>>>>> compared to 
>>>>>
>>>>> #include “board1.dts”
>>>>>
>>>>> / {
>>>>> 	/* slave was reconnected to uart4 */
>>>>> 	slave {
>>>>> 		uart = <&uart4>;
>>>>> 	};
>>>>> };
>>>>
>>>> As I mentioned, you can easily carve up your DTS to make that work with
>>>> includes if you really must:
>>>>
>>>> /* UART0 board variant */
>>>> #include "board.dtsi"
>>>> &uart0 {
>>>> 	#include "some-uart-slave.dtsi"
>>>> };
>>>>
>>>> /* UART1 board variant */
>>>> #include "board.dtsi"
>>>> &uart1 {
>>>> 	#include "some-uart-slave.dtsi"
>>>> };
>>>>
>>>> If you happen to find includes ugly then you can say it's ugly, but it's
>>>> functionally equivalent, and also means you can avoid having
>>>> disabled/partial nodes all over the place.
>>>
>>> Functionally equivalent would also be to copy the whole source file and
>>> s/&uart0/&uart1/.
>>>
>>> But this is not the best solution for the DT programmer since there is no
>>> automatic *reuse* of common parts.
>>>
>>> And your proposal requires 3 source files instead of 2 which deteriorates
>>> readibility and understanding what is really going on. And if you need to
>>> change the some-uart-slave, you have to touch a different file than for
>>> changing some other slave.
>>>
>>> Yes, it works, but IMHO other factors for a good design are also important.
>>>
>>> Maybe our main difference in PoV is that I specifically want to avoid that
>>> we force future DT programmers into “ugly” solutions (even if they work).
>>>
>>> If you think that DT programmers have to live with what they are
>>> given and do the best with it, we can end the discussion.
>>
>> The question of syntax is orthogonal to the discussion of the proper
>> devicetree representation.
>>
>> The awkwardness of expressing variants has nothing to do with the
>> appropriate device hierarchy (or whether there should be a hierarchy).
>> Describing variants is just as awkward when the parent-child relationship
>> is indisputable.
> 
> That is ok. But I still have not found the key rule when a parent-child relationship
> is indisputable. Candidates so far are “main interface” (which is still disputable)
> or “bus” (where we can dispute if a point-to-point connection is a “bus”).

Actually, at this point there is only one candidate, and that is the code
under review.


> But if both options are equally valid (maybe because there is no rule
> making either indisputable), I would chose the one with easier syntax.

There are many important criteria here.

1. Code complexity
2. Ease of adoption
3. Quality of abstraction
4. Extensibility

>> There was a recent discussion on devicetree ML regarding how best to
>> express and represent variance. Feel free to revive that discussion.
> 
> Does it help? Our core issue is not the syntax and variance per se. This are
> just examples to demonstrate differences in syntax of parent-child vs. phandle.
> 
> If we decide for either one, we have to live with syntactical and other
> implcationd.

The future implications of both the design and implementation need
careful consideration. That's why I'd like to see a v4.

Regards,
Peter Hurley

  reply	other threads:[~2015-05-07 16:18 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  5:58 [PATCH 0/3] tty slave device support - version 3 NeilBrown
2015-03-18  5:58 ` [PATCH 3/3] tty/slaves: add a driver to power on/off UART attached devices NeilBrown
     [not found]   ` <20150318055831.21025.33670.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-03-20  7:54     ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2015-03-20  7:54       ` Dr. H. Nikolaus Schaller
     [not found]       ` <C53A3E5D-5AEA-4F0F-88A9-F9BC8CB0D0D6-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-03-20  8:54         ` NeilBrown
2015-03-20  8:54           ` NeilBrown
2015-03-20  9:34           ` Dr. H. Nikolaus Schaller
     [not found]             ` <14FB51CF-9568-4BF4-B917-2C019D992FDB-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-03-20 19:50               ` Pavel Machek
2015-03-20 19:50                 ` Pavel Machek
2015-03-20 23:31             ` NeilBrown
2015-03-24 17:58               ` Dr. H. Nikolaus Schaller
2015-03-25  1:45                 ` Sebastian Reichel
2015-03-25  7:59                   ` Dr. H. Nikolaus Schaller
2015-03-25 15:21                     ` Sebastian Reichel
2015-03-25 16:44                       ` Dr. H. Nikolaus Schaller
2015-03-26 18:08                         ` Sebastian Reichel
2015-03-27  9:22                           ` Dr. H. Nikolaus Schaller
2015-03-27 16:31                             ` Sebastian Reichel
2015-03-27 17:11                               ` Dr. H. Nikolaus Schaller
2015-04-27 20:35                                 ` Pavel Machek
2015-04-29  6:56                                   ` Dr. H. Nikolaus Schaller
2015-03-25 20:53                     ` Pavel Machek
2015-03-25 21:25                       ` Dr. H. Nikolaus Schaller
2015-03-25 21:25                         ` Dr. H. Nikolaus Schaller
     [not found]                         ` <1F3B5E32-1330-457C-AE25-791319293C38-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-03-26  5:56                           ` Pavel Machek
2015-03-26  5:56                             ` Pavel Machek
2015-03-26  6:44                             ` Dr. H. Nikolaus Schaller
     [not found]                               ` <365B2C25-1782-4ADE-B620-190A4CC5E8E3-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-04-04  7:52                                 ` Pavel Machek
2015-04-04  7:52                                   ` Pavel Machek
2015-03-25 20:42                 ` Pavel Machek
2015-03-25 21:22                   ` Dr. H. Nikolaus Schaller
2015-03-25 21:22                     ` Dr. H. Nikolaus Schaller
2015-03-18  5:58 ` [PATCH 2/3] TTY: add support for tty_slave devices NeilBrown
2015-03-18  9:11   ` Paul Bolle
2015-03-22  3:32     ` NeilBrown
2015-03-20 19:41   ` Pavel Machek
2015-03-22  3:42     ` [Gta04-owner] " NeilBrown
     [not found]       ` <20150322144209.14abc603-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-03-22  7:58         ` Pavel Machek
2015-03-22  7:58           ` Pavel Machek
2015-03-24 10:31   ` Jiri Slaby
2015-03-30 23:45     ` NeilBrown
2015-03-25 16:30   ` Peter Hurley
2015-03-25 21:17     ` [Gta04-owner] " NeilBrown
2015-03-27 11:09       ` Peter Hurley
2015-03-31  0:33         ` NeilBrown
2015-03-18  5:58 ` [PATCH 1/3] TTY: use class_find_device to find port in uart_suspend/resume NeilBrown
     [not found]   ` <20150318055831.21025.27864.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-03-25 16:20     ` Peter Hurley
2015-03-25 16:20       ` Peter Hurley
2015-03-29 21:49       ` [Gta04-owner] " NeilBrown
2015-03-20  7:54 ` [Gta04-owner] [PATCH 0/3] tty slave device support - version 3 Dr. H. Nikolaus Schaller
     [not found]   ` <80D7E742-4633-4CCD-B754-221387D82922-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-03-20  8:43     ` NeilBrown
2015-03-20  8:43       ` NeilBrown
2015-03-20  8:54       ` Dr. H. Nikolaus Schaller
2015-03-20 13:08         ` Sebastian Reichel
2015-03-20 13:57           ` Dr. H. Nikolaus Schaller
     [not found]             ` <72268D51-F993-497A-B4F9-707C8DB7155C-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-03-20 17:14               ` Sebastian Reichel
2015-03-20 17:14                 ` Sebastian Reichel
2015-03-20 19:31 ` Pavel Machek
     [not found] ` <20150318055437.21025.13990.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-05-05 19:54   ` Peter Hurley
2015-05-05 19:54     ` Peter Hurley
2015-05-05 20:46     ` NeilBrown
     [not found]     ` <55492001.30806-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2015-05-06  5:19       ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2015-05-06  5:19         ` Dr. H. Nikolaus Schaller
     [not found]         ` <DE60E7AA-1BF4-4A68-9638-E09F85FD5C72-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-05-06  9:27           ` Pavel Machek
2015-05-06  9:27             ` Pavel Machek
2015-05-06 11:50             ` Dr. H. Nikolaus Schaller
2015-05-06 11:50               ` Dr. H. Nikolaus Schaller
2015-05-06 12:05               ` Peter Hurley
2015-05-06 12:27                 ` Dr. H. Nikolaus Schaller
2015-05-06 12:27                   ` Dr. H. Nikolaus Schaller
2015-05-06 12:36                   ` Mark Rutland
2015-05-06 13:28                     ` Dr. H. Nikolaus Schaller
2015-05-06 13:28                       ` Dr. H. Nikolaus Schaller
2015-05-06 14:15                       ` Mark Rutland
2015-05-06 16:09                         ` Dr. H. Nikolaus Schaller
2015-05-06 17:18                           ` Mark Rutland
2015-05-07 12:46                             ` Dr. H. Nikolaus Schaller
2015-05-07 12:46                               ` Dr. H. Nikolaus Schaller
2015-05-07 14:30                               ` Peter Hurley
2015-05-07 15:11                                 ` Dr. H. Nikolaus Schaller
2015-05-07 16:18                                   ` Peter Hurley [this message]
2015-05-07 16:57                                     ` Dr. H. Nikolaus Schaller
     [not found]                               ` <B4D487C5-C260-497B-A441-6C381D53616C-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-05-07 14:56                                 ` Peter Hurley
2015-05-07 14:56                                   ` Peter Hurley
     [not found]                                   ` <554B7D33.602-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2015-05-07 15:34                                     ` Dr. H. Nikolaus Schaller
2015-05-07 15:34                                       ` Dr. H. Nikolaus Schaller
2015-05-07 15:51                                       ` Peter Hurley
2015-05-07 16:46                                         ` Dr. H. Nikolaus Schaller
2015-05-13  8:09                                           ` Dr. H. Nikolaus Schaller
2015-06-03 11:49                                             ` [PATCH RFC 0/3] UART slave device support Dr. H. Nikolaus Schaller
     [not found]                                               ` <56C579D3-E8F8-4B5A-B6E8-993B113F3461-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-06-06 13:09                                                 ` Pavel Machek
2015-06-06 13:09                                                   ` Pavel Machek
     [not found]                                             ` <463356C5-E3C6-432C-A1C5-71F0287F1FEE@goldelico.com>
2015-06-03 12:09                                               ` [Gta04-owner] [PATCH RFC 3/3] misc: Add w2g0004 gps receiver driver Christ van Willegen
2015-05-07 15:37                       ` [Gta04-owner] [PATCH 0/3] tty slave device support - version 3 Peter Hurley
     [not found]               ` <A2594559-CA92-40C2-A06A-AC2483E85CB1-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-05-06 14:28                 ` Pavel Machek
2015-05-06 14:28                   ` Pavel Machek
2015-05-06 16:12                   ` Dr. H. Nikolaus Schaller
     [not found]                     ` <C68A105A-7147-4143-9B91-1A239726A780-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2015-06-06 13:09                       ` Pavel Machek
2015-06-06 13:09                         ` Pavel Machek
2015-06-06 18:53                         ` Belisko Marek
2015-06-06 18:55                           ` Belisko Marek
2015-05-07 15:48           ` Rob Herring
2015-05-07 15:48             ` Rob Herring
2015-05-06 11:10         ` Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554B9056.4090904@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gta04-owner@goldelico.com \
    --cc=hns@goldelico.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=neil@brown.name \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.