From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Darren Hart <dvhart@linux.intel.com>,
Grant Likely <grant.likely@secretlab.ca>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Aaron Lu <aaron.lu@intel.com>,
Max Eliaser <max.eliaser@intel.com>,
linux-acpi@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/9] Driver core: Unified device properties interface for platform firmware
Date: Mon, 18 Aug 2014 06:55:03 +0200 [thread overview]
Message-ID: <1838298.HBQHpiQkeW@vostro.rjw.lan> (raw)
In-Reply-To: <D016480B.A1AC8%dvhart@linux.intel.com>
On Sunday, August 17, 2014 12:31:27 PM Darren Hart wrote:
> On 8/17/14, 5:49, "Grant Likely" <grant.likely@secretlab.ca> wrote:
>
> >
> >Hi Mika and Rafael,
> >
> >Comments below...
[cut]
> ...
>
> >> @@ -701,6 +702,7 @@ struct acpi_dev_node {
> >> * @archdata: For arch-specific additions.
> >> * @of_node: Associated device tree node.
> >> * @acpi_node: Associated ACPI device node.
> >> + * @property_ops: Firmware interface for device properties
> >> * @devt: For creating the sysfs "dev".
> >> * @id: device instance
> >> * @devres_lock: Spinlock to protect the resource of the device.
> >> @@ -777,6 +779,7 @@ struct device {
> >>
> >> struct device_node *of_node; /* associated device tree node */
> >> struct acpi_dev_node acpi_node; /* associated ACPI device node */
> >> + struct dev_prop_ops *property_ops;
> >
> >There are only 2 users of this interface. I don't think adding an ops
> >pointer to each and every struct device is warrented when the wrapper
> >function can check if of_node or acpi_node is set and call the
> >appropriate helper. It is unlikely anything else will use this hook. It
> >will result in smaller memory footprint. Also smaller code when only one
> >of
> >CONFIG_OF and CONFIG_ACPI are selected, which is almost always. :-)
> >
> >It can be refactored later if that ever changes.
>
>
> Our intent was to eliminate the #ifdefery in every one of the accessors.
> It was my understanding the ops structures were preferable in such
> situations. For a 64-bit machine with 1000 devices (all of which use
> device properties) with one or the other of ACPI/OF enabled, the
> additional memory requirement here is what... Something like (8*1000 + 4)
> ~= 8KB ? That seems worth the arguably more maintainable code to me. Is
> there more to it than this, am I missing some more significant impact?
Also we wanted to avoid going throug the same sequence of checks every time
a property is accessed for a given device as the result those checks would
lead to every time was already known when the device was registered.
Arguably, if we decide that using DTs and ACPI on the same system at the same
time is a total no-go, then we'll need just one global ops pointer either to
the ACPI or to the DT set of callbacks, but I'm not sure whether or not that
is the way to go.
Rafael
next prev parent reply other threads:[~2014-08-18 4:36 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 6:04 [RFC PATCH 0/9] Add ACPI _DSD and unified device properties support Mika Westerberg
2014-08-17 6:04 ` [RFC PATCH 1/9] ACPI: Add support for device specific properties Mika Westerberg
2014-08-18 8:13 ` Hanjun Guo
2014-08-18 8:27 ` Mika Westerberg
2014-08-18 8:57 ` Hanjun Guo
2014-08-18 12:37 ` Darren Hart
2014-08-17 6:04 ` [RFC PATCH 2/9] ACPI: Document ACPI " Mika Westerberg
2014-08-18 10:54 ` Mark Rutland
2014-08-18 16:05 ` Mika Westerberg
2014-08-19 5:45 ` Darren Hart
2014-08-19 16:51 ` Mark Rutland
2014-08-17 6:04 ` [RFC PATCH 3/9] Driver core: Unified device properties interface for platform firmware Mika Westerberg
2014-08-17 12:49 ` Grant Likely
2014-08-17 17:31 ` Darren Hart
2014-08-18 4:55 ` Rafael J. Wysocki [this message]
2014-08-18 4:46 ` Rafael J. Wysocki
2014-08-17 6:04 ` [RFC PATCH 4/9] of: Add property_ops callback for devices with of_node Mika Westerberg
2014-08-17 12:54 ` Grant Likely
2014-08-18 9:29 ` Mika Westerberg
2014-08-18 12:44 ` Darren Hart
2014-08-18 0:44 ` Rob Herring
2014-08-17 6:04 ` [RFC PATCH 5/9] mfd: Add ACPI support Mika Westerberg
2014-08-28 11:29 ` Lee Jones
2014-08-28 11:45 ` Mika Westerberg
2014-08-17 6:04 ` [RFC PATCH 6/9] gpiolib: add API to get gpio desc and flags Mika Westerberg
2014-08-17 13:00 ` Grant Likely
2014-08-17 17:43 ` Darren Hart
2014-08-18 4:57 ` Rafael J. Wysocki
2014-08-18 7:16 ` Aaron Lu
2014-08-19 15:58 ` Grant Likely
2014-08-17 6:04 ` [RFC PATCH 7/9] gpio: sch: Consolidate core and resume banks Mika Westerberg
2014-08-17 6:04 ` [RFC PATCH 8/9] Input: gpio_keys_polled - Make use of device property API Mika Westerberg
2014-08-17 6:04 ` [RFC PATCH 9/9] leds: leds-gpio: " Mika Westerberg
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=1838298.HBQHpiQkeW@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=aaron.lu@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dvhart@linux.intel.com \
--cc=grant.likely@secretlab.ca \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=max.eliaser@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®