Message ID | 20231101-tidss-probe-v1-4-45149e0f9415@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282797vqx; Wed, 1 Nov 2023 02:20:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHC7Ql4Je31vfqZRQ/uaHMtKmgVpNywhO1p9rXLhmSXFWLS5+huMN3dSqbzoYAAECU3XPsF X-Received: by 2002:a05:6870:2304:b0:1e9:c974:5f7e with SMTP id w4-20020a056870230400b001e9c9745f7emr18995949oao.40.1698830407042; Wed, 01 Nov 2023 02:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830407; cv=none; d=google.com; s=arc-20160816; b=RudzRWQGh5zIKC7VP7BktQuueU3Bz7xvlyNVtmRtcdaqbeXryAHVUAsPH65Lc4NCWN nC2g0vI7IwHSxYL3DAAHhuf8z5rTc3siw+g71vWa2hQe5GVPgJQUux9nnRASugjj9fVh UWSXdpG5G1o3ngY2ugL9VfMiPJaUoYVv80ljkst+P0S4Xp2BdULjHta/kmz/08v9hCSV 8UsUUKbTv9UVZ1rdQMQ9x3S/YSbjf8icEWVcvSP1+FL3/8PdmcVJYGTY74ddaKkNdn0O 1gI24vVplLmg3XDdhIF12geaOieEjyH2YcQ/OZTem5JLSmB+zu8wIDrXfSizySHNMA88 PprA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pKcs/xPloQYE/Gx8+0nJbKdApBZEay/XewUBU7+EfGg=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=HGSuW4gsACLHHnyOePn42Ir1oZFQHHsAQQVXOUZSHtjtVUDglwA+O0iJ34Vg6/mhnz pW8izC1AEwYUvkwKfDsxZAn2BXBzL1MXgZM36LFmNJRAeKLhsA8UJgcj2rYpKGxCD1kw kHp/h5Wdrdx+EXvYuyPwBMVNKHdBHFZTbOtqebinuG7vGsvfCkDdajHTY9LMoZ6qmuJ8 AtgwHlAoCeZotTKKnr8XkGq/oGBQh484REbwKbBWeyB/Hba794beO9bEgqVLhPWYHW2T vO2eMuuIh1hosHEL2tHbG5u/GJD67IdTCi8yWnbd9aMtrWKZvx5MyzA23h05H5WkAxk6 5flQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="p/T0QMM1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k184-20020a6384c1000000b005bd043711cbsi774312pgd.216.2023.11.01.02.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="p/T0QMM1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 55409805DC67; Wed, 1 Nov 2023 02:19:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234867AbjKAJTB (ORCPT <rfc822;rbbytesnap@gmail.com> + 35 others); Wed, 1 Nov 2023 05:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234822AbjKAJSy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Nov 2023 05:18:54 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E4CB9 for <linux-kernel@vger.kernel.org>; Wed, 1 Nov 2023 02:18:48 -0700 (PDT) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 44C9AE52; Wed, 1 Nov 2023 10:18:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830300; bh=9o8g+vSUQSS3NMbFAfGUkXi52cmu6Vb3V663gNfc4iY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=p/T0QMM11m5z3vXdBLD95kfaCJDQgXUYH5Y18q6/1yRkfjNCHx0NLbSThIUxS7tU4 n5Nt8UGErZQpNfl7nnGoYcP+aG5UNHdeH2wppHR5/vNDnl3h+kjgjYiDgE09SfbMga iEIgrs5XSnvSPf8iSJv9fEfZiJBSDXqhj+NATuO4= From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Date: Wed, 01 Nov 2023 11:17:41 +0200 Subject: [PATCH 04/10] drm/tidss: Move reset to the end of dispc_init() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231101-tidss-probe-v1-4-45149e0f9415@ideasonboard.com> References: <20231101-tidss-probe-v1-0-45149e0f9415@ideasonboard.com> In-Reply-To: <20231101-tidss-probe-v1-0-45149e0f9415@ideasonboard.com> To: Aradhya Bhatia <a-bhatia1@ti.com>, Devarsh Thakkar <devarsht@ti.com>, Jyri Sarha <jyri.sarha@iki.fi>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1363; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=9o8g+vSUQSS3NMbFAfGUkXi52cmu6Vb3V663gNfc4iY=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfmqKrrOflLOTzV3Rkv9Kbh/MN1PuuDm8/ON sPnotTWnrSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5gAKCRD6PaqMvJYe 9WbBD/4mv6KLlnj3Gja378NvTcc+TdWKrXms3LxA6LYYNBr9MZP8NrejQnGyZ2scbA9TseQaLKl xqtmW3v5E0vgnfbFCxnvRpSiMN5LFF49++VbMbNUR9OBmNhhAIVKDdRnqefYS3q4f1AHfHWXriV siw+rcnKIWQGXm7PHo4JqLA6SCXpYmzQfuHkplxtl8UBki8/HiX/PxsUmizmZfLlTRZ9E+6THwV A6Bc69316TyAu4A+n6rPZqlEnVqZc5qzQZLndYj1/39Smem4725r1nE7jtsjPuKV2H0NgEinXQi qU+F9mA8H2KkiIwipJ4VyXgsjJCI+mRrsfPCeLDYwsF6sUX1O22/Na84WPcfZxrIaah6hvGejl2 ooEtZWgv5kqzRvw8A1hzsdSHwhikoKrYWu+vAFrKuRGRcvoJVJvvusoQUwOsMbg6f/n2yxJVMGd B3m7pIw3P5gzug99n3Je2D+KRpe9pfsMwWkqfO21Elw5xsrhhfDTuFeCbjxyQU7i54W3b1aak/i vYF+fOJYdx39Ld3wUzYz2+aJ1P7/OSZLb2gwBgYusMPb3e1lleR491ykd2XgM/w3hih3KZjDoYA fjuUhfMR6SJnmnPbGQ+U5qNsfPdevqyjfvtNjlvk2ideK0ZJxRaqF8rAduvr+VsLOSonkJo0R97 cm0/hvJnAwW77sg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:19:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352792835636047 X-GMAIL-MSGID: 1781352792835636047 |
Series |
drm/tidss: Probe related fixes and cleanups
|
|
Commit Message
Tomi Valkeinen
Nov. 1, 2023, 9:17 a.m. UTC
We do a DSS reset in the middle of the dispc_init(). While that happens
to work now, we should really make sure that e..g the fclk, which is
acquired only later in the function, is enabled when doing a reset. This
will be handled in a later patch, but for now, let's move the
dispc_softreset() call to the end of dispc_init(), which is a sensible
place for it anyway.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/tidss/tidss_dispc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
Hi Tomi, Thank you for the patch. On Wed, Nov 01, 2023 at 11:17:41AM +0200, Tomi Valkeinen wrote: > We do a DSS reset in the middle of the dispc_init(). While that happens > to work now, we should really make sure that e..g the fclk, which is > acquired only later in the function, is enabled when doing a reset. This > will be handled in a later patch, but for now, let's move the > dispc_softreset() call to the end of dispc_init(), which is a sensible > place for it anyway. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> But do I understand correctly that the device isn't powered up at this point ? That seems problematic. I'm also not sure why we need to reset the device at probe time. > --- > drivers/gpu/drm/tidss/tidss_dispc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c > index ad7999434299..9430625e2d62 100644 > --- a/drivers/gpu/drm/tidss/tidss_dispc.c > +++ b/drivers/gpu/drm/tidss/tidss_dispc.c > @@ -2777,10 +2777,6 @@ int dispc_init(struct tidss_device *tidss) > return r; > } > > - /* K2G display controller does not support soft reset */ > - if (feat->subrev != DISPC_K2G) > - dispc_softreset(dispc); > - > for (i = 0; i < dispc->feat->num_vps; i++) { > u32 gamma_size = dispc->feat->vp_feat.color.gamma_size; > u32 *gamma_table; > @@ -2831,5 +2827,9 @@ int dispc_init(struct tidss_device *tidss) > > tidss->dispc = dispc; > > + /* K2G display controller does not support soft reset */ > + if (feat->subrev != DISPC_K2G) > + dispc_softreset(dispc); > + > return 0; > } >
On 01/11/2023 15:57, Laurent Pinchart wrote: > Hi Tomi, > > Thank you for the patch. > > On Wed, Nov 01, 2023 at 11:17:41AM +0200, Tomi Valkeinen wrote: >> We do a DSS reset in the middle of the dispc_init(). While that happens >> to work now, we should really make sure that e..g the fclk, which is >> acquired only later in the function, is enabled when doing a reset. This >> will be handled in a later patch, but for now, let's move the >> dispc_softreset() call to the end of dispc_init(), which is a sensible >> place for it anyway. >> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > But do I understand correctly that the device isn't powered up at this > point ? That seems problematic. Indeed. It's fixed later in this series. > I'm also not sure why we need to reset the device at probe time. That's the usual place to do a reset, to make sure the HW is in a known state, is it not? Where would you place it? Tomi
On Thu, Nov 02, 2023 at 08:40:10AM +0200, Tomi Valkeinen wrote: > On 01/11/2023 15:57, Laurent Pinchart wrote: > > On Wed, Nov 01, 2023 at 11:17:41AM +0200, Tomi Valkeinen wrote: > >> We do a DSS reset in the middle of the dispc_init(). While that happens > >> to work now, we should really make sure that e..g the fclk, which is > >> acquired only later in the function, is enabled when doing a reset. This > >> will be handled in a later patch, but for now, let's move the > >> dispc_softreset() call to the end of dispc_init(), which is a sensible > >> place for it anyway. > >> > >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > But do I understand correctly that the device isn't powered up at this > > point ? That seems problematic. > > Indeed. It's fixed later in this series. > > > I'm also not sure why we need to reset the device at probe time. > > That's the usual place to do a reset, to make sure the HW is in a known > state, is it not? Where would you place it? The first time the device is used, or possibly every time it is resumed ? It seems that you're resuming it at probe time for the only reason that you want to then reset it. Resuming it at probe could get entirely skipped.
On 06/11/2023 00:54, Laurent Pinchart wrote: > On Thu, Nov 02, 2023 at 08:40:10AM +0200, Tomi Valkeinen wrote: >> On 01/11/2023 15:57, Laurent Pinchart wrote: >>> On Wed, Nov 01, 2023 at 11:17:41AM +0200, Tomi Valkeinen wrote: >>>> We do a DSS reset in the middle of the dispc_init(). While that happens >>>> to work now, we should really make sure that e..g the fclk, which is >>>> acquired only later in the function, is enabled when doing a reset. This >>>> will be handled in a later patch, but for now, let's move the >>>> dispc_softreset() call to the end of dispc_init(), which is a sensible >>>> place for it anyway. >>>> >>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> >>> >>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> >>> >>> But do I understand correctly that the device isn't powered up at this >>> point ? That seems problematic. >> >> Indeed. It's fixed later in this series. >> >>> I'm also not sure why we need to reset the device at probe time. >> >> That's the usual place to do a reset, to make sure the HW is in a known >> state, is it not? Where would you place it? > > The first time the device is used, or possibly every time it is resumed > ? It seems that you're resuming it at probe time for the only reason > that you want to then reset it. Resuming it at probe could get entirely > skipped. As I mentioned in the earlier reply, I feel better resetting as early as possible. Otherwise the DSS may be running, in an unknown state, doing things. It's hard to say if that would cause problems or not. The DSS IP would be using clocks that have not been set up or enabled by the driver, which might mean that the clock rates get changed underneath, caused by some other driver configuring its clocks. That might lead to DSS IP misbehaving. Whether that would cause any issues, hard to say. Still, I'd much rather have the DSS IP in a known state. We could reset it every time the DSS is resumed, and that would be safe, but it also feels pointless, as the DSS is in a known state already (presuming it was reset in probe). Tomi
diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index ad7999434299..9430625e2d62 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2777,10 +2777,6 @@ int dispc_init(struct tidss_device *tidss) return r; } - /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) - dispc_softreset(dispc); - for (i = 0; i < dispc->feat->num_vps; i++) { u32 gamma_size = dispc->feat->vp_feat.color.gamma_size; u32 *gamma_table; @@ -2831,5 +2827,9 @@ int dispc_init(struct tidss_device *tidss) tidss->dispc = dispc; + /* K2G display controller does not support soft reset */ + if (feat->subrev != DISPC_K2G) + dispc_softreset(dispc); + return 0; }