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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Nov 2017 11:07:23 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Baolin Wang <baolin.wang@...aro.org>
Cc:     Lee Jones <lee.jones@...aro.org>, Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Mark Brown <broonie@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        DTML <devicetree@...r.kernel.org>
Subject: Re: [PATCH v3] mfd: syscon: Add hardware spinlock support

On Mon, Nov 20, 2017 at 7:54 AM, Baolin Wang <baolin.wang@...aro.org> wrote:
> Some system control registers need hardware spinlock to synchronize
> between the multiple subsystems, so we should add hardware spinlock
> support for syscon.
>

> @@ -87,6 +88,12 @@ static struct syscon *of_syscon_register(struct device_node *np)
>         if (ret)
>                 reg_io_width = 4;
>
> +       ret = of_hwspin_lock_get_id(np, 0);
> +       if (ret > 0) {
> +               syscon_config.hwlock_id = ret;
> +               syscon_config.hwlock_mode = HWLOCK_IRQSTATE;
> +       }

Hi Baolin,

The error handling here seems insufficient, I think we have to treat
the following cases separately:

- ret>0 (this is fine)
- no spinlock in DT: of_hwspin_lock_get_id currently returns -EINVAL,
  we probably want to use a different return code (maybe -ESRCH ?)
  here so we can tell the difference beween no spinlock, and an
  invalid spinlock
- deferred probing: if the spinlock is there but the driver is not
  yet available, we may need to propagate the -EPROBE_DEFER
  here
- other error: this would probably be a fatal condition here, and
  we should print a warning and clean up.

       Arnd

Powered by blists - more mailing lists