Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert drm/vc4 hdmi runtime PM changes

This reverts commits

9984d6664ce9 ("drm/vc4: hdmi: Make sure the controller is powered in detect")
411efa18e4b0 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm")

as Michael Stapelberg reports that the new runtime PM changes cause his
Raspberry Pi 3 to hang on boot, probably due to interactions with other
changes in the DRM tree (because a bisect points to the merge in commit
e058a84bfddc: "Merge tag 'drm-next-2021-07-01' of git://.../drm").

Revert these two commits until it's been resolved.

Link: https://lore.kernel.org/all/871r5mp7h2.fsf@midna.i-did-not-set--mail-host-address--so-tickle-me/
Reported-and-tested-by: Michael Stapelberg <michael@stapelberg.ch>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dave Airlie <airlied@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+10 -34
+10 -34
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 167 167 struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); 168 168 bool connected = false; 169 169 170 - WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); 171 - 172 170 if (vc4_hdmi->hpd_gpio && 173 171 gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { 174 172 connected = true; ··· 187 189 } 188 190 } 189 191 190 - pm_runtime_put(&vc4_hdmi->pdev->dev); 191 192 return connector_status_connected; 192 193 } 193 194 194 195 cec_phys_addr_invalidate(vc4_hdmi->cec_adap); 195 - pm_runtime_put(&vc4_hdmi->pdev->dev); 196 196 return connector_status_disconnected; 197 197 } 198 198 ··· 631 635 vc4_hdmi->variant->phy_disable(vc4_hdmi); 632 636 633 637 clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock); 638 + clk_disable_unprepare(vc4_hdmi->hsm_clock); 634 639 clk_disable_unprepare(vc4_hdmi->pixel_clock); 635 640 636 641 ret = pm_runtime_put(&vc4_hdmi->pdev->dev); ··· 944 947 return; 945 948 } 946 949 950 + ret = clk_prepare_enable(vc4_hdmi->hsm_clock); 951 + if (ret) { 952 + DRM_ERROR("Failed to turn on HSM clock: %d\n", ret); 953 + clk_disable_unprepare(vc4_hdmi->pixel_clock); 954 + return; 955 + } 956 + 947 957 vc4_hdmi_cec_update_clk_div(vc4_hdmi); 948 958 949 959 if (pixel_rate > 297000000) ··· 963 959 ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate); 964 960 if (ret) { 965 961 DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret); 962 + clk_disable_unprepare(vc4_hdmi->hsm_clock); 966 963 clk_disable_unprepare(vc4_hdmi->pixel_clock); 967 964 return; 968 965 } ··· 971 966 ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); 972 967 if (ret) { 973 968 DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret); 969 + clk_disable_unprepare(vc4_hdmi->hsm_clock); 974 970 clk_disable_unprepare(vc4_hdmi->pixel_clock); 975 971 return; 976 972 } ··· 2120 2114 return 0; 2121 2115 } 2122 2116 2123 - #ifdef CONFIG_PM 2124 - static int vc4_hdmi_runtime_suspend(struct device *dev) 2125 - { 2126 - struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); 2127 - 2128 - clk_disable_unprepare(vc4_hdmi->hsm_clock); 2129 - 2130 - return 0; 2131 - } 2132 - 2133 - static int vc4_hdmi_runtime_resume(struct device *dev) 2134 - { 2135 - struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); 2136 - int ret; 2137 - 2138 - ret = clk_prepare_enable(vc4_hdmi->hsm_clock); 2139 - if (ret) 2140 - return ret; 2141 - 2142 - return 0; 2143 - } 2144 - #endif 2145 - 2146 2117 static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) 2147 2118 { 2148 2119 const struct vc4_hdmi_variant *variant = of_device_get_match_data(dev); ··· 2374 2391 {} 2375 2392 }; 2376 2393 2377 - static const struct dev_pm_ops vc4_hdmi_pm_ops = { 2378 - SET_RUNTIME_PM_OPS(vc4_hdmi_runtime_suspend, 2379 - vc4_hdmi_runtime_resume, 2380 - NULL) 2381 - }; 2382 - 2383 2394 struct platform_driver vc4_hdmi_driver = { 2384 2395 .probe = vc4_hdmi_dev_probe, 2385 2396 .remove = vc4_hdmi_dev_remove, 2386 2397 .driver = { 2387 2398 .name = "vc4_hdmi", 2388 2399 .of_match_table = vc4_hdmi_dt_match, 2389 - .pm = &vc4_hdmi_pm_ops, 2390 2400 }, 2391 2401 };