Skip to content

Commit 4294fd7

Browse files
tq-schiffermrobherring
authored andcommitted
Describe "fail" status for /cpus/cpu* nodes
There are situations where it is desirable to use the same base Device Tree for devices with a different number of CPUs: There may be CPU variants with different numbers of cores that can be used interchangably on the same mainboard, or there are multiple CPU sockets. Not needing to explicitly build a device tree for each such variant can make maintenance significantly easier. For this to work, a system firmware / bootloader needs to adjust the Device Tree by removing or disabling the excess CPU nodes. However, this is currently not easily possible due to the special meaning of the "disabled" status for CPU nodes: - A "disabled" CPU node is interpreted as inactive, but existent. The Linux kernel will attempt to enable such CPUs on boot, which will obviously fail for non-existent CPUs - Removing the CPU node altogether from a Device Tree is much more complex than setting a single property, as it may leave dangling phandle references, often requiring specific knowledge of other nodes' structure to deal with them. In the discussion [1] it was suggested to introduce a new status value for CPUs that should really not be used at all. Rob proposed to use the value "fail", which already exists in the generic definitions of the status property. [1] https://www.lkml.org/lkml/2020/8/26/1237 Suggested-by: Rob Herring <[email protected]> Signed-off-by: Matthias Schiffer <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 13a1a82 commit 4294fd7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

source/chapter3-devicenodes.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,18 @@ standard properties with specific applicable detail.
614614
CPU. This property shall be present for nodes
615615
representing CPUs in a symmetric
616616
multiprocessing (SMP) configuration. For a CPU
617-
node the meaning of the ``"okay"`` and
618-
``"disabled"`` values are as follows:
617+
node the meaning of the ``"okay"``, ``"disabled"``
618+
and ``"fail"`` values are as follows:
619619

620620
``"okay"`` :
621621
The CPU is running.
622622

623623
``"disabled"`` :
624624
The CPU is in a quiescent state.
625625

626+
``"fail"`` :
627+
The CPU is not operational or does not exist.
628+
626629
A quiescent CPU is in a state where it cannot
627630
interfere with the normal operation of other
628631
CPUs, nor can its state be affected by the
@@ -639,6 +642,11 @@ standard properties with specific applicable detail.
639642
loop, held in reset, and electrically isolated
640643
from the system bus or in another
641644
implementation dependent state.
645+
646+
A CPU with ``"fail"`` status does not affect the
647+
system in any way.
648+
The status is assigned to nodes for which no
649+
corresponding CPU exists.
642650
``enable-method`` | SD | ``<stringlist>`` Describes the method by which a CPU in a
643651
disabled state is enabled. This property is
644652
required for CPUs with a status property with

0 commit comments

Comments
 (0)