Skip to content

Commit

Permalink
FROMLIST v2: media: qcom: camss: Fix ordering of pm_runtime_enable
Browse files Browse the repository at this point in the history
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: 02afa81 ("media: camss: Add basic runtime PM support")
Reported-by: Johan Hovold <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Tested-by: Johan Hovold <[email protected]>
Cc: <[email protected]>
Signed-off-by: Bryan O'Donoghue <[email protected]>
  • Loading branch information
0xB0D authored and barni2000 committed Jul 27, 2024
1 parent baf0f05 commit 5be9170
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/platform/qcom/camss/camss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,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;
Expand Down Expand Up @@ -1859,15 +1861,14 @@ static int camss_probe(struct platform_device *pdev)
}
}

pm_runtime_enable(dev);

return 0;

err_register_subdevs:
camss_unregister_entities(camss);
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);

Expand Down

0 comments on commit 5be9170

Please sign in to comment.