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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdar+8qS6r30WwCJBjVuqc16xnruVQa3y1m1rKAnJbcN7Q@mail.gmail.com>
Date: Fri, 20 Dec 2024 14:43:15 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Matthias Schiffer <matthias.schiffer@...tq-group.com>, Mark Brown <broonie@...nel.org>
Cc: Bartosz Golaszewski <brgl@...ev.pl>, linux@...tq-group.com, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] gpio: tqmx86: introduce tqmx86_gpio_clrsetbits() helper

On Tue, Dec 17, 2024 at 4:11 PM Matthias Schiffer
<matthias.schiffer@...tq-group.com> wrote:

> - I introduced a tqmx86_gpio_read() wrapper around regmap_read() to avoid
>   dealing with the indirect value argument all the time for an operation that
>   can't actually fail
> - I also kept the tqmx86_gpio_write() for symmetry (just wrapping regmap_write)

I don't see why we can't add
unsigned in regmap_read_cantfail()
that always just return the value if this is a common problem for people using
regmap MMIO specifically? Could perhaps be restricted to mmio.

Maybe Mark has objections.

> - I introduced a tqmx86_gpio_clrsetbits() wrapper around regmap_update_bits()
>   (having arguments for set and clear was more convenient than mask and value
>    in a few places)

Isn't that what regmap fields are for?
regmap_field_set_bits()
regmap_field_clear_bits()
...
but I can see why that would feel overdesigned, it's not like I don't get
the point.

> - I was still handling locking outside of regmap because we sometimes want to
>   protect a whole sequence of accesses or other driver state

So reg_sequence cannot be used in this case? (Other driver state seems
to imply that.)

> - The TQMx86 GPIO controller has a write-only and a read-only register at the
>   same address, which I understand not to be supported well by regmap (at least
>   if you also want to use a regcache)

Hehe yeah that is a first! I never saw that before.

Thanks for considering anyway, I can live without regmap.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ