lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqLMoUZwacLe-mz1uHd9y7dy-ynS85=9aHARr+jB33K2jA@mail.gmail.com>
Date:   Mon, 21 Aug 2023 14:00:25 -0500
From:   Rob Herring <robh@...nel.org>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Frank Rowand <frowand.list@...il.com>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Petr Mladek <pmladek@...e.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/6] of: Refactor node and property manipulation
 function locking

On Mon, Aug 21, 2023 at 8:19 AM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Rob,
>
> On Fri, Aug 18, 2023 at 10:41 PM Rob Herring <robh@...nel.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@...nel.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.

Yes, good catch.

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

We still take the of_mutex. :) I looked at it some and we're already
not consistent in usage of '__'. Not a great argument I know, but if
we're going to make things consistent I think we should do that
separately for the whole subsys.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ