Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629293

Re: [PATCH] driver-core: remove lock for platform devices during probe

From weili@codeaurora.org
Newsgroups linux.kernel
Subject Re: [PATCH] driver-core: remove lock for platform devices during probe
Date 2017-04-24 10:30 +0200
Message-ID <tzHxD-4Ds-5@gated-at.bofh.it> (permalink)
References <tzF2O-2W0-17@gated-at.bofh.it> <tzGLg-45f-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Greg,

    We are optimizing boot time for Linux kernel and try to make some 
platform drivers use asynchronous probe(by changing probe type of driver 
to PROBE_PREFER_ASYNCHRONOUS) to reduce boot time. However we found the 
platform drivers did not probe in parallel because they will lock the 
same parent device(platform bus for platform drivers) during probe.  So 
we add this patch to remove lock of parent for platform device. This 
will help to make platform driver probe in parallel and reduce boot 
time.


Best Regards
Wei


On 2017-04-24 15:32, Greg Kroah-Hartman wrote:
> On Mon, Apr 24, 2017 at 01:42:16PM +0800, Wei Li wrote:
>> 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>
> 
> Why?  Why does this matter?
> 
>> ---
>>  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 */
> 
> The platform_bus_type check is not needed by USB, right?
> 
> thanks,
> 
> greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] driver-core: remove lock for platform devices during probe Wei Li <weili@codeaurora.org> - 2017-04-24 07:50 +0200
  Re: [PATCH] driver-core: remove lock for platform devices during  probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-24 09:40 +0200
    Re: [PATCH] driver-core: remove lock for platform devices during  probe weili@codeaurora.org - 2017-04-24 10:30 +0200
      Re: [PATCH] driver-core: remove lock for platform devices during  probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-24 10:50 +0200

csiph-web