Re: [PATCH-next 07/20] gpio: gpio-omap: simplify omap_gpio_get_direction()

From: Linus Walleij
Date: Wed Jun 12 2019 - 04:52:13 EST


On Mon, Jun 10, 2019 at 7:12 PM Grygorii Strashko
<grygorii.strashko@xxxxxx> wrote:

> From: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
>
> Architectures are single-copy atomic, which means that simply reading
> a register is an inherently atomic operation. There is no need to
> take a spinlock here.
>
> Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@xxxxxx>

Patch applied.

This makes me wonder how many more instances we have
of this kind of mistake in the kernel :/ I guess it is mostly
harmless but it sure makes for massive code complexity.

I would sure like e.g. drivers/gpio/gpio-mmio.c to avoid
taking locks on architectures where this is not a problem
given it is used on a plethora of architectures.

Yours,
Linus Walleij