[v3,0/6] dt: changeset fixes and cleanups

Message ID 20230801-dt-changeset-fixes-v3-0-5f0410e007dd@kernel.org
Headers
Series dt: changeset fixes and cleanups |

Message

Rob Herring Aug. 18, 2023, 8:40 p.m. UTC
  Geert's locking fix[1] prompted my closer look at 
__of_changeset_entry_apply() and related functions. The result is a 
couple of fixes I found and some refactoring that unifies the "old 
dynamic API" and the changeset API implementations.

[1] https://lore.kernel.org/all/c593d8389352c574b5be69d4ca4810da13326a50.1690533838.git.geert+renesas@glider.be/

Signed-off-by: Rob Herring <robh@kernel.org>
---
Changes in v3:
- Drop print changeset entry pointers
- Add bounds check for action value
- Further rework deadprops helper to remove a property from either list
- Keep existing style for deadprops loop
- Link to v2: https://lore.kernel.org/r/20230801-dt-changeset-fixes-v2-0-c2b701579dee@kernel.org

Changes in v2:
- Rework debug printing to fix issues with pr_debug() not having a 
  return value with dynamic debug
- Split action print refactoring into separate patch from fix
- Make removing property from deadprops a helper function
- Rework __of_add_property()/__of_update_property() exit code
- Link to v1: https://lore.kernel.org/r/20230801-dt-changeset-fixes-v1-0-b5203e3fc22f@kernel.org

---
Rob Herring (6):
      of: unittest: Fix EXPECT for parse_phandle_with_args_map() test
      of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock
      of: dynamic: Refactor changeset action printing to common helpers
      of: dynamic: Fix race in getting old property when updating property
      of: dynamic: Move dead property list check into property add/update functions
      of: Refactor node and property manipulation function locking

 drivers/of/base.c     |  92 +++++++++++++++++-------------
 drivers/of/dynamic.c  | 153 +++++++++++---------------------------------------
 drivers/of/unittest.c |   4 +-
 3 files changed, 88 insertions(+), 161 deletions(-)
---
base-commit: 66a4210bc82e024e6de0f94298ad9230984a5924
change-id: 20230801-dt-changeset-fixes-b76b88fecc43

Best regards,
  

Comments

Geert Uytterhoeven Aug. 21, 2023, 12:09 p.m. UTC | #1
Hi Rob,

Thanks for the update!

On Fri, Aug 18, 2023 at 10:41 PM Rob Herring <robh@kernel.org> wrote:
> Several places print the changeset action with node and property
> details. Refactor these into a common printing helper. The complicating
> factor is some prints are debug and some are errors. Solve this with a
> bit of preprocessor magic.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> v3:
>  - Drop printing changeset entry pointers

I think it would be good to mention this in the actual patch
description, too.

> --- a/drivers/of/dynamic.c
> +++ b/drivers/of/dynamic.c

> @@ -598,7 +568,7 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce)
>         unsigned long flags;
>         int ret = 0;
>
> -       __of_changeset_entry_dump(ce);
> +       of_changeset_action_debug("applying: ", ce->action, ce->np, ce->prop);

s/applying/apply/ ?

The rest LGTM, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert