Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp68576ybi; Fri, 26 Jul 2019 06:16:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXoG7wCta65NF0lZ5vAIn5/oufIsnlJnPmXO9qrtsKswOcf6cGqKnfYV0+LXOfuPrQ3083 X-Received: by 2002:a63:194f:: with SMTP id 15mr56827990pgz.382.1564146979098; Fri, 26 Jul 2019 06:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564146979; cv=none; d=google.com; s=arc-20160816; b=dDDGplg8QOBI0m99Gf65uYOH6Nm77IA3icPYpECH72LBIzE5pnLOm/2pfLQGNdxeE0 JaupbePn341y/n6f93ZibAdwaqFkHuqzKK6d8kN1z2G7ZORJzyF96fB8CW3lV7py3mGf q9G+l4CIcQ8Cfjjw+k2UE/+ZieRYvtPYS8WK/c+XMUtaIBaMEEyxSl0K5erW9r0IkEii mkI9hB4+6TTZmtz5Y4jHKWsosR6j4yvsvaL4OZuooSGGsuBCPfsC+0JDkf6Es7Z8TnHS FmTpxI236m47rkjEJkuYYkNDF1q80bNdNFYTXg649fi+UfdSnd2mA+rmRidEAOiSS/40 4FLg== 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 :references:in-reply-to:message-id:date:subject:to:from; bh=sFlmW1XP/YTzc6K9H4SU1Hcf4bAn2Kq5oirJ84tOvO8=; b=ck6ZYeEntMpf7CGNt1qbJQWGRWuAaRaaU/NUd6tM+SfLVrQoy82oJ0y8Y8VkGqp7XU D1QJnn/xGjJNjJ0MVJqNXw9lcZY0UVNow11Xoi+bYSbplZeqguHaORn2jNrUlTxLlr2T HcH8/qK8vBqd4u4ZHjPvmvsL4SiS3Cizbka6/6oUQuzompy9GqsOy0ZxLggPAZ3RFWyi P6HY5TzPDTSuKZ9+zy/TTelv7yI/wc4NzSVzFd6ixO02ow6Os8NUPtTUm4rYBhxUz9Kc EwHidZi090RPbR3QOlxaj1uAnybmF7ofU6DIirCO2EwHDbxZ4oiycoOtAA8pnM73t9y8 54jA== 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 k10si20812140pjw.1.2019.07.26.06.16.03; Fri, 26 Jul 2019 06:16:19 -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 S1727071AbfGZNOw (ORCPT + 99 others); Fri, 26 Jul 2019 09:14:52 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:36368 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726604AbfGZNOr (ORCPT ); Fri, 26 Jul 2019 09:14:47 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id D501CFB05; Fri, 26 Jul 2019 15:14:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nICvhURxg7dB; Fri, 26 Jul 2019 15:14:41 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 23A0446AA3; Fri, 26 Jul 2019 15:14:40 +0200 (CEST) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: =?UTF-8?q?Guido=20G=C3=BCnther?= , Purism Kernel Team , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] drm/panel: jh057n00900: Move panel DSI init to enable() Date: Fri, 26 Jul 2019 15:14:36 +0200 Message-Id: <12c3495b234952aafe11980a9e06cfd246134660.1564146727.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: 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 If the panel is wrapped in a panel_bridge it gets prepar()ed before the upstream DSI bridge which can cause hangs (e.g. with imx-nwl since clocks are not enabled yet). To avoid this move the panel's first DSI access to enable() so the upstream bridge can prepare the DSI host controller in it's pre_enable(). This is also in line with other panel drivers. Signed-off-by: Guido Günther Reviewed-by: Sam Ravnborg --- .../gpu/drm/panel/panel-rocktech-jh057n00900.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c index 1274b54f2672..c6b4bfd79fde 100644 --- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c +++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c @@ -143,6 +143,14 @@ static int jh057n_init_sequence(struct jh057n *ctx) static int jh057n_enable(struct drm_panel *panel) { struct jh057n *ctx = panel_to_jh057n(panel); + int ret; + + ret = jh057n_init_sequence(ctx); + if (ret < 0) { + DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", + ret); + return ret; + } return backlight_enable(ctx->backlight); } @@ -197,13 +205,6 @@ static int jh057n_prepare(struct drm_panel *panel) gpiod_set_value_cansleep(ctx->reset_gpio, 0); msleep(20); - ret = jh057n_init_sequence(ctx); - if (ret < 0) { - DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", - ret); - return ret; - } - ctx->prepared = true; return 0; -- 2.20.1