Skip to content

Commit fe8152b

Browse files
committed
Merge tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull device properties framework updates from Rafael Wysocki: "These update the handling of software nodes and graph properties, and the MAINTAINERS entry for the former. Specifics: - Remove device_add_properties() which does not work correctly if software nodes holding additional device properties are shared or reused (Heikki Krogerus). - Fix nargs_prop property handling for software nodes (Clément Léger). - Update documentation of ACPI device properties (Sakari Ailus). - Update the handling of graph properties in the generic framework to match the DT case (Sakari Ailus). - Update software nodes entry in MAINTAINERS (Andy Shevchenko)" * tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: software node: Update MAINTAINERS data base software node: fix wrong node passed to find nargs_prop device property: Drop fwnode_graph_get_remote_node() device property: Use fwnode_graph_for_each_endpoint() macro device property: Implement fwnode_graph_get_endpoint_count() Documentation: ACPI: Update references Documentation: ACPI: Fix data node reference documentation device property: Fix documentation for FWNODE_GRAPH_DEVICE_DISABLED device property: Fix fwnode_graph_devcon_match() fwnode leak device property: Remove device_add_properties() API driver core: Don't call device_remove_properties() from device_del() PCI: Convert to device_create_managed_software_node()
2 parents fe2437c + 3a571fc commit fe8152b

File tree

11 files changed

+127
-182
lines changed

11 files changed

+127
-182
lines changed

Documentation/firmware-guide/acpi/dsd/data-node-references.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
Referencing hierarchical data nodes
66
===================================
77

8-
:Copyright: |copy| 2018 Intel Corporation
8+
:Copyright: |copy| 2018, 2021 Intel Corporation
99
:Author: Sakari Ailus <[email protected]>
1010

1111
ACPI in general allows referring to device objects in the tree only.
1212
Hierarchical data extension nodes may not be referred to directly, hence this
1313
document defines a scheme to implement such references.
1414

1515
A reference consist of the device object name followed by one or more
16-
hierarchical data extension [1] keys. Specifically, the hierarchical data
17-
extension node which is referred to by the key shall lie directly under the
18-
parent object i.e. either the device object or another hierarchical data
16+
hierarchical data extension [dsd-guide] keys. Specifically, the hierarchical
17+
data extension node which is referred to by the key shall lie directly under
18+
the parent object i.e. either the device object or another hierarchical data
1919
extension node.
2020

2121
The keys in the hierarchical data nodes shall consist of the name of the node,
@@ -33,7 +33,7 @@ extension key.
3333
Example
3434
=======
3535

36-
In the ASL snippet below, the "reference" _DSD property [2] contains a
36+
In the ASL snippet below, the "reference" _DSD property contains a
3737
device object reference to DEV0 and under that device object, a
3838
hierarchical data extension key "node@1" referring to the NOD1 object
3939
and lastly, a hierarchical data extension key "anothernode" referring to
@@ -52,12 +52,14 @@ the ANOD object which is also the final target node of the reference.
5252
Name (NOD0, Package() {
5353
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
5454
Package () {
55+
Package () { "reg", 0 },
5556
Package () { "random-property", 3 },
5657
}
5758
})
5859
Name (NOD1, Package() {
5960
ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
6061
Package () {
62+
Package () { "reg", 1 },
6163
Package () { "anothernode", "ANOD" },
6264
}
6365
})
@@ -74,7 +76,11 @@ the ANOD object which is also the final target node of the reference.
7476
Name (_DSD, Package () {
7577
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
7678
Package () {
77-
Package () { "reference", ^DEV0, "node@1", "anothernode" },
79+
Package () {
80+
"reference", Package () {
81+
^DEV0, "node@1", "anothernode"
82+
}
83+
},
7884
}
7985
})
8086
}
@@ -85,10 +91,6 @@ Documentation/firmware-guide/acpi/dsd/graph.rst.
8591
References
8692
==========
8793

88-
[1] Hierarchical Data Extension UUID For _DSD.
89-
<https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
90-
referenced 2018-07-17.
91-
92-
[2] Device Properties UUID For _DSD.
93-
<https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
94-
referenced 2016-10-04.
94+
[dsd-guide] DSD Guide.
95+
https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
96+
2021-11-30.

Documentation/firmware-guide/acpi/dsd/graph.rst

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Graphs
77
_DSD
88
====
99

10-
_DSD (Device Specific Data) [7] is a predefined ACPI device
10+
_DSD (Device Specific Data) [dsd-guide] is a predefined ACPI device
1111
configuration object that can be used to convey information on
1212
hardware features which are not specifically covered by the ACPI
13-
specification [1][6]. There are two _DSD extensions that are relevant
14-
for graphs: property [4] and hierarchical data extensions [5]. The
13+
specification [acpi]. There are two _DSD extensions that are relevant
14+
for graphs: property [dsd-guide] and hierarchical data extensions. The
1515
property extension provides generic key-value pairs whereas the
1616
hierarchical data extension supports nodes with references to other
1717
nodes, forming a tree. The nodes in the tree may contain properties as
@@ -36,8 +36,9 @@ Ports and endpoints
3636
===================
3737

3838
The port and endpoint concepts are very similar to those in Devicetree
39-
[3]. A port represents an interface in a device, and an endpoint
40-
represents a connection to that interface.
39+
[devicetree, graph-bindings]. A port represents an interface in a device, and
40+
an endpoint represents a connection to that interface. Also see [data-node-ref]
41+
for generic data node references.
4142

4243
All port nodes are located under the device's "_DSD" node in the hierarchical
4344
data extension tree. The data extension related to each port node must begin
@@ -153,25 +154,20 @@ the "ISP" device and vice versa.
153154
References
154155
==========
155156

156-
[1] _DSD (Device Specific Data) Implementation Guide.
157-
https://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,
158-
referenced 2016-10-03.
157+
[acpi] Advanced Configuration and Power Interface Specification.
158+
https://uefi.org/specifications/ACPI/6.4/, referenced 2021-11-30.
159159

160-
[2] Devicetree. https://www.devicetree.org, referenced 2016-10-03.
160+
[data-node-ref] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
161161

162-
[3] Documentation/devicetree/bindings/graph.txt
162+
[devicetree] Devicetree. https://www.devicetree.org, referenced 2016-10-03.
163163

164-
[4] Device Properties UUID For _DSD.
165-
https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
166-
referenced 2016-10-04.
164+
[dsd-guide] DSD Guide.
165+
https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
166+
2021-11-30.
167167

168-
[5] Hierarchical Data Extension UUID For _DSD.
169-
https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
170-
referenced 2016-10-04.
171-
172-
[6] Advanced Configuration and Power Interface Specification.
173-
https://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,
174-
referenced 2016-10-04.
175-
176-
[7] _DSD Device Properties Usage Rules.
168+
[dsd-rules] _DSD Device Properties Usage Rules.
177169
Documentation/firmware-guide/acpi/DSD-properties-rules.rst
170+
171+
[graph-bindings] Common bindings for device graphs (Devicetree).
172+
https://github.com/devicetree-org/dt-schema/blob/main/schemas/graph.yaml,
173+
referenced 2021-11-30.

Documentation/firmware-guide/acpi/dsd/leds.rst

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
Describing and referring to LEDs in ACPI
66
========================================
77

8-
Individual LEDs are described by hierarchical data extension [6] nodes under the
8+
Individual LEDs are described by hierarchical data extension [5] nodes under the
99
device node, the LED driver chip. The "reg" property in the LED specific nodes
1010
tells the numerical ID of each individual LED output to which the LEDs are
11-
connected. [3] The hierarchical data nodes are named "led@X", where X is the
11+
connected. [leds] The hierarchical data nodes are named "led@X", where X is the
1212
number of the LED output.
1313

14-
Referring to LEDs in Device tree is documented in [4], in "flash-leds" property
15-
documentation. In short, LEDs are directly referred to by using phandles.
14+
Referring to LEDs in Device tree is documented in [video-interfaces], in
15+
"flash-leds" property documentation. In short, LEDs are directly referred to by
16+
using phandles.
1617

17-
While Device tree allows referring to any node in the tree[1], in ACPI
18-
references are limited to device nodes only [2]. For this reason using the same
19-
mechanism on ACPI is not possible. A mechanism to refer to non-device ACPI nodes
20-
is documented in [7].
18+
While Device tree allows referring to any node in the tree [devicetree], in
19+
ACPI references are limited to device nodes only [acpi]. For this reason using
20+
the same mechanism on ACPI is not possible. A mechanism to refer to non-device
21+
ACPI nodes is documented in [data-node-ref].
2122

2223
ACPI allows (as does DT) using integer arguments after the reference. A
2324
combination of the LED driver device reference and an integer argument,
@@ -90,22 +91,17 @@ where
9091
References
9192
==========
9293

93-
[1] Device tree. https://www.devicetree.org, referenced 2019-02-21.
94+
[acpi] Advanced Configuration and Power Interface Specification.
95+
https://uefi.org/specifications/ACPI/6.4/, referenced 2021-11-30.
9496

95-
[2] Advanced Configuration and Power Interface Specification.
96-
https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf,
97-
referenced 2019-02-21.
97+
[data-node-ref] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
9898

99-
[3] Documentation/devicetree/bindings/leds/common.txt
99+
[devicetree] Devicetree. https://www.devicetree.org, referenced 2019-02-21.
100100

101-
[4] Documentation/devicetree/bindings/media/video-interfaces.txt
101+
[dsd-guide] DSD Guide.
102+
https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
103+
2021-11-30.
102104

103-
[5] Device Properties UUID For _DSD.
104-
https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
105-
referenced 2019-02-21.
105+
[leds] Documentation/devicetree/bindings/leds/common.yaml
106106

107-
[6] Hierarchical Data Extension UUID For _DSD.
108-
https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
109-
referenced 2019-02-21.
110-
111-
[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
107+
[video-interfaces] Documentation/devicetree/bindings/media/video-interfaces.yaml

Documentation/firmware-guide/acpi/dsd/phy.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
MDIO bus and PHYs in ACPI
55
=========================
66

7-
The PHYs on an MDIO bus [1] are probed and registered using
7+
The PHYs on an MDIO bus [phy] are probed and registered using
88
fwnode_mdiobus_register_phy().
99

1010
Later, for connecting these PHYs to their respective MACs, the PHYs registered
1111
on the MDIO bus have to be referenced.
1212

1313
This document introduces two _DSD properties that are to be used
14-
for connecting PHYs on the MDIO bus [3] to the MAC layer.
14+
for connecting PHYs on the MDIO bus [dsd-properties-rules] to the MAC layer.
1515

1616
These properties are defined in accordance with the "Device
17-
Properties UUID For _DSD" [2] document and the
17+
Properties UUID For _DSD" [dsd-guide] document and the
1818
daffd814-6eba-4d8c-8a91-bc9bbf4aa301 UUID must be used in the Device
1919
Data Descriptors containing them.
2020

@@ -48,22 +48,22 @@ as device object references (e.g. \_SB.MDI0.PHY1).
4848
phy-mode
4949
--------
5050
The "phy-mode" _DSD property is used to describe the connection to
51-
the PHY. The valid values for "phy-mode" are defined in [4].
51+
the PHY. The valid values for "phy-mode" are defined in [ethernet-controller].
5252

5353
managed
5454
-------
5555
Optional property, which specifies the PHY management type.
56-
The valid values for "managed" are defined in [4].
56+
The valid values for "managed" are defined in [ethernet-controller].
5757

5858
fixed-link
5959
----------
6060
The "fixed-link" is described by a data-only subnode of the
6161
MAC port, which is linked in the _DSD package via
6262
hierarchical data extension (UUID dbb8e3e6-5886-4ba6-8795-1319f52a966b
63-
in accordance with [5] "_DSD Implementation Guide" document).
63+
in accordance with [dsd-guide] "_DSD Implementation Guide" document).
6464
The subnode should comprise a required property ("speed") and
6565
possibly the optional ones - complete list of parameters and
66-
their values are specified in [4].
66+
their values are specified in [ethernet-controller].
6767

6868
The following ASL example illustrates the usage of these properties.
6969

@@ -188,12 +188,14 @@ MAC node example with a "fixed-link" subnode.
188188
References
189189
==========
190190

191-
[1] Documentation/networking/phy.rst
191+
[phy] Documentation/networking/phy.rst
192192

193-
[2] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
193+
[dsd-properties-rules]
194+
Documentation/firmware-guide/acpi/DSD-properties-rules.rst
194195

195-
[3] Documentation/firmware-guide/acpi/DSD-properties-rules.rst
196+
[ethernet-controller]
197+
Documentation/devicetree/bindings/net/ethernet-controller.yaml
196198

197-
[4] Documentation/devicetree/bindings/net/ethernet-controller.yaml
198-
199-
[5] https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.pdf
199+
[dsd-guide] DSD Guide.
200+
https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
201+
2021-11-30.

MAINTAINERS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17734,12 +17734,17 @@ F: drivers/firmware/arm_sdei.c
1773417734
F: include/linux/arm_sdei.h
1773517735
F: include/uapi/linux/arm_sdei.h
1773617736

17737-
SOFTWARE NODES
17737+
SOFTWARE NODES AND DEVICE PROPERTIES
1773817738
R: Andy Shevchenko <[email protected]>
17739+
R: Daniel Scally <[email protected]>
1773917740
R: Heikki Krogerus <[email protected]>
17741+
R: Sakari Ailus <[email protected]>
1774017742
1774117743
S: Maintained
17744+
F: drivers/base/property.c
1774217745
F: drivers/base/swnode.c
17746+
F: include/linux/fwnode.h
17747+
F: include/linux/property.h
1774317748

1774417749
SOFTWARE RAID (Multiple Disks) SUPPORT
1774517750
M: Song Liu <[email protected]>

drivers/base/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3581,7 +3581,6 @@ void device_del(struct device *dev)
35813581
device_pm_remove(dev);
35823582
driver_deferred_probe_del(dev);
35833583
device_platform_notify_remove(dev);
3584-
device_remove_properties(dev);
35853584
device_links_purge(dev);
35863585

35873586
if (dev->bus)

0 commit comments

Comments
 (0)