From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: [PATCH v8 0/6] software node: add support for reference properties
Date: Thu, 7 Nov 2019 20:22:19 -0800 [thread overview]
Message-ID: <20191108042225.45391-1-dmitry.torokhov@gmail.com> (raw)
These series implement "references" properties for software nodes as true
properties, instead of managing them completely separately.
The first 2 patches do away with separate handling of arrays vs
single-value properties, and treat everything as arrays (which really
matches how we handle OF or ACPI properties). Instead we recognize that
data, if it is small enough, may be embedded into property_entry
structure. As a side effect, properties can be converted from having their
data stored separately to embedding their data when they are being copied.
Patch #3 implements PROPERTY_ENTRY_REF() and friends; patch #4 converts
the user of references to the property syntax, and patch #5 removes the
remains of references as entities that are managed separately.
Patch #6 adds unit tests to verify that the handling of property
entries is correct.
Note that patches #4 and $5 can be postponed.
Changes in v8:
- switch data members of "value" union to be arrays to clearly show
that even when embedding we may be dealing with more than one element
- when parsing references use property_entry_read_int_array() instead of
fetching u32 value directly from nargs property
Changes in v7:
- rebased onto next-20191107
- dropped already applied patches
- reworked patch that moved small properties inline on copying to
avoid temporary allocation
- cleaned up logic for embedding vs storing values out-of-line
- fixed handling of embedded 2-element string array on x32
Changes in v6:
- rebased onto next-20191023
- fixed patch moving small properties inline
- fixed handling boolean properties after is_array -> is_inline
conversion
- changed comments around is_inline "stored directly" vs embedded
in one place (Andy)
- added unit tests for property entries based on KUnit framework
- added Any's reviewed-by/acked-by
Changes in v5:
- rebased onto next-20191011
Changes in v4:
- dealt with union aliasing concerns
- inline small properties on copy
Changes in v3:
- added various cleanups before implementing reference properties
Changes in v2:
- reworked code so that even single-entry reference properties are
stored as arrays (i.e. the software_node_ref_args instances are
not part of property_entry structure) to avoid size increase.
From user's POV nothing is changed, one can still use PROPERTY_ENTRY_REF
macro to define reference "inline".
- dropped unused DEV_PROP_MAX
- rebased on linux-next
Dmitry Torokhov (6):
software node: rename is_array to is_inline
software node: allow embedding of small arrays into property_entry
software node: implement reference properties
platform/x86: intel_cht_int33fe: use inline reference properties
software node: remove separate handling of references
software node: add basic tests for property entries
drivers/base/swnode.c | 154 +++---
drivers/base/test/Makefile | 2 +
drivers/base/test/property-entry-test.c | 472 ++++++++++++++++++
.../platform/x86/intel_cht_int33fe_typec.c | 81 +--
include/linux/property.h | 98 ++--
5 files changed, 655 insertions(+), 152 deletions(-)
create mode 100644 drivers/base/test/property-entry-test.c
--
2.24.0.rc1.363.gb1bccd3e3d-goog
next reply other threads:[~2019-11-08 4:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 4:22 Dmitry Torokhov [this message]
2019-11-08 4:22 ` [PATCH v8 1/6] software node: rename is_array to is_inline Dmitry Torokhov
2019-11-08 9:49 ` Rafael J. Wysocki
2019-11-13 6:52 ` Bjørn Mork
2019-11-13 8:08 ` Dmitry Torokhov
[not found] ` <CGME20191212111237eucas1p1a278d2d5d2437e3219896367e82604cc@eucas1p1.samsung.com>
2019-12-12 11:12 ` Marek Szyprowski
2019-12-12 11:28 ` Andy Shevchenko
2019-12-12 16:41 ` Rafael J. Wysocki
2019-12-13 6:47 ` Marek Szyprowski
2019-12-13 8:37 ` Rafael J. Wysocki
2019-12-13 1:24 ` Dmitry Torokhov
2019-12-13 6:44 ` Marek Szyprowski
2019-11-08 4:22 ` [PATCH v8 2/6] software node: allow embedding of small arrays into property_entry Dmitry Torokhov
2019-11-08 4:22 ` [PATCH v8 3/6] software node: implement reference properties Dmitry Torokhov
[not found] ` <CGME20201109170241eucas1p14c2156334d8c6ef15d52664fa4776f41@eucas1p1.samsung.com>
2020-11-09 17:02 ` Lukasz Stelmach
2020-11-09 17:24 ` Andy Shevchenko
[not found] ` <CGME20201109181851eucas1p241de8938e399c0b603c764593b057c41@eucas1p2.samsung.com>
2020-11-09 18:18 ` Lukasz Stelmach
2020-11-09 18:53 ` Dmitry Torokhov
2020-11-09 19:05 ` Andy Shevchenko
2020-11-10 12:39 ` Heikki Krogerus
2020-11-10 12:46 ` Rafael J. Wysocki
[not found] ` <CGME20201109195504eucas1p19d493c947d8752e39c26202cf0978fc0@eucas1p1.samsung.com>
2020-11-09 19:54 ` Lukasz Stelmach
2020-11-09 19:02 ` Andy Shevchenko
[not found] ` <CGME20201109194725eucas1p2cc9357486879a14b2ad2f6ef968ff4b2@eucas1p2.samsung.com>
2020-11-09 19:47 ` Lukasz Stelmach
2020-11-09 21:20 ` Andy Shevchenko
2019-11-08 4:22 ` [PATCH v8 4/6] platform/x86: intel_cht_int33fe: use inline " Dmitry Torokhov
2019-11-08 4:22 ` [PATCH v8 5/6] software node: remove separate handling of references Dmitry Torokhov
2019-11-08 4:22 ` [PATCH v8 6/6] software node: add basic tests for property entries Dmitry Torokhov
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=20191108042225.45391-1-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ard.biesheuvel@linaro.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--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 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.