Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-10 Thread Mark Brown
On Thu, May 09, 2013 at 05:39:03PM +0100, Grant Likely wrote: > +1. You can /minimize/ up-down cycles with the kind of optimization > that is being attempted here, but the driver still *must* deal with > bringing resources back up if they get requested "later than you would > otherwise like".

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-10 Thread Mark Brown
On Thu, May 09, 2013 at 05:39:03PM +0100, Grant Likely wrote: +1. You can /minimize/ up-down cycles with the kind of optimization that is being attempted here, but the driver still *must* deal with bringing resources back up if they get requested later than you would otherwise like. Now that

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:07 Thu 09 May , Russell King - ARM Linux wrote: > On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: > > On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: > > > On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: > > > > > > Even if the driver

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Saravana Kannan
On 05/09/2013 11:09 AM, Grant Likely wrote: On Thu, May 9, 2013 at 5:52 PM, Saravana Kannan wrote: On 05/09/2013 04:50 AM, Grant Likely wrote: On Thu, May 9, 2013 at 11:07 AM, Ming Lei wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan wrote: The most obvious fallback of using

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 5:52 PM, Saravana Kannan wrote: > On 05/09/2013 04:50 AM, Grant Likely wrote: >> >> On Thu, May 9, 2013 at 11:07 AM, Ming Lei wrote: >>> >>> On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan >>> wrote: The most obvious fallback of using late_initcall_sync()

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Saravana Kannan
On 05/09/2013 04:50 AM, Grant Likely wrote: On Thu, May 9, 2013 at 11:07 AM, Ming Lei wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan wrote: The most obvious fallback of using late_initcall_sync() also doesn't work since the deferred probing work initated during late_initcall() is

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 3:14 PM, Russell King - ARM Linux wrote: > On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: >> On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: >> >> > However, if a device that shuts down resources after init has >> > completed and then cannot turn

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 04:07:50PM +0100, Russell King - ARM Linux wrote: > On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: > > That's clearly a "don't do that then" sort of thing; while we don't want > > to be unhelpful there's no guarantees with this approach. > That's not a "don't

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Russell King - ARM Linux
On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: > On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: > > On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: > > > > Even if the driver copes fine it can still be desirable to avoid the > > > power down/up

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: > On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: > > Even if the driver copes fine it can still be desirable to avoid the > > power down/up cycle if it involves some user visible effect - things > > like

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Ming Lei
On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan wrote: > Kernel framework (Eg: regulator, clock, etc) might want to do some clean up > work (Eg: turn off unclaimed resources) after all devices are done probing > during kernel init. Before deferred probing was introduced, this was Generally,

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Russell King - ARM Linux
On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: > On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: > > > However, if a device that shuts down resources after init has > > completed and then cannot turn those resources back on when another > > driver requests them then it

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: > However, if a device that shuts down resources after init has > completed and then cannot turn those resources back on when another > driver requests them then it sounds like there is a bigger design > problem. We're in a hotplug

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 11:07 AM, Ming Lei wrote: > On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan > wrote: >> >> The most obvious fallback of using late_initcall_sync() also doesn't work >> since the deferred probing work initated during late_initcall() is done in >> a workqueue. So,

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Ming Lei
On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan wrote: > > The most obvious fallback of using late_initcall_sync() also doesn't work > since the deferred probing work initated during late_initcall() is done in > a workqueue. So, frameworks that want to wait for all devices to finish > probing

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Ming Lei
On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan skan...@codeaurora.org wrote: The most obvious fallback of using late_initcall_sync() also doesn't work since the deferred probing work initated during late_initcall() is done in a workqueue. So, frameworks that want to wait for all devices to

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 11:07 AM, Ming Lei tom.leim...@gmail.com wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan skan...@codeaurora.org wrote: The most obvious fallback of using late_initcall_sync() also doesn't work since the deferred probing work initated during late_initcall() is

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: However, if a device that shuts down resources after init has completed and then cannot turn those resources back on when another driver requests them then it sounds like there is a bigger design problem. We're in a hotplug world

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Russell King - ARM Linux
On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: However, if a device that shuts down resources after init has completed and then cannot turn those resources back on when another driver requests them then it sounds

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Ming Lei
On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan skan...@codeaurora.org wrote: Kernel framework (Eg: regulator, clock, etc) might want to do some clean up work (Eg: turn off unclaimed resources) after all devices are done probing during kernel init. Before deferred probing was introduced, this

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: Even if the driver copes fine it can still be desirable to avoid the power down/up cycle if it involves some user visible effect - things like blinking the

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Russell King - ARM Linux
On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: Even if the driver copes fine it can still be desirable to avoid the power down/up cycle if

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Mark Brown
On Thu, May 09, 2013 at 04:07:50PM +0100, Russell King - ARM Linux wrote: On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: That's clearly a don't do that then sort of thing; while we don't want to be unhelpful there's no guarantees with this approach. That's not a don't do that

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 3:14 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: On Thu, May 09, 2013 at 12:50:46PM +0100, Grant Likely wrote: However, if a device that shuts down resources after init has completed and then

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Saravana Kannan
On 05/09/2013 04:50 AM, Grant Likely wrote: On Thu, May 9, 2013 at 11:07 AM, Ming Lei tom.leim...@gmail.com wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan skan...@codeaurora.org wrote: The most obvious fallback of using late_initcall_sync() also doesn't work since the deferred probing

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Grant Likely
On Thu, May 9, 2013 at 5:52 PM, Saravana Kannan skan...@codeaurora.org wrote: On 05/09/2013 04:50 AM, Grant Likely wrote: On Thu, May 9, 2013 at 11:07 AM, Ming Lei tom.leim...@gmail.com wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan skan...@codeaurora.org wrote: The most obvious

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Saravana Kannan
On 05/09/2013 11:09 AM, Grant Likely wrote: On Thu, May 9, 2013 at 5:52 PM, Saravana Kannan skan...@codeaurora.org wrote: On 05/09/2013 04:50 AM, Grant Likely wrote: On Thu, May 9, 2013 at 11:07 AM, Ming Lei tom.leim...@gmail.com wrote: On Thu, May 9, 2013 at 1:18 PM, Saravana Kannan

Re: [PATCH 1/3] driver core: Add API to wait for deferred probe to complete during init

2013-05-09 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:07 Thu 09 May , Russell King - ARM Linux wrote: On Thu, May 09, 2013 at 03:37:02PM +0100, Mark Brown wrote: On Thu, May 09, 2013 at 03:14:45PM +0100, Russell King - ARM Linux wrote: On Thu, May 09, 2013 at 02:50:17PM +0100, Mark Brown wrote: Even if the driver copes fine it