Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1702775pxb; Thu, 16 Sep 2021 13:24:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTMw1TDJOzI1QMcuhA+6klcid3oJP/FhXtVL2u9//F2EMhNx4r5J0afjFqTRgXcOdk8HQG X-Received: by 2002:a92:ca82:: with SMTP id t2mr5206300ilo.151.1631823879109; Thu, 16 Sep 2021 13:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823879; cv=none; d=google.com; s=arc-20160816; b=c2cf0ctD15PQNSFEGwu8tA4lt9hDD32o5AC88gw730pTNwyfHdb9u2OmWpQRQbQT3F dvzKLQwgsx5iIciqCbNKzbgr5yX4cPhQs+KrHQTNkyHlVssO9CD0t5UMPlB2d/inZkCe dVWX99C0WyylLg1PxkWVt7XtWznyQ+a1tZR2Mqo64BHJCnZmeGWS5C13bAGbWO+M5zXf k2/hvy2zZC79rTwxdCNdWWq//IOtr8tdqwhJVTdzN/03XHxqwI1WhZvXldTZyVmcGjAF Sa3TXkiwT4x1x797F9W/fo89EqG1GNqVAOp6C2RlChjtGEhI4upw0lm3M30cqHFNUUgj a5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d79AHvWFA80uLlEEQLEyR41XliI526DtPN0aNyZb/Zk=; b=QQxdPr2IJH87DXyEOK4bB/fiGK9F88PiePeW6wvJwhC8OzmPglZ2vufpWpJW9e8Mc2 iKs/wjjgO9GmIeLh1sniIn4FYVzjojcnKCyLdfkRGCovklopW4vk1Mu6+H/y0y3tZzlA VUSnPbqOT4FrvWbKMaXZCNdDB7NpIpYMt+Rd6P+G23Mr2in/vm44FsHdm/PBMq/1gyGS d+DDtI6Zh5Gtj92xDAQtw9KOARFRxcLwrk9RbGSGul7oVvYqWL9RjKf5IdUr0OSdHBJu QxRWE+/pivdR2SVLCp51Zu7GQO9LZt0w+QBe/bbvuPezJohO1BOIZX+rmnL21Lcx+c4B GGXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hVFnI3IQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si2339906ilo.140.2021.09.16.13.24.26; Thu, 16 Sep 2021 13:24:39 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hVFnI3IQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242149AbhIPQ0v (ORCPT + 99 others); Thu, 16 Sep 2021 12:26:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:54968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240775AbhIPQRU (ORCPT ); Thu, 16 Sep 2021 12:17:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1849161359; Thu, 16 Sep 2021 16:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808729; bh=WL95pBWX9utgm6lK7UPse5AMxSDQI3yjGj2AO5EUIW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hVFnI3IQZxuS7zJzh+jhXycmqebnaZljxkYoG6YhCNJsk5DyFmZnR/HnA0p/7bwoS 0DZqg5m4OFCTLvJeOPF+YML4vy0bYnaKe61EQPTbpZqWJN2vueY91TQIQ7HmiyYFvO rQdkaRjnC03+/1tEq9mLe4++1P07MSVapDQSLPw8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quanyang Wang , Laurent Pinchart , Sasha Levin Subject: [PATCH 5.10 200/306] drm: xlnx: zynqmp_dpsub: Call pm_runtime_get_sync before setting pixel clock Date: Thu, 16 Sep 2021 17:59:05 +0200 Message-Id: <20210916155800.875175402@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quanyang Wang [ Upstream commit a19effb6dbe5bd1be77a6d68eba04dba8993ffeb ] The Runtime PM subsystem will force the device "fd4a0000.zynqmp-display" to enter suspend state while booting if the following conditions are met: - the usage counter is zero (pm_runtime_get_sync hasn't been called yet) - no 'active' children (no zynqmp-dp-snd-xx node under dpsub node) - no other device in the same power domain (dpdma node has no "power-domains = <&zynqmp_firmware PD_DP>" property) So there is a scenario as below: 1) DP device enters suspend state <- call zynqmp_gpd_power_off 2) zynqmp_disp_crtc_setup_clock <- configurate register VPLL_FRAC_CFG 3) pm_runtime_get_sync <- call zynqmp_gpd_power_on and clear previous VPLL_FRAC_CFG configuration 4) clk_prepare_enable(disp->pclk) <- enable failed since VPLL_FRAC_CFG configuration is corrupted >From above, we can see that pm_runtime_get_sync may clear register VPLL_FRAC_CFG configuration and result the failure of clk enabling. Putting pm_runtime_get_sync at the very beginning of the function zynqmp_disp_crtc_atomic_enable can resolve this issue. Signed-off-by: Quanyang Wang Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 8cd8af35cfaa..205c72a249b7 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1447,9 +1447,10 @@ zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; int ret, vrefresh; + pm_runtime_get_sync(disp->dev); + zynqmp_disp_crtc_setup_clock(crtc, adjusted_mode); - pm_runtime_get_sync(disp->dev); ret = clk_prepare_enable(disp->pclk); if (ret) { dev_err(disp->dev, "failed to enable a pixel clock\n"); -- 2.30.2