dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/omap: force runtime PM suspend on system suspend
@ 2020-06-18  9:51 Tomi Valkeinen
  2020-06-18 13:16 ` Tony Lindgren
  2020-07-17 16:28 ` Tony Lindgren
  0 siblings, 2 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2020-06-18  9:51 UTC (permalink / raw)
  To: dri-devel, Tony Lindgren
  Cc: Tomi Valkeinen, Grygorii Strashko, Laurent Pinchart

Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
suspend and resume.

We use suspend late version so that omapdrm's system suspend callback is
called first, as that will disable all the display outputs after which
it's safe to force DSS into suspend.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 1 +
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 1 +
 drivers/gpu/drm/omapdrm/dss/dss.c   | 1 +
 drivers/gpu/drm/omapdrm/dss/venc.c  | 1 +
 4 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 6639ee9b05d3..48593932bddf 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -4915,6 +4915,7 @@ static int dispc_runtime_resume(struct device *dev)
 static const struct dev_pm_ops dispc_pm_ops = {
 	.runtime_suspend = dispc_runtime_suspend,
 	.runtime_resume = dispc_runtime_resume,
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 struct platform_driver omap_dispchw_driver = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 79ddfbfd1b58..eeccf40bae41 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5467,6 +5467,7 @@ static int dsi_runtime_resume(struct device *dev)
 static const struct dev_pm_ops dsi_pm_ops = {
 	.runtime_suspend = dsi_runtime_suspend,
 	.runtime_resume = dsi_runtime_resume,
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 struct platform_driver omap_dsihw_driver = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 4d5739fa4a5d..6ccbc29c4ce4 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1614,6 +1614,7 @@ static int dss_runtime_resume(struct device *dev)
 static const struct dev_pm_ops dss_pm_ops = {
 	.runtime_suspend = dss_runtime_suspend,
 	.runtime_resume = dss_runtime_resume,
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 struct platform_driver omap_dsshw_driver = {
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 9701843ccf09..01ee6c50b663 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -902,6 +902,7 @@ static int venc_runtime_resume(struct device *dev)
 static const struct dev_pm_ops venc_pm_ops = {
 	.runtime_suspend = venc_runtime_suspend,
 	.runtime_resume = venc_runtime_resume,
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static const struct of_device_id venc_of_match[] = {
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-06-18  9:51 [PATCH v2] drm/omap: force runtime PM suspend on system suspend Tomi Valkeinen
@ 2020-06-18 13:16 ` Tony Lindgren
  2020-06-18 14:01   ` Tomi Valkeinen
  2020-07-17 16:28 ` Tony Lindgren
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-06-18 13:16 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Grygorii Strashko, Laurent Pinchart, dri-devel

* Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 09:53]:
> Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
> suspend and resume.
> 
> We use suspend late version so that omapdrm's system suspend callback is
> called first, as that will disable all the display outputs after which
> it's safe to force DSS into suspend.

This looks like a nice way of doing it, would be good to have as a
regression fix for the -rc cycle:

Acked-by: Tony Lindgren <tony@atomide.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-06-18 13:16 ` Tony Lindgren
@ 2020-06-18 14:01   ` Tomi Valkeinen
  2020-06-18 14:41     ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2020-06-18 14:01 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Grygorii Strashko, Laurent Pinchart, dri-devel

On 18/06/2020 16:16, Tony Lindgren wrote:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 09:53]:
>> Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
>> suspend and resume.
>>
>> We use suspend late version so that omapdrm's system suspend callback is
>> called first, as that will disable all the display outputs after which
>> it's safe to force DSS into suspend.
> 
> This looks like a nice way of doing it, would be good to have as a
> regression fix for the -rc cycle:
> 
> Acked-by: Tony Lindgren <tony@atomide.com>

Thanks. Did you get the full suspend working? I still can't resume, unless I use pm_test to avoid 
the full suspend. So I'm still not sure if things really work.

  Tomi

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-06-18 14:01   ` Tomi Valkeinen
@ 2020-06-18 14:41     ` Tony Lindgren
  2020-06-18 16:24       ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-06-18 14:41 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Grygorii Strashko, Laurent Pinchart, dri-devel

* Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 14:03]:
> On 18/06/2020 16:16, Tony Lindgren wrote:
> > * Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 09:53]:
> > > Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
> > > suspend and resume.
> > > 
> > > We use suspend late version so that omapdrm's system suspend callback is
> > > called first, as that will disable all the display outputs after which
> > > it's safe to force DSS into suspend.
> > 
> > This looks like a nice way of doing it, would be good to have as a
> > regression fix for the -rc cycle:
> > 
> > Acked-by: Tony Lindgren <tony@atomide.com>
> 
> Thanks. Did you get the full suspend working? I still can't resume, unless I
> use pm_test to avoid the full suspend. So I'm still not sure if things
> really work.

I just tested my fixes branch at commit 80bf72598663 ("ARM: dts: am5729:
beaglebone-ai: fix rgmii phy-mode") with your patch and HDMI cable
attached and suspend and resume works for me:

Tested-by: Tony Lindgren <tony@atomide.com>

I did not have luck the last time I tried am437x-sk-evm, but that
seems like some separate regression that's been around for awhile.
I recall testing it successfully last fall at some point.

Regards,

Tony
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-06-18 14:41     ` Tony Lindgren
@ 2020-06-18 16:24       ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-06-18 16:24 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, Grygorii Strashko, Laurent Pinchart, dri-devel

* Tony Lindgren <tony@atomide.com> [200618 07:42]:
> I did not have luck the last time I tried am437x-sk-evm, but that
> seems like some separate regression that's been around for awhile.
> I recall testing it successfully last fall at some point.

OK I got am437x-sk-evm suspend and resume working again and
LCD console comes back after resume. I also had to apply the
panel-simple fix "drm/panel-simple: fix connector type for
newhaven_nhd_43_480272ef_atxl" to get LCD working again.

I was missing /lib/firmware/am335x-pm-firmware.elf after updating
my NFSroot file system. And FYI, here are the modules I now load
with my test script:

modprobe omap-mailbox
modprobe omap_remoteproc
modprobe wkup_m3_rproc
modprobe wkup_m3_ipc
modprobe pm33xx
modprobe rtc-omap
modprobe pwm-omap-dmtimer
modprobe pwm-tiecap
modprobe pwm_bl
modprobe edt-ft5x06		# on am437x-sk-evm
modprobe pixcir_i2c_ts		# NOT on am437x-sk-evm, only on am437x-gp-evm.dts
modprobe omapdrm
modprobe panel-simple
modprobe display-connector	# starting with v5.7-rc1
modprobe omapdss
modprobe panel-dpi
modprobe omap-dss

And then I get the following with rtcwake -m mem -s 5.

Sometimes cps and NFSroot seems to take few tens of seconds to
recover though.

Regards,

Tony

8< ------------------
[   33.481400] omapdss_dss 4832a000.dss: supply vdda_video not found, using dummy regulator
[   33.481573] DSS: OMAP DSS rev 2.0
[   33.485412] omapdss_dss 4832a000.dss: bound 4832a400.dispc (ops dispc_component_ops [omapdss])
[   33.485932] omapdrm omapdrm.0: DMM not available, disable DMM support
[   33.486322] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   33.525740] Console: switching to colour frame buffer device 60x34
[   33.543690] omapdrm omapdrm.0: fb0: omapdrmdrmfb frame buffer device
[   33.544563] [drm] Initialized omapdrm 1.0.0 20110917 for omapdrm.0 on minor 0
[   40.196247] vmmcwl_fixed: disabling
[  124.230087] PM: suspend entry (deep)
[  124.230152] Filesystems sync: 0.000 seconds
[  124.233068] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  124.234420] OOM killer disabled.
[  124.234424] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[  124.235607] WARNING: This platform does not support off-mode, entering DeepSleep suspend.
[  124.235623] printk: Suspending console(s) (use no_console_suspend to debug)
[  124.255315] cpsw 4a100000.ethernet eth0: Link is Down
[  124.260828] Disabling non-boot CPUs ...
[  124.260839] WARNING: This platform does not support off-mode, entering DeepSleep suspend.
[  124.260839] WARNING: This platform does not support off-mode, entering DeepSleep suspend.
[  124.260839] pm33xx pm33xx: PM: Could not transition all powerdomains to target state
[  124.260839] PM: Wakeup source RTC Alarm
[  124.260839] WARNING: This platform does not support off-mode, entering DeepSleep suspend.
[  124.271744] ti-sysc 4a101200.target-module: OCP softreset timed out
[  124.274498] cpsw 4a100000.ethernet: initializing cpsw version 1.15 (0)
[  124.415839] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:04: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:04, irq=POLL)
[  124.493879] OOM killer enabled.
[  124.493885] Restarting tasks ... done.
[  124.502993] PM: suspend exit
[  132.757778] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-06-18  9:51 [PATCH v2] drm/omap: force runtime PM suspend on system suspend Tomi Valkeinen
  2020-06-18 13:16 ` Tony Lindgren
@ 2020-07-17 16:28 ` Tony Lindgren
  2020-08-04  8:22   ` Tomi Valkeinen
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-07-17 16:28 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Grygorii Strashko, Laurent Pinchart, dri-devel

* Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 09:53]:
> Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
> suspend and resume.
> 
> We use suspend late version so that omapdrm's system suspend callback is
> called first, as that will disable all the display outputs after which
> it's safe to force DSS into suspend.

This would be great to have merged as a fix for v5.8 as it fixes a
suspend and resume regression:

Fixes: cef766300353 ("drm/omap: Prepare DSS for probing without legacy platform data")
Tested-by: Tony Lindgren <tonY@atomide.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] drm/omap: force runtime PM suspend on system suspend
  2020-07-17 16:28 ` Tony Lindgren
@ 2020-08-04  8:22   ` Tomi Valkeinen
  0 siblings, 0 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2020-08-04  8:22 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Grygorii Strashko, Laurent Pinchart, dri-devel

Hi,

On 17/07/2020 19:28, Tony Lindgren wrote:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [200618 09:53]:
>> Use SET_LATE_SYSTEM_SLEEP_PM_OPS in DSS submodules to force runtime PM
>> suspend and resume.
>>
>> We use suspend late version so that omapdrm's system suspend callback is
>> called first, as that will disable all the display outputs after which
>> it's safe to force DSS into suspend.
> 
> This would be great to have merged as a fix for v5.8 as it fixes a
> suspend and resume regression:
> 
> Fixes: cef766300353 ("drm/omap: Prepare DSS for probing without legacy platform data")
> Tested-by: Tony Lindgren <tonY@atomide.com>
> 

I have pushed this to drm-misc-fixes. I added

Cc: stable@vger.kernel.org # v5.7+

 Tomi

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-04  8:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18  9:51 [PATCH v2] drm/omap: force runtime PM suspend on system suspend Tomi Valkeinen
2020-06-18 13:16 ` Tony Lindgren
2020-06-18 14:01   ` Tomi Valkeinen
2020-06-18 14:41     ` Tony Lindgren
2020-06-18 16:24       ` Tony Lindgren
2020-07-17 16:28 ` Tony Lindgren
2020-08-04  8:22   ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).