Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2175846lqo; Mon, 13 May 2024 09:50:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYFqvRjHpRrJ1g/rFi6lG14E9mDV8euVjJmtU4Ut8ITFlU+1wZbZBqm2ecPZIVOawyHhJr0V3ACrqaYqfpaN3fy1v7U+Z0fcbBFgZY3g== X-Google-Smtp-Source: AGHT+IG3bbhoHkl8xA1NthxPtMzTUEXuqMGJ8107C9zEFd2K85vnNs9aznPY1r0/1+gE49w0/hjG X-Received: by 2002:a50:d50f:0:b0:573:1e9e:2d71 with SMTP id 4fb4d7f45d1cf-5734d70885bmr9249937a12.19.1715619044108; Mon, 13 May 2024 09:50:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715619044; cv=pass; d=google.com; s=arc-20160816; b=mx4iYGA74891amwWto+tHcA4qB6ms3TonlxAMaJGqC+swOFmNCEoAgTnsMPnl2nmuL b3QkIjFIXgnBdfaOJwtq3YiH758QCsD4JJOpqHjy6rDw85WWDpWY1cWA2doz9Et8LQC/ RYr5l8/MHNkf1XEVNmw8oi/4YRP/Mdr5da0ahTpH80r8Ep0eBeGeBcPGHJtrP4W6Q+vC tvbo7mifrZKcNUww2FZpShhYSVAu5CL1ahfWeWqJ/8N1iBP9incBttJWIjUF49P3o12R QPDuDn7r0G6HKbOGFc5p85xQY+guI+BkmumUVSxKqAPbi9dbcP5QCn1BQz/pL2YwQ3FO NDGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=yqGcUGnb85hb/1qnUc2yHGBmYYJRR1WDbLRrLV3pVkw=; fh=YoHSB4y5jcXiMhgQMRDvC9sthjDzxd5QYw/LuXsElSI=; b=GCHD9djmpVnagivse3WVy0bM+dvDfDwNZAOooLcS151/bYxNaiGmu0KtmkpXXPNM7M tmQgEx0voa/S6NMEhujUmVsk0IVx/2oegZYX9sBz+ay90A77sqPDOA8zBMUfMDl5gnZf /eE+nSDDHdfhDPqkM0kC9ggPhi5xFwN98/m+X+U1oD9JKUe/TIJRl3dcO2ar5LDPFc+e DzRHhwhWefylpHvjA3KjuNPKxkjf/U5uOWJatHaDOqr1n69Bf1nJVQ2qQWqUkYAcZo/z /5jqlvJ0nqcUECDxVJr2kJ8lkhpA0nQ+ch2JBNT4KgBu++krpy9wKOueMTwYRdEDdJnr DiWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B0F0/V78"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-177852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beac31esi5578412a12.76.2024.05.13.09.50.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 09:50:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B0F0/V78"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-177852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8E63A1F2402E for ; Mon, 13 May 2024 16:50:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2F6F21342; Mon, 13 May 2024 16:50:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B0F0/V78" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEB5920DC4 for ; Mon, 13 May 2024 16:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619013; cv=none; b=o+1AWDRvtY50LLLy90acIFWak2J4QAcoLg29Yi+8EsENwL102+RDoHFTGTtcci7xCb1NiI6/TsjjIhtjx2YYF5rAf6F6x6VukeFC7yea0TcC14nU2mi2dhZ12kQyPmCL2UXGyWx2B7CqxoXAb9XLyvUWvVSR2OVda98K4PNiqLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619013; c=relaxed/simple; bh=kVSNLmMVb3ishC+4udHKioz5ZxxHmqDWUUUuuA8nWc4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=lPBF//zf0LqhWfNARDDWl1Y4T5PX91LSkeSuuyv/LeT4iYPoBrNxOOGdAnqsCmJq0S4d6KIHrx5PtGkPgOns2Lld/xDrNq8EaR1306iA1AKuDWyMX9aq7RPjApoI2PrFHUxChrst1F8SOPGwwGfeXWrj/xRJsbqA74PuRBPoMvw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B0F0/V78; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FA4BC4AF0D for ; Mon, 13 May 2024 16:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715619013; bh=kVSNLmMVb3ishC+4udHKioz5ZxxHmqDWUUUuuA8nWc4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=B0F0/V78joq/yEbhD0tf92fIRwmf60l5/p80nc+aV20iAs3E6+rXxrkcb6OakynYA DY12ZdC+uJNi2gz0XEKapwThxCA+nX7OmtJrD0/fejcce5672zFYPXlFfFtMpDV/JC lEI8Fv1zgWo9eSQO08Lam0LNMQXaIeBhEuzXmCzsJ7wjRPfn/skTXVBOSqUgzdGTpJ dwaxCOFE0NvKt6TTqYHw9yg6utRaXGrOgXHi0Ec9DcQiLcn1aB/0/l/kNPinWAIi7+ taqDQruFTtl7XlVeVNND/EQHCEvM2Hz7mgB4a0gqnT9TzDYzpGH5ZNvXi6a0CPtBUR F05CKP2vwYK9A== Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-241572c02efso2821631fac.3 for ; Mon, 13 May 2024 09:50:13 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVunrd6wyaL3DGiAAd2u9/A5wEGwA8FY/IDB7qUagPIyXk1cspOtuK4NemBfrqb6qafEfw4acRwVGo+rR59kTc9dWc7koZ19OAYHnVB X-Gm-Message-State: AOJu0YymQT+2FKKMIx+JN8KzvFZ3xUJDNj03uZ8YNJBcoH3NusDFt5CD L8/NSy12FGIrvw5Tl/BAl5VTS3+xRLXA+PJQ7HsSLW3lOA3MoqS/u9ZPmq0pXlGm1B5saEb2Mjp Rww3hCZnSCrjHaZ7nQ2wLGzTf3pEhyra0zVypmg== X-Received: by 2002:a05:6870:4191:b0:23c:6cb5:24f6 with SMTP id 586e51a60fabf-241728f480cmr13074398fac.7.1715619012605; Mon, 13 May 2024 09:50:12 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240513080243.3952292-1-victor.liu@nxp.com> <4b6e49ee-d2fd-4e54-88d5-ab06d8ebf644@bosc.ac.cn> In-Reply-To: <4b6e49ee-d2fd-4e54-88d5-ab06d8ebf644@bosc.ac.cn> From: Robert Foss Date: Mon, 13 May 2024 18:49:59 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: drm/bridge: adv7511: Attach next bridge without creating connector To: Sui Jingfeng Cc: Liu Ying , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dmitry.baryshkov@linaro.org, biju.das.jz@bp.renesas.com, aford173@gmail.com, bli@bang-olufsen.dk, robh@kernel.org, jani.nikula@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2024 at 6:30=E2=80=AFPM Sui Jingfeng wrote: > > Hi, > > > On 5/13/24 16:02, Liu Ying wrote: > > The connector is created by either this ADV7511 bridge driver or > > any DRM device driver/previous bridge driver, so this ADV7511 > > bridge driver should not let the next bridge driver create connector. > > > > If the next bridge is a HDMI connector, the next bridge driver > > would fail to attach bridge from display_connector_attach() without > > the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag. > > > > Add that flag to drm_bridge_attach() function call in > > adv7511_bridge_attach() to fix the issue. > > > > This fixes the issue where the HDMI connector bridge fails to attach > > to the previous ADV7535 bridge on i.MX8MP EVK platform: > > > > [ 2.216442] [drm:drm_bridge_attach] *ERROR* failed to attach bridge = /hdmi-connector to encoder None-37: -22 > > [ 2.220675] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] us= ing ADMA > > [ 2.226262] [drm:drm_bridge_attach] *ERROR* failed to attach bridge = /soc@0/bus@30800000/i2c@30a30000/hdmi@3d to encoder None-37: -22 > > [ 2.245204] [drm:drm_bridge_attach] *ERROR* failed to attach bridge = /soc@0/bus@32c00000/dsi@32e60000 to encoder None-37: -22 > > [ 2.256445] imx-lcdif 32e80000.display-controller: error -EINVAL: Fa= iled to attach bridge for endpoint0 > > [ 2.265850] imx-lcdif 32e80000.display-controller: error -EINVAL: Ca= nnot connect bridge > > [ 2.274009] imx-lcdif 32e80000.display-controller: probe with driver= imx-lcdif failed with error -22 > > > > Fixes: 14b3cdbd0e5b ("drm/bridge: adv7511: make it honour next bridge i= n DT") > > Signed-off-by: Liu Ying > > --- > > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu= /drm/bridge/adv7511/adv7511_drv.c > > index dd21b81bd28f..66ccb61e2a66 100644 > > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > > @@ -953,7 +953,8 @@ static int adv7511_bridge_attach(struct drm_bridge = *bridge, > > int ret =3D 0; > > > > if (adv->next_bridge) { > > - ret =3D drm_bridge_attach(bridge->encoder, adv->next_brid= ge, bridge, flags); > > + ret =3D drm_bridge_attach(bridge->encoder, adv->next_brid= ge, bridge, > > + flags | DRM_BRIDGE_ATTACH_NO_CONN= ECTOR); > > As a side note, I think, maybe you could do better in the future. > > If we know that the KMS display driver side has the HDMI connector > already created for us, we should pass DRM_BRIDGE_ATTACH_NO_CONNECTOR > from the root KMS driver side. Which is to forbidden all potential > drm bridge drivers to create a connector in the middle. > > The KMS display driver side could parse the DT to know if there is > a hdmi connector, or merely just hdmi connector device node, or > something else. > > However, other maintainer and/or reviewer's opinion are of cause > more valuable. I send a A-b because I thought the bug is urgency > and it's probably more important to solve this bug first. And > maybe you can Cc: if you like. > Reviewed-by: Robert Foss