Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp604715ybg; Tue, 9 Jun 2020 08:22:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYuIkljNysqh+7Zj+pqHhQkuWFZNxMRy0EGH/xpACXumfrNGZv5BCVEkHI4Pdo/CeUbJs8 X-Received: by 2002:a17:906:9243:: with SMTP id c3mr26057998ejx.400.1591716127262; Tue, 09 Jun 2020 08:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591716127; cv=none; d=google.com; s=arc-20160816; b=CPD3cwDKBq1NqAXhPctIu27EW3P39HuLXhNUIWlbU/fOb6CCwRUN3NQrTr6nmcyrJ6 KmKreaCwNnAzX4FTaUS9TZNREXTPYu4y8g7VE3+KXO0Je8Y2+IZC7W9uiZvanAzRojm/ nMmgv318klVe4GS1F4tRtWSUThSGivfCnJh7f3ouKhSZPQX6DfVZcQIns3Mf7rJmjn60 pCmd+XBVbhZ36w+gHndPWokPg4sm64CuXqMeIhsXviC8s/rWOaSoWVXerU5CQu+bD82i 4FaglMKCJxKsabzqhodKUzAJrVxUL3aXnFCoyKYGSyCv6gpQxhUrEd+eN0JAnVkv4iGJ jOSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vTywcZbSpkbivHXJDYTonQgM4gnaIgRAZdFQUseoNbQ=; b=HSi/YukFHLGgW4lBf+FFtElKVTwUn6A53Vv988rwBEWcvbJt9jVBxFp+R/kzL7tXFP GOYlWdYtb+K1cvuDiU09Asii0nJRr5H+Uh0QY5/Dg58lQrLRdXaMGvqiFahmiDWd59b9 kZZoMqtEMF0jgjP6m/eceyVdnoOPG8DgzA4sKMh8PWLJJZokpuQIlWBexP5bCC5/Bgax l/L3rlFQWcTfketB3xiO6tw0c01yRKzUjBrDBhIYNH6NUkdJsWD+fmTJATiHGhnab8ov oORo9jYtOBeSsfSI7JZPKRKMPBTf+RP2ESQTCWdQxz4i+PmkLjyZLhupt+wkqCrCVeIS EnIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si10459741edj.393.2020.06.09.08.21.41; Tue, 09 Jun 2020 08:22:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730756AbgFIPTv (ORCPT + 99 others); Tue, 9 Jun 2020 11:19:51 -0400 Received: from muru.com ([72.249.23.125]:57370 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729665AbgFIPTt (ORCPT ); Tue, 9 Jun 2020 11:19:49 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4AAD38088; Tue, 9 Jun 2020 15:20:37 +0000 (UTC) Date: Tue, 9 Jun 2020 08:19:43 -0700 From: Tony Lindgren To: Tomi Valkeinen Cc: linux-omap@vger.kernel.org, "Andrew F . Davis" , Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Nishanth Menon , Peter Ujfalusi , Roger Quadros , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Laurent Pinchart Subject: Re: [PATCH 1/5] drm/omap: Fix suspend resume regression after platform data removal Message-ID: <20200609151943.GL37466@atomide.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47e286dd-f87a-4440-5bde-1f7b53e8b672@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tomi Valkeinen [200609 07:05]: > On 03/06/2020 17:06, Tony Lindgren wrote: > > * Tomi Valkeinen [200603 12:34]: > > > Hi Tony, > > > > > > On 31/05/2020 22:39, Tony Lindgren wrote: > > > > When booting without legacy platform data, we no longer have omap_device > > > > calling PM runtime suspend for us on suspend. This causes the driver > > > > context not be saved as we have no suspend and resume functions defined. > > > > > > > > Let's fix the issue by switching over to use UNIVERSAL_DEV_PM_OPS as it > > > > will call the existing PM runtime suspend functions on suspend. > > > > > > I don't think we can use UNIVERSAL_DEV_PM_OPS, as we can't disable DSS > > > modules in any order, but things have to be shut down in orderly manner. > > > > OK. I presume you talk about the order of dss child devices here. > > Yes, but not only that. > > E.g. the dispc driver hasn't been designed to be suspended while active. The > only way to properly suspend the dispc HW is to first disable the outputs, > wait until they've finished with their current frame, and only then can > things be shut down. OK > The suspend machinery doesn't handle all that (and it couldn't anyway, due > to the dependencies to other DSS devices in the pipeline). OK I replied to your patch with some untested comments that might simplify it potentially. > > > omapdrm hasn't relied on omap_device calling runtime suspend for us (I > > > didn't know it does that). We have system suspend hooks in omap_drv.c: > > > > We had omap_device sort of brute forcing things to idle on suspend > > which only really works for interconnect target modules with one > > device in them. > > > > > SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume) > > > > > > omap_drm_suspend() is supposed to turn off the displays, which then cause > > > dispc_runtime_put (and other runtime_puts) to be called, which result in > > > dispc_runtime_suspend (and other runtime PM suspends). > > > > OK thanks for explaining, I missed that part. > > > > > So... For some reason that's no longer happening? I need to try to find a > > > board with which suspend/resume works (without DSS)... > > > > Yes it seems something has changed. When diffing the dmesg debug output > > on suspend and resume, context save and restore functions are no longer > > called as the PM runtime suspend and resume functions are no longer > > called on suspend and resume. > > I now tested with AM4 SK, and I still can't get system suspend/resume work > (without DSS). I have no clue about how to fix that. But if I use pm_test to > prevent total suspend, I can reproduce this (or at least looks the same). OK > And now that I look at this, I have a recollection that I've seen this > before. What happens is that the system suspend hook (omap_drm_suspend) gets > called fine, and it turns off the displays, which leads to > dispc_runtime_puts etc. All goes fine. > > 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. Currently I'm only able to rmmod -f omapdrm, not sure if these issues might be related. As we now have the interconnect target module as the parent so usage counts might be different but should balance out the same way as earlier. > I think the PM framework does this when starting system suspend process. > Maybe this was also happening earlier, but omap_device used to do the final > suspend (so omapdrm depended on that functionality, after all...). Yes the different handling seems to be the main part of the issue. Regards, Tony