• Douglas Anderson's avatar
    drm/msm/dsi: More properly handle errors in regards to dsi_mgr_bridge_power_on() · d8dd416c
    Douglas Anderson authored
    In commit 7d8e9a90 ("drm/msm/dsi: move DSI host powerup to modeset
    time") the error handling with regards to dsi_mgr_bridge_power_on()
    got a bit worse. Specifically if we failed to power the bridge on then
    nothing would really notice. The modeset function couldn't return an
    error and thus we'd blindly go forward and try to do the pre-enable.
    
    In commit ec7981e6 ("drm/msm/dsi: don't powerup at modeset time
    for parade-ps8640") we added a special case to move the powerup back
    to pre-enable time for ps8640. When we did that, we didn't try to
    recover the old/better error handling just for ps8640.
    
    In the patch ("drm/msm/dsi: Stop unconditionally powering up DSI hosts
    at modeset") we've now moved the powering up back to exclusively being
    during pre-enable. That means we can add the better error handling
    back in, so let's do it. To do so we'll add a new function
    dsi_mgr_bridge_power_off() that's matches how errors were handled
    prior to commit 7d8e9a90 ("drm/msm/dsi: move DSI host powerup to
    modeset time").
    
    NOTE: Now that we have dsi_mgr_bridge_power_off(), it feels as if we
    should be calling it in dsi_mgr_bridge_post_disable(). That would make
    some sense, but doing so would change the current behavior and thus
    should be a separate patch. Specifically:
    * dsi_mgr_bridge_post_disable() always calls dsi_mgr_phy_disable()
      even in the slave-DSI case of bonded DSI. We'd need to add special
      handling for this if it's truly needed.
    * dsi_mgr_bridge_post_disable() calls msm_dsi_phy_pll_save_state()
      midway through the poweroff.
    * dsi_mgr_bridge_post_disable() has a different order of some of the
      poweroffs / IRQ disables.
    For now we'll leave dsi_mgr_bridge_post_disable() alone.
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
    Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
    Patchwork: https://patchwork.freedesktop.org/patch/521059/
    Link: https://lore.kernel.org/r/20230131141756.RFT.v2.3.I3c87b53c4ab61a7d5e05f601a4eb44c7e3809a01@changeidSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
    d8dd416c
dsi_manager.c 17.6 KB