From patchwork Wed Nov 16 09:37:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 9433285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BF6760469 for ; Thu, 17 Nov 2016 00:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D47F291BA for ; Thu, 17 Nov 2016 00:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 517FF291BD; Thu, 17 Nov 2016 00:49:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3183291BA for ; Thu, 17 Nov 2016 00:49:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77EB36E73C; Thu, 17 Nov 2016 00:48:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 653016E66F for ; Wed, 16 Nov 2016 09:37:39 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id 5252F5FA51; Wed, 16 Nov 2016 17:37:36 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , David Airlie Subject: [PATCH] drm/sun4i: tcon: Initialize regmap after enabling bus clocks Date: Wed, 16 Nov 2016 17:37:32 +0800 Message-Id: <20161116093732.12828-2-wens@csie.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161116093732.12828-1-wens@csie.org> References: <20161116093732.12828-1-wens@csie.org> X-Mailman-Approved-At: Thu, 17 Nov 2016 00:48:12 +0000 Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If we attempt to read/write the TCON registers before the bus clock is enabled, those accesses get ignored. In practice this almost never occurs because U-boot had already enabled the bus clock as part of its firmware provided framebuffer (simplefb). Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Chen-Yu Tsai --- I was looking around the DRM driver and noticed this sequence was off. --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c6afb2448655..8c2db65ea229 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -506,16 +506,16 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, return ret; } - ret = sun4i_tcon_init_regmap(dev, tcon); + ret = sun4i_tcon_init_clocks(dev, tcon); if (ret) { - dev_err(dev, "Couldn't init our TCON regmap\n"); + dev_err(dev, "Couldn't init our TCON clocks\n"); goto err_assert_reset; } - ret = sun4i_tcon_init_clocks(dev, tcon); + ret = sun4i_tcon_init_regmap(dev, tcon); if (ret) { - dev_err(dev, "Couldn't init our TCON clocks\n"); - goto err_assert_reset; + dev_err(dev, "Couldn't init our TCON regmap\n"); + goto err_free_clocks; } ret = sun4i_tcon_init_irq(dev, tcon);