From patchwork Tue Nov 24 04:34:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ruehl X-Patchwork-Id: 11927069 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=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 715C8C6379F for ; Tue, 24 Nov 2020 04:36:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 CB5C120857 for ; Tue, 24 Nov 2020 04:36:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U0slif/h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB5C120857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gtsys.com.hk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=EEQiPOsnszDH0284ISDW+LRXHl1qk79VG9OJyo8tyQU=; b=U0slif/hfkHss2Kf6n5apRKMo6 Q6Lmp2HJ3tpSQZxnMmn9WCITb9/dDfe2x74wOGUVGJY6G1oevejTIzcYQm2nwUrqtkCmosGhLNJW+ yZOkE0zEevq6zGmH6lyvZSGIaIZzLmRP354YyMq8T/MNKzW/WfyvwGQJwbGJZRnxC5LfK+GVtt4hT iqr8p6ws015jGe2vZzQaAppYcUQTMD5jRLanLXqmQ3tHmDmGJD9U22UubkmXytJCSgsCtKIA1RmaK VS3JYh2Y35HFpZUy3ebzoIY75VhS5gAEpHiQC7bykTYaPso/YBewGGkWn7/bSwCmFqVX/RzAg/AQg Ry4/Ru8w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khQ2L-00074G-Ai; Tue, 24 Nov 2020 04:34:41 +0000 Received: from [27.111.83.178] (helo=mail.gtsys.com.hk) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khQ2I-00073X-Hb for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 04:34:40 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.gtsys.com.hk (Postfix) with ESMTP id 7C14D2015B9C; Tue, 24 Nov 2020 12:34:27 +0800 (HKT) X-Virus-Scanned: Debian amavisd-new at gtsys.com.hk Received: from mail.gtsys.com.hk ([127.0.0.1]) by localhost (mail.gtsys.com.hk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aVvZsY2B5Oz7; Tue, 24 Nov 2020 12:34:27 +0800 (HKT) Received: from s01.gtsys.com.hk (unknown [10.128.4.2]) by mail.gtsys.com.hk (Postfix) with ESMTP id 5B8592015B8C; Tue, 24 Nov 2020 12:34:27 +0800 (HKT) Received: from [10.128.2.32] (unknown [124.217.188.234]) by s01.gtsys.com.hk (Postfix) with ESMTPSA id 289A6C01B4A; Tue, 24 Nov 2020 12:34:27 +0800 (HKT) To: linux-arm-kernel@lists.infradead.org, Heiko Stuebner From: Chris Ruehl Subject: rk3399: Power Domain infinite loop 'pd_gpu' Message-ID: Date: Tue, 24 Nov 2020 12:34:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_233438_985617_376FCE2A X-CRM114-Status: GOOD ( 16.06 ) 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: Jack Lo Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)