From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A412AC433E1 for ; Thu, 11 Jun 2020 13:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D97A206C3 for ; Thu, 11 Jun 2020 13:59:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="tcZyQjBo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgFKN7S (ORCPT ); Thu, 11 Jun 2020 09:59:18 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:37596 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgFKN7R (ORCPT ); Thu, 11 Jun 2020 09:59:17 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwvWK123801; Thu, 11 Jun 2020 08:58:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591883937; bh=vm6dEZBsilsx43enScI+BD49SWDr4ySN9rl3BtNbgmk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=tcZyQjBo76EqNJpxeti///VQAcFdzyw9PMHY1rnerSEoaSnxotNdpO6RqXAbLRWRo ZQYf0FOrLwXIH71T8fVsJjXz3YEy1Oo1Pa75nEOb/O0BNE5s4Ij5AFgp6ir6+tAN3R zm3kGFoP43Y9vVR7fYrvCs9f50JG7Xuu7ky9tk4o= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05BDwvkJ035414 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Jun 2020 08:58:57 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 11 Jun 2020 08:58:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 11 Jun 2020 08:58:57 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwrlD054159; Thu, 11 Jun 2020 08:58:53 -0500 Subject: Re: [PATCH 1/5] drm/omap: Fix suspend resume regression after platform data removal To: Tomi Valkeinen , Tony Lindgren CC: , "Andrew F . Davis" , Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Keerthy , Nishanth Menon , Peter Ujfalusi , Roger Quadros , Suman Anna , Tero Kristo , , , , Laurent Pinchart References: <20200531193941.13179-1-tony@atomide.com> <20200531193941.13179-2-tony@atomide.com> <16ba1808-5c7f-573d-8dd0-c80cac2f476e@ti.com> <20200603140639.GG37466@atomide.com> <47e286dd-f87a-4440-5bde-1f7b53e8b672@ti.com> <20200609151943.GL37466@atomide.com> <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> From: Grygorii Strashko Message-ID: Date: Thu, 11 Jun 2020 17:00:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2020 18:26, Tomi Valkeinen wrote: > On 09/06/2020 18:19, Tony Lindgren wrote: >>> But there's an extra runtime PM reference (dev.power.usage_count) that seems >>> to come out of nowhere. So when omap_drm_suspend is finished, there's still >>> usage_count of 1, and dispc never suspends fully. >> >> Hmm no idea about that. My guess is that there might be an issue that was >> masked earlier with omap_device calling the child runtime_suspend. > > Yes. It's how PM works. It calls pm_runtime_get_noresume() before starting the suspend of a device. So I guess omapdrm's suspend has been broken all the time, but it was "fixed" by omap_device. > I think I might have an idea what is going wrong. Before: +----------------------+ |omap_device_pm_domain | +---------------+------+------+ | device | +-------------+ | omap_device | +-------------+ omap_device is embedded in DD device and PM handled by omap_device_pm_domain. static int _od_suspend_noirq(struct device *dev) { ... ret = pm_generic_suspend_noirq(dev); [1] ^^ device suspend_noirq call if (!ret && !pm_runtime_status_suspended(dev)) { if (pm_generic_runtime_suspend(dev) == 0) { [2] ^^ device pm_runtime_suspend force call omap_device_idle(pdev); [3] ^^ omap_device disable od->flags |= OMAP_DEVICE_SUSPENDED; } } return ret; } Now: +------------+ |ti sysc dev | +-+----------+ | | | +-------------+ | | device | +-->+ | +-------------+ With new approach the omap_device is not embedded in DD Device anymore, instead ti-sysc (hwmod replacement) became parent of DD Device. As result suspend sequence became the following (Note. All PM runtime PUT calls became NOP during suspend by design): device |-> suspend() - in case of dss omap_drm_suspend() and Co if defined |-> suspend_noirq() - in case of dss *not defined", equal to step [1] above .. ti sysc dev (ti-sysc is parent, so called after device) |-> sysc_noirq_suspend |-> pm_runtime_force_suspend() |-> sysc_runtime_suspend() - equal to step [3] above And step [2] is missing as of now! I think, suspend might be fixed if all devices, which are now child of ti-sysc, will do pm_runtime_force_xxx() calls at noirq suspend stage by adding: SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) Am I missing smth? -- Best regards, grygorii From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 832AFC433E0 for ; Thu, 11 Jun 2020 13:59:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 43427206C3 for ; Thu, 11 Jun 2020 13:59:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KpvfBoKg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="tcZyQjBo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43427206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=G21BheMHqVnAtbKkqg12QPoKxXU+sEJbohYy+XV+zII=; b=KpvfBoKgcueUx/q9BYwf9eJ+6 C8o7uYiUh7WOkMksxXijT9Y0gXYOinLxqhz1wWduxoGI5KXUv/w9Yic5FJP3E2EEWf3oWkVOdQSXk Vx2fVG++ib3faTw9l0TVhfR/Dpa3Tuv5N9ZM114L1gJPbqMwnr74YJhcfP5ZnABMkwm5EJob5ehjM i4ZUVW6S33gCG1AOkL/b7Hdf+BHUaU9GtZo03Bd+CzL7IFO+oAQDbn4WR6UYA/wAvSEZsmjRvm4d4 jXcitR9EOE0n+PzfKHzkNZoLX6KuHdtW7QAVxzeze2huHifa+XGc05JVRvu78QOtwqDf08hZ1NPHN d7reeKJnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjNji-0002g6-Sm; Thu, 11 Jun 2020 13:59:18 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjNjf-0002fL-Bc for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2020 13:59:16 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwvWK123801; Thu, 11 Jun 2020 08:58:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591883937; bh=vm6dEZBsilsx43enScI+BD49SWDr4ySN9rl3BtNbgmk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=tcZyQjBo76EqNJpxeti///VQAcFdzyw9PMHY1rnerSEoaSnxotNdpO6RqXAbLRWRo ZQYf0FOrLwXIH71T8fVsJjXz3YEy1Oo1Pa75nEOb/O0BNE5s4Ij5AFgp6ir6+tAN3R zm3kGFoP43Y9vVR7fYrvCs9f50JG7Xuu7ky9tk4o= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05BDwvkJ035414 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Jun 2020 08:58:57 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 11 Jun 2020 08:58:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 11 Jun 2020 08:58:57 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwrlD054159; Thu, 11 Jun 2020 08:58:53 -0500 Subject: Re: [PATCH 1/5] drm/omap: Fix suspend resume regression after platform data removal To: Tomi Valkeinen , Tony Lindgren References: <20200531193941.13179-1-tony@atomide.com> <20200531193941.13179-2-tony@atomide.com> <16ba1808-5c7f-573d-8dd0-c80cac2f476e@ti.com> <20200603140639.GG37466@atomide.com> <47e286dd-f87a-4440-5bde-1f7b53e8b672@ti.com> <20200609151943.GL37466@atomide.com> <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> From: Grygorii Strashko Message-ID: Date: Thu, 11 Jun 2020 17:00:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200611_065915_480681_686018ED X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Tero Kristo , Suman Anna , Dave Gerlach , Keerthy , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, "Andrew F . Davis" , Peter Ujfalusi , Faiz Abbas , Laurent Pinchart , Greg Kroah-Hartman , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Roger Quadros Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09/06/2020 18:26, Tomi Valkeinen wrote: > On 09/06/2020 18:19, Tony Lindgren wrote: >>> But there's an extra runtime PM reference (dev.power.usage_count) that seems >>> to come out of nowhere. So when omap_drm_suspend is finished, there's still >>> usage_count of 1, and dispc never suspends fully. >> >> Hmm no idea about that. My guess is that there might be an issue that was >> masked earlier with omap_device calling the child runtime_suspend. > > Yes. It's how PM works. It calls pm_runtime_get_noresume() before starting the suspend of a device. So I guess omapdrm's suspend has been broken all the time, but it was "fixed" by omap_device. > I think I might have an idea what is going wrong. Before: +----------------------+ |omap_device_pm_domain | +---------------+------+------+ | device | +-------------+ | omap_device | +-------------+ omap_device is embedded in DD device and PM handled by omap_device_pm_domain. static int _od_suspend_noirq(struct device *dev) { ... ret = pm_generic_suspend_noirq(dev); [1] ^^ device suspend_noirq call if (!ret && !pm_runtime_status_suspended(dev)) { if (pm_generic_runtime_suspend(dev) == 0) { [2] ^^ device pm_runtime_suspend force call omap_device_idle(pdev); [3] ^^ omap_device disable od->flags |= OMAP_DEVICE_SUSPENDED; } } return ret; } Now: +------------+ |ti sysc dev | +-+----------+ | | | +-------------+ | | device | +-->+ | +-------------+ With new approach the omap_device is not embedded in DD Device anymore, instead ti-sysc (hwmod replacement) became parent of DD Device. As result suspend sequence became the following (Note. All PM runtime PUT calls became NOP during suspend by design): device |-> suspend() - in case of dss omap_drm_suspend() and Co if defined |-> suspend_noirq() - in case of dss *not defined", equal to step [1] above .. ti sysc dev (ti-sysc is parent, so called after device) |-> sysc_noirq_suspend |-> pm_runtime_force_suspend() |-> sysc_runtime_suspend() - equal to step [3] above And step [2] is missing as of now! I think, suspend might be fixed if all devices, which are now child of ti-sysc, will do pm_runtime_force_xxx() calls at noirq suspend stage by adding: SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) Am I missing smth? -- Best regards, grygorii _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F396FC433E1 for ; Sat, 13 Jun 2020 10:18:31 +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 C2A5020739 for ; Sat, 13 Jun 2020 10:18:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="tcZyQjBo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2A5020739 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.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 CF9B96E45C; Sat, 13 Jun 2020 10:17:35 +0000 (UTC) X-Greylist: delayed 5014 seconds by postgrey-1.36 at gabe; Thu, 11 Jun 2020 15:22:39 UTC Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74E386E922 for ; Thu, 11 Jun 2020 15:22:39 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwvWK123801; Thu, 11 Jun 2020 08:58:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591883937; bh=vm6dEZBsilsx43enScI+BD49SWDr4ySN9rl3BtNbgmk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=tcZyQjBo76EqNJpxeti///VQAcFdzyw9PMHY1rnerSEoaSnxotNdpO6RqXAbLRWRo ZQYf0FOrLwXIH71T8fVsJjXz3YEy1Oo1Pa75nEOb/O0BNE5s4Ij5AFgp6ir6+tAN3R zm3kGFoP43Y9vVR7fYrvCs9f50JG7Xuu7ky9tk4o= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05BDwvkJ035414 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Jun 2020 08:58:57 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 11 Jun 2020 08:58:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 11 Jun 2020 08:58:57 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05BDwrlD054159; Thu, 11 Jun 2020 08:58:53 -0500 Subject: Re: [PATCH 1/5] drm/omap: Fix suspend resume regression after platform data removal To: Tomi Valkeinen , Tony Lindgren References: <20200531193941.13179-1-tony@atomide.com> <20200531193941.13179-2-tony@atomide.com> <16ba1808-5c7f-573d-8dd0-c80cac2f476e@ti.com> <20200603140639.GG37466@atomide.com> <47e286dd-f87a-4440-5bde-1f7b53e8b672@ti.com> <20200609151943.GL37466@atomide.com> <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> From: Grygorii Strashko Message-ID: Date: Thu, 11 Jun 2020 17:00:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <9ed70121-2a53-d2b3-051a-88eb83e6c53f@ti.com> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Sat, 13 Jun 2020 10:16:46 +0000 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: Nishanth Menon , Tero Kristo , Suman Anna , Dave Gerlach , Keerthy , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, "Andrew F . Davis" , Peter Ujfalusi , Faiz Abbas , Laurent Pinchart , Greg Kroah-Hartman , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Roger Quadros Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 09/06/2020 18:26, Tomi Valkeinen wrote: > On 09/06/2020 18:19, Tony Lindgren wrote: >>> But there's an extra runtime PM reference (dev.power.usage_count) that seems >>> to come out of nowhere. So when omap_drm_suspend is finished, there's still >>> usage_count of 1, and dispc never suspends fully. >> >> Hmm no idea about that. My guess is that there might be an issue that was >> masked earlier with omap_device calling the child runtime_suspend. > > Yes. It's how PM works. It calls pm_runtime_get_noresume() before starting the suspend of a device. So I guess omapdrm's suspend has been broken all the time, but it was "fixed" by omap_device. > I think I might have an idea what is going wrong. Before: +----------------------+ |omap_device_pm_domain | +---------------+------+------+ | device | +-------------+ | omap_device | +-------------+ omap_device is embedded in DD device and PM handled by omap_device_pm_domain. static int _od_suspend_noirq(struct device *dev) { ... ret = pm_generic_suspend_noirq(dev); [1] ^^ device suspend_noirq call if (!ret && !pm_runtime_status_suspended(dev)) { if (pm_generic_runtime_suspend(dev) == 0) { [2] ^^ device pm_runtime_suspend force call omap_device_idle(pdev); [3] ^^ omap_device disable od->flags |= OMAP_DEVICE_SUSPENDED; } } return ret; } Now: +------------+ |ti sysc dev | +-+----------+ | | | +-------------+ | | device | +-->+ | +-------------+ With new approach the omap_device is not embedded in DD Device anymore, instead ti-sysc (hwmod replacement) became parent of DD Device. As result suspend sequence became the following (Note. All PM runtime PUT calls became NOP during suspend by design): device |-> suspend() - in case of dss omap_drm_suspend() and Co if defined |-> suspend_noirq() - in case of dss *not defined", equal to step [1] above .. ti sysc dev (ti-sysc is parent, so called after device) |-> sysc_noirq_suspend |-> pm_runtime_force_suspend() |-> sysc_runtime_suspend() - equal to step [3] above And step [2] is missing as of now! I think, suspend might be fixed if all devices, which are now child of ti-sysc, will do pm_runtime_force_xxx() calls at noirq suspend stage by adding: SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) Am I missing smth? -- Best regards, grygorii _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel