From patchwork Mon Apr 17 12:37:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 13213792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A32F3C77B70 for ; Mon, 17 Apr 2023 12:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From: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=0VusdGqyHKv4nRbR5x/Y8k1xoXq/QuTy8+mUsE9pfcs=; b=LeuxxTgQRD2RaE 4Dw9Yuk/s1h1xHaRuiXtlaDVZBojSxoYwF9ucH3X9SsDE7W1YlgTHBywq7iFL2a5LSYukAg+8UJ/f yWW/poZhiBDdmLHb/TiTlAVUjnxbkLeCg88sST8u6mhkgJhTsf1vJAOU2KfAmxFqYjseZEr9msh2d Dn3NrbGf6h5hioZDYgJf5uNLUxsZbtGroMFKIr7mymXiITtr9sFPp6BN0Pa9j/LlQZADd2bvpQafd 2qTVR6Zv+hkjnuNs+HA7yH/76AkfgThFQC8l8rtZCiMfrgkPooMoh/H8sS1NmB6QuiqrXaKy2cXMt K+2dleydlE0c5qEBow0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poO7n-00GAD0-0A; Mon, 17 Apr 2023 12:38:27 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1poO7k-00GAB8-1X for linux-rockchip@lists.infradead.org; Mon, 17 Apr 2023 12:38:25 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poO7b-0006Br-ME; Mon, 17 Apr 2023 14:38:15 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1poO7T-00BseC-Rd; Mon, 17 Apr 2023 14:38:07 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1poO7T-00993Y-4i; Mon, 17 Apr 2023 14:38:07 +0200 From: Sascha Hauer To: dri-devel@lists.freedesktop.org Cc: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , linux-rockchip@lists.infradead.org, kernel@pengutronix.de, Chris Morgan , =?utf-8?q?K=C3=B6ry_Maincent?= , Michael Riesch , Paul Kocialkowski , Sascha Hauer , stable@vger.kernel.org Subject: [PATCH] drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume Date: Mon, 17 Apr 2023 14:37:47 +0200 Message-Id: <20230417123747.2179695-1-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230417_053824_512704_9635DD07 X-CRM114-Status: GOOD ( 13.57 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org afa965a45e01 ("drm/rockchip: vop2: fix suspend/resume") uses regmap_reinit_cache() to fix the suspend/resume issue with the VOP2 driver. During discussion it came up that we should rather use regcache_sync() instead. As the original patch is already applied fix this up in this follow-up patch. Fixes: afa965a45e01 ("drm/rockchip: vop2: fix suspend/resume") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230417094215.2049231-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index d9daa686b014d..293c228a83f90 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -215,8 +215,6 @@ struct vop2 { struct vop2_win win[]; }; -static const struct regmap_config vop2_regmap_config; - static struct vop2_video_port *to_vop2_video_port(struct drm_crtc *crtc) { return container_of(crtc, struct vop2_video_port, crtc); @@ -841,11 +839,7 @@ static void vop2_enable(struct vop2 *vop2) return; } - ret = regmap_reinit_cache(vop2->map, &vop2_regmap_config); - if (ret) { - drm_err(vop2->drm, "failed to reinit cache: %d\n", ret); - return; - } + regcache_sync(vop2->map); if (vop2->data->soc_id == 3566) vop2_writel(vop2, RK3568_OTP_WIN_EN, 1); @@ -875,6 +869,8 @@ static void vop2_disable(struct vop2 *vop2) pm_runtime_put_sync(vop2->dev); + regcache_mark_dirty(vop2->map); + clk_disable_unprepare(vop2->aclk); clk_disable_unprepare(vop2->hclk); }