public inbox for linux-phy@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] drm: simplify support for transparent DRM bridges
@ 2023-08-17 14:55 Dmitry Baryshkov
  2023-08-17 14:55 ` [PATCH v4 1/3] drm/bridge: add transparent bridge helper Dmitry Baryshkov
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Dmitry Baryshkov @ 2023-08-17 14:55 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Heikki Krogerus, Greg Kroah-Hartman
  Cc: dri-devel, linux-arm-msm, linux-phy, linux-usb, freedreno

Supporting DP/USB-C can result in a chain of several transparent
bridges (PHY, redrivers, mux, etc). This results in drivers having
similar boilerplate code for such bridges.

Next, these drivers are susceptible to -EPROBE_DEFER loops: the next
bridge can either be probed from the bridge->attach callback, when it is
too late to return -EPROBE_DEFER, or from the probe() callback, when the
next bridge might not yet be available, because it depends on the
resources provided by the probing device.

Last, but not least, this results in the the internal knowledge of DRM
subsystem slowly diffusing into other subsystems, like PHY or USB/TYPEC.

To solve all these issues, define a separate DRM helper, which creates
separate aux device just for the bridge. During probe such aux device
doesn't result in the EPROBE_DEFER loops. Instead it allows the device
drivers to probe properly, according to the actual resource
dependencies. The bridge auxdevs are then probed when the next bridge
becomes available, sparing drivers from drm_bridge_attach() returning
-EPROBE_DEFER.

Proposed merge strategy: immutable branch with the drm commit, which is
then merged into PHY and USB subsystems together with the corresponding
patch.

Changes since v3:
 - Moved bridge driver to gpu/drm/bridge (Neil Armstrong)
 - Renamed it to aux-bridge (since there is already a simple_bridge driver)
 - Made CONFIG_OF mandatory for this driver (Neil Armstrong)
 - Added missing kfree and ida_free (Dan Carpenter)

Changes since v2:
 - ifdef'ed bridge->of_node access (LKP)

Changes since v1:
 - Added EXPORT_SYMBOL_GPL / MODULE_LICENSE / etc. to drm_simple_bridge

Dmitry Baryshkov (3):
  drm/bridge: add transparent bridge helper
  phy: qcom: qmp-combo: switch to DRM_AUX_BRIDGE
  usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE

 drivers/gpu/drm/bridge/Kconfig            |   9 ++
 drivers/gpu/drm/bridge/Makefile           |   1 +
 drivers/gpu/drm/bridge/aux-bridge.c       | 132 ++++++++++++++++++++++
 drivers/phy/qualcomm/Kconfig              |   2 +-
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c |  44 +-------
 drivers/usb/typec/mux/Kconfig             |   2 +-
 drivers/usb/typec/mux/nb7vpq904m.c        |  44 +-------
 include/drm/bridge/aux-bridge.h           |  19 ++++
 8 files changed, 167 insertions(+), 86 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/aux-bridge.c
 create mode 100644 include/drm/bridge/aux-bridge.h

-- 
2.39.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH v4 0/3 RESEND] drm: simplify support for transparent DRM bridges
@ 2023-10-10 23:10 Dmitry Baryshkov
  2023-10-10 23:10 ` [PATCH v4 3/3] usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE Dmitry Baryshkov
  0 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2023-10-10 23:10 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Heikki Krogerus, Greg Kroah-Hartman
  Cc: dri-devel, linux-arm-msm, linux-phy, linux-usb, freedreno

[Resending since the discussion with Laurent has died with no response
received for more than three weeks]

Supporting DP/USB-C can result in a chain of several transparent
bridges (PHY, redrivers, mux, etc). All attempts to implement DP support
in a different way resulted either in series of hacks or in device tree
not reflecting the actual hardware design. This results in drivers
having similar boilerplate code for such bridges.

Next, these drivers are susceptible to -EPROBE_DEFER loops: the next
bridge can either be probed from the bridge->attach callback, when it is
too late to return -EPROBE_DEFER, or from the probe() callback, when the
next bridge might not yet be available, because it depends on the
resources provided by the probing device. Device links can not fully
solve this problem since there are mutual dependencies between adjancent
devices.

Last, but not least, this results in the the internal knowledge of DRM
subsystem slowly diffusing into other subsystems, like PHY or USB/TYPEC.

To solve all these issues, define a separate DRM helper, which creates
separate aux device just for the bridge. During probe such aux device
doesn't result in the EPROBE_DEFER loops. Instead it allows the device
drivers to probe properly, according to the actual resource
dependencies. The bridge auxdevs are then probed when the next bridge
becomes available, sparing drivers from drm_bridge_attach() returning
-EPROBE_DEFER.

Changes since v3:
 - Moved bridge driver to gpu/drm/bridge (Neil Armstrong)
 - Renamed it to aux-bridge (since there is already a simple_bridge driver)
 - Made CONFIG_OF mandatory for this driver (Neil Armstrong)
 - Added missing kfree and ida_free (Dan Carpenter)

Changes since v2:
 - ifdef'ed bridge->of_node access (LKP)

Changes since v1:
 - Added EXPORT_SYMBOL_GPL / MODULE_LICENSE / etc. to drm_simple_bridge

Dmitry Baryshkov (3):
  drm/bridge: add transparent bridge helper
  phy: qcom: qmp-combo: switch to DRM_AUX_BRIDGE
  usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE

 drivers/gpu/drm/bridge/Kconfig            |   9 ++
 drivers/gpu/drm/bridge/Makefile           |   1 +
 drivers/gpu/drm/bridge/aux-bridge.c       | 132 ++++++++++++++++++++++
 drivers/phy/qualcomm/Kconfig              |   2 +-
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c |  44 +-------
 drivers/usb/typec/mux/Kconfig             |   2 +-
 drivers/usb/typec/mux/nb7vpq904m.c        |  44 +-------
 include/drm/bridge/aux-bridge.h           |  19 ++++
 8 files changed, 167 insertions(+), 86 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/aux-bridge.c
 create mode 100644 include/drm/bridge/aux-bridge.h

-- 
2.39.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-10-10 23:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 14:55 [PATCH v4 0/3] drm: simplify support for transparent DRM bridges Dmitry Baryshkov
2023-08-17 14:55 ` [PATCH v4 1/3] drm/bridge: add transparent bridge helper Dmitry Baryshkov
2023-08-17 14:55 ` [PATCH v4 2/3] phy: qcom: qmp-combo: switch to DRM_AUX_BRIDGE Dmitry Baryshkov
2023-08-22 13:51   ` Vinod Koul
2023-08-17 14:55 ` [PATCH v4 3/3] usb: typec: nb7vpq904m: " Dmitry Baryshkov
2023-08-22 12:36   ` Greg Kroah-Hartman
2023-08-22 14:17 ` [PATCH v4 0/3] drm: simplify support for transparent DRM bridges Laurent Pinchart
2023-08-22 14:19   ` Laurent Pinchart
2023-08-22 14:27     ` Neil Armstrong
2023-09-14 21:23       ` Laurent Pinchart
2023-09-14 22:10         ` Dmitry Baryshkov
2023-08-28 22:28     ` Dmitry Baryshkov
2023-09-03 21:02   ` Dmitry Baryshkov
2023-09-14 21:44     ` Laurent Pinchart
2023-09-14 22:01       ` Dmitry Baryshkov
  -- strict thread matches above, loose matches on Subject: below --
2023-10-10 23:10 [PATCH v4 0/3 RESEND] " Dmitry Baryshkov
2023-10-10 23:10 ` [PATCH v4 3/3] usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox