This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: qcom: camss: Fix ordering of pm_runtime_enable
Author:  Bryan O'Donoghue <bryan.odonog...@linaro.org>
Date:    Mon Jul 29 13:42:03 2024 +0100

pm_runtime_enable() should happen prior to vfe_get() since vfe_get() calls
pm_runtime_resume_and_get().

This is a basic race condition that doesn't show up for most users so is
not widely reported. If you blacklist qcom-camss in modules.d and then
subsequently modprobe the module post-boot it is possible to reliably show
this error up.

The kernel log for this error looks like this:

qcom-camss ac5a000.camss: Failed to power up pipeline: -13

Fixes: 02afa816dbbf ("media: camss: Add basic runtime PM support")
Reported-by: Johan Hovold <johan+lin...@kernel.org>
Closes: https://lore.kernel.org/lkml/zovnhoti0pkmn...@hovoldconsulting.com/
Tested-by: Johan Hovold <johan+lin...@kernel.org>
Cc: <sta...@vger.kernel.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org>
Reviewed-by: Konrad Dybcio <konradyb...@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 drivers/media/platform/qcom/camss/camss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

---

diff --git a/drivers/media/platform/qcom/camss/camss.c 
b/drivers/media/platform/qcom/camss/camss.c
index 51b1d3550421..d64985ca6e88 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -2283,6 +2283,8 @@ static int camss_probe(struct platform_device *pdev)
 
        v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev);
 
+       pm_runtime_enable(dev);
+
        num_subdevs = camss_of_parse_ports(camss);
        if (num_subdevs < 0) {
                ret = num_subdevs;
@@ -2323,8 +2325,6 @@ static int camss_probe(struct platform_device *pdev)
                }
        }
 
-       pm_runtime_enable(dev);
-
        return 0;
 
 err_register_subdevs:
@@ -2332,6 +2332,7 @@ err_register_subdevs:
 err_v4l2_device_unregister:
        v4l2_device_unregister(&camss->v4l2_dev);
        v4l2_async_nf_cleanup(&camss->notifier);
+       pm_runtime_disable(dev);
 err_genpd_cleanup:
        camss_genpd_cleanup(camss);
 

Reply via email to