mbox series

[v2,0/5] pinctrl: microchip-sgpio: locking and synchronous output

Message ID 20220226204507.2511633-1-michael@walle.cc
Headers show
Series pinctrl: microchip-sgpio: locking and synchronous output | expand

Message

Michael Walle Feb. 26, 2022, 8:45 p.m. UTC
There are boards which use the output of the SGPIO to drive I2C muxers.
SGPIO right now is broken in a way that when the software sets this bit
there is a rather large delay until that value ends up on the hardware
pin.

While digging into this, I've noticed that there is no locking at all
in this driver. Add locking for all RWM accesses.

Please note, that parts of the modification of the first patch are
removed again in a later patch. This is because the first patch is
intended to be backported to the stable trees.

This was also just tested on a LAN9668 SoC. If you have additional
hardware, please test.

Changes since v1:
 - add Ocelot support

Michael Walle (5):
  pinctrl: microchip-sgpio: lock RMW access
  pinctrl: microchip-sgpio: don't do RMW for interrupt ack register
  pinctrl: microchip-sgpio: use regmap_update_bits()
  pinctrl: microchip-sgpio: return error in spgio_output_set()
  pinctrl: microchip-sgpio: wait until output is actually set

 drivers/pinctrl/pinctrl-microchip-sgpio.c | 112 +++++++++++++++++++---
 1 file changed, 97 insertions(+), 15 deletions(-)

Comments

Linus Walleij March 15, 2022, 12:57 a.m. UTC | #1
On Sat, Feb 26, 2022 at 9:45 PM Michael Walle <michael@walle.cc> wrote:

> There are boards which use the output of the SGPIO to drive I2C muxers.
> SGPIO right now is broken in a way that when the software sets this bit
> there is a rather large delay until that value ends up on the hardware
> pin.
>
> While digging into this, I've noticed that there is no locking at all
> in this driver. Add locking for all RWM accesses.
>
> Please note, that parts of the modification of the first patch are
> removed again in a later patch. This is because the first patch is
> intended to be backported to the stable trees.
>
> This was also just tested on a LAN9668 SoC. If you have additional
> hardware, please test.

Nobody is protesting for three weeks or so, I just applied the patches
for v5.18.

If there are problems we can fix them in the v5.18-rc:s

Yours,
Linus Walleij