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


Groups > linux.kernel > #1337603 > unrolled thread

[PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered

Started byJavier Martinez Canillas <javier@osg.samsung.com>
First post2016-02-18 19:20 +0100
Last post2016-02-19 05:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered Javier Martinez Canillas <javier@osg.samsung.com> - 2016-02-18 19:20 +0100
    Re: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but  not registered Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-02-19 05:30 +0100
    Re: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but  not registered Andi Shyti <andi.shyti@samsung.com> - 2016-02-19 05:30 +0100

#1337603 — [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-02-18 19:20 +0100
Subject[PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered
Message-ID<r3Blf-16f-7@gated-at.bofh.it>
The driver doesn't check if the regulator_get_optional return value is
-EPROBE_DEFER so it will wrongly assume that the regulator couldn't be
found just because the regulator driver wasn't registered yet, i.e:

exynos-tmu 10060000.tmu: Regulator node (vtmu) not found

In this case the return value should be propagated to allow the driver
probe function to be deferred until the regulator driver is registered.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/thermal/samsung/exynos_tmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index f4f36bba7be9..f3ce94ec73b5 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1318,6 +1318,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 			return ret;
 		}
 	} else {
+		if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
 		dev_info(&pdev->dev, "Regulator node (vtmu) not found\n");
 	}
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1337876 — Re: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2016-02-19 05:30 +0100
SubjectRe: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered
Message-ID<r3KRB-7S9-5@gated-at.bofh.it>
In reply to#1337603
On 19.02.2016 13:20, Andi Shyti wrote:
> Hi Javier,
> 
> Just a question...
> 
>> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
>> index f4f36bba7be9..f3ce94ec73b5 100644
>> --- a/drivers/thermal/samsung/exynos_tmu.c
>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>> @@ -1318,6 +1318,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>>  			return ret;
>>  		}
>>  	} else {
>> +		if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
>> +			return -EPROBE_DEFER;
> 
> shouldn't we return also in case of -ENOMEM? -ENOMEM is a Kernel
> failure, not depending on the regulator itself.

Usually not because that would make this error path quite complicated
and difficult to keep consistent. If you choose this way then you will
have to probably extend the black list (e.g. EINVAL, some other)... or
use a white list.

Additionally the error codes can come from deeper layers. These layer
now can return ESOMETHING but later it might change to EDIFFERENT... you
cannot predict that.

Whatever the reason was (except defer), just ignore the regulator.

Best regards,
Krzysztof

[toc] | [prev] | [next] | [standalone]


#1337877 — Re: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered

FromAndi Shyti <andi.shyti@samsung.com>
Date2016-02-19 05:30 +0100
SubjectRe: [PATCH 3/3] thermal: exynos: Defer probe if vtmu is present but not registered
Message-ID<r3KRB-7S9-7@gated-at.bofh.it>
In reply to#1337603
Hi Javier,

Just a question...

> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index f4f36bba7be9..f3ce94ec73b5 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -1318,6 +1318,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  			return ret;
>  		}
>  	} else {
> +		if (PTR_ERR(data->regulator) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;

shouldn't we return also in case of -ENOMEM? -ENOMEM is a Kernel
failure, not depending on the regulator itself.

Andi

>  		dev_info(&pdev->dev, "Regulator node (vtmu) not found\n");
>  	}

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web