Patch "drm/tegra: dc: Don't set PLL clock to 0Hz" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/tegra: dc: Don't set PLL clock to 0Hz

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-tegra-dc-don-t-set-pll-clock-to-0hz.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c0ccd86be3be454a6490cb18faf4b8ba8da5ea27
Author: Dmitry Osipenko <digetx@xxxxxxxxx>
Date:   Tue Mar 2 16:15:06 2021 +0300

    drm/tegra: dc: Don't set PLL clock to 0Hz
    
    [ Upstream commit f8fb97c915954fc6de6513cdf277103b5c6df7b3 ]
    
    RGB output doesn't allow to change parent clock rate of the display and
    PCLK rate is set to 0Hz in this case. The tegra_dc_commit_state() shall
    not set the display clock to 0Hz since this change propagates to the
    parent clock. The DISP clock is defined as a NODIV clock by the tegra-clk
    driver and all NODIV clocks use the CLK_SET_RATE_PARENT flag.
    
    This bug stayed unnoticed because by default PLLP is used as the parent
    clock for the display controller and PLLP silently skips the erroneous 0Hz
    rate changes because it always has active child clocks that don't permit
    rate changes. The PLLP isn't acceptable for some devices that we want to
    upstream (like Samsung Galaxy Tab and ASUS TF700T) due to a display panel
    clock rate requirements that can't be fulfilled by using PLLP and then the
    bug pops up in this case since parent clock is set to 0Hz, killing the
    display output.
    
    Don't touch DC clock if pclk=0 in order to fix the problem.
    
    Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx>
    Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 8eeef5017826..134986dc2783 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1688,6 +1688,11 @@ static void tegra_dc_commit_state(struct tegra_dc *dc,
 			dev_err(dc->dev,
 				"failed to set clock rate to %lu Hz\n",
 				state->pclk);
+
+		err = clk_set_rate(dc->clk, state->pclk);
+		if (err < 0)
+			dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n",
+				dc->clk, state->pclk, err);
 	}
 
 	DRM_DEBUG_KMS("rate: %lu, div: %u\n", clk_get_rate(dc->clk),
@@ -1698,11 +1703,6 @@ static void tegra_dc_commit_state(struct tegra_dc *dc,
 		value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1;
 		tegra_dc_writel(dc, value, DC_DISP_DISP_CLOCK_CONTROL);
 	}
-
-	err = clk_set_rate(dc->clk, state->pclk);
-	if (err < 0)
-		dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n",
-			dc->clk, state->pclk, err);
 }
 
 static void tegra_dc_stop(struct tegra_dc *dc)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux