[PATCH] media: venus: drop bogus probe deferrals

Johan Hovold posted 1 patch 3 months, 3 weeks ago
drivers/media/platform/qcom/venus/vdec.c | 5 +----
drivers/media/platform/qcom/venus/venc.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
[PATCH] media: venus: drop bogus probe deferrals
Posted by Johan Hovold 3 months, 3 weeks ago
The encoder and decoder platform devices are registered by the venus
driver as children of the venus device, but even if someone were to mess
this up no amount of probe deferring is going to conjure up a parent.

Relatedly, the venus driver sets its driver data before registering the
child devices and if this ever breaks we want to learn about it by
failing probe.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/media/platform/qcom/venus/vdec.c | 5 +----
 drivers/media/platform/qcom/venus/venc.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 55c27345b7d8..2d822ad86dce 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1778,12 +1778,9 @@ static int vdec_probe(struct platform_device *pdev)
 	struct venus_core *core;
 	int ret;
 
-	if (!dev->parent)
-		return -EPROBE_DEFER;
-
 	core = dev_get_drvdata(dev->parent);
 	if (!core)
-		return -EPROBE_DEFER;
+		return -EINVAL;
 
 	platform_set_drvdata(pdev, core);
 
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index fba07557a399..f1abd2bdce6b 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -1560,12 +1560,9 @@ static int venc_probe(struct platform_device *pdev)
 	struct venus_core *core;
 	int ret;
 
-	if (!dev->parent)
-		return -EPROBE_DEFER;
-
 	core = dev_get_drvdata(dev->parent);
 	if (!core)
-		return -EPROBE_DEFER;
+		return -EINVAL;
 
 	platform_set_drvdata(pdev, core);
 
-- 
2.49.1
Re: [PATCH] media: venus: drop bogus probe deferrals
Posted by Vikash Garodia 3 months, 1 week ago
On 10/17/2025 11:28 AM, Johan Hovold wrote:
> The encoder and decoder platform devices are registered by the venus
> driver as children of the venus device, but even if someone were to mess
> this up no amount of probe deferring is going to conjure up a parent.
> 
> Relatedly, the venus driver sets its driver data before registering the
> child devices and if this ever breaks we want to learn about it by
> failing probe.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>


Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Re: [PATCH] media: venus: drop bogus probe deferrals
Posted by Dikshita Agarwal 3 months, 1 week ago

On 10/17/2025 11:28 AM, Johan Hovold wrote:
> The encoder and decoder platform devices are registered by the venus
> driver as children of the venus device, but even if someone were to mess
> this up no amount of probe deferring is going to conjure up a parent.
> 
> Relatedly, the venus driver sets its driver data before registering the
> child devices and if this ever breaks we want to learn about it by
> failing probe.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/media/platform/qcom/venus/vdec.c | 5 +----
>  drivers/media/platform/qcom/venus/venc.c | 5 +----
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 55c27345b7d8..2d822ad86dce 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -1778,12 +1778,9 @@ static int vdec_probe(struct platform_device *pdev)
>  	struct venus_core *core;
>  	int ret;
>  
> -	if (!dev->parent)
> -		return -EPROBE_DEFER;
> -
>  	core = dev_get_drvdata(dev->parent);
>  	if (!core)
> -		return -EPROBE_DEFER;
> +		return -EINVAL;
>  
>  	platform_set_drvdata(pdev, core);
>  
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index fba07557a399..f1abd2bdce6b 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -1560,12 +1560,9 @@ static int venc_probe(struct platform_device *pdev)
>  	struct venus_core *core;
>  	int ret;
>  
> -	if (!dev->parent)
> -		return -EPROBE_DEFER;
> -
>  	core = dev_get_drvdata(dev->parent);
>  	if (!core)
> -		return -EPROBE_DEFER;
> +		return -EINVAL;
>  
>  	platform_set_drvdata(pdev, core);
>  

Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>

Thanks,
Dikshita
Re: [PATCH] media: venus: drop bogus probe deferrals
Posted by Bryan O'Donoghue 3 months, 3 weeks ago
On 17/10/2025 06:58, Johan Hovold wrote:
> The encoder and decoder platform devices are registered by the venus
> driver as children of the venus device, but even if someone were to mess
> this up no amount of probe deferring is going to conjure up a parent.
> 
> Relatedly, the venus driver sets its driver data before registering the
> child devices and if this ever breaks we want to learn about it by
> failing probe.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>   drivers/media/platform/qcom/venus/vdec.c | 5 +----
>   drivers/media/platform/qcom/venus/venc.c | 5 +----
>   2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 55c27345b7d8..2d822ad86dce 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -1778,12 +1778,9 @@ static int vdec_probe(struct platform_device *pdev)
>   	struct venus_core *core;
>   	int ret;
> 
> -	if (!dev->parent)
> -		return -EPROBE_DEFER;
> -
>   	core = dev_get_drvdata(dev->parent);
>   	if (!core)
> -		return -EPROBE_DEFER;
> +		return -EINVAL;
> 
>   	platform_set_drvdata(pdev, core);
> 
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index fba07557a399..f1abd2bdce6b 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -1560,12 +1560,9 @@ static int venc_probe(struct platform_device *pdev)
>   	struct venus_core *core;
>   	int ret;
> 
> -	if (!dev->parent)
> -		return -EPROBE_DEFER;
> -
>   	core = dev_get_drvdata(dev->parent);
>   	if (!core)
> -		return -EPROBE_DEFER;
> +		return -EINVAL;
> 
>   	platform_set_drvdata(pdev, core);
> 
> --
> 2.49.1
> 
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>