mirror-linux/drivers/gpu/drm/bridge
Luca Ceresoli ad81feb5b6 Revert "drm/bridge: ti-sn65dsi83: Fix enable error path"
This reverts commit 8a91b29f1f.

The regulator_disable() added by the original commit solves one kind of
regulator imbalance but adds another one as it allows the regulator to be
disabled one more time than it is enabled in the following scenario:

 1. Start video pipeline -> sn65dsi83_atomic_pre_enable -> regulator_enable
 2. PLL lock fails -> regulator_disable
 3. Stop video pipeline -> sn65dsi83_atomic_disable -> regulator_disable

The reason is clear from the code flow, which looks like this (after
removing unrelated code):

  static void sn65dsi83_atomic_pre_enable()
  {
      regulator_enable(ctx->vcc);

      if (PLL failed locking) {
          regulator_disable(ctx->vcc);  <---- added by patch being reverted
          return;
      }
  }

  static void sn65dsi83_atomic_disable()
  {
      regulator_disable(ctx->vcc);
  }

The use case for introducing the additional regulator_disable() was
removing the module for debugging (see link below for the discussion). If
the module is removed after a .atomic_pre_enable, i.e. with an active
pipeline from the DRM point of view, .atomic_disable is not called and thus
the regulator would not be disabled.

According to the discussion however there is no actual use case for
removing the module with an active pipeline, except for
debugging/development.

On the other hand, the occurrence of a PLL lock failure is possible due to
any physical reason (e.g. a temporary hardware failure for electrical
reasons) so handling it gracefully should be supported. As there is no way
for .atomic[_pre]_enable to report an error to the core, the only clean way
to support it is calling regulator_disabled() only in .atomic_disable,
unconditionally, as it was before.

Link: https://lore.kernel.org/all/15244220.uLZWGnKmhe@steina-w/
Fixes: 8a91b29f1f ("drm/bridge: ti-sn65dsi83: Fix enable error path")
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240426122259.46808-1-luca.ceresoli@bootlin.com
(cherry picked from commit 2940ee03b2)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2024-05-02 23:40:13 +02:00
..
adv7511 drm/bridge: adv7511: make it honour next bridge in DT 2024-04-24 08:55:44 +02:00
analogix Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
cadence Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
imx Revert "drm: Make drivers depends on DRM_DW_HDMI" 2024-05-02 17:59:59 +02:00
synopsys Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
Kconfig Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
Makefile drm/bridge: add lvds controller support for sam9x7 2024-04-23 09:29:43 +02:00
aux-bridge.c
aux-hpd-bridge.c drm/bridge: aux-hpd: separate allocation and registration 2024-02-23 17:00:56 +02:00
chipone-icn6211.c drm/bridge: chipone-icn6211: drop driver owner assignment 2024-04-24 12:42:45 +03:00
chrontel-ch7033.c drm/bridge: chrontel-ch7033: switch to drm_bridge_edid_read() 2024-02-08 17:11:04 +02:00
cros-ec-anx7688.c
display-connector.c drm/bridge: display-connector: switch to ->edid_read callback 2024-02-09 10:15:29 +02:00
fsl-ldb.c
ite-it6505.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
ite-it66121.c drm/bridge: it66121: Remove a duplicated invoke of of_device_is_available() 2024-03-18 16:16:20 +01:00
lontium-lt8912b.c drm/bridge: lt8912b: Don't log an error when DSI host can't be found 2024-04-16 15:18:53 +02:00
lontium-lt9211.c
lontium-lt9611.c drm/bridge: lt9611: Don't log an error when DSI host can't be found 2024-04-16 15:18:56 +02:00
lontium-lt9611uxc.c drm/bridge: lt9611uxc: Don't log an error when DSI host can't be found 2024-04-16 15:18:59 +02:00
lvds-codec.c
megachips-stdpxxxx-ge-b850v3-fw.c drm/bridge: megachips: switch to ->edid_read callback 2024-02-09 10:15:41 +02:00
microchip-lvds.c drm/bridge: add lvds controller support for sam9x7 2024-04-23 09:29:43 +02:00
nwl-dsi.c
nwl-dsi.h
nxp-ptn3460.c drm/bridge: nxp-ptn3460: switch to ->edid_read callback 2024-02-09 10:15:43 +02:00
panel.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
parade-ps8622.c
parade-ps8640.c
samsung-dsim.c Merge drm/drm-next into drm-misc-next 2024-02-07 13:02:20 +01:00
sii902x.c drm/bridge: sii902x: switch to ->edid_read callback 2024-02-09 10:15:48 +02:00
sii9234.c
sil-sii8620.c
sil-sii8620.h
simple-bridge.c drm: bridge: simple-bridge: clear the EDID property on failures 2024-02-08 17:12:21 +02:00
tc358762.c
tc358764.c drm/bridge: tc358764: drop driver owner assignment 2024-04-24 12:42:45 +03:00
tc358767.c drm/bridge: tc358767: switch to ->edid_read callback 2024-02-09 10:16:16 +02:00
tc358768.c
tc358775.c drm/bridge: tc358775: Configure hs_rate and lp_rate 2024-04-23 17:33:23 +02:00
thc63lvd1024.c drm: bridge: thc63lvd1024: Print error message when DT parsing fails 2024-03-19 16:46:23 +01:00
ti-dlpc3433.c drm/bridge: dpc3433: Don't log an error when DSI host can't be found 2024-04-16 15:19:04 +02:00
ti-sn65dsi83.c Revert "drm/bridge: ti-sn65dsi83: Fix enable error path" 2024-05-02 23:40:13 +02:00
ti-sn65dsi86.c drm for 6.9: 2024-03-13 18:34:05 -07:00
ti-tfp410.c drm/bridge: tfp410: clear the EDID property on failures 2024-02-08 17:12:26 +02:00
ti-tpd12s015.c