lkml.org 
[lkml]   [2013]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpiolib: Fix locking on gpio debugfs files
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@nvidia.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Tested-by: Alexandre Courbot <acourbot@nvidia.com>

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().

Thanks,
Alex.


\
 
 \ /
  Last update: 2013-02-11 05:41    [W:0.052 / U:1.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site