[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 6 Jun 2008 09:52:00 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Leon Woestenberg <leon.woestenberg@...il.com>
Cc: LAK <linux-arm-kernel@...ts.arm.linux.org.uk>,
Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: Locking in the (now generic) GPIO infrastructure?
On Wed, Jun 04, 2008 at 01:00:19PM +0200, Leon Woestenberg wrote:
> include/asm-arm/arch-ixp4xx/platform.h:
> static inline void gpio_line_set(u8 line, int value)
> {
> if (value == IXP4XX_GPIO_HIGH)
> *IXP4XX_GPIO_GPOUTR |= (1 << line);
> else if (value == IXP4XX_GPIO_LOW)
> *IXP4XX_GPIO_GPOUTR &= ~(1 << line);
> }
>
> Under a Linux kernel where multiple drivers are accessing GPIO, the
> latter does not seem safe against preemption (assuming the memory
> read-modify-write is not atomic).
or even interrupts.
> Shouldn't GPIO access be protected against concurrent access here?
Definitely. It's certainly buggy as currently stands.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists