* [PATCH 0/3] Fix races on device removal
@ 2020-07-08 12:48 Lukas Wunner
0 siblings, 0 replies; 3+ messages in thread
From: Lukas Wunner @ 2020-07-08 12:48 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Rafael J. Wysocki, Dan Williams, Geert Uytterhoeven,
Pantelis Antoniou, Alexander Duyck, Mark Brown, linux-kernel
Prevent dynamic SPI device addition below a controller which is
being removed. To do so, set the controller's "dead" flag using
kill_device() (patch [3/3]).
Serialize access to a device's "dead" flag with a newly introduced
rw_semaphore in lieu of the device_lock to avoid deadlocks occurring
with the new use case (patch [2/3]).
Add a missing check for the "dead" flag upon driver binding
(patch [1/3]).
Lukas Wunner (3):
driver core: Avoid binding drivers to dead devices
driver core: Use rwsem for kill_device() serialization
driver core: Avoid adding children below a dead parent
drivers/base/base.h | 2 ++
drivers/base/core.c | 47 ++++++++++++++++++++++++++++++++------------
drivers/base/dd.c | 12 ++++++++++-
drivers/nvdimm/bus.c | 8 +-------
drivers/spi/spi.c | 3 +++
5 files changed, 51 insertions(+), 21 deletions(-)
--
2.27.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/3] Fix races on device removal
@ 2020-07-08 13:27 Lukas Wunner
2020-07-30 6:54 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wunner @ 2020-07-08 13:27 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Rafael J. Wysocki, Dan Williams, Geert Uytterhoeven,
Pantelis Antoniou, Alexander Duyck, Mark Brown, linux-kernel,
linux-spi
Prevent dynamic SPI device addition below a controller which is
being removed. To do so, set the controller's "dead" flag using
kill_device() (patch [3/3]).
Serialize access to a device's "dead" flag with a newly introduced
rw_semaphore in lieu of the device_lock to avoid deadlocks occurring
with the new use case (patch [2/3]).
Add a missing check for the "dead" flag upon driver binding
(patch [1/3]).
Lukas Wunner (3):
driver core: Avoid binding drivers to dead devices
driver core: Use rwsem for kill_device() serialization
driver core: Avoid adding children below a dead parent
drivers/base/base.h | 2 ++
drivers/base/core.c | 49 ++++++++++++++++++++++++++++++--------------
drivers/base/dd.c | 12 ++++++++++-
drivers/nvdimm/bus.c | 8 +-------
drivers/spi/spi.c | 3 +++
5 files changed, 51 insertions(+), 23 deletions(-)
--
2.27.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 0/3] Fix races on device removal
2020-07-08 13:27 Lukas Wunner
@ 2020-07-30 6:54 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-07-30 6:54 UTC (permalink / raw)
To: Lukas Wunner
Cc: Rafael J. Wysocki, Dan Williams, Geert Uytterhoeven,
Pantelis Antoniou, Alexander Duyck, Mark Brown, linux-kernel,
linux-spi
On Wed, Jul 08, 2020 at 03:27:00PM +0200, Lukas Wunner wrote:
> Prevent dynamic SPI device addition below a controller which is
> being removed. To do so, set the controller's "dead" flag using
> kill_device() (patch [3/3]).
Why is the SPI bus allowing this to happen? Don't you have a per-bus
lock that can serialize all of this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-30 6:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-08 12:48 [PATCH 0/3] Fix races on device removal Lukas Wunner
-- strict thread matches above, loose matches on Subject: below --
2020-07-08 13:27 Lukas Wunner
2020-07-30 6:54 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox