• Douglas Anderson's avatar
    drm/bridge: ps8640: Add back the 50 ms mystery delay after HPD · cb8e30dd
    Douglas Anderson authored
    Back in commit 826cff3f ("drm/bridge: parade-ps8640: Enable
    runtime power management") we removed a mysterious 50 ms delay because
    "Parade's support [couldn't] explain what the delay [was] for".
    
    While I'm always a fan of removing mysterious delays, I suspect that
    we need this mysterious delay to avoid some problems.
    
    Specifically, what I found recently is that on sc7180-trogdor-homestar
    sometimes the AUX backlight wasn't initializing properly. Some
    debugging showed that the drm_dp_dpcd_read() function that the AUX
    backlight driver was calling was returning bogus data about 1% of the
    time when I booted up. This confused
    drm_panel_dp_aux_backlight(). From continued debugging:
    - If I retried the read then the read worked just fine.
    - If I added a loop to perform the same read that
      drm_panel_dp_aux_backlight() was doing 30 times at bootup I could
      see that some percentage of the time the first read would give bogus
      data but all 29 additional reads would always be fine.
    - If I added a large delay _after_ powering on the panel but before
      powering on PS8640 I could still reproduce the problem.
    - If I added a delay after PS8640 powered on then I couldn't reproduce
      the problem.
    - I couldn't reproduce the problem on a board with the same panel but
      the ti-sn65dsi86 bridge chip.
    
    To me, the above indicated that there was a problem with PS8640 and
    not the panel.
    
    I don't really have any insight into what's going on in the MCU, but
    my best guess is that when the MCU itself sees the HPD go high that it
    does some AUX transfers itself and this is confusing things.
    
    Let's go back and add back in the mysterious 50 ms delay. We only want
    to do this the first time we see HPD go high after booting the MCU,
    not every time we double-check HPD.
    
    With this, the backlight initializes reliably on homestar.
    
    Fixes: 826cff3f ("drm/bridge: parade-ps8640: Enable runtime power management")
    Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20221017121813.1.I59700c745fbc31559a5d5c8e2a960279c751dbd5@changeid
    cb8e30dd
parade-ps8640.c 20.6 KB