From patchwork Tue Apr 5 23:45:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12802130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 126ECC433F5 for ; Tue, 5 Apr 2022 23:46:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E248E10EA3B; Tue, 5 Apr 2022 23:45:55 +0000 (UTC) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3D3910EAE9 for ; Tue, 5 Apr 2022 23:45:54 +0000 (UTC) Received: by mail-lj1-x233.google.com with SMTP id s13so1064642ljd.5 for ; Tue, 05 Apr 2022 16:45:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=sPe/iqwEicjdxx1JaEmsexqI0mM5o2EgIZXKAaX//Hs=; b=gd6O1Mwu7ekfyikdHG4+HD22Kwjth89ebHwIsgU1WE+yQ8Xbb/34CgYYPszNlW17EP THqPT6iHYqRDCyyiNQdSrV0XvlnxqRSC0KcPvOIi48V7Gsj/NiH3zubwBQQISxNfN8tK 6A+ehOjpBinhmRN7TCHdgcwZCSVoYvVROT3TqwhhGED2SGoKiLo4IY91gZrZKNd2w7VD IMQYYkf4npxk+Rd/wKI6ARTDrUYh539Y0Rj6O8VywVOfdRkxViTrrfDQ5F7JNo9X6Jep bKEpjG2x8veupDp/5UF1YOh1ufzl/dCfLxLs+z0jAlRN3ugQi2yQLcGl9sHG4bD+CUrV oaCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sPe/iqwEicjdxx1JaEmsexqI0mM5o2EgIZXKAaX//Hs=; b=LtDKYtstYh/JL/+6AvnWCXzqtXcYqWBkWoTcRlYwb5zfi2YAMJSpJJx5Ttl2wTnaxY txVF5C8EUlBPwhE3H202a9ffG0fBn8+jtMiHHZE27M4rX4UAoMyV/+HVICbxx2R2EUPx r4L7pPgxHFfsS4Q7EBDAsAZ7HHVaBLTKZK3vlzwi9LTaQ3X6ENz/oO3Up90D1ZkwPwZz hC9+wJ1WnhFQhmD1H96A7UZDO3zlvTnp77ZXCFhvdHRcfOCq1Cn1QvsXLmfuJbFTwY5v dQR4f/CkA5mkeGUXR1Ij7L6SgfSyIKwTaFdAEWFTau3+gUj5NksAeG4Wbd+1PxRHezkO 4CfQ== X-Gm-Message-State: AOAM533Q7kCtxoPMAdNutEXHlUBbvln9a0UK2YyuQzMqCCByouBX3aeg M2x0WiDvOwDAToNGz8qg25yw9Q== X-Google-Smtp-Source: ABdhPJxApADsqzdd9+ZMoEM2yi86wkhuBvf78CQFa7fEGP3UIejNKhVqu6/I+/g+66xdehrKU8LpwA== X-Received: by 2002:a05:651c:179a:b0:247:d37b:6ec5 with SMTP id bn26-20020a05651c179a00b00247d37b6ec5mr3492194ljb.112.1649202353228; Tue, 05 Apr 2022 16:45:53 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id g11-20020ac24d8b000000b0044a3454c858sm1651897lfe.81.2022.04.05.16.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:45:52 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 1/4] drm/msm/hdmi: properly add and remove created bridges Date: Wed, 6 Apr 2022 02:45:48 +0300 Message-Id: <20220405234551.359453-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> References: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add calls to drm_bridge_add()/drm_bridge_remove() for the internal HDMI bridges. This fixes the following warning. [ 2.195003] ------------[ cut here ]------------ [ 2.195044] WARNING: CPU: 0 PID: 1 at kernel/locking/mutex.c:579 __mutex_lock+0x840/0x9f4 [ 2.198774] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 2.198786] Modules linked in: [ 2.211868] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.18.0-rc1-00002-g3054695a0d27-dirty #55 [ 2.214671] Hardware name: Generic DT based system [ 2.223265] unwind_backtrace from show_stack+0x10/0x14 [ 2.228036] show_stack from dump_stack_lvl+0x58/0x70 [ 2.233159] dump_stack_lvl from __warn+0xc8/0x1e8 [ 2.238367] __warn from warn_slowpath_fmt+0x78/0xa8 [ 2.243054] warn_slowpath_fmt from __mutex_lock+0x840/0x9f4 [ 2.248174] __mutex_lock from mutex_lock_nested+0x1c/0x24 [ 2.253818] mutex_lock_nested from drm_bridge_hpd_enable+0x2c/0x84 [ 2.259116] drm_bridge_hpd_enable from msm_hdmi_modeset_init+0xc0/0x21c [ 2.265279] msm_hdmi_modeset_init from mdp4_kms_init+0x53c/0x90c [ 2.272223] mdp4_kms_init from msm_drm_bind+0x514/0x698 [ 2.278212] msm_drm_bind from try_to_bring_up_aggregate_device+0x160/0x1bc [ 2.283595] try_to_bring_up_aggregate_device from component_master_add_with_match+0xc4/0xf8 [ 2.290281] component_master_add_with_match from msm_pdev_probe+0x274/0x350 [ 2.298958] msm_pdev_probe from platform_probe+0x5c/0xbc [ 2.305990] platform_probe from really_probe.part.0+0x9c/0x290 [ 2.311284] really_probe.part.0 from __driver_probe_device+0xa8/0x13c [ 2.317011] __driver_probe_device from driver_probe_device+0x34/0x10c [ 2.323610] driver_probe_device from __driver_attach+0xbc/0x178 [ 2.330122] __driver_attach from bus_for_each_dev+0x74/0xc0 [ 2.336282] bus_for_each_dev from bus_add_driver+0x160/0x1e4 [ 2.341925] bus_add_driver from driver_register+0x88/0x118 [ 2.347570] driver_register from do_one_initcall+0x6c/0x334 [ 2.352953] do_one_initcall from kernel_init_freeable+0x1bc/0x220 [ 2.358853] kernel_init_freeable from kernel_init+0x18/0x12c [ 2.364842] kernel_init from ret_from_fork+0x14/0x2c [ 2.370657] Exception stack(0xf081dfb0 to 0xf081dff8) [ 2.375693] dfa0: 00000000 00000000 00000000 00000000 [ 2.380733] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 2.388893] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 2.397170] irq event stamp: 202911 [ 2.403551] hardirqs last enabled at (202911): [] _raw_spin_unlock_irqrestore+0x44/0x48 [ 2.406944] hardirqs last disabled at (202910): [] _raw_spin_lock_irqsave+0x68/0x6c [ 2.416063] softirqs last enabled at (202738): [] __do_softirq+0x2f8/0x530 [ 2.424638] softirqs last disabled at (202733): [] __irq_exit_rcu+0x14c/0x170 [ 2.432453] ---[ end trace 0000000000000000 ]--- Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 10ebe2089cb6..97c24010c4d1 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -15,6 +15,7 @@ void msm_hdmi_bridge_destroy(struct drm_bridge *bridge) struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); msm_hdmi_hpd_disable(hdmi_bridge); + drm_bridge_remove(bridge); } static void msm_hdmi_power_on(struct drm_bridge *bridge) @@ -349,6 +350,8 @@ struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; + drm_bridge_add(bridge); + ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret) goto fail; From patchwork Tue Apr 5 23:45:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12802131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E954C433F5 for ; Tue, 5 Apr 2022 23:46:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83ED510ED3C; Tue, 5 Apr 2022 23:45:57 +0000 (UTC) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9679110EB6E for ; Tue, 5 Apr 2022 23:45:55 +0000 (UTC) Received: by mail-lj1-x232.google.com with SMTP id a30so1013054ljq.13 for ; Tue, 05 Apr 2022 16:45:55 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=1Iqbt8lWWr5PzRARKZi/p/Y11hVS9kTb+tshjhqgJ7E=; b=wRW6uTvNQyhoC+8+zMwMBjUsGSemFwkaIJ8xaNBFrridKcCvtpLpQyKrjQi92H0RXs 1D/QOTXmnzYeouRzogg5XhCE2NbolhKi7R5bnxy0vwps03S5Kw6INRd3FQJNmj01+qPz xauU8d/5fQNStJjmZafsoSV03V45G4aKtm3lWT4i/jYtKvl9TDeSnsP9arkpL4sZm3a5 847El/elkSrnN4m36pMvypC4m362PwtvyUhNsxl+pRqclq/77+e0knH7z6rF3T7L0Gyh PcQMS8E6R8iKI4SvjktmVpngyc9yrfgZA7SoDx3dX7mepxwHdlYbPNfer0R3yXioZ5DV QFQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1Iqbt8lWWr5PzRARKZi/p/Y11hVS9kTb+tshjhqgJ7E=; b=e8XDdm/Zu7XF6GdSbCyNUP+dF/cpDFQ2w/CFl96wpwZLPGd5LHiEejJbXZZh3/UaHX h5fhujOQ44svT/Es/MqPRmR5FitCbm366g667msfugDk8MLxIXvcd19nlLGGrKbdCg6M wWp+J6PaR2hGmMYKxU1ezFz3Scb64JTKKVHvuoNMO9F9vYS4gDqxjN02ijOZ13bBLaKG s2iDe9CCeoY3dRYHzKkhkHbHgU+psb/nfPUNd+f/bmUa7vzbaHql7cQdFRCtM5tb2n8e 158jOjUgy8x47dGDkfQfSx84q04sGaMWuJATM7I9m4seTP8QrhTrU/rOB+XkTH92+v6c SJJw== X-Gm-Message-State: AOAM533W35OibhZk8EmZPxxxqzOmiYjaxIjh6Uggnf5og0XksWfjXlua pTt1wV8mvhKeFDC/nSpuU6k7TqsffZbCuQ== X-Google-Smtp-Source: ABdhPJw4ndQZB0hZbehYl/6rPiUUMMPM2zRus59KEaw1GkIplzOXt3oANnF+9oTn3gbdRdhjTxezXw== X-Received: by 2002:a2e:b88b:0:b0:249:a45a:b9a3 with SMTP id r11-20020a2eb88b000000b00249a45ab9a3mr3670215ljp.48.1649202353964; Tue, 05 Apr 2022 16:45:53 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id g11-20020ac24d8b000000b0044a3454c858sm1651897lfe.81.2022.04.05.16.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:45:53 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 2/4] drm/msm/dsi: properly add and remove created bridges Date: Wed, 6 Apr 2022 02:45:49 +0300 Message-Id: <20220405234551.359453-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> References: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add calls to drm_bridge_add()/drm_bridge_remove() for the internal DSI bridges. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 0c1b7dde377c..918498e71255 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -665,6 +665,8 @@ struct drm_bridge *msm_dsi_manager_bridge_init(u8 id) bridge = &dsi_bridge->base; bridge->funcs = &dsi_mgr_bridge_funcs; + drm_bridge_add(bridge); + ret = drm_bridge_attach(encoder, bridge, NULL, 0); if (ret) goto fail; @@ -735,6 +737,7 @@ struct drm_connector *msm_dsi_manager_ext_bridge_init(u8 id) void msm_dsi_manager_bridge_destroy(struct drm_bridge *bridge) { + drm_bridge_remove(bridge); } int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg) From patchwork Tue Apr 5 23:45:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12802132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C167C433F5 for ; Tue, 5 Apr 2022 23:46:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB0AF10EB6E; Tue, 5 Apr 2022 23:45:58 +0000 (UTC) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81E6C10EC60 for ; Tue, 5 Apr 2022 23:45:56 +0000 (UTC) Received: by mail-lj1-x22e.google.com with SMTP id 17so1091200lji.1 for ; Tue, 05 Apr 2022 16:45:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aea1eCmRXc8SvtM+T5RIzo3X5fELyftyC6ru1eyNaJQ=; b=QNMeYGmbbeXLzOYPgSwVK5EPsBm0loeIlT/9PVLnAQSYIwBexuRGVtEtuqmfnl62ol U2iFKUauEhHdSPbFcevKHJVoP5d75BPcy1bgBlhguKYCU5TqlCdJykzy4Eg8qBfj+vrZ V+qlU5SZBBowD+Pzd9YjJn2vk1XVMXZRGRq4QwKYRXxGdMvnIF+LbUOJmXrdkxn90X+a //gUCMfRfZ8X8KUvWOd9x9MI/+VUEnlGqBwV2Vf27WjJ3TP78Bt2g77Rw4+C5EQhD/wn 3GuadRjY3Jf2C+2HolvwFGp8MLuaGEmQh7y9gvQICUA9PsmRLfKT2sIjc3C1mc2U72Hn K3FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Aea1eCmRXc8SvtM+T5RIzo3X5fELyftyC6ru1eyNaJQ=; b=ZlvLBJSiv3DV3Ja1U+KMEyI3zkUyfekoEzfZypSHQw6lLBsDxzAP/mHavDXA11ZQ6y QUKLWEFtKkmZA+6GmcVdUf6cBb/vWMi2lvgQiloHZ4XGw+GIslAiiC7nBLjsDrC65KJ4 lGcb/UJ5cCXxGxrL6VU9scP2jPcV5KnKELiXoPHjL34BEeNkuNTqVeUdB0aArErP2Agc aFI989PidqYKSddnidCy19//bOmeUSkt5c8EAv36Bpt9XJ8TAOmU2iYqgxhuf7wQLntH eXkDRhvh9BbNkz3S/85IQGhMVMkODA+wukC06z579RryuzWsyOMjntncj0LqxFjpjFoN wL5g== X-Gm-Message-State: AOAM531iK0nLm2VYQ0m9BUV7Z4dn2Xi+/91fNvK1+sD96m/QQW3298mg I0qOEGyNMPohnpidgfTqHOIT3w== X-Google-Smtp-Source: ABdhPJzo4h+1cA8+ptBf6oSHmeKyXyUhblQE/hDzU3ZFeZOpPffVOlZamsan2q3hL+qQPtLNbg7+FQ== X-Received: by 2002:a05:651c:154:b0:24b:152:266e with SMTP id c20-20020a05651c015400b0024b0152266emr3656017ljd.185.1649202354706; Tue, 05 Apr 2022 16:45:54 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id g11-20020ac24d8b000000b0044a3454c858sm1651897lfe.81.2022.04.05.16.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:45:54 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 3/4] drm/msm/dp: properly add and remove created bridges Date: Wed, 6 Apr 2022 02:45:50 +0300 Message-Id: <20220405234551.359453-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> References: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add calls to drm_bridge_add()/drm_bridge_remove() for the internal DP bridges. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_drm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 80f59cf99089..a7415f9eb80e 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -230,9 +230,13 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi bridge->funcs = &dp_bridge_ops; bridge->encoder = encoder; + drm_bridge_add(bridge); + rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc) { DRM_ERROR("failed to attach bridge, rc=%d\n", rc); + drm_bridge_remove(bridge); + return ERR_PTR(rc); } @@ -242,6 +246,7 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc < 0) { DRM_ERROR("failed to attach panel bridge: %d\n", rc); + drm_bridge_detach(bridge); drm_bridge_remove(bridge); return ERR_PTR(rc); } From patchwork Tue Apr 5 23:45:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12802133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 101D1C433F5 for ; Tue, 5 Apr 2022 23:46:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8AB610EB2C; Tue, 5 Apr 2022 23:46:00 +0000 (UTC) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1016A10EC6C for ; Tue, 5 Apr 2022 23:45:57 +0000 (UTC) Received: by mail-lj1-x236.google.com with SMTP id by7so1134529ljb.0 for ; Tue, 05 Apr 2022 16:45:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=3hI4loPQKfesNHihNQukITqdxiwz9vk8ypDb2Yqay+s=; b=JFBR9cW1qO6/WeFEIv0ozzxLr288vzqyaaEq2Wtjt3+bH0OGiYsl8rfUvBJYF8mkcD /EqeFYvgtii+DQ+ZDoEmy8Y/kv2FV7nTT54PEDic5H3AIG5XzNylEt38/ks/+jpbbyUF pmLYnBOGMv+t/yzkjrr5oVgavXVK32Ysc0l2iMfOq0Nz6REgyKAc3CSGrQG5oPImekAF 2HbvJBXr+EDpCv8sI1QsEfLQAWFkGHVh6Q1/MM1BHXfDw9h+wC2bXqB3/eplTQOwUr5O khU4G6iNjHc06Z5se+MX6Uo4bzkXuexzMKiEGc15pXfPPacXWXQN0wUgzqxg4WuJ7Tap Exjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3hI4loPQKfesNHihNQukITqdxiwz9vk8ypDb2Yqay+s=; b=rq7jnGfe4IzmiA4qaA6Bl9tk4SPQRVmLDq9nqGvRfrAG5dNbnJgbzkkcpTHMvvZr63 4i6Caohi3Y8atPwaiv1PpRsbBf+sVPnozEUPHrptbvzgD+MzqHyC47S1CyN18iFbCkgk A3Ox6odQUhIChNGZn+rXcaciGXNa0g6c0pVWrtWZQlAMRvkvUIqu76OgiROGainu1wVT tfXFy1dfWsO65Tro05DIvD58eyy1QgpicvMpr5+8M69pe7tOUymczDuHtQVk268c2Fyg VHL9GMTN8G13tBaEpJyS7lICX9VJJQmG07JT7rMKICHroYhz13vuKaVzqgtRE0sbl8F5 myUQ== X-Gm-Message-State: AOAM533Gfg6UYcMDOEFg/DaTdJRjQ4S7EJoX8ZqBeaZd34fY7MRGdzsj J8BTnRQWWuYjhz6dfGUreOoNng== X-Google-Smtp-Source: ABdhPJzxlKTyT9cYYHxN2DLSvcm8mw6mjktnkfjs1jTREW+tywB+hcj2PYPVdouYdXCOPLfHJvr6YQ== X-Received: by 2002:a2e:924d:0:b0:24b:238:3be8 with SMTP id v13-20020a2e924d000000b0024b02383be8mr3707357ljg.181.1649202355412; Tue, 05 Apr 2022 16:45:55 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id g11-20020ac24d8b000000b0044a3454c858sm1651897lfe.81.2022.04.05.16.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:45:55 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 4/4] drm/msm: unregister all internal bridges Date: Wed, 6 Apr 2022 02:45:51 +0300 Message-Id: <20220405234551.359453-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> References: <20220405234551.359453-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Unwind all drm_bridge_add() calls for internal bridges and remove all bridges added by the msm driver itself by calling drm_bridge_remove(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index affa95eb05fc..71e1b7393f6f 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -232,6 +232,9 @@ static int msm_drm_uninit(struct device *dev) drm_mode_config_cleanup(ddev); + for (i = 0; i < priv->num_bridges; i++) + drm_bridge_remove(priv->bridges[i]); + pm_runtime_get_sync(dev); msm_irq_uninstall(ddev); pm_runtime_put_sync(dev);