[PATCH v6 1/4] of: remove *phandle properties from expanded device tree

2017-06-20 Thread frowand . list
From: Frank Rowand Remove "phandle", "linux,phandle", and "ibm,phandle" properties from the internal device tree. The phandle will still be in the struct device_node phandle field and will still be displayed as if it is a property in /proc/device_tree. This is to resolve the issue found by Step

[PATCH v6 4/4] of: detect invalid phandle in overlay

2017-06-20 Thread frowand . list
From: Frank Rowand Overlays are not allowed to modify phandle values of previously existing nodes because there is no information available to allow fixup up properties that use the previously existing phandle. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 4 1 file changed, 4 in

[PATCH v6 3/4] of: be consistent in form of file mode

2017-06-20 Thread frowand . list
From: Frank Rowand checkpatch whined about using S_IRUGO instead of octal equivalent when adding phandle sysfs code, so used octal in that patch. Change other instances of the S_* constants in the same file to the octal form. Signed-off-by: Frank Rowand --- drivers/of/base.c | 2 +- 1 file cha

[PATCH v6 0/4] of: remove *phandle properties from expanded device tree

2017-06-20 Thread frowand . list
From: Frank Rowand Remove "phandle" and "linux,phandle" properties from the internal device tree. The phandle will still be in the struct device_node phandle field and will still be displayed as if it is a property in /proc/device_tree. This is to resolve the issue found by Stephen Boyd [1] whe

[PATCH v6 2/4] of: make __of_attach_node() static

2017-06-20 Thread frowand . list
From: Frank Rowand __of_attach_node() is not used outside of drivers/of/dynamic.c. Make it static and remove it from drivers/of/of_private.h. Signed-off-by: Frank Rowand --- drivers/of/dynamic.c| 2 +- drivers/of/of_private.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH] Documentation: remove overlay-notes reference to non-existent file

2017-06-20 Thread frowand . list
From: Frank Rowand File dt-object-internal.txt does not exist. Remove a reference to it and fix up tags for references to other files. Reported-by: afaer...@suse.de Signed-off-by: Frank Rowand --- Documentation/devicetree/overlay-notes.txt | 8 +++- 1 file changed, 3 insertions(+), 5 dele

[PATCH] dt-bindings: display-timing.txt convert non-ascii characters to ascii

2017-06-20 Thread frowand . list
From: Frank Rowand Convert non-ascii up and down arrows to '^' and 'v' Signed-off-by: Frank Rowand --- .../devicetree/bindings/display/panel/display-timing.txt | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/d

[PATCH] of: make of_fdt_is_compatible() static

2017-06-20 Thread frowand . list
From: Frank Rowand The callers of of_fdt_is_compatible() are all in fdt.c so make it static. Signed-off-by: Frank Rowand --- drivers/of/fdt.c | 2 +- include/linux/of_fdt.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 30

[PATCH] of: fdt.c header comment typo

2017-06-20 Thread frowand . list
From: Frank Rowand Fix typo in header comment for early_init_dt_scan_memory() Signed-off-by: Frank Rowand --- drivers/of/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3080d9dd031d..c053b4f4fbc1 100644 --- a/drivers/of/fdt.c

[PATCH] of: address.c header comment typo

2017-06-20 Thread frowand . list
From: Frank Rowand Fix typo in header comment for of_address_to_resource() Signed-off-by: Frank Rowand --- drivers/of/address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 72914cdfce2a..580bbf6ca2b1 100644 --- a/drivers/

[PATCH] of: make __of_attach_node() static

2017-06-21 Thread frowand . list
From: Frank Rowand __of_attach_node() is not used outside of drivers/of/dynamic.c. Make it static and remove it from drivers/of/of_private.h. Signed-off-by: Frank Rowand --- drivers/of/dynamic.c| 2 +- drivers/of/of_private.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH] of: be consistent in form of file mode

2017-06-21 Thread frowand . list
From: Frank Rowand checkpatch whined about using S_IRUGO instead of octal equivalent when adding phandle sysfs code, so used octal in that pending patch. Change other instances of the S_* constants in the same file to the octal form. Signed-off-by: Frank Rowand --- drivers/of/base.c | 2 +- 1

[PATCH] of: detect invalid phandle in overlay

2017-06-21 Thread frowand . list
From: Frank Rowand Overlays are not allowed to modify phandle values of previously existing nodes because there is no information available to allow fixup up properties that use the previously existing phandle. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 4 1 file changed, 4 in

[PATCH v2 12/12] of: overlay: remove unneeded check for NULL kbasename()

2017-10-16 Thread frowand . list
From: Frank Rowand kbasename() will not return NULL if passed a valid string. If the parameter passed to kbasename() in this case is already NULL then the devicetree has been corrupted. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/d

[PATCH v2 07/12] of: overlay: expand check of whether overlay changeset can be removed

2017-10-16 Thread frowand . list
From: Frank Rowand The test of whether it is safe to remove an overlay changeset looked at whether any node in the overlay changeset was in a subtree rooted at any more recently applied overlay changeset node. The test failed to determine whether any node in the overlay changeset was the root of

[PATCH v2 00/12] of: overlay: clean up device tree overlay code

2017-10-16 Thread frowand . list
From: Frank Rowand I have found the device tree overlay code to be difficult to read and maintain. This patch series attempts to improve that situation. The cleanup includes some changes visible to users of overlays. The only in kernel user of overlays is fixed up for those changes. The in ke

[PATCH v2 11/12] of: overlay: remove a dependency on device node full_name

2017-10-16 Thread frowand . list
From: Frank Rowand The "%pOF" printf format was recently added to print the full name of a device tree node, with the intent of changing the node full_name field to contain only the node name instead of the full path of the node. dup_and_fixup_symbol_prop() duplicates a property from the "/__sym

[PATCH v2 09/12] of: overlay: avoid race condition between applying multiple overlays

2017-10-16 Thread frowand . list
From: Frank Rowand The process of applying an overlay consists of: - unflatten an overlay FDT (flattened device tree) into an EDT (expanded device tree) - fixup the phandle values in the overlay EDT to fit in a range above the phandle values in the live device tree - create the over

[PATCH v2 10/12] of: overlay: simplify applying symbols from an overlay

2017-10-16 Thread frowand . list
From: Frank Rowand The code to apply symbols from an overlay to the live device tree was implemented with the intent to be minimally intrusive on the existing code. After recent restructuring of the overlay apply code, it is easier to disintangle the code that applies the symbols, and to make th

[PATCH v2 03/12] of: overlay: rename identifiers to more reflect what they do

2017-10-16 Thread frowand . list
From: Frank Rowand This patch is aimed primarily at drivers/of/overlay.c, but those changes also have a small impact in a few other files. overlay.c is difficult to read and maintain. Improve readability: - Rename functions, types and variables to better reflect what they do and to be con

[PATCH v2 08/12] of: overlay: loosen overly strict phandle clash check

2017-10-16 Thread frowand . list
From: Frank Rowand When an overlay contains a node that already exists in the live device tree, the overlay node is not allowed to change the phandle of the existing node. The existing check refused to allow an overlay node to set the node phandle even when the existing node did not have a phand

[PATCH v2 06/12] of: overlay: detect cases where device tree may become corrupt

2017-10-16 Thread frowand . list
From: Frank Rowand When an attempt to apply an overlay changeset fails, an effort is made to revert any partial application of the changeset. When an attempt to remove an overlay changeset fails, an effort is made to re-apply any partial reversion of the changeset. The existing code does not che

[PATCH v2 05/12] of: overlay: minor restructuring

2017-10-16 Thread frowand . list
From: Frank Rowand Continue improving the readability of overlay.c. The previous patches renamed identifiers. This patch is split out from the previous patches to make the previous patches easier to review. Changes are: - minor code restructuring - some initialization of an overlay changes

[PATCH v2 01/12] of: overlay.c: Remove comments that state the obvious, to reduce clutter

2017-10-16 Thread frowand . list
From: Frank Rowand Follows recommendations in Documentation/process/coding-style.rst, section 8, Commenting. Some in function comments are promoted to function header comments. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 53 1 fi

[PATCH v2 04/12] of: overlay: rename identifiers in dup_and_fixup_symbol_prop()

2017-10-16 Thread frowand . list
From: Frank Rowand More renaming of identifiers to better reflect what they do. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 397ef10d1f26..c35

[PATCH v2 02/12] of: overlay.c: Convert comparisons to zero or NULL to logical expressions

2017-10-16 Thread frowand . list
From: Frank Rowand Use normal shorthand for comparing a variable to zero. For variable "XXX": convert (XXX == 0) to (!XXX) convert (XXX != 0) to (XXX) Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 36 ++-- 1 file changed, 18 insertions(+), 18 dele

[PATCH v3 00/12] of: overlay: clean up device tree overlay code

2017-10-17 Thread frowand . list
From: Frank Rowand I have found the device tree overlay code to be difficult to read and maintain. This patch series attempts to improve that situation. The cleanup includes some changes visible to users of overlays. The only in kernel user of overlays is fixed up for those changes. The in ke

[PATCH v3 04/12] of: overlay: rename identifiers in dup_and_fixup_symbol_prop()

2017-10-17 Thread frowand . list
From: Frank Rowand More renaming of identifiers to better reflect what they do. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 69610637af88..bb8

[PATCH v3 12/12] of: overlay: remove unneeded check for NULL kbasename()

2017-10-17 Thread frowand . list
From: Frank Rowand kbasename() will not return NULL if passed a valid string. If the parameter passed to kbasename() in this case is already NULL then the devicetree has been corrupted. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/d

[PATCH v3 11/12] of: overlay: remove a dependency on device node full_name

2017-10-17 Thread frowand . list
From: Frank Rowand The "%pOF" printf format was recently added to print the full name of a device tree node, with the intent of changing the node full_name field to contain only the node name instead of the full path of the node. dup_and_fixup_symbol_prop() duplicates a property from the "/__sym

[PATCH v3 10/12] of: overlay: simplify applying symbols from an overlay

2017-10-17 Thread frowand . list
From: Frank Rowand The code to apply symbols from an overlay to the live device tree was implemented with the intent to be minimally intrusive on the existing code. After recent restructuring of the overlay apply code, it is easier to disintangle the code that applies the symbols, and to make th

[PATCH v3 03/12] of: overlay: rename identifiers to more reflect what they do

2017-10-17 Thread frowand . list
From: Frank Rowand This patch is aimed primarily at drivers/of/overlay.c, but those changes also have a small impact in a few other files. overlay.c is difficult to read and maintain. Improve readability: - Rename functions, types and variables to better reflect what they do and to be con

[PATCH v3 09/12] of: overlay: avoid race condition between applying multiple overlays

2017-10-17 Thread frowand . list
From: Frank Rowand The process of applying an overlay consists of: - unflatten an overlay FDT (flattened device tree) into an EDT (expanded device tree) - fixup the phandle values in the overlay EDT to fit in a range above the phandle values in the live device tree - create the over

[PATCH v3 05/12] of: overlay: minor restructuring

2017-10-17 Thread frowand . list
From: Frank Rowand Continue improving the readability of overlay.c. The previous patches renamed identifiers. This patch is split out from the previous patches to make the previous patches easier to review. Changes are: - minor code restructuring - some initialization of an overlay changes

[PATCH v3 07/12] of: overlay: expand check of whether overlay changeset can be removed

2017-10-17 Thread frowand . list
From: Frank Rowand The test of whether it is safe to remove an overlay changeset looked at whether any node in the overlay changeset was in a subtree rooted at any more recently applied overlay changeset node. The test failed to determine whether any node in the overlay changeset was the root of

[PATCH v3 08/12] of: overlay: loosen overly strict phandle clash check

2017-10-17 Thread frowand . list
From: Frank Rowand When an overlay contains a node that already exists in the live device tree, the overlay node is not allowed to change the phandle of the existing node. The existing check refused to allow an overlay node to set the node phandle even when the existing node did not have a phand

[PATCH v3 06/12] of: overlay: detect cases where device tree may become corrupt

2017-10-17 Thread frowand . list
From: Frank Rowand When an attempt to apply an overlay changeset fails, an effort is made to revert any partial application of the changeset. When an attempt to remove an overlay changeset fails, an effort is made to re-apply any partial reversion of the changeset. The existing code does not che

[PATCH v3 02/12] of: overlay.c: Convert comparisons to zero or NULL to logical expressions

2017-10-17 Thread frowand . list
From: Frank Rowand Use normal shorthand for comparing a variable to zero. For variable "XXX": convert (XXX == 0) to (!XXX) convert (XXX != 0) to (XXX) Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 36 ++-- 1 file changed, 18 insertions(+), 18 dele

[PATCH v3 01/12] of: overlay.c: Remove comments that state the obvious, to reduce clutter

2017-10-17 Thread frowand . list
From: Frank Rowand Follows recommendations in Documentation/process/coding-style.rst, section 8, Commenting. Some in function comments are promoted to function header comments. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 47 ++- 1 file ch

[PATCH] Add Frank Rowand to list of enforcement statement endorsers

2017-11-03 Thread frowand . list
From: Frank Rowand Add my name to the list. Signed-off-by: Frank Rowand --- Hi Greg, I noticed that there is a double entry for Ivan Safonov, just below where my name goes. I didn't want to create a merge conflict with this patch, so I'm leaving that alone. Documentation/process/kernel-enf

[PATCH] of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove

2017-10-19 Thread frowand . list
From: Frank Rowand A device tree overlay notifier can return NOTIFY_OK, NOTIFY_STOP, or an embedded errno. overlay_notify() incorrectly reports an error for NOTIFY_OK. Reported-by: at...@kernel.org Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] of: overlay: make pr_err() string unique

2017-10-19 Thread frowand . list
From: Frank Rowand The same error string occurs in drivers/of/resolver.c. Change the error here to more precisely describe this case, and avoid the possible confusion of looking in the wrong source location to understand the cause of an error. Signed-off-by: Frank Rowand --- And yes, I was lo

Re: [PATCH v3] of: dynamic: fix memory leak related to properties of __of_node_dup

2017-10-19 Thread frowand . list
From: Frank Rowand This is Lixin's patch v3, reworded for my preferred style. --- If Lixin agrees, Reviewed-by: Frank Rowand drivers/of/dynamic.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c in

[PATCH] of: overlay: update phandle cache on overlay apply and remove

2018-07-12 Thread frowand . list
From: Frank Rowand A comment in the review of the patch adding the phandle cache said that the cache would have to be updated when modules are applied and removed. This patch implements the cache updates. Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()"

[PATCH] of: cache phandle nodes to decrease cost of of_find_node_by_phandle()

2018-01-31 Thread frowand . list
From: Frank Rowand Create a cache of the nodes that contain a phandle property. Use this cache to find the node for a given phandle value instead of scanning the devicetree to find the node. If the phandle value is not found in the cache, of_find_node_by_phandle() will fall back to the tree sca

[PATCH] of: cache phandle nodes to decrease cost of of_find_node_by_phandle()

2018-01-31 Thread frowand . list
From: Frank Rowand Create a cache of the nodes that contain a phandle property. Use this cache to find the node for a given phandle value instead of scanning the devicetree to find the node. If the phandle value is not found in the cache, of_find_node_by_phandle() will fall back to the tree sca

[PATCH 2/2] of: convert unittest overlay devicetree source to sugar syntax

2018-01-28 Thread frowand . list
From: Frank Rowand The unittest-data overlays have been pulled into proper overlay devicetree source files without changing their format. The next step is to convert them to use sugar syntax instead of hand coding overlay fragments structure. A few of the overlays can not be converted because t

[PATCH 0/2] of: change overlay apply input data from EDT to FDT

2018-01-28 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH 1/2] of: change overlay apply input data from EDT to FDT

2018-01-28 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH 2/2] of: unittest: local return value variable related cleanups

2018-03-08 Thread frowand . list
From: Frank Rowand Several more style issues became apparent while creating "of: unittest: remove unneeded local return value variables". Correct those issues. Signed-off-by: Frank Rowand --- drivers/of/unittest.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) d

[PATCH 1/2] of: unittest: remove unneeded local return value variables

2018-03-08 Thread frowand . list
From: Frank Rowand A common pattern in many unittest functions is to save the return value of a function in a local variable, then test the value of the local variable, without using that return value for any further purpose. Remove the local return value variable for these cases. A second comm

[PATCH] of: add dtc annotations functionality to dtx_diff

2018-11-26 Thread frowand . list
From: Frank Rowand Add -T and --annotations command line arguments to dtx_diff. These arguments will be passed through to dtc. dtc will then add source location annotations to its output. Signed-off-by: Frank Rowand --- This feature depends upon commit 5667e7ef9a9a ("annotations: add the ann

[RFC PATCH] of: overlay: update phandle cache on overlay apply and remove

2018-06-17 Thread frowand . list
From: Frank Rowand A comment in the review of the patch adding the phandle cache said that the cache would have to be updated when modules are applied and removed. This patch implements the cache updates. Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()"

[PATCH] of: overlay: validate offset from property fixups

2018-05-16 Thread frowand . list
From: Frank Rowand The smatch static checker marks the data in offset as untrusted, leading it to warn: drivers/of/resolver.c:125 update_usages_of_a_phandle_reference() error: buffer underflow 'prop->value' 's32min-s32max' Add check to verify that offset is within the property data. Report

[PATCH 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-13 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. Remove the node from the cache. Add paranoia checks in of_find_node_by_phandle() as a second level of def

[PATCH 0/2] of: phandle_cache, fix refcounts, remove stale entry

2018-12-13 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. This bug exposed the foloowing phandle cache refcount bug. The refcount of phandle_cache entries is not i

[PATCH 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-13 Thread frowand . list
From: Frank Rowand The phandle cache contains struct device_node pointers. The refcount of the pointers was not incremented while in the cache, allowing use after free error after kfree() of the node. Add the proper increment and decrement of the use count. Fixes: 0b3ce78e90fc ("of: cache phan

[PATCH v3 0/2] of: phandle_cache, fix refcounts, remove stale entry

2018-12-18 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. This bug exposed the foloowing phandle cache refcount bug. The refcount of phandle_cache entries is not i

[PATCH v3 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-18 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. Remove the node from the cache. Add paranoia checks in of_find_node_by_phandle() as a second level of def

[PATCH v3 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-18 Thread frowand . list
From: Frank Rowand The phandle cache contains struct device_node pointers. The refcount of the pointers was not incremented while in the cache, allowing use after free error after kfree() of the node. Add the proper increment and decrement of the use count. Fixes: 0b3ce78e90fc ("of: cache phan

[PATCH v2 0/2] of: phandle_cache, fix refcounts, remove stale entry

2018-12-16 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. This bug exposed the foloowing phandle cache refcount bug. The refcount of phandle_cache entries is not i

[PATCH v2 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-16 Thread frowand . list
From: Frank Rowand The phandle cache contains struct device_node pointers. The refcount of the pointers was not incremented while in the cache, allowing use after free error after kfree() of the node. Add the proper increment and decrement of the use count. Fixes: 0b3ce78e90fc ("of: cache phan

[PATCH v2 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-16 Thread frowand . list
From: Frank Rowand Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. Remove the node from the cache. Add paranoia checks in of_find_node_by_phandle() as a second level of def

[PATCH v2] of: overlay: user space synchronization

2018-10-15 Thread frowand . list
From: Frank Rowand When an overlay is applied or removed, the live devicetree visible in /proc/device-tree/, aka /sys/firmware/devicetree/base/, reflects the changes. There is no method for user space to determine whether the live devicetree was modified by overlay actions. Provide a sysfs file

[PATCH v4 15/18] of: overlay: set node fields from properties when add new overlay node

2018-10-15 Thread frowand . list
From: Frank Rowand Overlay nodes added by add_changeset_node() do not have the node fields name, phandle, and type set. The node passed to __of_attach_node() when the add node changeset entry is processed does not contain any properties. The node's properties are located in add property changes

[PATCH v4 09/18] of: overlay: validate overlay properties #address-cells and #size-cells

2018-10-15 Thread frowand . list
From: Frank Rowand If overlay properties #address-cells or #size-cells are already in the live devicetree for any given node, then the values in the overlay must match the values in the live tree. If the properties are already in the live tree then there is no need to create a changeset entry to

[PATCH v3] of: overlay: user space synchronization

2018-10-16 Thread frowand . list
From: Frank Rowand When an overlay is applied or removed, the live devicetree visible in /proc/device-tree/, aka /sys/firmware/devicetree/base/, reflects the changes. There is no method for user space to determine whether the live devicetree was modified by overlay actions. Provide a sysfs file

[PATCH] of: overlay: user space synchronization

2018-10-14 Thread frowand . list
From: Frank Rowand When an overlay is applied or removed, the live devicetree visible in /proc/device-tree/, aka /sys/firmware/devicetree/base/, reflects the changes. There is no method for user space to determine whether the live devicetree was modified by overlay actions. Provide a sysfs file

[PATCH] of: overlay: update documentation to match current implementation

2018-10-14 Thread frowand . list
From: Frank Rowand The overlay information in Documentation/devicetree/ is out of date. Signed-off-by: Frank Rowand --- .../devicetree/dynamic-resolution-notes.txt| 24 -- Documentation/devicetree/overlay-notes.txt | 93 ++ 2 files changed, 42 insertions

[PATCH] of: Documentation: remove unmaintained todo file

2018-10-14 Thread frowand . list
From: Frank Rowand The todo.txt file was created by a previous maintainer and has never been updated by the current OPEN FIRMWARE AND FLATTENED DEVICE TREE maintainers. Remove the out of date file. Signed-off-by: Frank Rowand --- Documentation/devicetree/todo.txt | 10 -- 1 file chang

[PATCH v4] of: overlay: user space synchronization

2018-11-02 Thread frowand . list
From: Frank Rowand When an overlay is applied or removed, the live devicetree visible in /proc/device-tree/, aka /sys/firmware/devicetree/base/, reflects the changes. There is no method for user space to determine whether the live devicetree was modified by overlay actions. Provide a sysfs file

[PATCH 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-07 Thread frowand . list
From: Frank Rowand The Devicetree standard specifies an 8 byte alignment of the FDT. Code in libfdt expects this alignment for an FDT image in memory. kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() with kmalloc(), align pointer, memcpy() to get proper alignment. The 4 byte al

[PATCH v2 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread frowand . list
From: Frank Rowand The Devicetree standard specifies an 8 byte alignment of the FDT. Code in libfdt expects this alignment for an FDT image in memory. kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() with kmalloc(), align pointer, memcpy() to get proper alignment. The 4 byte al

[PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread frowand . list
From: Frank Rowand The Devicetree standard specifies an 8 byte alignment of the FDT. Code in libfdt expects this alignment for an FDT image in memory. kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() with kmalloc(), align pointer, memcpy() to get proper alignment. The 4 byte al

[PATCH v4 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread frowand . list
From: Frank Rowand The Devicetree standard specifies an 8 byte alignment of the FDT. Code in libfdt expects this alignment for an FDT image in memory. kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() with kmalloc(), align pointer, memcpy() to get proper alignment. The 4 byte al

[PATCH v4 0/2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle()

2018-02-28 Thread frowand . list
From: Frank Rowand Create a cache of the nodes that contain a phandle property. Use this cache to find the node for a given phandle value instead of scanning the devicetree to find the node. If the phandle value is not found in the cache, of_find_node_by_phandle() will fall back to the tree sca

[PATCH v4 2/2] of: add early boot allocation of of_find_node_by_phandle() cache

2018-02-28 Thread frowand . list
From: Frank Rowand The initial implementation of the of_find_node_by_phandle() cache allocates the cache using kcalloc(). Add an early boot allocation of the cache so it will be usable during early boot. Switch over to the kcalloc() based cache once normal memory allocation becomes available.

[PATCH v4 1/2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle()

2018-02-28 Thread frowand . list
From: Frank Rowand Create a cache of the nodes that contain a phandle property. Use this cache to find the node for a given phandle value instead of scanning the devicetree to find the node. If the phandle value is not found in the cache, of_find_node_by_phandle() will fall back to the tree sca

[PATCH v4 0/4] of: change overlay apply input data from unflattened

2018-03-01 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH v4 2/4] of: Documentation: of_overlay_apply() replaced by of_overlay_fdt_apply()

2018-03-01 Thread frowand . list
From: Frank Rowand Signed-off-by: Frank Rowand --- Documentation/devicetree/overlay-notes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/overlay-notes.txt b/Documentation/devicetree/overlay-notes.txt index c4aa0adf13ec..5175a24d387e 100644

[PATCH v4 4/4] of: improve reporting invalid overlay target path

2018-03-01 Thread frowand . list
From: Frank Rowand Errors while developing the patch to create of_overlay_fdt_apply() exposed inadequate error messages to debug problems when overlay devicetree fragment nodes contain an invalid target path. Improve the messages in find_target_node() to remedy this. Signed-off-by: Frank Rowand

[PATCH v4 1/4] of: change overlay apply input data from unflattened to FDT

2018-03-01 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH v4 3/4] of: convert unittest overlay devicetree source to sugar syntax

2018-03-01 Thread frowand . list
From: Frank Rowand The unittest-data overlays have been pulled into proper overlay devicetree source files without changing their format. The next step is to convert them to use sugar syntax instead of hand coding overlay fragments structure. A few of the overlays can not be converted because t

[PATCH v5 4/4] of: improve reporting invalid overlay target path

2018-03-01 Thread frowand . list
From: Frank Rowand Errors while developing the patch to create of_overlay_fdt_apply() exposed inadequate error messages to debug problems when overlay devicetree fragment nodes contain an invalid target path. Improve the messages in find_target_node() to remedy this. Signed-off-by: Frank Rowand

[PATCH v5 0/4] of: change overlay apply input data from unflattened

2018-03-01 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH v5 1/4] of: change overlay apply input data from unflattened to FDT

2018-03-01 Thread frowand . list
From: Frank Rowand Move duplicating and unflattening of an overlay flattened devicetree (FDT) into the overlay application code. To accomplish this, of_overlay_apply() is replaced by of_overlay_fdt_apply(). The copy of the FDT (aka "duplicate FDT") now belongs to devicetree code, which is thus

[PATCH v5 3/4] of: convert unittest overlay devicetree source to sugar syntax

2018-03-01 Thread frowand . list
From: Frank Rowand The unittest-data overlays have been pulled into proper overlay devicetree source files without changing their format. The next step is to convert them to use sugar syntax instead of hand coding overlay fragments structure. A few of the overlays can not be converted because t

[PATCH v5 2/4] of: Documentation: of_overlay_apply() replaced by of_overlay_fdt_apply()

2018-03-01 Thread frowand . list
From: Frank Rowand Signed-off-by: Frank Rowand --- Documentation/devicetree/overlay-notes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/overlay-notes.txt b/Documentation/devicetree/overlay-notes.txt index c4aa0adf13ec..5175a24d387e 100644

[PATCH] MAINTAINERS: add keyword for devicetree overlay notifiers

2018-04-27 Thread frowand . list
From: Frank Rowand From: Frank Rowand Devicetree overlay notifiers have a chance to potentially get pointers into the overlay unflattened devicetree and overlay FDT. The only protection against these pointers being accessed after the underlying data has been released by kfree() is by source cod

[PATCH v2] MAINTAINERS: add keyword for devicetree overlay notifiers

2018-04-27 Thread frowand . list
From: Frank Rowand Devicetree overlay notifiers have a chance to potentially get pointers into the overlay unflattened devicetree and overlay FDT. The only protection against these pointers being accessed after the underlying data has been released by kfree() is by source code review of patches.

re: [PATCH] of: unittest: Statically apply overlays using fdtoverlay

2021-01-18 Thread frowand . list
From: Frank Rowand These changes apply on top of the patches in: [PATCH] of: unittest: Statically apply overlays using fdtoverlay Message-Id: <1e42183ccafa1afba33b3e79a4e3efd3329fd133.1610095159.git.viresh.ku...@linaro.org> There are still some issues to be cleaned up, so not ready for acc

[PATCH 1/1] of: unittest: rename overlay source files from .dts to .dtso

2021-03-24 Thread frowand . list
From: Frank Rowand Add Makefile rule to build .dtbo.o assembly file from overlay .dtso source file. Rename unittest .dts overlay source files to use .dtso suffix. Update Makefile to build .dtbo.o objects instead of .dtb.o from unittest overlay source files. Modify unitest.c to use .dtbo.o base

[PATCH 1/1] of: properly check for error returned by fdt_get_name()

2021-04-04 Thread frowand . list
From: Frank Rowand fdt_get_name() returns error values via a parameter pointer instead of in function return. Fix check for this error value in populate_node() and callers of populate_node(). Chasing up the caller tree showed callers of various functions failing to initialize the value of point

[PATCH] docs: kernel-doc: typo "if ... if" -> "if ... is"

2019-02-11 Thread frowand . list
From: Frank Rowand "If no *function* if specified" should instead be "If no *function* is specified". Reported-by: Matthew Wilcox Signed-off-by: Frank Rowand --- Documentation/doc-guide/kernel-doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc-guide/

[PATCH RESEND] of: add dtc annotations functionality to dtx_diff

2019-01-17 Thread frowand . list
From: Frank Rowand Add -T and --annotations command line arguments to dtx_diff. These arguments will be passed through to dtc. dtc will then add source location annotations to its output. Signed-off-by: Frank Rowand --- If dtx_diff is provided with a single devicetree source file then that s

[PATCH] docs: kernel-doc: update commands to generate man page

2019-02-01 Thread frowand . list
From: Frank Rowand (1) The command to generate man pages is truncated in the pdf version of the document. Reformat the command into multiple lines to prevent the truncation. (2) Older versions of git do not support all variants of pathspec syntax. Provide commands to generate man pages for var

[PATCH] docs: kernel-doc: typo "documentaion"

2019-02-01 Thread frowand . list
From: Frank Rowand Fix a typo in kernel-doc.rst Signed-off-by: Frank Rowand --- Documentation/doc-guide/kernel-doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst index 450ac634e92e..6513c1

[PATCH 1/2] of: unittest: remove report of expected error

2019-01-24 Thread frowand . list
From: Frank Rowand update_node_properties() reports an error when the test data contains a node (such as "/aliases") that already exists in the base devicetree. The error is caused by of_fdt_unflatten_tree() autogenerating the "name" property, thus both the existing node and the new node will hav

[PATCH 2/2] of: unittest: add caution to function header comment

2019-01-24 Thread frowand . list
From: Frank Rowand Name of function attach_node_and_children() is misleading because if the node already exists in the livetree then only the node's properties are attached. This works for the existing test data, but add comment warning of this misleading name. Signed-off-by: Frank Rowand ---

[PATCH 0/2] of: unittest: minor cleanups

2019-01-24 Thread frowand . list
From: Frank Rowand 1) Suppress expected error message when adding unittest data to livetree. 2) While writing patch 1, noted a misleading function name. Add comment to the function header warning about possible unexpected results. Frank Rowand (2): of: unittest: remove report of expected

  1   2   3   >