From patchwork Tue Aug 20 17:46:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 11104453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B36A1864 for ; Tue, 20 Aug 2019 17:46:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 608FC22DA7 for ; Tue, 20 Aug 2019 17:46:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 608FC22DA7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6E2A6E83A; Tue, 20 Aug 2019 17:46:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0628.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::628]) by gabe.freedesktop.org (Postfix) with ESMTPS id 598F66E83A for ; Tue, 20 Aug 2019 17:46:41 +0000 (UTC) Received: from VE1PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:803:104::29) by DB6PR0802MB2597.eurprd08.prod.outlook.com (2603:10a6:4:99::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Tue, 20 Aug 2019 17:46:36 +0000 Received: from VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::208) by VE1PR08CA0016.outlook.office365.com (2603:10a6:803:104::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Tue, 20 Aug 2019 17:46:36 +0000 Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT053.mail.protection.outlook.com (10.152.19.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Tue, 20 Aug 2019 17:46:35 +0000 Received: ("Tessian outbound 578a71fe5eaa:v26"); Tue, 20 Aug 2019 17:46:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3e106def2ec4df2b X-CR-MTA-TID: 64aa7808 Received: from be28f872337c.1 (cr-mta-lb-1.cr-mta-net [104.47.2.56]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id AB360F74-5088-45AF-ADE2-1A366B85D7F7.1; Tue, 20 Aug 2019 17:46:21 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2056.outbound.protection.outlook.com [104.47.2.56]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id be28f872337c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Tue, 20 Aug 2019 17:46:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WSY6q4nUenKmmLmzH8i7vj+8QN/M+GMH+wgJIWViLnOIzOos73cSYglA4SByAcAFak8osNKptunCfS7tyUWgfAwymZxdJm/sp9oAULay9f/GCOI8tkEPg4tf0Ejt/1CDEGKiuvGaAQQAB6nQGJFrDSRnXuEteie1GvoGBjbN+DXVW8pjClnGeO4hkiqjSLkVFL6vIYibGiOixXMIJaz/9ZlYV0n0C/C8ANQYlpVNOpCG/XFSYqCbI2qgq36u/cS7OwoOQOvrH+5zYga2VmivVUGIvsq2PCqVmj+19QG1DQ0kKUTBZk8h16kZlhxzq4H5jv+dAsFS2Wzrsd0fAoOUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qeAqChYb+xMSB36Is9YHtIowRWMUwlMz/dz4dVsxAb0=; b=mMtTOzUBTwfvjbuYPUqb+kjMYc5wELqnj5N1Q1F4i8aLsiTatgO2wL5u0UlgNMpVw3wuBEqfIk2uwSjpRVIv1DBUGMC610H5gNJqnlVR0MyGaGGko6PHCGymABdhtkUIWD1zfQ28pI8M5b105CbrQEqjz41OZaq02Rh5Rr0ZWE95KhSow7Ql78Y13SnOuSPrbcSQjcmYO1pXQpzVi/6QXymhLmG9nSGxrQBUkqqRWGsGJ5a3zezg8EuZvK9Z71UdltBsWrqZQ4wRr59bBWO/cnlY5jDa40qIm5lNifjP8jODw6Ns+tIk040KrgBfJfbrGw44rgDsbJr9d1vdtwQCNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from AM0PR08MB5345.eurprd08.prod.outlook.com (52.132.212.135) by AM0PR08MB4065.eurprd08.prod.outlook.com (20.178.119.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Tue, 20 Aug 2019 17:46:20 +0000 Received: from AM0PR08MB5345.eurprd08.prod.outlook.com ([fe80::7532:a9e4:63b6:6a55]) by AM0PR08MB5345.eurprd08.prod.outlook.com ([fe80::7532:a9e4:63b6:6a55%4]) with mapi id 15.20.2178.018; Tue, 20 Aug 2019 17:46:20 +0000 From: Ayan Halder To: Ayan Halder , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "james qian wang (Arm Technology China)" , "airlied@linux.ie" , "daniel@ffwll.ch" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] drm/komeda: Reordered the komeda's de-init functions Thread-Topic: [PATCH] drm/komeda: Reordered the komeda's de-init functions Thread-Index: AQHVV38sxxLTSIs2FkGlnIkeXiN2Eg== Date: Tue, 20 Aug 2019 17:46:19 +0000 Message-ID: <20190820174606.1133-1-ayan.halder@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0216.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::36) To AM0PR08MB5345.eurprd08.prod.outlook.com (2603:10a6:208:17f::7) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Ayan.Halder@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [217.140.106.54] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 731832bf-a7b0-46a1-ad6d-08d72596585b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam-Untrusted: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR08MB4065; X-MS-TrafficTypeDiagnostic: AM0PR08MB4065:|DB6PR0802MB2597: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:57;OLM:57; x-forefront-prvs: 013568035E X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(376002)(396003)(39860400002)(189003)(199004)(4326008)(2906002)(50226002)(7736002)(305945005)(71190400001)(71200400001)(36756003)(99286004)(256004)(14444005)(5024004)(8936002)(8676002)(81156014)(81166006)(6512007)(66446008)(64756008)(66556008)(66476007)(3846002)(6116002)(53936002)(1076003)(25786009)(110136005)(66946007)(86362001)(14454004)(52116002)(2201001)(316002)(2501003)(26005)(186003)(66066001)(44832011)(486006)(476003)(2616005)(5660300002)(6436002)(102836004)(6506007)(386003)(6486002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4065; H:AM0PR08MB5345.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: qUxw3S9AZVLxbjMIFpTPNC+daCu3BvN0kahoiHD7KTsGx2AyqR/L7kzAqfF/qOahw0dEoViLzNoUQ83jYoKZEvnaH0CgGsLtDm04OWKcarpvwSXyltACh1mFft4KTGtG8zA9KjaOSVFWNlSj6wK44FHFGeSewfZrxgxyNnvyvMK6mZhJtauNpcQzHcHha8+mh9M3/z/fjzAvpW38SThIQU3XmCRIUNepWrJR5nNPQgtebO68/hk4KkvWE6cXxHl3e9yfW9QVCPQZBFIR4LuRMg5ghdLAz9jHp+yb3UP/qLjCrgY8QCwj28yOLJYLCHnt3i6qzTaHDmylMp414+HDhljbPk9Wj2uZWLts/Vf888FaC564VrBYq6UBaEDC+ccEbWDeBZxW8wUPCX9URhD3pXQ5dxWa30st/vKjF6kmIS0= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4065 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ayan.Halder@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(346002)(376002)(39860400002)(2980300002)(199004)(189003)(47776003)(110136005)(36906005)(316002)(66066001)(5660300002)(99286004)(102836004)(2501003)(70586007)(186003)(22756006)(386003)(6506007)(23756003)(70206006)(26005)(14454004)(5024004)(1076003)(50466002)(6486002)(76130400001)(6512007)(14444005)(336012)(486006)(478600001)(86362001)(7736002)(81156014)(81166006)(50226002)(4326008)(2201001)(6116002)(3846002)(63350400001)(63370400001)(8936002)(8746002)(476003)(356004)(25786009)(126002)(305945005)(8676002)(2906002)(26826003)(2616005)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2597; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:TempError; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 7e3e3f1b-5373-4d10-f0d2-08d725964f07 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(710020)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:DB6PR0802MB2597; NoDisclaimer: True X-Forefront-PRVS: 013568035E X-Microsoft-Antispam-Message-Info: sT7uJd9wtA1L0Jj5Ig/C0Lvu61xZ9achs1yT6KJqtHU+P0vTlhbxAfaIG0kqXR7ugbXRcWYcVIicQE57bMz75PQQMDLZy3aD8283RjA71hMbYOjWbjpMDdwuvtGa0zZ1h5DZt4kOI0qNRG0tiG980bOpnzGfnv3A4b7LlN5KhVDHpDBAh2j+HxGp8g5S5p/lG14DJ5X9yzRUBmer7ovxtxcscK/9EuY8hBjBXQDXXurK++1xwq1W6f5Uxh4GeEvCzj71/erpJ4y4M7zy7PlykleFuyEJvbL8+OlyeLJbSWWjTorf1Nfb+Ok8mvX5da4ZuuRKpL2BbKrwzC4iDyxTz8v3cMr7VfMd7+Xy6XFKmpDnRhZEck2xlnAMXL8fDFHp/7mu117jBgcDSjlbEKatLwRl6PcG4giO/9h7q9jisIM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2019 17:46:35.2688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 731832bf-a7b0-46a1-ad6d-08d72596585b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2597 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qeAqChYb+xMSB36Is9YHtIowRWMUwlMz/dz4dVsxAb0=; b=WV1dUR4SxFLwNm13EEUupx+8Jl4JGJWzh8y3oi5MmHmI0m7v7C8quVPRhD4Fr/P+D1mrj/LLX4FY2pTx4vbfb4YXH6dfLKqrHln+hfvZc98356dQzf20kmRn9CO09SMNWsKhi0G5sgBXOYGDa6de43ggTigMEK6BIdkZuNV4/qw= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qeAqChYb+xMSB36Is9YHtIowRWMUwlMz/dz4dVsxAb0=; b=WV1dUR4SxFLwNm13EEUupx+8Jl4JGJWzh8y3oi5MmHmI0m7v7C8quVPRhD4Fr/P+D1mrj/LLX4FY2pTx4vbfb4YXH6dfLKqrHln+hfvZc98356dQzf20kmRn9CO09SMNWsKhi0G5sgBXOYGDa6de43ggTigMEK6BIdkZuNV4/qw= X-Mailman-Original-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=temperror action=none header.from=arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The de-init routine should be doing the following in order:- 1. Unregister the drm device 2. Shut down the crtcs - failing to do this might cause a connector leakage See the 'commit 109c4d18e574 ("drm/arm/malidp: Ensure that the crtcs are shutdown before removing any encoder/connector")' 3. Disable the interrupts 4. Unbind the components 5. Free up DRM mode_config info Signed-off-by: Ayan Kumar Halder Reviewed-by: Mihail Atanassov --- .../gpu/drm/arm/display/komeda/komeda_kms.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 89191a555c84..e219d1b67100 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -304,24 +305,30 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) komeda_kms_irq_handler, IRQF_SHARED, drm->driver->name, drm); if (err) - goto cleanup_mode_config; + goto free_component_binding; err = mdev->funcs->enable_irq(mdev); if (err) - goto cleanup_mode_config; + goto free_component_binding; drm->irq_enabled = true; err = drm_dev_register(drm, 0); if (err) - goto cleanup_mode_config; + goto free_interrupts; return kms; -cleanup_mode_config: +free_interrupts: drm->irq_enabled = false; + mdev->funcs->disable_irq(mdev); +free_component_binding: + component_unbind_all(mdev->dev, drm); +cleanup_mode_config: drm_mode_config_cleanup(drm); komeda_kms_cleanup_private_objs(kms); + drm->dev_private = NULL; + drm_dev_put(drm); free_kms: kfree(kms); return ERR_PTR(err); @@ -332,12 +339,13 @@ void komeda_kms_detach(struct komeda_kms_dev *kms) struct drm_device *drm = &kms->base; struct komeda_dev *mdev = drm->dev_private; + drm_dev_unregister(drm); + drm_atomic_helper_shutdown(drm); drm->irq_enabled = false; mdev->funcs->disable_irq(mdev); - drm_dev_unregister(drm); component_unbind_all(mdev->dev, drm); - komeda_kms_cleanup_private_objs(kms); drm_mode_config_cleanup(drm); + komeda_kms_cleanup_private_objs(kms); drm->dev_private = NULL; drm_dev_put(drm); }