public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver core: flush async calls before testing driver removal
@ 2016-12-10  0:15 Vladimir Zapolskiy
  2016-12-10  1:59 ` Dmitry Torokhov
  2016-12-10  7:32 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 10+ messages in thread
From: Vladimir Zapolskiy @ 2016-12-10  0:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring; +Cc: linux-kernel

If CONFIG_DEBUG_TEST_DRIVER_REMOVE option is enabled a number of false
positives are reported for ATA controller drivers, because ATA port
probes are done asynchronously, and the same problem may also touch
other asynchronously probed drivers.

To reduce the rate of false reports on boot call async_synchronize_full()
before attempting to remove a driver, the same is done in delete_module()
syscall for all possible drivers and in __device_release_driver() function
for asynchronously probed drivers.

Fixes: bea5b158ff0d ("driver core: add test of driver remove calls during probe")
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
Some time ago the issue was discussed on the linux-ide mailing list, see

  https://www.spinics.net/lists/linux-ide/msg53481.html

 drivers/base/dd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index d76cd97..a4feecf 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -384,6 +384,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 	if (test_remove) {
 		test_remove = false;
 
+		async_synchronize_full();
+
 		if (dev->bus->remove)
 			dev->bus->remove(dev);
 		else if (drv->remove)
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-12-12 18:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-10  0:15 [PATCH] driver core: flush async calls before testing driver removal Vladimir Zapolskiy
2016-12-10  1:59 ` Dmitry Torokhov
2016-12-10 12:57   ` Vladimir Zapolskiy
2016-12-10  7:32 ` Greg Kroah-Hartman
2016-12-10 12:38   ` Vladimir Zapolskiy
2016-12-10 13:04     ` Greg Kroah-Hartman
2016-12-11  1:44       ` Vladimir Zapolskiy
2016-12-12 17:50         ` Tejun Heo
2016-12-12 18:33           ` Rob Herring
2016-12-12 18:46             ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox