linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chris Ruehl <chris.ruehl@gtsys.com.hk>
To: linux-arm-kernel@lists.infradead.org, Heiko Stuebner <heiko@sntech.de>
Cc: Jack Lo <jack.lo@gtsys.com.hk>
Subject: rk3399: Power Domain infinite loop 'pd_gpu'
Date: Tue, 24 Nov 2020 12:34:26 +0800	[thread overview]
Message-ID: <de6ddbb1-57ea-f5dc-415b-14d6b9dd032f@gtsys.com.hk> (raw)

Hi All.

Just have a board boot from sd-card and hang after time out on
the ack for the power domain of the gpu subsystem

I looked into the pm_domain.c of the rk3399 where the error message
is reported and realized that the return code isn't handled at all
(vanilla v5.4.77).

this is just a preliminary reach out to you before I go and file
a bug and send official patch to the kernel guys.
The boot log and patch below.

[--shnip--]
[    1.840491] 005: dwhdmi-rockchip ff940000.hdmi: Detected HDMI TX controller 
v2.11a with HDCP (DWC HDMI 2.0 TX PHY)
[    1.841127] 005: rockchip-drm display-subsystem: bound ff940000.hdmi (ops 
dw_hdmi_rockchip_ops)
[    1.841133] 005: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.841135] 005: [drm] No driver support for vblank timestamp query.
[    1.841160] 005: [drm] Cannot find any crtc or sizes
[    1.841455] 005: [drm] Initialized rockchip 1.0.0 20140818 for 
display-subsystem on minor 0
[    1.851607] 005: rockchip-pm-domain 
ff310000.power-management:power-controller: failed to get ack on domain 
'pd_gpu', val=0x800789
[--shnap--]


Patch to escalate the error upstream.
not call rockchip_pmu_restore_qos() if the ACK timed out.


--- drivers/soc/rockchip/pm_domains.c.orig      2020-11-24 11:48:42.216855194 +0800
+++ drivers/soc/rockchip/pm_domains.c   2020-11-24 12:05:27.242044445 +0800
@@ -291,7 +291,7 @@
  static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
  {
         struct rockchip_pmu *pmu = pd->pmu;
-       int ret;
+       int ret = 0;

         mutex_lock(&pmu->mutex);

@@ -307,23 +307,24 @@
                         rockchip_pmu_save_qos(pd);

                         /* if powering down, idle request to NIU first */
-                       rockchip_pmu_set_idle_request(pd, true);
+                       ret = rockchip_pmu_set_idle_request(pd, true);
                 }

                 rockchip_do_pmu_set_power_domain(pd, power_on);

                 if (power_on) {
                         /* if powering up, leave idle mode */
-                       rockchip_pmu_set_idle_request(pd, false);
+                       ret = rockchip_pmu_set_idle_request(pd, false);

-                       rockchip_pmu_restore_qos(pd);
+                       if (ret==0)
+                               rockchip_pmu_restore_qos(pd);
                 }

                 clk_bulk_disable(pd->num_clks, pd->clks);
         }

         mutex_unlock(&pmu->mutex);
-       return 0;
+       return ret;
  }

  static int rockchip_pd_power_on(struct generic_pm_domain *domain)



-- 
GTSYS Limited RFID Technology
9/F, Unit E, R07, Kwai Shing Industrial Building Phase 2,
42-46 Tai Lin Pai Road, Kwai Chung, N.T., Hong Kong
Tel (852) 9079 9521

Disclaimer: https://www.gtsys.com.hk/email/classified.html

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

                 reply	other threads:[~2020-11-24  4:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de6ddbb1-57ea-f5dc-415b-14d6b9dd032f@gtsys.com.hk \
    --to=chris.ruehl@gtsys.com.hk \
    --cc=heiko@sntech.de \
    --cc=jack.lo@gtsys.com.hk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).