From patchwork Mon May 27 04:50:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10962077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B3731880 for ; Mon, 27 May 2019 04:51:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A32028960 for ; Mon, 27 May 2019 04:51:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E45828AC1; Mon, 27 May 2019 04:51:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3090628960 for ; Mon, 27 May 2019 04:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6kqWx4Yctn8rABzAUXmigvERmLe3xiJOeJ4OGVTuAa0=; b=c8d8c6QBuEND19 tI0WJDLvsR4SJp8iXaupEogwRGGK8/ugkayeEgrxtYHdY+Qk+SABtWVbbGBKRSyXEAQOePl08blVf ANqc1KXdCM3FiUvlP/jA41BnxeItCc0euFxbKGtnsNVFfTO83j4Lgudf5E2A9tJMLM5rEk8XpYbx2 uZ34KA3u9qYYYzq8oxlTcTspFy0qIeDeiEchCJVMGbkhWbKEI6+leJZ7k1mnXNgR//OP2eeiCjYla vL8DDzRtkrh+tFzWQht4EF2bC3JtR1iiFHqca0dC+OlcN5L/PZHj1mFi9SWCOSR+5hlETistKgTYh 4N4kc+MBDwPbW0GM8Uag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7br-0007xp-PV; Mon, 27 May 2019 04:51:43 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7bg-0007i4-9p for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2019 04:51:36 +0000 Received: by mail-pl1-x641.google.com with SMTP id go2so6534852plb.9 for ; Sun, 26 May 2019 21:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lqtXYGK6k+BsF6lFW0Ln3+MfttYOEkXamBERmqOmC5Y=; b=HF/zJF0QdICLy7NJ4bW6FA9TCLsUv3ADJGYPEPuA3By1u7Y8V2Rl/zlVDy2sdKk81o IbxnGSFNNx2FgwLaedCVxPoaF9ANY3vK9P0MF5dAYMhvATfvsyTjwFBSMA0sEktklVak GoJSPLBV+x21zj7b9LVfsAHc8PGNEre2C1GFU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=lqtXYGK6k+BsF6lFW0Ln3+MfttYOEkXamBERmqOmC5Y=; b=R/+RVOc5QlbFHjInVugAruQNCOHV8kXKAl3BXcYO2ACPb1etdCJLAfOP/Y8d785B0U Y4QtQmjKMiT5Qb0QiaIQ1wbxX0kFwf8Yh3+zbSVSv8A0fMUpsOLWD2m5vilnSbRYqKsZ OZOnT0fZLY0iEYJhG31jz2UlDXX+DLW1he4fS46NYWp2Is3k/JyE8D/jV+V4+swmAyP2 iWegnC9AaLUVzvqlDqsq+/DcsZz66ii1xeaoTRkk1MVmxEiOVt7eiiV+VurUPisceT9b fxZ9EorK332iBQ7dXiqDLJrm/geslQh+QBSrJ58kNg3EvgxrJNPCochogOOPuECFfqHP eL0Q== X-Gm-Message-State: APjAAAWdWAv1XKLOMUKmIuHO3dN98y4ipXCoW5ZMQYLd1sOSBwvDt9wC dXmFDKxQo9TIBOwXmFr728aCqcqYL9VV8w== X-Google-Smtp-Source: APXvYqx3i22O/tAoY6zgk8Ct9ltJx/aRFrpHG2CUs0/G8ATOoqFQULNscuyQ9TI0cY5+0fUmhDePyw== X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr77262990plb.240.1558932691335; Sun, 26 May 2019 21:51:31 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id t18sm8082745pgm.69.2019.05.26.21.51.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 May 2019 21:51:30 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] drm: mediatek: fix unbind functions Date: Mon, 27 May 2019 12:50:52 +0800 Message-Id: <20190527045054.113259-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527045054.113259-1-hsinyi@chromium.org> References: <20190527045054.113259-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190526_215132_784881_5FCEC2C4 X-CRM114-Status: GOOD ( 13.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Matthias Brugger , linux-mediatek@lists.infradead.org, Daniel Vetter , CK Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP move mipi_dsi_host_unregister() to .remove since mipi_dsi_host_register() is called in .probe. detatch panel in mtk_dsi_destroy_conn_enc(), since .bind will try to attach it again. Fixes: 2e54c14e310f ("drm/mediatek: Add DSI sub driver") Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index b00eb2d2e086..c9b6d3a68c8b 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -844,6 +844,8 @@ static void mtk_dsi_destroy_conn_enc(struct mtk_dsi *dsi) /* Skip connector cleanup if creation was delegated to the bridge */ if (dsi->conn.dev) drm_connector_cleanup(&dsi->conn); + if (dsi->panel) + drm_panel_detach(dsi->panel); } static void mtk_dsi_ddp_start(struct mtk_ddp_comp *comp) @@ -1073,7 +1075,6 @@ static void mtk_dsi_unbind(struct device *dev, struct device *master, struct mtk_dsi *dsi = dev_get_drvdata(dev); mtk_dsi_destroy_conn_enc(dsi); - mipi_dsi_host_unregister(&dsi->host); mtk_ddp_comp_unregister(drm, &dsi->ddp_comp); } @@ -1179,6 +1180,7 @@ static int mtk_dsi_remove(struct platform_device *pdev) mtk_output_dsi_disable(dsi); component_del(&pdev->dev, &mtk_dsi_component_ops); + mipi_dsi_host_unregister(&dsi->host); return 0; } From patchwork Mon May 27 04:50:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10962079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEE8513AD for ; Mon, 27 May 2019 04:51:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD80728AB0 for ; Mon, 27 May 2019 04:51:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B196C28AB3; Mon, 27 May 2019 04:51:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47C3428AD5 for ; Mon, 27 May 2019 04:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GQe09thY8a2E90GDSJaHIReqIZoizt9DjlMT/QYPlXY=; b=OetSJfAI98IBqZ sNiEF8gwO0hf91C4QZqkL1A4N0ruKOYDrsREjAoyV7ykKIvs3KhXc2kS3lc9zZXH8B9my7vUQJ99v S6kTdbhbOB22D2fIsARURueG+2850FzlRAlfQzhOF93PHDrd82gr/6fDyLbnIndtTJRX9fwpKUB8k etRxSrlj1o8zabbYRa57F0esWcaiNmPdaOPu9Es9KxbO5u+YO+XuFNgDbcfAld7arivjP0stai7Zn Eqwq/CdBw0eJJx2PzMNZAj2DuuqxVxxzx0aCwXFM3U6RYUs1fyFVyoL2zkYrRBXhf5PfhbUdmBgpJ oP2p/iIb6qMHFh+pMrSg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7c0-00087b-Qq; Mon, 27 May 2019 04:51:52 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7bk-0007oB-Cz for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2019 04:51:38 +0000 Received: by mail-pf1-x443.google.com with SMTP id u17so8836889pfn.7 for ; Sun, 26 May 2019 21:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nTNnUu5Pg74lFPYV76pxj/avOtvPxN38IgfsN4zW7KQ=; b=fjbKiekoEYOoJBE0nUV6/Q9YCysuZfEp+pEMPPi41BXxdQCweXz3u6dxC632AR4SmS y2yCfjzWKum60A/UdH1QkxrFpcR111NmZhwY2ZqRwh9ElglQSnMEFWXz4doFbAksG3fj /Q/d3ScgIQ/QIeK6u0PHG4rbgVSsL949aTXQg= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=nTNnUu5Pg74lFPYV76pxj/avOtvPxN38IgfsN4zW7KQ=; b=FfddRgDWlrmJv5Fsem5/9kciVMeyRlQ8G8LgEhtHMjlhhLJhFtGdFYtzPOjqLzw9Ol wSnTXxa5Hqt9G5VnQ7BXkQblbDoUDe1RA4+SvMTF6fdyU7VjwypvIgE3IwMaV6E22N8t rkMmpd1lmI8SE2YXL3yiaMbg9tqk3E1mj8rogHFMzFUnvF4fZRi2lxRw3TvvhMj0cLBq Py6maxQ9qacv17hs1fgLfzwfcMZMUXBP8KdGJnZTxE3adpL2Red6wVnv/KrHVacBwzhm 1NzPWvpXtFyirv5Bd+ls/vIoKNhtZlVvfZJRz+ipqBDAq4UEoScx8D4LrLSUIBA5t3en Z1gA== X-Gm-Message-State: APjAAAWDMJpL/jmu7guM3DFMPBAAl8TiRcXvK91+NVNFNgYF4XRcJ7EB S68AXLZ/YzRXZSj5oNTf5n30aJ6bW9RnnQ== X-Google-Smtp-Source: APXvYqx8WppvdjWZOUQtU7qfCXOcLLa/ChE21AsiaFIreNV8ZZUyC8OHhrhAkIaKUz2GmqI9e+qn3Q== X-Received: by 2002:a17:90a:fa09:: with SMTP id cm9mr28441942pjb.137.1558932695346; Sun, 26 May 2019 21:51:35 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id t18sm8082745pgm.69.2019.05.26.21.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 May 2019 21:51:34 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] drm: mediatek: remove clk_unprepare() in mtk_drm_crtc_destroy() Date: Mon, 27 May 2019 12:50:53 +0800 Message-Id: <20190527045054.113259-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527045054.113259-1-hsinyi@chromium.org> References: <20190527045054.113259-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190526_215136_587320_756A6E94 X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Matthias Brugger , linux-mediatek@lists.infradead.org, Daniel Vetter , CK Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There is no clk_prepare() called in mtk_drm_crtc_reset(), when unbinding drm device, mtk_drm_crtc_destroy() will be triggered, and the clocks will be disabled and unprepared in mtk_crtc_ddp_clk_disable. If clk_unprepare() is called here, we'll get warnings[1], so remove clk_unprepare() here. [1] [ 19.416020] mm_disp_ovl0 already unprepared .... [ 19.487536] pstate: 60000005 (nZCv daif -PAN -UAO) [ 19.492325] pc : clk_core_unprepare+0x1d8/0x220 [ 19.496851] lr : clk_core_unprepare+0x1d8/0x220 [ 19.501373] sp : ffffff8017bbba30 [ 19.504681] x29: ffffff8017bbba50 x28: fffffff3f7978000 [ 19.509989] x27: 0000000000000000 x26: 0000000000000000 [ 19.515298] x25: 0000000044000000 x24: fffffff3f7978000 [ 19.520605] x23: 0000000000000060 x22: ffffff9688a89f48 [ 19.525912] x21: fffffff3f8755540 x20: 0000000000000000 [ 19.531219] x19: fffffff3f9d5ca00 x18: 00000000fffebd18 [ 19.536526] x17: 000000000000003c x16: ffffff96881458e4 [ 19.541833] x15: 0000000000000005 x14: 706572706e752079 [ 19.547140] x13: ffffff80085cc950 x12: 0000000000000000 [ 19.552446] x11: 0000000000000000 x10: 0000000000000000 [ 19.557754] x9 : 1b0fa21f0ec0d800 x8 : 1b0fa21f0ec0d800 [ 19.563060] x7 : 0000000000000000 x6 : ffffff9688b5dd07 [ 19.568366] x5 : 0000000000000000 x4 : 0000000000000000 [ 19.573673] x3 : 0000000000000000 x2 : fffffff3fffa0248 [ 19.578979] x1 : fffffff3fff97a00 x0 : 000000000000001f [ 19.584288] Call trace: [ 19.586734] clk_core_unprepare+0x1d8/0x220 [ 19.590914] clk_unprepare+0x30/0x40 [ 19.594491] mtk_drm_crtc_destroy+0x30/0x5c [ 19.598672] drm_mode_config_cleanup+0x124/0x290 [ 19.603286] mtk_drm_unbind+0x44/0x5c [ 19.606946] take_down_master+0x40/0x54 [ 19.610775] component_master_del+0x70/0x94 [ 19.614952] mtk_drm_remove+0x28/0x44 [ 19.618612] platform_drv_remove+0x28/0x50 [ 19.622702] device_release_driver_internal+0x138/0x1ec [ 19.627921] device_release_driver+0x24/0x30 [ 19.632185] unbind_store+0x90/0xdc [ 19.635667] drv_attr_store+0x3c/0x54 [ 19.639327] sysfs_kf_write+0x50/0x68 [ 19.642986] kernfs_fop_write+0x12c/0x1c8 [ 19.646997] __vfs_write+0x54/0x15c [ 19.650482] vfs_write+0xcc/0x188 [ 19.653792] ksys_write+0x78/0xd8 [ 19.657104] __arm64_sys_write+0x20/0x2c [ 19.661027] el0_svc_common+0x9c/0xfc [ 19.664686] el0_svc_compat_handler+0x2c/0x38 [ 19.669039] el0_svc_compat+0x8/0x18 [ 19.672609] ---[ end trace 41ce954855cda6f0 ]--- Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index acad088173da..c2b38997ac8b 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -98,10 +98,6 @@ static void mtk_drm_finish_page_flip(struct mtk_drm_crtc *mtk_crtc) static void mtk_drm_crtc_destroy(struct drm_crtc *crtc) { struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - int i; - - for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) - clk_unprepare(mtk_crtc->ddp_comp[i]->clk); mtk_disp_mutex_put(mtk_crtc->mutex); From patchwork Mon May 27 04:50:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10962085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D434313AD for ; Mon, 27 May 2019 04:52:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C43AD28AB0 for ; Mon, 27 May 2019 04:52:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B12B928AE3; Mon, 27 May 2019 04:52:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64ABF28AD5 for ; Mon, 27 May 2019 04:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HY2R3uFm8F4LHSBBrMkehQVyieRzS08E3SUEaBaXW4I=; b=nvWjTscNzcPVFE 0YklbCMcV7l1QaglInvGlGy3UPlQ18UYsbJMsWFPVjcquS+PNfmeXPDhhgE95rT2qhE/I9rEwwUPh rXS1LXn7SZMiXTh0wh0p8fe/kaepdtu9Ao+fyRcs/BbuAQqGiRCsbfA/OdIR50+oikC1Bnr7ZbHWr 0rDZK1wlHX8rXyGmbmiSReCHufriOpC2Roel848jXlbi8rQF9GM4gRHtZsnaw/mIg3sgTiGctW0We xl05Mw5Fd4/2xVIAaiXMNXaAXk05cZ3jFEXVmghTatPF7f5hqtgu5MtF3jMOr41S7gUO71g2iEp0e 8xWiLz43Cw448zvk8RiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7cS-00006q-6r; Mon, 27 May 2019 04:52:20 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hV7bn-0007sd-AY for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2019 04:51:41 +0000 Received: by mail-pg1-x541.google.com with SMTP id f25so8369740pgv.10 for ; Sun, 26 May 2019 21:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yUlmxOGnO1980oiGUAyuWMhEyWoJa2PD9pLjCihMzns=; b=nh0J9d5tWECthEBuxY2gAfAcXw9czzCE8YBbgHOFmoDnQGRnZEmVmdROoGoBbFK5l5 S5RwdS7TIk22ToA6KWeEGhKKKMhk701Hett9H/ziY9fXTnM2ZOxXEYwhuy2heRufHuva pU6I6/OE0aiTYhfWOUjCBadxOrSI2D3SvI0JU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yUlmxOGnO1980oiGUAyuWMhEyWoJa2PD9pLjCihMzns=; b=nHrkgRAHdGRDssO3TEFooRfJtSBMpr8jkn3ht40XGM5AiDw/pMSHTpPRIvK5223bVz hYPd6l5/Qe67NSbnHWq1yQsE/xRGpF4l3Pj9XRlFEmP2EYOyZ+0NT7nEbwpo0IlO8IcN yKeQLWBooStKtNomf1zmvTNKOzT+xWLKrznVKNCudO7iuusBxNsyfcNmJMyUS57VuGim i+gT6yE/fGc026cybKzB/6kNRbiwqJPcyKl4oo8RdMpttWdd1nZZMe0KB0l9CFFoC580 eBcAbwGyxHD4vbm/f4cp5fCyCLKsyFq8U2O0yA+kWSmFrxWj7sM+5XL/LBUHcAmpm0Dl JUng== X-Gm-Message-State: APjAAAVsUCX4M1G0SR4HGGO+pNOLCGE9Hj/kCySpfV6fnTfvRFQ8KaOd bGvO+r0GpvDhwS90PFYLqQf2MmAqu8tuZQ== X-Google-Smtp-Source: APXvYqzFWcOQGNGke5SxYSfkPoz9/3QKFu6HpjgLwWyUA0idRxx7jSQ5CVK8tJUBDNqu1vgLMfZVlg== X-Received: by 2002:a63:6bc3:: with SMTP id g186mr111791764pgc.21.1558932698131; Sun, 26 May 2019 21:51:38 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id t18sm8082745pgm.69.2019.05.26.21.51.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 May 2019 21:51:37 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] drm: mediatek: unbind components in mtk_drm_unbind() Date: Mon, 27 May 2019 12:50:54 +0800 Message-Id: <20190527045054.113259-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527045054.113259-1-hsinyi@chromium.org> References: <20190527045054.113259-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190526_215139_637120_1CB9E3B5 X-CRM114-Status: GOOD ( 13.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Matthias Brugger , linux-mediatek@lists.infradead.org, Daniel Vetter , CK Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Unbinding components (i.e. mtk_dsi and mtk_disp_ovl/rdma/color) will trigger master(mtk_drm)'s .unbind(), and currently mtk_drm's unbind won't actually unbind components. During the next bind, mtk_drm_kms_init() is called, and the components are added back. .unbind() should call mtk_drm_kms_deinit() to unbind components. And since component_master_del() in .remove() will trigger .unbind(), which will also unregister device, it's fine to remove original functions called here. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 57ce4708ef1b..bbfe3a464aea 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -311,6 +311,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) static void mtk_drm_kms_deinit(struct drm_device *drm) { drm_kms_helper_poll_fini(drm); + drm_atomic_helper_shutdown(drm); component_unbind_all(drm->dev, drm); drm_mode_config_cleanup(drm); @@ -397,7 +398,9 @@ static void mtk_drm_unbind(struct device *dev) struct mtk_drm_private *private = dev_get_drvdata(dev); drm_dev_unregister(private->drm); + mtk_drm_kms_deinit(private->drm); drm_dev_put(private->drm); + private->num_pipes = 0; private->drm = NULL; } @@ -568,13 +571,8 @@ static int mtk_drm_probe(struct platform_device *pdev) static int mtk_drm_remove(struct platform_device *pdev) { struct mtk_drm_private *private = platform_get_drvdata(pdev); - struct drm_device *drm = private->drm; int i; - drm_dev_unregister(drm); - mtk_drm_kms_deinit(drm); - drm_dev_put(drm); - component_master_del(&pdev->dev, &mtk_drm_ops); pm_runtime_disable(&pdev->dev); of_node_put(private->mutex_node);