devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	David Woodhouse <david.woodhouse@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Grant Likely <grant.likely@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Lee Jones <lee.jones@linaro.org>,
	Aaron Lu <aaron.lu@intel.com>
Subject: Re: [RFC PATCH v2 07/16] gpio: Add support for unified device properties interface
Date: Thu, 25 Sep 2014 20:21:32 -0700	[thread overview]
Message-ID: <20140926032131.GC40523@vmdeb7> (raw)
In-Reply-To: <6744174.JquHLt80n3@wuerfel>

On Wed, Sep 24, 2014 at 11:12:36AM +0200, Arnd Bergmann wrote:
> On Tuesday 23 September 2014 14:15:47 Darren Hart wrote:
> > Arnd, I think you meant:
> > 
> >         Return gpio_leds_create_acpi(pdev) ?
> 
> Yes, sorry for the confusion on my part.

Hi Arnd,

No problem, just wanted to make sure I knew what you meant.

> 
> > This is what we did early on to prototype this concept, but the problem
> > with this approach we duplicate all of the creation code, which leads to
> > maintenance errors, and is inconsistent with the goals of the _DSD which
> > is to reuse the same schemas for ACPI and FDT. If we have separate pdata
> > creation functions anyway, we are leaving much of the advantage of the
> > common schema on the table. Namely the ability to reuse drivers relatively
> > easily across firmware implementations. We don't want driver authors to
> > have to care if it's ACPI or FDT.
> 
> I think we are absolutely in agreement about the basic principle here,
> but disagree on how far we'd want to take the abstraction.
> 
> I got a little confused by the leds-gpio example, as I initially saw
> that as generic infrastructure rather than a specific driver. As I just
> wrote in my reply to Rafael, I generally believe we should strive to
> have generic driver-side interfaces so drivers don't have to care,
> but keep the differences in subsystem specific code.
> 
> > We would have preferred to have deprecated the of property interface in
> > favor of the new generic device_property interface, but Grant specifically
> > requested that we update drivers individually rather than all at once,
> > which means we can't just kill the OF interface.
> 
> I don't actually have a strong opinion on that matter, having only the
> device property interface does have some advantages as well, but I also
> agree that we are somewhat better off not having to change all the drivers.
> 
> > We agreed to that, somewhat reluctantly as it adds more work in updating
> > the drivers over time which will slow adoption, but I understand the
> > desire not to make large sweeping changes due to the risk of breaking
> > things inadvertently as we cannot expect to be able to test all of them.
> > That said, I don't want to forget that the goal is to use the common
> > interface over time as we convert individual drivers, and using the common
> > interface means we need a common iterator function and that we not have fw
> > implementation specific pdata create functions.
> 
> I've looked a bit closer at how the LED subsystem handles sub-nodes
> in DT at the moment. It seems that there is some duplication between
> the drivers already, as they all implement a variation of the sub-node
> parsing code.
> 
> There are other non-LED drivers with similar loops, but they seem to be
> either very specialized, or explicitly for DT abstractions, so I'm still
> not convinced we need a generic loop-through-child-nodes-and-parse-properties
> interface.
> 
> How would you feel about a more general way of probing LED, using
> a new helper in the leds-core that iterates over the child nodes
> and parses the standard properties but calls into a driver specific
> callback to parse the specific properties?
> It's probably much more work than your current approach, but it seems
> to me that there is more to gain by solving the problem for LED
> drivers in particular to cut down the per-driver duplication
> at the same time as the per-firmware-interface duplication.
> 
> As a start, we could probably take the proposed device_for_each_child_node
> and move that into the leds-core, changing the fw_dev_node argument
> for an led_classdev with the addition of the of_node and acpi_object
> members. It would still leave it up to the gpio-leds driver to do
> 
> 	if (led_cdev->of_node)
> 		gpiod = devm_of_get_gpiod(led_cdev->of_node, ...);
> 	else
> 		gpiod = devm_acpi_get_gpiod(led_cdev->acpi_object, ...);

So as Mika has pointed out, LEDs aren't the only ones affected. Several drivers
will need to walk through non-device child nodes, and it seems to me that having
a firmware-independent mechanism to do so benefits the drivers by both making
them smaller and by increasing the reusability of new drivers and drivers
updated to use the new API across platforms.

I fear we might be entering bike shed territory as we seem to be repeating
points now. Can you restate your concern with the interface and why this level
of abstraction is worse for the kernel? I'm not seeing this point, so I'm not
sure what to address in my response.

Grant, Linus W? Thoughts?

> 
> but there seems little benefit in abstracting this because there is
> only one driver that needs it.
> 
> 	Arnd
> 

-- 
Darren Hart
Intel Open Source Technology Center

  parent reply	other threads:[~2014-09-26  3:21 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 11:52 [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 01/16] ACPI: Add support for device specific properties Mika Westerberg
2014-10-06 13:50   ` Grant Likely
     [not found]     ` <20141006135021.0EB04C43FBE-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-10-06 14:32       ` Mika Westerberg
2014-10-06 16:25         ` Darren Hart
2014-09-16 11:52 ` [RFC PATCH v2 02/16] Driver core: Unified device properties interface for platform firmware Mika Westerberg
2014-09-17 18:28   ` Greg Kroah-Hartman
2014-09-16 11:52 ` [RFC PATCH v2 03/16] ACPI: Allow drivers to match using Device Tree compatible property Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 04/16] ACPI: Document ACPI device specific properties Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 05/16] mfd: Add ACPI support Mika Westerberg
2014-09-16 21:54   ` Lee Jones
2014-09-24 12:00   ` Lee Jones
2014-09-16 11:52 ` [RFC PATCH v2 06/16] gpio / ACPI: Add support for _DSD device properties Mika Westerberg
2014-09-23 15:27   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 07/16] gpio: Add support for unified device properties interface Mika Westerberg
     [not found]   ` <1410868367-11056-8-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-09-23 15:25     ` Linus Walleij
2014-09-23 15:45       ` Arnd Bergmann
2014-09-23 15:52         ` Mika Westerberg
2014-09-23 16:17           ` Dmitry Torokhov
     [not found]             ` <20140923161724.GA40700-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2014-09-23 20:31               ` Rafael J. Wysocki
2014-09-23 16:25         ` Rafael J. Wysocki
     [not found]           ` <2895905.coa5UvrkJk-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-09-23 16:26             ` Arnd Bergmann
2014-09-23 20:47               ` Rafael J. Wysocki
     [not found]                 ` <1579761.oeYleOAY1N-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-09-24  7:55                   ` Arnd Bergmann
2014-09-24 14:08                     ` Rafael J. Wysocki
2014-09-23 21:15               ` Darren Hart
2014-09-24  9:12                 ` Arnd Bergmann
2014-09-24  9:38                   ` Mika Westerberg
2014-09-24 14:11                     ` Rafael J. Wysocki
2014-09-26  3:21                   ` Darren Hart [this message]
2014-09-26  8:36                     ` Arnd Bergmann
2014-09-26 14:42                       ` Rafael J. Wysocki
2014-10-07 13:37                     ` Linus Walleij
2014-10-07 15:37                       ` Andy Shevchenko
2014-10-07 23:57                       ` Rafael J. Wysocki
2014-09-16 11:52 ` [RFC PATCH v2 08/16] gpio: sch: Consolidate core and resume banks Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 09/16] leds: leds-gpio: Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:18   ` Alexandre Courbot
2014-09-24  7:55   ` Linus Walleij
2014-09-24  9:42     ` Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 10/16] leds: leds-gpio: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 11/16] leds: leds-gpio: Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 12/16] input: gpio_keys_polled - Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:22   ` Alexandre Courbot
2014-09-24  8:02   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 13/16] input: gpio_keys_polled - Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 14/16] input: gpio_keys_polled - Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 15/16] misc: at25: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 16/16] misc: at25: Add ACPI probing support Mika Westerberg
2014-09-21  0:26 ` [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Rafael J. Wysocki
2014-09-24  8:34   ` Lee Jones
2014-09-24  9:45     ` Mika Westerberg
2014-09-22 23:29 ` Bryan Wu
2014-10-01  2:08 ` [PATCH v3 00/15] " Rafael J. Wysocki
2014-10-01  2:08   ` [PATCH v3 01/15] ACPI: Add support for device specific properties Rafael J. Wysocki
2014-10-01  7:38     ` Arnd Bergmann
2014-10-01  2:10   ` [PATCH v3 02/15] Driver core: Unified device properties interface for platform firmware Rafael J. Wysocki
2014-10-01  7:47     ` Arnd Bergmann
2014-10-01 22:09       ` Rafael J. Wysocki
2014-10-01 23:01         ` Rafael J. Wysocki
2014-10-02  7:46         ` Arnd Bergmann
2014-10-02 16:50           ` Rafael J. Wysocki
2014-10-02  0:03     ` Greg Kroah-Hartman
2014-10-01  2:10   ` [PATCH v3 03/15] ACPI: Allow drivers to match using Device Tree compatible property Rafael J. Wysocki
2014-10-01  7:48     ` Arnd Bergmann
2014-10-03 13:43     ` Mark Rutland
2014-10-03 17:59       ` Dmitry Torokhov
2014-10-04  0:02         ` Rafael J. Wysocki
2014-10-01  2:11   ` [PATCH v3 04/15] ACPI: Document ACPI device specific properties Rafael J. Wysocki
2014-10-01  7:59     ` Arnd Bergmann
2014-10-02 10:41       ` Mika Westerberg
2014-10-02 11:51         ` Arnd Bergmann
2014-10-02 12:15           ` Mika Westerberg
2014-10-02 12:46             ` Arnd Bergmann
2014-10-02 13:36               ` Mika Westerberg
2014-10-02 14:29                 ` Arnd Bergmann
2014-10-02 14:38                   ` Mika Westerberg
2014-10-02 14:55                     ` Arnd Bergmann
2014-10-03 13:56                       ` Mark Rutland
2014-10-03 15:02                         ` Arnd Bergmann
2014-10-03 23:58                           ` Rafael J. Wysocki
2014-10-04 10:56                             ` Arnd Bergmann
2014-10-05 21:40                               ` Rafael J. Wysocki
2014-10-03  2:03                 ` Rafael J. Wysocki
2014-10-03  8:12                   ` Mika Westerberg
2014-10-03 13:58                   ` Mark Rutland
2014-10-03 14:38                     ` Rafael J. Wysocki
2014-10-03 14:35                       ` Mark Rutland
2014-10-04  0:13                         ` Rafael J. Wysocki
     [not found]                           ` <6568619.UkU5qISONv-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-10-04 10:59                             ` Arnd Bergmann
2014-10-05 22:26                               ` Rafael J. Wysocki
2014-10-03 13:48             ` Mark Rutland
2014-10-04  0:16               ` Rafael J. Wysocki
2014-10-01  2:12   ` [PATCH v3 05/15] gpio / ACPI: Add support for _DSD device properties Rafael J. Wysocki
     [not found]     ` <4786851.38d7sjpzag-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-10-01  8:03       ` Arnd Bergmann
2014-10-05 10:36         ` Alexandre Courbot
2014-10-05 21:20           ` Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 07/15] gpio: sch: Consolidate core and resume banks Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 08/15] leds: leds-gpio: Add support for GPIO descriptors Rafael J. Wysocki
     [not found]     ` <1490183.QvrzPxsV7q-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-10-01  8:05       ` Arnd Bergmann
2014-10-01  2:16   ` [PATCH v3 09/15] leds: leds-gpio: Make use of device property API Rafael J. Wysocki
2014-10-03 14:07     ` Mark Rutland
2014-10-04  0:18       ` Rafael J. Wysocki
2014-10-01  2:17   ` [PATCH v3 10/15] leds: leds-gpio: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  9:13       ` Mika Westerberg
2014-10-01 10:01         ` Arnd Bergmann
2014-10-01 11:59           ` Mika Westerberg
2014-10-01 13:52             ` Arnd Bergmann
2014-10-01 14:04               ` Mika Westerberg
     [not found]                 ` <20141001140441.GF1786-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2014-10-01 14:14                   ` Arnd Bergmann
2014-10-02  9:55                     ` Mika Westerberg
2014-10-02 10:44                       ` Arnd Bergmann
2014-10-01 16:30       ` Dmitry Torokhov
2014-10-01 18:11         ` Darren Hart
2014-10-01 18:21           ` Dmitry Torokhov
2014-10-01 18:22           ` Arnd Bergmann
2014-10-01  2:17   ` [PATCH v3 11/15] input: gpio_keys_polled - Add support for GPIO descriptors Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  2:20   ` [PATCH v3 12/15] input: gpio_keys_polled - Make use of device property API Rafael J. Wysocki
2014-10-01  2:20   ` [PATCH v3 13/15] input: gpio_keys_polled - Add ACPI probing support Rafael J. Wysocki
2014-10-01  7:48     ` Dmitry Torokhov
2014-10-01  9:15       ` Mika Westerberg
2014-10-01 16:28         ` Dmitry Torokhov
2014-10-02  9:53           ` Mika Westerberg
2014-10-01  2:21   ` [PATCH v3 14/15] misc: at25: Make use of device property API Rafael J. Wysocki
     [not found]     ` <2074642.sV7QBxD3Ne-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-10-01  8:14       ` Arnd Bergmann
     [not found]   ` <1852462.V1jlbi8OPt-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-10-01  2:14     ` [PATCH v3 06/15] gpio: Support for unified device properties interface Rafael J. Wysocki
2014-10-01  2:22     ` [PATCH v3 15/15] misc: at25: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:15       ` Arnd Bergmann

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=20140926032131.GC40523@vmdeb7 \
    --to=dvhart@infradead.org \
    --cc=aaron.lu@intel.com \
    --cc=arnd@arndb.de \
    --cc=cooloney@gmail.com \
    --cc=david.woodhouse@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).