From patchwork Thu Mar 19 04:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 184687 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1656247ile; Thu, 19 Mar 2020 01:09:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vupGg18h9SQudHIsEZdIRhCHEMhYhkYtk8R05OWntcA4kk0VHZ4Dvd9s3fxneudmFzwPbTf X-Received: by 2002:a63:fe58:: with SMTP id x24mr2071190pgj.170.1584605374874; Thu, 19 Mar 2020 01:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584605374; cv=none; d=google.com; s=arc-20160816; b=rMGTEoXb7E5TxIoQPv55iW+vJFYwR7TTnvTBgb13lKIrJ6jd8/n3j2RLGk001rlIhU v44ZK1PrNrs7aX99DQgxrSZmwiJRFjBeR3sblRwpxWmQpPTX3Z52uxedCqzY0568gW1z qoZt9S46ppkxC+IMik8KeZBT1SP4Tk2ViHCVAtvyy7xMe5HuqmFQ6By7k2PQRZTk0dOB 3XxRPbFNK2pIlkmM+u5o4G3++tOlIEDYaFuYj/twPcd9obDJj35DZvO3iIKfcG5SJ7as N/QzzBF4xOs0yZMMLWhSfm4OLRYYOJNECzbAsEq6vNzD33ur+eq6v+UXCKayCj4UN9im bLPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=0VAfFmSNWryMWnAyUnF2XjkMt4b9va2srZcv6P+955U=; b=DChJigvcp8s+Zq9hlNSRxlUapBX/u2s4PdHluPk+BAUIuUE6QWi1sdNshwQbvFDkWF VnQeLyGEDKQoKcLqHvGd38yewCiqN+SjdJqmRzMgxuMlZX8jTQ7T16OUiZ1X8gK9+ifK olpNzRbZyNix58bJV5pQLAtlBJTYTgayNDSTqDZUguDAxJyl0pgQxddoVi29eUR/sOEF msZ+a9NpXFkwmV+qkGiGsoqmjQ3ONGna8E30AJQd1F1eb4jZlhAlvY3NaJ1nOXztHjp+ KvrbCuGfclRQXipGvS9l0/RLfoq/wVctNlT5MMPQrD4fSZuC6pGN1jugk5EL2t91hYHB Q+sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=tg2aN6xt; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g1si1290130plq.238.2020.03.19.01.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 01:09:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=tg2aN6xt; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 273D56E9AF; Thu, 19 Mar 2020 08:09:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B2736E0D8 for ; Thu, 19 Mar 2020 04:39:20 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id 37so534712pgm.11 for ; Wed, 18 Mar 2020 21:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ruMvWKaCTsbInQhs/V5bAwFT4fo/B2LhqokROVX1RJo=; b=tg2aN6xtBRVVIsylVN35uS278/h81kU5E3rrZb4l9rasLTWQ0gO2RA0UvpzzCntSPD ZPIiYQ8t6hnvWpKofzzGzll+jfkqbYURB0VtpYDjsIKqvD4B3bKHij1aLEY1qdFdWFUR 6II5O54rz9PrCLotYrETJh1NIQT3fKEtfL/DUGC2rs/BPsqoqb+egLQnKbiBy7uwf55n U+kLTmtbRTdj3d3FG0Jk7dNBxxYhnOvKmqe0Oau6zQGq5nEoJVoE1nooNnvWQxELdLl8 0bNe9Qqfe61hyW/e5KaoNY32tTxagRuyKyaKC1epbe1ve6VNNVmKXpriu+88+RagG67M Ixvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ruMvWKaCTsbInQhs/V5bAwFT4fo/B2LhqokROVX1RJo=; b=IB9WAwnE7vJw5/KuqLPZ13rABUDw93raLOhwaGiGVJlFQveuZCkkl9u1qXljR2ht99 lKhEi0msBMjvusAL2YaHOvnX4muslRu6Ea/XUaA87dmn3xCjhyNkltM3oS91ECCXAFzI xQd9GOi2Kj9IRNep6hGbXYI43QE6QFskD9U84oTWLGCB4K4DE6UPA1gQCv/lrLzw5j64 IDMLmoIMUqkFR9j65L/3envvT2ymPzdyZNCgfjvEE/7V0AnRE1PirfXnRiZx+t7SNhOE 2fogzZEqZmtBZC5w8k+/+4ZTMBBd+OcVPTJ0QsGXNndoui4cqe31TEk6IOMUOjM5CDEv x+rg== X-Gm-Message-State: ANhLgQ2/r7yGCKasZpk4CGOuRUfYojy8HgLM6B2UlHuxJ8CioZYhhOT9 1g8/0pDfpuX2D9BKVF1seqDPdg== X-Received: by 2002:a63:2a4b:: with SMTP id q72mr1309267pgq.441.1584592760401; Wed, 18 Mar 2020 21:39:20 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 25sm571370pfn.190.2020.03.18.21.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 21:39:19 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter Subject: [PATCH] drm/msm: Don't attempt to attach HDMI bridge twice Date: Wed, 18 Mar 2020 21:37:41 -0700 Message-Id: <20200319043741.3338842-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 19 Mar 2020 08:08:58 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Boris Brezillon , freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With the introduction of '3ef2f119bd3e ("drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder")' the HDMI bridge is attached both in msm_hdmi_bridge_init() and later in msm_hdmi_modeset_init(). The second attempt fails as the bridge is already attached to the encoder and the whole process is aborted. So instead make msm_hdmi_bridge_init() just initialize the hdmi_bridge object and let msm_hdmi_modeset_init() attach it later. Fixes: 3ef2f119bd3e ("drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder") Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) -- 2.24.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 6e380db9287b..0e103ee1b730 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -271,31 +271,18 @@ static const struct drm_bridge_funcs msm_hdmi_bridge_funcs = { /* initialize bridge */ struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) { - struct drm_bridge *bridge = NULL; struct hdmi_bridge *hdmi_bridge; - int ret; + struct drm_bridge *bridge; hdmi_bridge = devm_kzalloc(hdmi->dev->dev, sizeof(*hdmi_bridge), GFP_KERNEL); - if (!hdmi_bridge) { - ret = -ENOMEM; - goto fail; - } + if (!hdmi_bridge) + return ERR_PTR(-ENOMEM); hdmi_bridge->hdmi = hdmi; bridge = &hdmi_bridge->base; bridge->funcs = &msm_hdmi_bridge_funcs; - ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, 0); - if (ret) - goto fail; - return bridge; - -fail: - if (bridge) - msm_hdmi_bridge_destroy(bridge); - - return ERR_PTR(ret); }