From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 42D07C43381 for ; Thu, 28 Feb 2019 15:18:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 034C720C01 for ; Thu, 28 Feb 2019 15:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551367095; bh=7oi7TntVPUw5g2J24gMEsASxr3uzwTV0ecCh2PFUVp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ohozuc5zqMWJxdCQ9KR8gS3SaTHGZ6KlkMD2j79PSHfp0foIUiUmdvW/IHdFcqeni x8MRkCcJrbHzS7w83NjlNAtMEs/X8J+cOBCrRqzYRx/IfpAUxiJJQNZmNhldAI5M4m +F6csNonV4ATSEHFnsk31yp7sBAe/vYyGE6UdUbU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388885AbfB1PPf (ORCPT ); Thu, 28 Feb 2019 10:15:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:51060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388849AbfB1PP0 (ORCPT ); Thu, 28 Feb 2019 10:15:26 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66392218D9; Thu, 28 Feb 2019 15:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551366926; bh=7oi7TntVPUw5g2J24gMEsASxr3uzwTV0ecCh2PFUVp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uO7tuU8P/AIBLt+Bqdye57GfgnMlHi386o6nkPTkD6v1s1SVkHSlJ3DCeizv0qwgk H/r+SklBL+X/0qde2V8mhMQJQtYLk3HReHEq2Td0lCB2kcJ5/XJBrgD95NKJe0xKI4 JDqcYsZOMhOMI26237FLed9c+I/9g+GD93WzQu5Y= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Paul Kocialkowski , Maxime Ripard , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.9 06/19] drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init Date: Thu, 28 Feb 2019 10:15:02 -0500 Message-Id: <20190228151517.12705-6-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190228151517.12705-1-sashal@kernel.org> References: <20190228151517.12705-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Kocialkowski [ Upstream commit b14e945bda8ae227d1bf2b1837c0c4a61721cd1a ] When initializing clocks, a reference to the TCON channel 0 clock is obtained. However, the clock is never prepared and enabled later. Switching from simplefb to DRM actually disables the clock (that was usually configured by U-Boot) because of that. On the V3s, this results in a hang when writing to some mixer registers when switching over to DRM from simplefb. Fix this by preparing and enabling the clock when initializing other clocks. Waiting for sun4i_tcon_channel_enable to enable the clock is apparently too late and results in the same mixer register access hang. Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20190131132550.26355-1-paul.kocialkowski@bootlin.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index f2975a1525bee..2796fea70a427 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -327,6 +327,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, dev_err(dev, "Couldn't get the TCON channel 0 clock\n"); return PTR_ERR(tcon->sclk0); } + clk_prepare_enable(tcon->sclk0); if (tcon->quirks->has_channel_1) { tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); @@ -341,6 +342,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) { + clk_disable_unprepare(tcon->sclk0); clk_disable_unprepare(tcon->clk); } -- 2.19.1