Skip to content

Commit b1044a9

Browse files
committed
Revert drm/vc4 hdmi runtime PM changes
This reverts commits 9984d66 ("drm/vc4: hdmi: Make sure the controller is powered in detect") 411efa1 ("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 e058a84: "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 <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Dave Stevenson <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d4d016c commit b1044a9

File tree

1 file changed

+10
-34
lines changed

1 file changed

+10
-34
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
167167
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
168168
bool connected = false;
169169

170-
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
171-
172170
if (vc4_hdmi->hpd_gpio &&
173171
gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) {
174172
connected = true;
@@ -189,12 +187,10 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
189187
}
190188
}
191189

192-
pm_runtime_put(&vc4_hdmi->pdev->dev);
193190
return connector_status_connected;
194191
}
195192

196193
cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
197-
pm_runtime_put(&vc4_hdmi->pdev->dev);
198194
return connector_status_disconnected;
199195
}
200196

@@ -635,6 +631,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
635631
vc4_hdmi->variant->phy_disable(vc4_hdmi);
636632

637633
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
634+
clk_disable_unprepare(vc4_hdmi->hsm_clock);
638635
clk_disable_unprepare(vc4_hdmi->pixel_clock);
639636

640637
ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
@@ -947,6 +944,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
947944
return;
948945
}
949946

947+
ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
948+
if (ret) {
949+
DRM_ERROR("Failed to turn on HSM clock: %d\n", ret);
950+
clk_disable_unprepare(vc4_hdmi->pixel_clock);
951+
return;
952+
}
953+
950954
vc4_hdmi_cec_update_clk_div(vc4_hdmi);
951955

952956
if (pixel_rate > 297000000)
@@ -959,13 +963,15 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
959963
ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate);
960964
if (ret) {
961965
DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret);
966+
clk_disable_unprepare(vc4_hdmi->hsm_clock);
962967
clk_disable_unprepare(vc4_hdmi->pixel_clock);
963968
return;
964969
}
965970

966971
ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
967972
if (ret) {
968973
DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret);
974+
clk_disable_unprepare(vc4_hdmi->hsm_clock);
969975
clk_disable_unprepare(vc4_hdmi->pixel_clock);
970976
return;
971977
}
@@ -2114,29 +2120,6 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
21142120
return 0;
21152121
}
21162122

2117-
#ifdef CONFIG_PM
2118-
static int vc4_hdmi_runtime_suspend(struct device *dev)
2119-
{
2120-
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
2121-
2122-
clk_disable_unprepare(vc4_hdmi->hsm_clock);
2123-
2124-
return 0;
2125-
}
2126-
2127-
static int vc4_hdmi_runtime_resume(struct device *dev)
2128-
{
2129-
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
2130-
int ret;
2131-
2132-
ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
2133-
if (ret)
2134-
return ret;
2135-
2136-
return 0;
2137-
}
2138-
#endif
2139-
21402123
static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
21412124
{
21422125
const struct vc4_hdmi_variant *variant = of_device_get_match_data(dev);
@@ -2391,18 +2374,11 @@ static const struct of_device_id vc4_hdmi_dt_match[] = {
23912374
{}
23922375
};
23932376

2394-
static const struct dev_pm_ops vc4_hdmi_pm_ops = {
2395-
SET_RUNTIME_PM_OPS(vc4_hdmi_runtime_suspend,
2396-
vc4_hdmi_runtime_resume,
2397-
NULL)
2398-
};
2399-
24002377
struct platform_driver vc4_hdmi_driver = {
24012378
.probe = vc4_hdmi_dev_probe,
24022379
.remove = vc4_hdmi_dev_remove,
24032380
.driver = {
24042381
.name = "vc4_hdmi",
24052382
.of_match_table = vc4_hdmi_dt_match,
2406-
.pm = &vc4_hdmi_pm_ops,
24072383
},
24082384
};

0 commit comments

Comments
 (0)