Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp451168pxb; Thu, 9 Sep 2021 04:54:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3hXbe0urDRju+ZvDU8LIkCb4bQ3VO8BrWQDoi3WD6lUrdLnjyQiMeDKIacQ2Tzi150Kl8 X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr2759342eds.166.1631188483805; Thu, 09 Sep 2021 04:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188483; cv=none; d=google.com; s=arc-20160816; b=ZFFKxVUKqRtmymO6Wf9hdjCQVOnzA7xcl7j3OeJlwQdHY5pp7Ln6nM58MDsYuHTf5P cYlycZgHwG2MwDEd7OQlnxv2+TdnBq6k8qro+R/VCzzurE5C56NOj67UJDV6v7UmXSKW MmnWUj5JIhkWJP8M+a8KibU/ROpya2qk6U0Kvh2Y9G0mKint2lBvXDvlUAyx5yYuUbP5 BW/69C0oxDoxMcoviP/Bp3QJFXGRGQT635gGQjTUxTT1vc0Xjnk77dK+NK/cOzYM8T27 3x+4ioZ0bne5bnO2PpfOKjOYRmEHcLQbX/zmOmb1le/tDcGeohGt9Qeq+2gqmCcJ+261 EpoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1vctbxq36nWp+wOCmjAiScjoWm16fz6Bdts3/wULSg0=; b=gXm746a6Yp/PTN3tDZ7AfEjJU9OKmw5WkC/0NOcI8pNp5Iic8Jy3CcsMKtVJEB9/ct VC7u8f7/2u3ZcmVVtNXHHRhleo8hOZwawkmueH/rtVHpGgTbDk4u4UDdJfJRbthJyzSy v9/Dd/NyXfgrcCnYXrR3ZJHRsiLp7e2BDKwPR8Df10Q+mD1dBkcHJEpCDAapzOr815Wb fAKeI7AUlBQVthUDNTfBHRFt/gQoqzXtJelX3ho1wGzviqH8qa9AlqQzy9dhOyoYUZqi FmXMnWlI0UdBzXw3NEchoiw+lPxdL/V+cHrNSDmk68FYxg4Ms7Sx+Wzdp5ZvFitrZu6V TLKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U7xHPXPf; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hy16si1417830ejc.209.2021.09.09.04.54.11; Thu, 09 Sep 2021 04:54:43 -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=@kernel.org header.s=k20201202 header.b=U7xHPXPf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240791AbhIILxK (ORCPT + 99 others); Thu, 9 Sep 2021 07:53:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:54738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240972AbhIILui (ORCPT ); Thu, 9 Sep 2021 07:50:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 20A6061354; Thu, 9 Sep 2021 11:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187833; bh=W+T/E0zEhT623KLpFLXe20x3q4+PmgWC1T7ywY51mYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U7xHPXPfIBGUtwBlg5dKruGlcnRTk8GCUJaY6wPEGLU1jDx8TsRxv7PGBJ1RB5euN QAQa99lPC9eQPrlNELZFdtlDKFILqm6Hqb5JC0HN6F8ykziOgE5POtJTTFZvOAKz5c zsvlbwMVQuoiPlh4rMV9u6fwX4PBS7mOZdQCQMoCQEoXJWIC4Ay1JOSFInfMBsosWY C1p4PuVnUVUJE+RNUCAwSXaLRjG6H5CqZL3GzqngL1OW9aGDQC4z8rA2SSvWshPo2J NwJfas9JCFKQk2pjJVgcL5DWVcYnp93NI9tJz+Dez7x2WemOiykiwt/yNfwLSnlL98 rftB0d+MVQdaw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Quanyang Wang , Laurent Pinchart , Sasha Levin , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.14 129/252] drm: xlnx: zynqmp_dpsub: Call pm_runtime_get_sync before setting pixel clock Date: Thu, 9 Sep 2021 07:39:03 -0400 Message-Id: <20210909114106.141462-129-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 109d627968ac..01c6ce7784dd 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1452,9 +1452,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