Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1568739pxb; Thu, 16 Sep 2021 10:05:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzresWP0JpCO/r024uTO8JyMvtKiqrkHe94bo9w+yE0doBjHWYcYsnmkU0clvFCHVAjWeCW X-Received: by 2002:a17:906:9ad0:: with SMTP id ah16mr7696344ejc.43.1631811928833; Thu, 16 Sep 2021 10:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631811928; cv=none; d=google.com; s=arc-20160816; b=BgNcj2C3v6r7wfj9U9557WOP2vKrsitH6mnpPijADkVWlRIcHwQ+wlPVJAVs84uYeB GkuTHLgazmE9ZrLXqZ5eBYdVpXRUE/dfqB+wJsX6oo05nMUrOGCRW18+6r5VoXYjVRDn RftY1NVQdDOYWIekNtzMBpxwc7x5jxlGZe+xC12GBFovJTktqjAj7RrDhzwREdHrpgbk jO/3mNEpGUNJQH0AEpjMX7b9LY/Va4PR3642jfj8jPmS7MLnhtXmjb95SYBuwUNz4gAN //GsbDZfjee5lhkC138nFJOH1RaPxZs+IJLWfRsOH7iZ+EYipWFlUNCrmQHUwdrAQjX3 anxA== 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=PR5slj8txXBIHsmZ5lLQL+lXVicgO9QVs0wM5KfM8X4=; b=dh2p71YkbbeGf61dU34dIkLFdzObwvivq4G99FlZwfOnGGJszjp+sQ4jNUBySXJP6N DHnlKkisgrR5M8MMM1uEBPm/kK6RakXxvmThe81kQVudDjaESc6kU3w0mAGPWkbJqfv5 7gcurZyXtEDJxdlj0cmUmGO7myKiXi0Qp++PyHc0Hrd5K+6wYCLR1NXc0VJH9KgUuZk9 58PRpTyYGugoPbNpAbhTp6R1Lmc3Cbgo8MLXxAycMb8gJpyktY0MW+gxgtJF8Csqtraw alG+p8dPhAdEOBe31KuXjAqgl6i/6joxcLUWuvU/PoZyskSk+J1wAqi1YVsBIx1Rsag3 sMCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Y/Av5Gyf"; 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 e25si4130234ejy.256.2021.09.16.10.05.02; Thu, 16 Sep 2021 10:05:28 -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="Y/Av5Gyf"; 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 S1344072AbhIPQ50 (ORCPT + 99 others); Thu, 16 Sep 2021 12:57:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345944AbhIPQxB (ORCPT ); Thu, 16 Sep 2021 12:53:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E0C561A8D; Thu, 16 Sep 2021 16:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809777; bh=6XPkMybdNHKrHU4KwX8+K12QhA29HKIgLYqu2LzrJgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y/Av5GyfVXpwD/KefIjLwhNLi4iQJhEco8Sp3eWR9Gtn70ATRGnqJQ/JEwAfVbEMg Tr8u4ULuWv9XckiPgB+QVGhQIQU1cgYQyQX+Vfpiciqth7DdNNsI2l+B0C2eQh1IlY axPh0Mul7c017Sh1yM72U58nTihdGFRTA1aM8F+4= 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.13 248/380] drm: xlnx: zynqmp_dpsub: Call pm_runtime_get_sync before setting pixel clock Date: Thu, 16 Sep 2021 18:00:05 +0200 Message-Id: <20210916155812.519013106@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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 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