[PATCH] drm/tegra: hdmi: Setup audio only if configured

Thierry Reding thierry.reding at gmail.com
Tue Apr 16 14:41:37 UTC 2019


From: Thierry Reding <treding at nvidia.com>

The audio configuration is only valid if the HDMI codec has been
properly set up. Do not attempt to set up audio before that happens
because it causes a division by zero.

Note that this is only problematic on Tegra20 and Tegra30. Later chips
implement the division instructions which return zero when dividing by
zero and don't throw an exception.

Fixes: db5adf4d6dce ("drm/tegra: hdmi: Fix audio to work with any pixel clock rate")
Reported-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/tegra/hdmi.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 47c55974756d..e6c60bbc0fec 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1259,11 +1259,6 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder)
 	tegra_hdmi_writel(hdmi, value, HDMI_NV_PDISP_SOR_REFCLK);
 
 	hdmi->dvi = !tegra_output_is_hdmi(output);
-	if (!hdmi->dvi) {
-		err = tegra_hdmi_setup_audio(hdmi);
-		if (err < 0)
-			hdmi->dvi = true;
-	}
 
 	if (hdmi->config->has_hda)
 		tegra_hdmi_write_eld(hdmi);
-- 
2.21.0



More information about the dri-devel mailing list