linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver-core: remove lock for platform devices during probe
@ 2017-04-24  5:42 Wei Li
  2017-04-24  7:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Li @ 2017-04-24  5:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, vatsa, Wei Li

During driver probe procedure, lock on the parent of
platform devices could be removed to make probe in
parallel.

Signed-off-by: Wei Li <weili@codeaurora.org>
---
 drivers/base/dd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index a1fbf55..e238fbc 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -25,6 +25,7 @@
 #include <linux/async.h>
 #include <linux/pm_runtime.h>
 #include <linux/pinctrl/devinfo.h>
+#include <linux/platform_device.h>
 
 #include "base.h"
 #include "power/power.h"
@@ -749,13 +750,14 @@ static int __driver_attach(struct device *dev, void *data)
 		return ret;
 	} /* ret > 0 means positive match */
 
-	if (dev->parent)	/* Needed for USB */
+	if (dev->parent &&
+		(dev->bus != &platform_bus_type))	/* Needed for USB */
 		device_lock(dev->parent);
 	device_lock(dev);
 	if (!dev->driver)
 		driver_probe_device(drv, dev);
 	device_unlock(dev);
-	if (dev->parent)
+	if (dev->parent && (dev->bus != &platform_bus_type))
 		device_unlock(dev->parent);
 
 	return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project

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

end of thread, other threads:[~2017-05-02 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24  5:42 [PATCH] driver-core: remove lock for platform devices during probe Wei Li
2017-04-24  7:32 ` Greg Kroah-Hartman
2017-04-24  8:27   ` weili
2017-04-24  8:46     ` Greg Kroah-Hartman
2017-04-25  8:43       ` weili
2017-04-25 11:36         ` Greg Kroah-Hartman
2017-05-02  2:18           ` weili
2017-05-02 18:37             ` 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;
as well as URLs for NNTP newsgroup(s).