Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp356245imm; Wed, 13 Jun 2018 01:18:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJLY/5cnCP2tOxbPfS3VYn7y5iDNCBK33t/JUXQncq4INUyEz8bhlUtpXytvbGEG1u2ShJ4 X-Received: by 2002:a65:6148:: with SMTP id o8-v6mr3168893pgv.93.1528877920881; Wed, 13 Jun 2018 01:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528877920; cv=none; d=google.com; s=arc-20160816; b=ZQ13MPPc0mdkZ1l3Pmr003BgVqsOWlmfQ73yJqrS9gKLWFG0lEiW9nKS7l6mAdbB4j 6kbpiM4Q1qNbvWMZMweBMu5XXMup3ymWMVOQwAg95PYTiSMWVC5uVxfoFY6+lOJuJXi2 Xj0xCtActmPikibON/j+ukfsS94Dt3vDg55ZdEOzMZ+g+LfG9rFgiO0SGrZjPBaw7GsO 8P1c4YOjTzMLT1S+l/hr3m0DHaFVSRKb1L5qIjI4ENf17+tXiW/NEYXw3E9oWOSE6Omv dR0lhQ/WyacdjLi6JCaDMKLRfmxYiKaQJMtSvARzYj52L6MA2Nhc54FuJjgKLLpxIxUW ARxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=/nKGYfP5Ev+02Z4TYZxxZqi+W/AC25/A5Pgo4Xa++JU=; b=kjZ3tut7SkrJOloqpMnJ8z0wOnum7mjB0AxtTZgQxgVfwRdY6Kn+aDiIlPNfJlRyxJ h9JF0i7w10qurT46aVuqMfWZz0pwaX0iatnMhVrK1wTyTKPTyxh9VQP1V+BBl8p1BeLp /rphN1nMZ1bDm5e/y6vw3ADRloqhAEd2iJxohL+aQet9wBizhJlg8RZnObpboPzvdLh5 3D6jhLP+L/N8mNUXrMhCI/bIaePKxvARDScmrcuaRF2q3kl6zmpRCCsOMz5IuTGYF7F9 p+uhQJO8gV135zOBCLpF5A9iciIDB4zEYMnxiXCetsmOeSoj9kFKkiysp7t/J7nWHXlK s+iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si2417755plf.84.2018.06.13.01.18.26; Wed, 13 Jun 2018 01:18:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934889AbeFMIRf (ORCPT + 99 others); Wed, 13 Jun 2018 04:17:35 -0400 Received: from mail.bootlin.com ([62.4.15.54]:43672 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933618AbeFMIRb (ORCPT ); Wed, 13 Jun 2018 04:17:31 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 6C2B820A33; Wed, 13 Jun 2018 10:17:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id 1F5E520A2A; Wed, 13 Jun 2018 10:17:19 +0200 (CEST) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Maxime Ripard , David Airlie , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Giulio Benetti , Paul Kocialkowski , stable@vger.kernel.org Subject: [PATCH] Revert "drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE" Date: Wed, 13 Jun 2018 10:16:47 +0200 Message-Id: <20180613081647.31183-1-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 2c17a4368aad2b88b68e4390c819e226cf320f70. The offending commit triggers a run-time fault when accessing the panel element of the sun4i_tcon structure when no such panel is attached. It was apparently assumed in said commit that a panel is always used with the TCON. Although it is often the case, this is not always true. For instance a bridge might be used instead of a panel. This issue was discovered using an A13-OLinuXino, that uses the TCON in RGB mode for a simple DAC-based VGA bridge. Cc: stable@vger.kernel.org Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c3d92d537240..8045871335b5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -17,7 +17,6 @@ #include #include #include -#include #include @@ -350,9 +349,6 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, const struct drm_display_mode *mode) { - struct drm_panel *panel = tcon->panel; - struct drm_connector *connector = panel->connector; - struct drm_display_info display_info = connector->display_info; unsigned int bp, hsync, vsync; u8 clk_delay; u32 val = 0; @@ -410,27 +406,6 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, if (mode->flags & DRM_MODE_FLAG_PVSYNC) val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE; - /* - * On A20 and similar SoCs, the only way to achieve Positive Edge - * (Rising Edge), is setting dclk clock phase to 2/3(240°). - * By default TCON works in Negative Edge(Falling Edge), - * this is why phase is set to 0 in that case. - * Unfortunately there's no way to logically invert dclk through - * IO_POL register. - * The only acceptable way to work, triple checked with scope, - * is using clock phase set to 0° for Negative Edge and set to 240° - * for Positive Edge. - * On A33 and similar SoCs there would be a 90° phase option, - * but it divides also dclk by 2. - * Following code is a way to avoid quirks all around TCON - * and DOTCLOCK drivers. - */ - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE) - clk_set_phase(tcon->dclk, 240); - - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) - clk_set_phase(tcon->dclk, 0); - regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG, SUN4I_TCON0_IO_POL_HSYNC_POSITIVE | SUN4I_TCON0_IO_POL_VSYNC_POSITIVE, val); -- 2.17.0