Received: by 10.192.165.148 with SMTP id m20csp3516517imm; Mon, 23 Apr 2018 07:53:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LRpgBn74fBxNvQ2IL+jUmVIVlGetpjXfI5ZtTAjtjrfoqG4C/iN58Jz0xNZC4HSX9jrcV X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr20874343plu.22.1524495191261; Mon, 23 Apr 2018 07:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524495191; cv=none; d=google.com; s=arc-20160816; b=n+wrv2ZAdIHD13n9I0fseWmKO0paH5OcT30Kdpd+37Q2bEpJ3idSsnOhMk0ZBN/tY5 Jxnl3Nkjm9pWr+3BU0Kz/45+YoCrUiRxOjnP/p4hszx+lvUpDSlkb9AFlSU2XN12Z8TV V3GcFzH5RimeH87XWB4ZgPAGY+43asvC+hL2pdtDbj4s0dXFkidpTGvNX4LG/Ot268EM T14nUdJoB+GCzL/IjAxs3SMEJUie0hOhWH4badXjfV+LShNsKE++pxSU063FAZ5EKYJ3 UancZ/ivvDBAvSkUAjxCBnnNcIdCQxaApROz2O/42/blwk6I011WsyYURw5pKjXzI9ii CJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:nodisclaimer:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=PwG7qRUESs5tbJ8yhfW5NCMtezvftPHu7BcblWKezIQ=; b=Qw+onZYFu4Q0a9nvDfe8lM9RzRGNWm4XMYJewvTVQzYNg8T0AhNHgSDce/042zvcsp bfF/YMrUTPTN/abcTz/ceEPbC8tKeNBixgp006zP+DZTuWF4Q+U/KgtO6BILlE5jASfD BDtiHYElxAPkfoVCy8kZE7rJfh0xCjwgJk16ANVzPs2NmQdjFaV2vhso9xF5MsbirNZq 0hu3ZYNFCAANP6mYzfE7T5iPafwnLLFmsWyvNHUrDJ3SsbUhm31huTBRf+INf0cvgwhH 6fUVuvo1hETFmW+vVyAbEH09vGt8596Jmcy+vKYYqhpWYaylB1my/bfgPlqtIO2PRyFt bILQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=DKQoBtpX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137si7512086pfc.68.2018.04.23.07.52.57; Mon, 23 Apr 2018 07:53:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=DKQoBtpX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755723AbeDWOvo (ORCPT + 99 others); Mon, 23 Apr 2018 10:51:44 -0400 Received: from mail-he1eur01on0056.outbound.protection.outlook.com ([104.47.0.56]:26568 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755684AbeDWOv3 (ORCPT ); Mon, 23 Apr 2018 10:51:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PwG7qRUESs5tbJ8yhfW5NCMtezvftPHu7BcblWKezIQ=; b=DKQoBtpXoNa5U/ChSZtwJmPmisAFjtM/xZltSuoNgYptvG5O8YcRrBCl2aWtnF0INj+bp6SQyPWefY+LdEGcIux+21csd31kFi0i7wKtO7gWI9uVv8HeKgpfMMYDsMHe6mY4hsrjyMGqyAlLZ+f8fpEsd3WitSH4O97eglkPfc0= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from e113505-lin.cambridge.arm.com (217.140.96.140) by VI1PR08MB3039.eurprd08.prod.outlook.com (2603:10a6:803:45::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.12; Mon, 23 Apr 2018 14:51:12 +0000 From: Ayan Kumar Halder To: ayan.halder@arm.com, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: nd@arm.com Subject: [PATCH v2 8/8] drm/arm/malidp: Added the late system pm functions Date: Mon, 23 Apr 2018 15:50:51 +0100 Message-Id: <1524495051-3891-9-git-send-email-ayan.halder@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524495051-3891-1-git-send-email-ayan.halder@arm.com> References: <1524495051-3891-1-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: VI1PR0701CA0055.eurprd07.prod.outlook.com (2603:10a6:800:5f::17) To VI1PR08MB3039.eurprd08.prod.outlook.com (2603:10a6:803:45::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020);SRVR:VI1PR08MB3039; X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB3039;3:Bf2+nIJGld03A1pJ+5EO+B8swZjeWAVdvCdvApJpr/+b7iJ/Ud2iZvkSYh42kUWPg7I5hYl5PrMaQyBiV7Dsnl2aq9YcaN3RJAXtt9lKHM0JCCLvb/TIJHpVsBj+9DuoJJ43jF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l4tveBzSnKLJjhHTPQBljAEfy9Obv/cz2qKNonZsuKIneHjifqdfpAReMKvzPFaVsMeRS8msmxKUmcvf9MMjjIaDLEz2uhzNfkDelQpAvnl+xzXmIKoNWUcfxw0l3QDPw+Z438VjYhIrJ5M5H7ZP9bJggs5Y6gkPduTL/hjSiYORyVnvmlf/blinqTyN76om5jyqz3yCtiDgQ1LJMp396brRx+ozWAbAiJsxc1uACzDr7eTxo5NX9YI0jAJAVmQUmTOi5T61fzxSWvOZyLKQhUDkCV8t X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231232)(944501410)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:VI1PR08MB3039;BCL:0;PCL:0;RULEID:;SRVR:VI1PR08MB3039; X-Forefront-PRVS: 06515DA04B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(346002)(376002)(39380400002)(396003)(366004)(36756003)(47776003)(50466002)(6116002)(26005)(81166006)(3846002)(8676002)(48376002)(5660300001)(7736002)(66066001)(305945005)(16526019)(446003)(478600001)(2616005)(956004)(476003)(16586007)(52116002)(76176011)(59450400001)(316002)(4326008)(386003)(25786009)(72206003)(86362001)(6666003)(7696005)(11346002)(6486002)(2906002)(8936002)(50226002)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR08MB3039;H:e113505-lin.cambridge.arm.com;FPR:;SPF:None;LANG:en;MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR08MB3039;23:owfuhh5xjXpnZDIRIKw3v03Om7YDtWpn+38McCLKq?= =?us-ascii?Q?66ZMBSKpR2hI1ogVj5GTQpzzCofQgtJurBaA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3RPPMjLe0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB3039;7:mmRtCsmx84BQIvrq70vvIDUDq8QWE/eAfU6+IiBazecCE/uz09PZvyPLGg4H4shchtMef1SaMDY80pCBz8kGMVdYCczaA2Nvq+a+4jZ+b2xRQ9HHodzI3K5mhRPNuOt/NvnLUQvKjAZXC4dHLpnikP0mRFiFrZCGtbdZk0K4orJADkNun//Zb9+6HMyvQJ71e4GvvStywAi0NnQlVUW8irgvuiaSqkQl00g86EqLkCXuv4BGC2I8vcFJwmUmHC6p X-MS-Office365-Filtering-Correlation-Id: 2b722f64-651e-4b4d-b7ae-08d5a929a850 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2018 14:51:12.1658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b722f64-651e-4b4d-b7ae-08d5a929a850 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3039 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org malidp_pm_suspend_late checks if the runtime status is not suspended and if so, invokes malidp_runtime_pm_suspend which disables the display engine/core interrupts and the clocks. It sets the runtime status as suspended. The difference between suspend() and suspend_late() is as follows:- 1. suspend() makes the device quiescent. In our case, we invoke the DRM helper which disables the CRTC. This would have invoked runtime pm suspend but the system suspend process disables runtime pm. 2. suspend_late() It continues the suspend operations of the drm device which was started by suspend(). In our case, it performs the same functionality as runtime_suspend(). The complimentary functions are resume() and resume_early(). In the case of resume_early(), we invoke malidp_runtime_pm_resume() which enables the clocks and the interrupts. It sets the runtime status as active. If the device was in runtime suspend mode before system suspend was called, pm_runtime_work() will put the device back in runtime suspended mode( after the complete system has been resumed). Signed-off-by: Ayan Kumar Halder --- Changes in v2:- - Removed the change id and modified the commit message --- drivers/gpu/drm/arm/malidp_drv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index bd44a6d..f6124d8 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -766,8 +766,25 @@ static int __maybe_unused malidp_pm_resume(struct device *dev) return 0; } +static int __maybe_unused malidp_pm_suspend_late(struct device *dev) +{ + if (!pm_runtime_status_suspended(dev)) { + malidp_runtime_pm_suspend(dev); + pm_runtime_set_suspended(dev); + } + return 0; +} + +static int __maybe_unused malidp_pm_resume_early(struct device *dev) +{ + malidp_runtime_pm_resume(dev); + pm_runtime_set_active(dev); + return 0; +} + static const struct dev_pm_ops malidp_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(malidp_pm_suspend, malidp_pm_resume) \ + SET_LATE_SYSTEM_SLEEP_PM_OPS(malidp_pm_suspend_late, malidp_pm_resume_early) \ SET_RUNTIME_PM_OPS(malidp_runtime_pm_suspend, malidp_runtime_pm_resume, NULL) }; -- 2.7.4