Re: [GPIO]implement sleeping GPIO chip removal

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Grant Likely
Date: Tuesday, November 9, 2010 - 10:09 pm

On Sun, Nov 07, 2010 at 07:30:33PM +0100, Maciej Szmigiero wrote:

This patch makes me uncomfortable, but I'm not entirely sure why.  Is
there a reason that the process is manipulated directly instead of
using a completion?  Perhaps I'm bother by the joint use of
->dead + ->removing_task that is bothering me.  I need to mull on this
one some more.

Also, comments below...


Not holding spin lock.  Race condition.


race, grab spinlock first.


Drop the commented out printk


There has to be a better way to determine if a chip is still used
without resorting to a loop each and every time through.  At the very
least, this is a duplicate code block from gpiochip_remove which
should be generalized instead of duplicated.

In fact, gpiochip_remove could be called directly here (with some
spin_lock refactoring) and exit the loop if it doesn't return -EBUSY.


remove


remove


Don't open code this.  Generalize the code in gpiochip_remove() instead.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GPIO]implement sleeping GPIO chip removal, Maciej Szmigiero, (Sun Nov 7, 11:30 am)
Re: [GPIO]implement sleeping GPIO chip removal, Grant Likely, (Tue Nov 9, 10:09 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Thomas Gleixner, (Wed Nov 10, 2:49 am)
Re: [GPIO]implement sleeping GPIO chip removal, Maciej Szmigiero, (Wed Nov 10, 8:28 am)
Re: [GPIO]implement sleeping GPIO chip removal, Thomas Gleixner, (Wed Nov 10, 1:42 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Maciej Szmigiero, (Wed Nov 10, 2:01 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Thomas Gleixner, (Wed Nov 10, 2:07 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Grant Likely, (Wed Nov 10, 2:15 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Grant Likely, (Wed Nov 10, 3:14 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Greg KH, (Wed Nov 10, 3:45 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Thomas Gleixner, (Wed Nov 10, 3:47 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Paul Mundt, (Wed Nov 10, 4:15 pm)
Re: [GPIO]implement sleeping GPIO chip removal, Maciej Szmigiero, (Fri Nov 12, 1:46 pm)