From patchwork Wed May 29 10:25: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: 10966727 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 1390A933 for ; Wed, 29 May 2019 10:26:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04462287AA for ; Wed, 29 May 2019 10:26:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC262287E9; Wed, 29 May 2019 10:26:50 +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 A5C01287AA for ; Wed, 29 May 2019 10:26:50 +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=OWi3Ol10UTkvih5VntMYwUN4Ny6suOhbXX2e94Yu8aE=; b=ns6GwhLdWRZfWa JBjRcKVZXU5WMmJK30ujWinUQQ86peTdzZRZuWfkUx0C9uXiRIYVnQGWWgm4ImHtY3qIhRVGsY1Wy dOJTsdQEYUN5jxkamL7De/VG9TqPUCn/pWyAv6965nUh8MWL/9r9h3EiuoaEAzt62RocgwEw9DL/k efj9hzRrnqqzuC4zzjrF9/GdO0iyVkSvw+En7zKie4UvWYj7bmf17ytNOYgaFjwIBsIdTt5Mg1lYp o4WF94FjbApiNp2rM8FZ2SBMp9wP8ApGg3i1MaDAPsBYVYUWoPam1ZSoQ5s0heM9erO94Hbcy8bmz Aa1D0zb3dQROScZr9spQ==; 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 1hVvnF-0000F2-Bb; Wed, 29 May 2019 10:26:49 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVvn8-0008Vw-KU for linux-mediatek@lists.infradead.org; Wed, 29 May 2019 10:26:45 +0000 Received: by mail-pf1-x442.google.com with SMTP id d126so1355692pfd.2 for ; Wed, 29 May 2019 03:26:42 -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=GljBVRDvAaH/DkyFnuPUvDqT8RdA5gdVzG7vblp3VSs=; b=mNMl2dhA55pEBfDmm0KYY9HDhLUN9zY4R63Yol5LQp+MwaFD7w2xzRvbqvz1bFmf+u DMMZb+kETeAeYx2gPM9SRZ7DPKmUaheDn/YR7VfsXKXG2lpbc40nBCMhX7A6Ohts1pn+ kQiTIf76xeLlGk7d20NTCAZHzJA0ahlyXY/oc= 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=GljBVRDvAaH/DkyFnuPUvDqT8RdA5gdVzG7vblp3VSs=; b=mHCuP1gCnIBZZRUn/yyAJO8wVi+8osxr3K0xpdbFwe63UDJBcaoGeMIrUjDi5te0ef EdwB45PO+gvcVOZrzUbgb8Dzs1jZrcaSd5lvGLzd6bY8KCJ77HGptnBqqA2nEUbh4pbf qtnN/3Fus+QngVFaQuRr1Mm/DooVPNXBQi+wS3Cm+X9+y186hXq3xsRy8AZ6Ny50M1C6 z5H8CS/vfwm90PDlzKBDYG66KttcEHr/L0b0CljG6or/Gd9Nlp/VPGJ5Nl+7cbzKRV6l LKEbUbcPfZqqWx3nNuhVOPBuMl+5MZboy0hq9uqdW/SSHFRjeJLN4E8erTkjgUjL4u2n Db1w== X-Gm-Message-State: APjAAAVdeKbrvUE16xn7dMRf0R5LArifplF/cpI775VfB0kDd8br/06p 4Y+A+jCDTA3rIHlWjslJqDHBvg== X-Google-Smtp-Source: APXvYqz6GR4WNNXNVVY8FlZIz1QqWpoMlEteFKEd2dOX/waMt4VxWQVOVp9NyvwarqjmG8cnhKaspw== X-Received: by 2002:aa7:9aa5:: with SMTP id x5mr57398728pfi.135.1559125601694; Wed, 29 May 2019 03:26:41 -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 e12sm18992183pfl.122.2019.05.29.03.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 03:26:41 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/4] drm: mediatek: fix unbind functions Date: Wed, 29 May 2019 18:25:52 +0800 Message-Id: <20190529102555.251579-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529102555.251579-1-hsinyi@chromium.org> References: <20190529102555.251579-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190529_032642_794861_A15959E0 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: CK Hu --- change log v1->v2: * mipi_dsi_host_unregister() should be fixed in another patch on the list. --- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index b00eb2d2e086..1ae3be99e0ff 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) From patchwork Wed May 29 10:25: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: 10966731 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 B512515E6 for ; Wed, 29 May 2019 10:27:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60B321F61 for ; Wed, 29 May 2019 10:27:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A587287AB; Wed, 29 May 2019 10:27:14 +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 1084D21F61 for ; Wed, 29 May 2019 10:27:14 +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=iKhG5NGAJ7RascNX+u7Mf2QJmqije4ZY9PT7BG/QO1Y=; b=oCPb8ziZ9ErmuO KKb8Bc6xMgansq5sLCpHV47GEJ+GbEx02fyPQyRdO+CIpGZMl6JA3gvYvWxV5B2+usTRd+egaJijo gHiJLKma8mIOjca0UMUPMM4OND4s4mDA7LWKIC/QLrX3ACKJV2SHBvJx+iSY/Sj75BrpXS9Fv95G/ voVuTjas07G03IhWda67odOVBFC8CRJzaOwG0TYtFz2zEymcmNN3Ar25LmtVP+T/KPceSnHAxJcK1 yHU2xKeXFvUknEjUYcqT5ZNZ+OpNeItrRNRc2cQPnOP94PLQvCYHfE2gyEpesxFC+TnUgfFhWeWjD 1G4eISA1DEEn+Phct3kw==; 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 1hVvnc-0000gE-0E; Wed, 29 May 2019 10:27:12 +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 1hVvnB-000099-J3 for linux-mediatek@lists.infradead.org; Wed, 29 May 2019 10:26:49 +0000 Received: by mail-pg1-x541.google.com with SMTP id a3so1117341pgb.3 for ; Wed, 29 May 2019 03:26:45 -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=Qfu+lCX+mg4CHoSzn6sx71PO1L0xmj8Ng2bghmWxVtM=; b=nTovKIIjyeNQQu+BPV60MWd+6ikmDz5CTYIk7CO5q1I9JxYa/Y2hi1UEa7N1uc53tJ 0Ml03crB3KYobulpw2zmaJAB4YPE4Y1W1VCWvM74IWI/JBAFlblmjKqTrMCg0ajk1wD7 xGj5Gl5TJoDwlMuNXDh+oCwzMlUvgpwT9stYs= 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=Qfu+lCX+mg4CHoSzn6sx71PO1L0xmj8Ng2bghmWxVtM=; b=L1DfZSnDIxhDNtM+ebarlPZj5zneFIoLRcfSLvcxJZUWE9pGsbwERICNUdRKsF1SxL nfMqg2RuVpr8JXXcVC19ART7qlUeJ2Pbcb64o+AkApuSUJ+8hqduF2dL4ttWRRpM5gkh lwURuLcNnruyDQirHJH253sC9BoWGSoGPipPx16QtkmzseDpKKkZM3UEWXE//o7NDPuz hKihAgbzlFoqoI1ha1IFsvRqEH1S+2m6c2XrEw28sO6BMBrlAIXa9RKyTfJ6TLAn2NoW ZQLMPUQ8JP3K6XbQ/Vx442Ky20Hu8ML5MKyCKFaeKjPPq4nfdU0Ogm0r2pCY43ibF6o6 sY4g== X-Gm-Message-State: APjAAAXKW/t3mEUXlbyTksNpRVoxFYDKsOy5wizNX9UhO7DfqgTwxSOk NsMp7UCkMR0qWcbz5Jf2AZY7fw== X-Google-Smtp-Source: APXvYqwsCTf8MIeFhkI7oHCKHu8V4WhT0bsggX6aKGiM/Kq0hphXwbIVOk7WcOZTuamgoCEOW8/5cQ== X-Received: by 2002:aa7:83d4:: with SMTP id j20mr129161356pfn.90.1559125605031; Wed, 29 May 2019 03:26:45 -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 e12sm18992183pfl.122.2019.05.29.03.26.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 03:26:44 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/4] drm: mediatek: unbind components in mtk_drm_unbind() Date: Wed, 29 May 2019 18:25:53 +0800 Message-Id: <20190529102555.251579-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529102555.251579-1-hsinyi@chromium.org> References: <20190529102555.251579-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190529_032646_046741_F134ACE8 X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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 Reviewed-by: CK Hu --- change log v1->v2: * separate another 2 fixes to other patches. --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 57ce4708ef1b..e7362bdafa82 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -397,6 +397,7 @@ 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->drm = NULL; } @@ -568,13 +569,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); From patchwork Wed May 29 10:25: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: 10966733 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 85B05933 for ; Wed, 29 May 2019 10:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75F3121F61 for ; Wed, 29 May 2019 10:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69E81287AB; Wed, 29 May 2019 10:27:15 +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 1BF1D21F61 for ; Wed, 29 May 2019 10:27:15 +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=RQY2FApcUHrp+qCM/smCdNO+DPsNY+bRmAtM0ys/uCs=; b=uaGirPlYQrQUVZ xZZljdJTZWzfIz1+HVqkldY21j6PNF1vE+dLHNQ3xkZj8oCBi4rKaacgUkj1IJXSKT5W9g8wxeAqs kO5RIss3/8+W0J8yoBtgT1eTnaC1i1qHWItszFrviIeCOug5gfSj3SZwE4zHEtUlv6xJPR0ik7Zvd h1iVDJigmsESagPxdWHP573vk3nHsX//ShKTgad4BX1XBPDK+w02ccQ4rofPN+hxbpgURTjMT36cu K25uhGQIPe7mzJfadn5ftHmHZwLyJ32u4/LwD2D//8AGl3wSIIsivdfgd15V14bGtwgAhtDHjnLtv IrJO9VlYnz87glaq+2hg==; 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 1hVvnd-0000hl-9u; Wed, 29 May 2019 10:27:13 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVvnF-0000Di-05 for linux-mediatek@lists.infradead.org; Wed, 29 May 2019 10:26:52 +0000 Received: by mail-pf1-x444.google.com with SMTP id a23so1353199pff.4 for ; Wed, 29 May 2019 03:26:48 -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=zkf9FoxdryyDt1X+5P+GJSoX1FiD3J3GXj2LP0N8rdU=; b=KrJR7S9O4TEFHPeGH3rkqlofANGLf5xPlPIkRdAwYAC4yHaXwn/r/L5YxrLyP6L7K5 qaAvmgB0+oizqOfAJqwCXO6Bb570+HJHpI4ecYCXN0wEWCx0ClL1x6NMDWXAVOfvHBRR rfpWfc3r/oA8m007TQhh7sV5qE4QAleSuWEsI= 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=zkf9FoxdryyDt1X+5P+GJSoX1FiD3J3GXj2LP0N8rdU=; b=kHmny8kdqo72JVaKpmosNd56S4hI1OlzHbKQszBc9YRS5W59KofIZLkn/s6SWqPMIY vDdgRJfdMXZVGuxZZzIt+RdlMHU46FmQKTLBO7rj0dc0XM30xPQFy8PevJO0yxmIJjLw 2uKw8BMXiLcPQuRsS9aWUMH0XehZz2+e2l+CYGMN7YzkIDVZ4GD4Oe93YtH1Em833XMC RpMlomNVMrLDVTlqAeYwdguK5406rp4iZJFcTh2R5kt6Jlgi+Q3bSNypkopxvKSdvUUT fqJpXS/ms8tYBYtQQdOvSYl3scdYVe1Y4/lCgQiuYyWCXxYlSwx7Vqxb3SKWtn90Uv8e hiiw== X-Gm-Message-State: APjAAAVBScrOl4TIlJ/bsoeDjrmT+5N520IyKFwyejM0TukWbJ0k8H7V fh585ijkotr+irGD0mjUErIsdw== X-Google-Smtp-Source: APXvYqwnrc9pdx47YY9TRS/DoiPhrNWvI1W5hjidPKQ2diP8prk0BV504pPU4kJBaFleNW4weG407w== X-Received: by 2002:a62:d244:: with SMTP id c65mr111971351pfg.173.1559125608082; Wed, 29 May 2019 03:26:48 -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 e12sm18992183pfl.122.2019.05.29.03.26.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 03:26:47 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/4] drm: mediatek: call drm_atomic_helper_shutdown() when unbinding driver Date: Wed, 29 May 2019 18:25:54 +0800 Message-Id: <20190529102555.251579-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529102555.251579-1-hsinyi@chromium.org> References: <20190529102555.251579-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190529_032649_526620_17C4DAAA X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP shutdown all CRTC when unbinding drm driver. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index e7362bdafa82..8718d123ccaa 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); From patchwork Wed May 29 10:25:55 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: 10966737 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 DC297933 for ; Wed, 29 May 2019 10:27:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD67321F61 for ; Wed, 29 May 2019 10:27:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C15C0287AB; Wed, 29 May 2019 10:27:30 +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 727BE21F61 for ; Wed, 29 May 2019 10:27:30 +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=rR6zme2oI4uYK+Ils2kIVw3fEcvjWClujiQs39JPvPM=; b=UViLfYrcyr0HcI OtsxbGmMaLi2rM8Lvr9wfODMX8crFCaA2rsZKSZH+cH1exmferH+iqSmt0yPSwRKHd1ZOGw9x1zWo 1IZQJ8yo3OjvCU1xxgNN5Nboc9uoFYKG3dpJExxWQ6DkGbA5ZjtaFmid/WCBNRff23uybiz/nxmyK CF4e2NRsXoOIfiCZuGaTzeE0eEwXkM4UkIB57kARhNthdtkynX8Zdozxir+nWjHO35U+oxAcgArKX HDBJNMLouiyeHy1XpMgGzLSspmTkWoJ32HQISEQmT5sBgZAniBmcwy0hpeVh7uMhwwPePhjVU+8qy uIfyJukewdJI1YXEJU3w==; 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 1hVvnt-0000yb-J1; Wed, 29 May 2019 10:27:29 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVvnH-0000Ir-Qr for linux-mediatek@lists.infradead.org; Wed, 29 May 2019 10:26:53 +0000 Received: by mail-pf1-x444.google.com with SMTP id d126so1355941pfd.2 for ; Wed, 29 May 2019 03:26:51 -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=YcCSMOQNkzGaXhDk0okGAy0XqAbQi4G2u6aLWlPaPBw=; b=Cuhppf15fgs+ro5fQzou91thI1XLxU4KioJr8st6A+3rShMcYV8fSqZOp424wsNyS7 Yjt8ZDWKI8t5jY8/w/olvN9NejpmeXI58p0vNnxcpidO9I9OYs9PLq5hcAy2JUfwloW/ 0z63BUjUnVKb52ngcrkoQKYOWPV2zpLSKFZpM= 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=YcCSMOQNkzGaXhDk0okGAy0XqAbQi4G2u6aLWlPaPBw=; b=pVM2buK9OnhoZdNQJS5E5NIR8GYD8oHl9+/Ut856OYgN7ByqxqRWM+gT4TGv/Gh3vK 1IozQG5QwAKVlJKryT7v2ZN2s6WLDW0b8VPtZYP1JHR1s1TdQPlBCcW3PAQ2F+4+LkZT 69C593e5sRHc64txPw512///rt1m563vSopc1rRG86ALrkfEnd5OxBz12DU3PFufVc34 I7umiIK1SrMIgY3Dq+XufD+QZ5Uj/kjcz0n330D03MtfmJ/KDwK6QtV6j79GJp5JDjo2 e5RbIR8XYCsUwhDDZKokQaP2G0A881+19ITUEANE37FGjVbU/09Asa1cbooXpkFfwEKQ okcQ== X-Gm-Message-State: APjAAAWODw3CVpoOuNAGwKFd7sGlBf5DgYtuk3q2cPslX0PIvc2ilqPN rpmRS4iYKxBwZa/T9H1UhTvIUg== X-Google-Smtp-Source: APXvYqyyaROmC37HXAcccgz51No+HwGj0nRGT99eAspxv1IL1mnTD2gRQ1iaLO7Rvi00xcw+ddOyEQ== X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr11037075pjq.139.1559125611164; Wed, 29 May 2019 03:26:51 -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 e12sm18992183pfl.122.2019.05.29.03.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 03:26:50 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/4] drm: mediatek: clear num_pipes when unbind driver Date: Wed, 29 May 2019 18:25:55 +0800 Message-Id: <20190529102555.251579-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529102555.251579-1-hsinyi@chromium.org> References: <20190529102555.251579-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190529_032652_115921_20BCE966 X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP num_pipes is used for mutex created in mtk_drm_crtc_create(). If we don't clear num_pipes count, when rebinding driver, the count will be accumulated. From mtk_disp_mutex_get(), there can only be at most 10 mutex id. Clear this number so it starts from 0 in every rebind. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 8718d123ccaa..bbfe3a464aea 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -400,6 +400,7 @@ static void mtk_drm_unbind(struct device *dev) drm_dev_unregister(private->drm); mtk_drm_kms_deinit(private->drm); drm_dev_put(private->drm); + private->num_pipes = 0; private->drm = NULL; }