On Thu, Apr 07, 2022 at 11:34:08AM +0200, Paul Kocialkowski wrote:
With the previous rework of drm_of_find_panel_or_bridge only -EPROBE_DEFER is returned while previous behavior allowed -ENODEV to be returned when the port/endpoint is either missing or unavailable.
Make the default return code of the function -ENODEV to handle this and only return -EPROBE_DEFER in find_panel_or_bridge when the of device is available but not yet registered. Also return the error code whenever the remote node exists to avoid checking for child nodes.
Checking child nodes could result in -EPROBE_DEFER returned by find_panel_or_bridge with an unrelated child node that would overwrite a legitimate -ENODEV from find_panel_or_bridge if the remote node from the of graph is unavailable. This happens because find_panel_or_bridge has no way to distinguish between a legitimate panel/bridge node that isn't yet registered and an unrelated node.
Add comments around to clarify this behavior.
Signed-off-by: Paul Kocialkowski paul.kocialkowski@bootlin.com Fixes: 67bae5f28c89 ("drm: of: Properly try all possible cases for bridge/panel detection") Cc: Bjorn Andersson bjorn.andersson@linaro.org Cc: Thierry Reding thierry.reding@gmail.com Cc: Linus Walleij linus.walleij@linaro.org
drivers/gpu/drm/drm_of.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
This also fixes the regression that I was seeing on Tegra.
Tested-by: Thierry Reding treding@nvidia.com