Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1410001imm; Thu, 5 Jul 2018 22:51:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeu2nPOJBV93MllkXZVeGB4ZLPc84x0TiUqtzrwu7j7qYnN3y6WZdznJZfSwjF8nTsX98ZB X-Received: by 2002:a62:9bc5:: with SMTP id e66-v6mr9217396pfk.84.1530856270353; Thu, 05 Jul 2018 22:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856270; cv=none; d=google.com; s=arc-20160816; b=TAWpN2ypJ3B4JZOQB1RMz7eYt7NYpgzkXAVvkgG9uqiSw/M7c5lIGD65z06LDKoLx3 8hgQH3DSgrh+h2uw5SrSfqlrxZNna8kF3Vbrd3VceEsxryanAZgevqACv6xugYj3XfOH L5lYN0y/sKSx5ZDJyTYhA1A3XA48L+cKAszHs7M+jcaamjUMawMhXkB+4XlSSHvGsRxz yBEzOYh/lNUf2Jo5J+OX3457sKheERoJFViLSRMxITeNpR47wNHu0RnLliYyXZRdD6jX j88PtB/mA5s7psN3mqSQp3eVi+UNAIh4BTCxKY9wz59zQBZcarrHsNHK2nGk7Xe0O1ZU c0bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=f0+cSkJ63zhKCLuw7r9Dug2xC6YyOFPrPkvdnItiGIg=; b=ZBXsEDWdWKhwWAEpA0jyIT9EvGZuVZTghROJAPCZQScPSUiIWkWLx3Ia+zrjIvn/up m1dniKTw4hoVzPjmx7aiMtiAxB7A+FSSnAnJ8yk20JSrImiboLB6o96BPVsiH4COs3gi 0wAM+0iGp9BHG6imUuUUjylzxZYtu4gFntbdFWvF28BjAR7kxbygWkVA0wz/rQe0K1Gd Dzmu1mTmBQ3QxiKjjxLc/3R1jbhNzehfezcuYJE8ACjDddrb/m8d9thEjMO6OK3zLh9U cr2LpWUnSpllmzJ4YYp/0iu7r7QO8nGuSBTpvTelSS0qH99AO8ZFyldTwPJLiSGIoU30 4uwA== 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 g6-v6si6667876pgq.240.2018.07.05.22.50.56; Thu, 05 Jul 2018 22:51:10 -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 S933184AbeGFFsQ (ORCPT + 99 others); Fri, 6 Jul 2018 01:48:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59768 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933112AbeGFFsN (ORCPT ); Fri, 6 Jul 2018 01:48:13 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F048086A; Fri, 6 Jul 2018 05:48:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Kocialkowski , Maxime Ripard Subject: [PATCH 4.17 27/46] Revert "drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE" Date: Fri, 6 Jul 2018 07:46:48 +0200 Message-Id: <20180706054525.891089477@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054524.595521988@linuxfoundation.org> References: <20180706054524.595521988@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Kocialkowski commit 58b3d02f066e5b1480d80bd308c545526eea3250 upstream. 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 Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20180613081647.31183-1-paul.kocialkowski@bootlin.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 25 ------------------------- 1 file changed, 25 deletions(-) --- 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(st 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(str 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);