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-next>] [day] [month] [year] [list]
Message-ID: <CAF3==iuRn2juDJHkqyawxTj7ko0kGMaLdi8QsRpWswKUCS3woA@mail.gmail.com>
Date:   Mon, 31 Dec 2018 00:14:34 +0000
From:   Ben Whitten <benwhitten@...il.com>
To:     Andreas Färber <afaerber@...e.de>,
        Mark Brown <broonie@...nel.org>
Cc:     linux-lpwan@...ts.infradead.org,
        Ben Whitten <Ben.Whitten@...rdtech.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH lora-next] net: lora: sx1301: Fix radio SPI write

+ Mark +linux-kernel
On Sun, 30 Dec 2018 at 08:45, Andreas Färber <afaerber@...e.de> wrote:
>
> When converting to regmap_bus we omitted the write flag,
> rendering all sx125x register writes no-op.
>
> Signed-off-by: Andreas Färber <afaerber@...e.de>
> ---
>  drivers/net/lora/sx130x_radio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/lora/sx130x_radio.c b/drivers/net/lora/sx130x_radio.c
> index 6c94d13cd4db..e7b2df808c1a 100644
> --- a/drivers/net/lora/sx130x_radio.c
> +++ b/drivers/net/lora/sx130x_radio.c
> @@ -9,6 +9,7 @@
>   * Copyright (c) 2013 Semtech-Cycleo
>   */
>
> +#include <linux/bitops.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
>  #include <linux/regmap.h>
> @@ -40,7 +41,7 @@ static int sx1301_regmap_bus_write(void *context, unsigned int reg,
>         ret = regmap_write(priv->regmap, cs, 0);
>         if (ret)
>                 return ret;
> -       ret = regmap_write(priv->regmap, addr, reg);
> +       ret = regmap_write(priv->regmap, addr, BIT(7) | reg);

Curious.
Isn't the (read/write)_flag_mask, set in the regmap_config, a property of
the device connected to the regmap_bus?
I would have expected this to have been applied prior to passing to a
regmap_bus call, surely the bus should only be concerned with transport?

It will work in our case as our current hardware uses 1 in bit 7 but it
will not if we ever see other radios with different masks.

If the regmap_bus provider does need to apply the mask, can we get the
end device regmap_config and apply it from there?
Mark what are your thoughts on the route to take?

Regards,
Ben Whitten

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ