lkml.org 
[lkml]   [2023]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v3 6/6] of: Refactor node and property manipulation function locking
    Hi Rob,

    On Fri, Aug 18, 2023 at 10:41 PM Rob Herring <robh@kernel.org> wrote:
    > All callers of __of_{add,remove,update}_property() and
    > __of_{attach,detach}_node() wrap the call with the devtree_lock
    > spinlock. Let's move the spinlock into the functions. This allows moving
    > the sysfs update functions into those functions as well.
    >
    > Signed-off-by: Rob Herring <robh@kernel.org>
    > ---
    > v3:
    > - Rebase due to changes in prior patch

    Thanks for your patch!

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

    > @@ -1576,37 +1587,36 @@ int __of_add_property(struct device_node *np, struct property *prop)
    > */
    > int of_add_property(struct device_node *np, struct property *prop)
    > {
    > - unsigned long flags;
    > int rc;
    >
    > mutex_lock(&of_mutex);
    > -
    > - raw_spin_lock_irqsave(&devtree_lock, flags);
    > rc = __of_add_property(np, prop);
    > - raw_spin_unlock_irqrestore(&devtree_lock, flags);
    > -
    > - if (!rc)
    > - __of_add_property_sysfs(np, prop);
    > -
    > mutex_unlock(&of_mutex);
    >
    > - if (!rc)
    > - of_property_notify(OF_RECONFIG_ADD_PROPERTY, np, prop, NULL);

    The notify block should be kept.

    The rest LGTM, although I have some second thoughts about more
    functions with a double underscore now taking devtree_lock().

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But
    when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    \
     
     \ /
      Last update: 2023-08-21 15:19    [W:3.011 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site