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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWc78KFbBiqynfTF=LrD-rOxsk8EapqzKXP4qcP2nBSXg@mail.gmail.com>
Date:   Mon, 21 Aug 2023 15:18:53 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Rob Herring <robh@...nel.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

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.

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@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ