linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] driver core: Respect all error codes from dev_pm_domain_attach()
@ 2018-05-15  4:46 Guenter Roeck
  2018-05-15  7:59 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2018-05-15  4:46 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel

On Thu, Apr 26, 2018 at 10:53:06AM +0200, Ulf Hansson wrote:
> The limitation of being able to check only for -EPROBE_DEFER from
> dev_pm_domain_attach() has been removed. Hence let's respect all error
> codes and bail out accordingly.
> 

AFAICS this patch causes all drivers/devices to fail instantiating
if dev_pm_domain_set() is called in the device initialization path.
That seems to be a systemic problem, since dev_pm_domain_set() must
only be called for unbound devices.

In practice, I see the problem when trying to boot beagle or overo
with qemu (the Linaro version). Of course, that doesn't mean much
because that is not real hardware. However, I am not surprised that
all devices instantiated through, for example, omap_device_build_from_dt()
fail to instantiate. Instrumentation confirms that dev_pm_domain_set()
is called prior to platform_drv_probe(). 

Guenter

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/base/platform.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 8075ddc70a17..9460139d9b02 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev)
>  		return ret;
>  
>  	ret = dev_pm_domain_attach(_dev, true);
> -	if (ret != -EPROBE_DEFER) {
> -		if (drv->probe) {
> -			ret = drv->probe(dev);
> -			if (ret)
> -				dev_pm_domain_detach(_dev, true);
> -		} else {
> -			/* don't fail if just dev_pm_domain_attach failed */
> -			ret = 0;
> -		}
> +	if (ret)
> +		goto out;
> +
> +	if (drv->probe) {
> +		ret = drv->probe(dev);
> +		if (ret)
> +			dev_pm_domain_detach(_dev, true);
>  	}
>  
> +out:
>  	if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
>  		dev_warn(_dev, "probe deferral not supported\n");
>  		ret = -ENXIO;
> -- 
> 2.7.4

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

* Re: [PATCH] driver core: Respect all error codes from dev_pm_domain_attach()
  2018-05-15  4:46 [PATCH] driver core: Respect all error codes from dev_pm_domain_attach() Guenter Roeck
@ 2018-05-15  7:59 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2018-05-15  7:59 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Linux Kernel Mailing List

On 15 May 2018 at 06:46, Guenter Roeck <linux@roeck-us.net> wrote:
> On Thu, Apr 26, 2018 at 10:53:06AM +0200, Ulf Hansson wrote:
>> The limitation of being able to check only for -EPROBE_DEFER from
>> dev_pm_domain_attach() has been removed. Hence let's respect all error
>> codes and bail out accordingly.
>>
>
> AFAICS this patch causes all drivers/devices to fail instantiating
> if dev_pm_domain_set() is called in the device initialization path.
> That seems to be a systemic problem, since dev_pm_domain_set() must
> only be called for unbound devices.
>
> In practice, I see the problem when trying to boot beagle or overo
> with qemu (the Linaro version). Of course, that doesn't mean much
> because that is not real hardware. However, I am not surprised that
> all devices instantiated through, for example, omap_device_build_from_dt()
> fail to instantiate. Instrumentation confirms that dev_pm_domain_set()
> is called prior to platform_drv_probe().

Your observations are correct, my bad! Others have also reported the problems.

This should solve it:
https://patchwork.kernel.org/patch/10398597/

[...]

Kind regards
Uffe

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

end of thread, other threads:[~2018-05-15  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  4:46 [PATCH] driver core: Respect all error codes from dev_pm_domain_attach() Guenter Roeck
2018-05-15  7:59 ` Ulf Hansson

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).