Messages in this thread | | | Date | Mon, 31 Mar 2014 14:19:23 +0200 | From | Lars-Peter Clausen <> | Subject | Re: kernfs/rtc: circular dependency between kernfs and ops_lock |
| |
On 03/31/2014 02:03 PM, Alessandro Zummo wrote: > On Mon, 31 Mar 2014 13:07:10 +0200 > Lars-Peter Clausen <lars@metafoo.de> wrote: > >> It doesn't really matter where it is unregistered. device_unregister() will >> (somewhere down it's callchain) take the kernfs lock, hence it must be >> callled with the rtc mutex being held. > > Maybe device_remove_attrs could be called in the rtc base class, > before the device removal? >
Just move the device_unregister() call outside the lock. I think the only thing that needs to be protected is the ops = NULL assignment. Moving the unregister after the unlock also means that the extra get_device()/put_device() pair can be removed.
| |