diff mbox series

[v2,1/4] soc: samsung: exynos-asv: don't defer early on not-supported SoCs

Message ID 20201207190517.262051-2-krzk@kernel.org
State New
Headers show
Series soc: samsung: exynos-chipid and asv improvements | expand

Commit Message

Krzysztof Kozlowski Dec. 7, 2020, 7:05 p.m. UTC
From: Marek Szyprowski <m.szyprowski@samsung.com>


Check if the SoC is really supported before gathering the needed
resources. This fixes endless deferred probe on some SoCs other than
Exynos5422 (like Exynos5410).

Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---
 drivers/soc/samsung/exynos-asv.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.25.1

Comments

Pankaj Dubey Dec. 8, 2020, 5:56 a.m. UTC | #1
> -----Original Message-----

> From: Krzysztof Kozlowski <krzk@kernel.org>

> Sent: Tuesday, December 8, 2020 12:35 AM

> To: Krzysztof Kozlowski <krzk@kernel.org>; linux-arm-

> kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org; linux-

> kernel@vger.kernel.org

> Cc: Sylwester Nawrocki <snawrocki@kernel.org>; Marek Szyprowski

> <m.szyprowski@samsung.com>; Bartlomiej Zolnierkiewicz

> <b.zolnierkie@samsung.com>; Arnd Bergmann <arnd@arndb.de>; Chanwoo

> Choi <cw00.choi@samsung.com>; Alim Akhtar <alim.akhtar@samsung.com>;

> Pankaj Dubey <pankaj.dubey@samsung.com>; stable@vger.kernel.org

> Subject: [PATCH v2 1/4] soc: samsung: exynos-asv: don't defer early on

not-
> supported SoCs

> 

> From: Marek Szyprowski <m.szyprowski@samsung.com>

> 

> Check if the SoC is really supported before gathering the needed

resources.
> This fixes endless deferred probe on some SoCs other than

> Exynos5422 (like Exynos5410).

> 

> Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage

> driver")

> Cc: <stable@vger.kernel.org>

> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

> ---

>  drivers/soc/samsung/exynos-asv.c | 10 +++++-----

>  1 file changed, 5 insertions(+), 5 deletions(-)

> 

> diff --git a/drivers/soc/samsung/exynos-asv.c

> b/drivers/soc/samsung/exynos-asv.c

> index 8abf4dfaa5c5..f653e3533f0f 100644

> --- a/drivers/soc/samsung/exynos-asv.c

> +++ b/drivers/soc/samsung/exynos-asv.c

> @@ -119,11 +119,6 @@ static int exynos_asv_probe(struct platform_device

> *pdev)

>  	u32 product_id = 0;

>  	int ret, i;

> 

> -	cpu_dev = get_cpu_device(0);

> -	ret = dev_pm_opp_get_opp_count(cpu_dev);

> -	if (ret < 0)

> -		return -EPROBE_DEFER;

> -

>  	asv = devm_kzalloc(&pdev->dev, sizeof(*asv), GFP_KERNEL);

>  	if (!asv)

>  		return -ENOMEM;

> @@ -144,6 +139,11 @@ static int exynos_asv_probe(struct platform_device

> *pdev)

>  		return -ENODEV;

>  	}

> 

> +	cpu_dev = get_cpu_device(0);

> +	ret = dev_pm_opp_get_opp_count(cpu_dev);

> +	if (ret < 0)

> +		return -EPROBE_DEFER;

> +

>  	ret = of_property_read_u32(pdev->dev.of_node, "samsung,asv-

> bin",

>  				   &asv->of_bin);

>  	if (ret < 0)

> --

> 2.25.1


Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Krzysztof Kozlowski Jan. 3, 2021, 4:10 p.m. UTC | #2
On Mon, Dec 07, 2020 at 08:05:14PM +0100, Krzysztof Kozlowski wrote:
> From: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> Check if the SoC is really supported before gathering the needed
> resources. This fixes endless deferred probe on some SoCs other than
> Exynos5422 (like Exynos5410).
> 
> Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/soc/samsung/exynos-asv.c | 10 +++++-----

Thanks, applied.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/soc/samsung/exynos-asv.c b/drivers/soc/samsung/exynos-asv.c
index 8abf4dfaa5c5..f653e3533f0f 100644
--- a/drivers/soc/samsung/exynos-asv.c
+++ b/drivers/soc/samsung/exynos-asv.c
@@ -119,11 +119,6 @@  static int exynos_asv_probe(struct platform_device *pdev)
 	u32 product_id = 0;
 	int ret, i;
 
-	cpu_dev = get_cpu_device(0);
-	ret = dev_pm_opp_get_opp_count(cpu_dev);
-	if (ret < 0)
-		return -EPROBE_DEFER;
-
 	asv = devm_kzalloc(&pdev->dev, sizeof(*asv), GFP_KERNEL);
 	if (!asv)
 		return -ENOMEM;
@@ -144,6 +139,11 @@  static int exynos_asv_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	cpu_dev = get_cpu_device(0);
+	ret = dev_pm_opp_get_opp_count(cpu_dev);
+	if (ret < 0)
+		return -EPROBE_DEFER;
+
 	ret = of_property_read_u32(pdev->dev.of_node, "samsung,asv-bin",
 				   &asv->of_bin);
 	if (ret < 0)