Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp956086rdb; Wed, 1 Nov 2023 07:32:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEC1KrgYRY63TyecJKPuUG2zNkoVhZlA6ZJEb0hZrQqnA11EpMVfWlEpfDF3JfIE3c8M7Mx X-Received: by 2002:a05:6a20:7287:b0:154:d3ac:2063 with SMTP id o7-20020a056a20728700b00154d3ac2063mr15433495pzk.27.1698849176605; Wed, 01 Nov 2023 07:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698849176; cv=none; d=google.com; s=arc-20160816; b=g5qIyW4uiwBBJmuCDgAOiPI6hnRd2ADZfAyw/MV8yGuJjYjh2+hqBwBKVmrS0kU7Qf 2+8WE2uYjBWe6yJB5DeBU4y7T1bv85GkbStBXOJj0EQurvtYVYqPmqKoTts4X1i+wrY8 ixbUkXK0GUJavD+NrudfNbEP3B2cXVS3jJb4BSg04cSLYF6bADYcem869R7r2g/qdg8E Sd3GTLHRuA+EzYuWIaJvqMptd3m+kf5C7pq4fnWAdvBjTxhc6ERo0YaEs/iMaWPyZnzj bwf8hs7jQ9Ktw/SIKpCrlBWu1I/kqbDad1iXPdoEDVa8utjkBBL5nNLQPa64EDAwsN9i jB3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IgrnCFRjyrbGn7Tcwz4ROtgjgMkxmm2JeLhnYpElk5E=; fh=5C3CAkIfBsG8EK8jEaBmpiwV3a9azH+DT0pG9NOmIu4=; b=c9vG2xsd7iEJO88eytwoMAR8bDw7IZOgvvFGihD0drxnUPAtb5U1hvmo8pCmOEiYsU RvcH0SpecVvJDyukCLKz7mANR+65wlWQsHBmayYt3dKwL9FIrtC2GHRC0w+VMidIdBW2 49Q/wsflJsdYJgsR9qGuz5iBpLDS3qB/RNFgw3vK4ZQ2m5xd4Z+LtvJ4lLZJkT4ugtSE 4uoRSgK+FCJAr3bIR4INgTqgRI8VubjuuMxHDhfikQgTceZDtxFfVbt42SEOV8u7uf87 Se5kiX3QE0rduQmNMYqOtGaZ19jYN2Wb9RYaj+8o2z0AhVrPdutG+vHgFchatMWtbg8O j8wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=L2KGzq6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id lh6-20020a170903290600b001cc5505fffdsi2963195plb.644.2023.11.01.07.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:32:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=L2KGzq6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 4A4D0805CD98; Wed, 1 Nov 2023 07:32:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344444AbjKAOcd (ORCPT + 99 others); Wed, 1 Nov 2023 10:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344282AbjKAOcb (ORCPT ); Wed, 1 Nov 2023 10:32:31 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B48B83 for ; Wed, 1 Nov 2023 07:32:26 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D08E8D; Wed, 1 Nov 2023 15:32:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698849128; bh=a3lw8C+NZXOzSs8DpQrjBo8cXJrv3VFEkvITYoVoJFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L2KGzq6Vz51m8RMXprOhYxgkj6ZNkaYFKtRK15/cjNdkDti5CyhVt6dwn63Hyb+7i bSNPayJeEn3FPkffZlZsucFS9EPyPf399G2BNb2aP1rBMxiLXmDtT7HZLmc0a9pVMY DrsbngOa+UUej0hyCEGJoCaT0pruEVFuPX7QStZQ= Date: Wed, 1 Nov 2023 16:32:31 +0200 From: Laurent Pinchart To: Tomi Valkeinen Cc: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/10] drm/tidss: Add dispc_is_idle() Message-ID: <20231101143231.GX12764@pendragon.ideasonboard.com> References: <20231101-tidss-probe-v1-0-45149e0f9415@ideasonboard.com> <20231101-tidss-probe-v1-8-45149e0f9415@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231101-tidss-probe-v1-8-45149e0f9415@ideasonboard.com> 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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:32:51 -0700 (PDT) Hi Tomi, Thank you for the patch. On Wed, Nov 01, 2023 at 11:17:45AM +0200, Tomi Valkeinen wrote: > Add a helper function, dispc_is_idle(), which returns whether the DSS is > idle (i.e. is any video port enabled). > > For now we add a call to it in the suspend and resume callbacks, and > print a warning if in either place the DSS is not idle. Could you please explain here why these checks are needed/useful ? Why would the dispc not be idle ? > In the future > this can be used to detect if the bootloader had enabled the DSS, and > the driver can act on that. > > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/tidss/tidss_dispc.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c > index 13db062892e3..a527c28c8833 100644 > --- a/drivers/gpu/drm/tidss/tidss_dispc.c > +++ b/drivers/gpu/drm/tidss/tidss_dispc.c > @@ -2603,10 +2603,18 @@ void dispc_vp_setup(struct dispc_device *dispc, u32 hw_videoport, > dispc_vp_set_color_mgmt(dispc, hw_videoport, state, newmodeset); > } > > +static bool dispc_is_idle(struct dispc_device *dispc) > +{ > + return REG_GET(dispc, DSS_SYSSTATUS, 9, 9); > +} > + > int dispc_runtime_suspend(struct dispc_device *dispc) > { > dev_dbg(dispc->dev, "suspend\n"); > > + if (!dispc_is_idle(dispc)) > + dev_warn(dispc->dev, "Bad HW state: DSS not idle when suspending"); > + > dispc->is_enabled = false; > > clk_disable_unprepare(dispc->fclk); > @@ -2620,6 +2628,9 @@ int dispc_runtime_resume(struct dispc_device *dispc) > > clk_prepare_enable(dispc->fclk); > > + if (!dispc_is_idle(dispc)) > + dev_warn(dispc->dev, "Bad HW state: DSS not idle when resuming"); > + > if (REG_GET(dispc, DSS_SYSSTATUS, 0, 0) == 0) > dev_warn(dispc->dev, "DSS FUNC RESET not done!\n"); > -- Regards, Laurent Pinchart