Re: [GPIO]implement sleeping GPIO chip removal

From: Thomas Gleixner
Date: Wed Nov 10 2010 - 04:50:28 EST


On Tue, 9 Nov 2010, Grant Likely wrote:

> On Sun, Nov 07, 2010 at 07:30:33PM +0100, Maciej Szmigiero wrote:
> > [GPIO]implement sleeping GPIO chip removal
> >
> > Existing GPIO chip removal code is only of "non-blocking" type: if the chip is currently
> > requested it just returns -EBUSY.
> > This is bad for devices which disappear and reappear, like those on hot pluggable buses,
> > because it forces the driver to call gpiochip_remove() in loop until it returns 0.
> >
> > This patch implements a new function which sleeps until device is free instead of
> > returning -EBUSY like gpiochip_remove().
> >
> > Signed-off-by: Maciej Szmigiero <mhej@xxxxx>
>
> This patch makes me uncomfortable, but I'm not entirely sure why. Is

Maybe because it open codes a sloppy refcounting with a loop and magic
sleeps instead of converting the code to kobjects and proper
refcounting ?

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/