Patch "drm/bridge: tc358768: fix THS_TRAILCNT computation" has been added to the 6.3-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/bridge: tc358768: fix THS_TRAILCNT computation

to the 6.3-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-bridge-tc358768-fix-ths_trailcnt-computation.patch
and it can be found in the queue-6.3 subdirectory.

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



commit f6d01c235715a25cf037de1c3424ff4a91ff14d1
Author: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
Date:   Thu Apr 27 16:29:33 2023 +0200

    drm/bridge: tc358768: fix THS_TRAILCNT computation
    
    [ Upstream commit bac7842cd179572e8e0fc2d7b5254e40c6e9e057 ]
    
    Correct computation of THS_TRAILCNT register.
    
    This register must be set to a value that ensure that
    THS_TRAIL > 60 ns + 4 x UI
     and
    THS_TRAIL > 8 x UI
     and
    THS_TRAIL < TEOT
     with
    TEOT = 105 ns + (12 x UI)
    
    with the actual value of THS_TRAIL being
    
    (1 + THS_TRAILCNT) x ByteClk cycle + ((1 to 2) + 2) xHSBYTECLK cycle +
     - (PHY output delay)
    
    with PHY output delay being about
    
    (8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion.
    
    Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
    Signed-off-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
    Reviewed-by: Robert Foss <rfoss@xxxxxxxxxx>
    Signed-off-by: Robert Foss <rfoss@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-9-francesco@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c
index d8209433d5f43..966a25cb0b108 100644
--- a/drivers/gpu/drm/bridge/tc358768.c
+++ b/drivers/gpu/drm/bridge/tc358768.c
@@ -780,9 +780,10 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)
 	dev_dbg(priv->dev, "TCLK_POSTCNT: 0x%x\n", val);
 	tc358768_write(priv, TC358768_TCLK_POSTCNT, val);
 
-	/* 60ns + 4*UI < THS_PREPARE < 105ns + 12*UI */
-	val = tc358768_ns_to_cnt(60 + tc358768_to_ns(15 * ui_nsk),
-				 dsibclk_nsk) - 5;
+	/* max(60ns + 4*UI, 8*UI) < THS_TRAILCNT < 105ns + 12*UI */
+	raw_val = tc358768_ns_to_cnt(60 + tc358768_to_ns(18 * ui_nsk),
+				     dsibclk_nsk) - 4;
+	val = clamp(raw_val, 0, 15);
 	dev_dbg(priv->dev, "THS_TRAILCNT: 0x%x\n", val);
 	tc358768_write(priv, TC358768_THS_TRAILCNT, val);
 



[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