Re: [PATCH] gpiolib: Fix locking on gpio debugfs files

From: Alex Courbot
Date: Sun Feb 10 2013 - 23:26:21 EST

On 02/09/2013 07:34 PM, Grant Likely wrote:
The debugfs files really need to hold the gpiolib spinlock before
accessing the list. Otherwise chip addition/removal will cause an oops.

Cc: Alexandre Courbot <acourbot@xxxxxxxxxx>
Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Grant Likely <grant.likely@xxxxxxxxxxxx>

Tested-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Just wondering: if we manage to change this spinlock into a mutex in the future, wouldn't it be better to acquire it only once in gpiolib_seq_start() and release it in gpiolib_seq_stop()?

Even though the protection introduced by this patch definitely improves the situation, it seems to me that chips could still be removed while being displayed by gpiolib_seq_show().

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at