Re: [PATCH 2/3] driver core: Use rwsem for kill_device() serialization

2020-07-31 Thread Lukas Wunner
On Fri, Jul 31, 2020 at 08:45:05AM +0200, Greg Kroah-Hartman wrote: > On Thu, Jul 30, 2020 at 11:56:10AM +0200, Lukas Wunner wrote: > > On Thu, Jul 30, 2020 at 08:53:26AM +0200, Greg Kroah-Hartman wrote: > > > On Wed, Jul 08, 2020 at 03:27:02PM +0200, Lukas Wunner wrote: > > > > kill_device() is cu

Re: [PATCH 2/3] driver core: Use rwsem for kill_device() serialization

2020-07-30 Thread Greg Kroah-Hartman
On Thu, Jul 30, 2020 at 11:56:10AM +0200, Lukas Wunner wrote: > On Thu, Jul 30, 2020 at 08:53:26AM +0200, Greg Kroah-Hartman wrote: > > On Wed, Jul 08, 2020 at 03:27:02PM +0200, Lukas Wunner wrote: > > > kill_device() is currently serialized with driver probing by way of the > > > device_lock(). W

Re: [PATCH 2/3] driver core: Use rwsem for kill_device() serialization

2020-07-30 Thread Lukas Wunner
On Thu, Jul 30, 2020 at 08:53:26AM +0200, Greg Kroah-Hartman wrote: > On Wed, Jul 08, 2020 at 03:27:02PM +0200, Lukas Wunner wrote: > > kill_device() is currently serialized with driver probing by way of the > > device_lock(). We're about to serialize it with device_add() as well > > to prevent ad

Re: [PATCH 2/3] driver core: Use rwsem for kill_device() serialization

2020-07-29 Thread Greg Kroah-Hartman
On Wed, Jul 08, 2020 at 03:27:02PM +0200, Lukas Wunner wrote: > kill_device() is currently serialized with driver probing by way of the > device_lock(). We're about to serialize it with device_add() as well > to prevent addition of children below a device which is going away. Why? Who does this?

[PATCH 2/3] driver core: Use rwsem for kill_device() serialization

2020-07-08 Thread Lukas Wunner
kill_device() is currently serialized with driver probing by way of the device_lock(). We're about to serialize it with device_add() as well to prevent addition of children below a device which is going away. However the parent's device_lock() cannot be taken by device_add() lest deadlocks occur: