Skip to content

Commit

Permalink
media: qcom: camss: Fix pm_domain_on sequence in probe
Browse files Browse the repository at this point in the history
commit 7405116 upstream.

We need to make sure camss_configure_pd() happens before
camss_register_entities() as the vfe_get() path relies on the pointer
provided by camss_configure_pd().

Fix the ordering sequence in probe to ensure the pointers vfe_get() demands
are present by the time camss_register_entities() runs.

In order to facilitate backporting to stable kernels I've moved the
configure_pd() call pretty early on the probe() function so that
irrespective of the existence of the old error handling jump labels this
patch should still apply to -next circa Aug 2023 to v5.13 inclusive.

Fixes: 2f6f8af ("media: camss: Refactor VFE power domain toggling")
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
0xB0D authored and gregkh committed Nov 28, 2023
1 parent 6dcb260 commit 3166c3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/media/platform/qcom/camss/camss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,12 @@ static int camss_probe(struct platform_device *pdev)
if (ret < 0)
goto err_cleanup;

ret = camss_configure_pd(camss);
if (ret < 0) {
dev_err(dev, "Failed to configure power domains: %d\n", ret);
goto err_cleanup;
}

ret = camss_init_subdevices(camss);
if (ret < 0)
goto err_cleanup;
Expand Down Expand Up @@ -1676,12 +1682,6 @@ static int camss_probe(struct platform_device *pdev)
}
}

ret = camss_configure_pd(camss);
if (ret < 0) {
dev_err(dev, "Failed to configure power domains: %d\n", ret);
return ret;
}

pm_runtime_enable(dev);

return 0;
Expand Down

0 comments on commit 3166c3a

Please sign in to comment.