From patchwork Wed Nov 1 09:17:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160479 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282362vqx; Wed, 1 Nov 2023 02:18:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLmDgdlKSZzOfsjvyjGw4mpKBw9ZSjH6ZsPciWvW1QPPfmYlF1XSxP2nrLAFZ+XYueUxl3 X-Received: by 2002:aca:100a:0:b0:3a7:44da:d5e4 with SMTP id 10-20020aca100a000000b003a744dad5e4mr15777889oiq.51.1698830339459; Wed, 01 Nov 2023 02:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830339; cv=none; d=google.com; s=arc-20160816; b=SUVDNMLvQ8cRiCn3QRLxqzlJmmZ3jbj9qRpUPtIrWCnoCCEajgizgDFKsQmLs4LSuB E6VtYVGfzBaAkkiqM4w9NTK43iaINMKhjCSjQfraZi8M80PuKLb5PYbNl9Odz3NcBIx9 72S0/7vEqLnG3QkVdcj2wbG1jBQ2nQhDek9YPPoJSvaUrPOufH2OjC3ht1t9mZPX3dHr qIyyXGJKBcPbdLuE3rxTh5n2W01Qted/uunRoLMZw0lstAkR6vEL19ernOmkIm+eTH47 WqNmldTIP2BG2MuBWQzRaI/QnDxbEnbMKRCSs9HM3yLXfSgfmz2ppzNCism38DH9TO6V z9lA== 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=cM5qdD63oHiwProA2gXdY43xgxS/+Mvt34vJ4dBKG2k=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=IVXv8wIob1f3u3hHdeN4aqHwQyD0OLNpN7mIMsPPBhy2SlrnWFbyzJVnZ3fPe2YrR0 yAF92EzHc4mpW9+u0/o6uwWeVHHKJUPqzUujSkS3PSpvv/e8+pItl9EveVG/fTUuBqdW a/Rmce1GAlJX7shRFRUolTcoogukwfARvfedPdVRcWYOs7dgm68bOePkcZ/Sw1koAaGk lakblvwQ+XH5j6nFXng+NV+hH3QJoQsmgjs2UqVC/2BvO5Vwj1+xuHZn5JDueKjuVzSm FUcAt2J4KoYfGuvwIoV9IxxZxzlTpk4HohKpq0hsLQvbjdOAqmaZqn7TLUj4tnG56R9O yu9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=o2mRwQzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l72-20020a63914b000000b005ac9ae1aaa6si2721600pge.334.2023.11.01.02.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=o2mRwQzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 5672E80408D5; Wed, 1 Nov 2023 02:18:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbjKAJSs (ORCPT + 35 others); Wed, 1 Nov 2023 05:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbjKAJSo (ORCPT ); Wed, 1 Nov 2023 05:18:44 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2315EF3 for ; Wed, 1 Nov 2023 02:18:37 -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 D826E7F8; Wed, 1 Nov 2023 10:18:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830298; bh=gkIBd5+fMV46AC7d0uwLpkNL1fVDY+8sAYxHxQO4ANk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=o2mRwQzu+y+EV3qM9yFl6nfauKT2y7VcnTtn8wCh+NPKjDdmlxzVOFIouNOYvo3/Q wPTnw/uwXe0nrTTwCbKXII0J4TBcA02J7f2pW9Z09jJaPX+ss56DPnzQhBDbW8eNn5 wazuHRifULXVGzoeuY+EkIOl8P8uAakZgHC8Rpec= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:38 +0200 Subject: [PATCH 01/10] drm/tidss: Use pm_runtime_resume_and_get() MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-1-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=905; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=gkIBd5+fMV46AC7d0uwLpkNL1fVDY+8sAYxHxQO4ANk=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhflp0H+oMJh4AKSQ1Ir0s9axU9mj4Jd5D82W 7KdfFko9HaJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5QAKCRD6PaqMvJYe 9bCTD/9V0Lh/Xns/cGwDrdHS5OhAzc26iltUq4huG/4tVJYYv2XmPd6R+VH0Z8s9o1C7I3yiunU j9QZRslEBhzf/Tz/uFfzTjPyGxLOlMRxol0YP2oljPMFCX2O440hxKRddhpFRKCq9INj8gq2NFX 8txW/8WLqURoHLOmv8CBL7ANxceY9iMp3ISW+UPBtXo8wlX0P8pircepSn9/dbhlmdL5os9IOPN 4lhrv51b+9qGXKa1OWhI1izPJQthC370HFjrWghKPityx6WWX+iYhIHm9BAKdvK5JSVmoVLpDbe nNp+njQE+t64euRlO0153TDCoiiWcih/4AtUvbBV/PE937sMbqR9k7pxqIlZ9aLkd5XF18+v2we lMepM+F22FQVnK8Dzf6a5kNus7k90Nna0M+BIo3aol2IwPaBz1vIFJzYvtbmadUS7cMWhsOrzA1 FgKqlxWiz8rnrPUZwBsYezqwkuuIIO5dFXkmMkLGLpxgoHDeKjcmxhztSdnYMqvzEWvVndOergC HptBTmZ9F8j4yTSZzGMiMB8TP9l1tzI0X7sGeByKSj4HAdZ06ZngsL4PjEw/bD8fDw1Or7oxYIH xMJ5S88qA4SSXUpP5vwhUgmSv+NERyMT/PMDmUodnZkbRNMuXyAnL2Wh9CCQAntk81Lihb5ihPp G5Tr9Nl2jbqdrSA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:18:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352721644397671 X-GMAIL-MSGID: 1781352721644397671 Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), which will handle error situations better. Also fix the return, as there should be no reason for the current complex return. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/tidss/tidss_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index 4d063eb9cd0b..f403db11b846 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -32,9 +32,9 @@ int tidss_runtime_get(struct tidss_device *tidss) dev_dbg(tidss->dev, "%s\n", __func__); - r = pm_runtime_get_sync(tidss->dev); + r = pm_runtime_resume_and_get(tidss->dev); WARN_ON(r < 0); - return r < 0 ? r : 0; + return r; } void tidss_runtime_put(struct tidss_device *tidss) From patchwork Wed Nov 1 09:17:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282378vqx; Wed, 1 Nov 2023 02:19:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKQMCoJMQeoeDpltv+r/f6YwNtRMz2nWllCgEA1vf/cB32to3v3MQAzZUkaU9iUJ1LxDzY X-Received: by 2002:a17:903:41cc:b0:1cc:5dd4:7ce5 with SMTP id u12-20020a17090341cc00b001cc5dd47ce5mr7068120ple.19.1698830343272; Wed, 01 Nov 2023 02:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830343; cv=none; d=google.com; s=arc-20160816; b=X5hvGi3VXnAl3CXOLSPn9wXljYPOj1lfREKUtmnShqr/Tpfn0E45EEgswQ9vmOOCeF JR90qykHrbtC+5QIAyw3EIXAIXVenrkRyheQxKrKZfTNJwk3f5pFOYhm5CYR6M1hPo/R A95twIpVyx2hVbIiyUeY+aYzXZl3Tvb0ygnTiZP8zGE6/kPNLCHP0r/5L7kZjdAhqQWz it2vh0CoRRhUgIDzzEN+AeJTtFQabL1qM4EhgtZUKhpPENDCqs9oggEIkGGuW2Vtw13B /m+WF2FnNXk5nhGVPeGAI7QIiagWvJ+oziRgem09+/sdfxX9F9SCoiCVdgUWyX0Nlh/k mt2A== 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=3yyJZeIL7Ueb0PsHWIdSyRyjprOtnWSXlL2eGiTOfuk=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=u/VlzomIP018vNQLKOt7qsHDKDEs6tZKvNEePFuzsiZfIN1zpJtkRH5pEHICXSMf3d Nlv+QtKbXM8cQHM0dtk22UPYnk6THvux8eV5P8nKdntzOSCUgZ2EXNtuoyVWmnd78teZ iQxB2iuZivfWVGBXOr/nfrZMuJKte9wwXwyVpSn90FpYDy1rpU4qyCyTUlxB5ClzzOui xhIGlMk0DbhSHXTj8knn92r8eCCO88d34UpJyGnUWYBwpDuQZXwYq4hfq71r+epkMI3P 7D5WKAcBzI/Bj9/9bKQx2zYWA2IhR9xMlViHBS//4MRvm9yM3pEj5TOmfH2fOI5n9qRE JQIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jPCXMnQl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b2-20020a170903228200b001c76b4c349esi2748755plh.218.2023.11.01.02.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:19:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jPCXMnQl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4041B802B045; Wed, 1 Nov 2023 02:19:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234508AbjKAJSv (ORCPT + 35 others); Wed, 1 Nov 2023 05:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234431AbjKAJSt (ORCPT ); Wed, 1 Nov 2023 05:18:49 -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 5C78BB9 for ; Wed, 1 Nov 2023 02:18:43 -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 A68F68E1; Wed, 1 Nov 2023 10:18:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830299; bh=xQfh4wFKSK2nLKdijYY1UXEQqCMe4QymvcSpQaHogdw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jPCXMnQlK5QA+NqQ5hjcsWNTq9cQXbhcyJgOPZIsF3DARySjdLJKLrzvGIgX2DK8F dzT80FHD5Wsl45jzxgy8UwRwhwUJXqL078FLSXGQIG8tw7YZ1RT+i0sCRqaAH6L0fN 43tT3dMXxEHYncXH15dYGEBAld5wukbngtbxCqN0= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:39 +0200 Subject: [PATCH 02/10] drm/tidss: Use PM autosuspend MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-2-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1500; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=xQfh4wFKSK2nLKdijYY1UXEQqCMe4QymvcSpQaHogdw=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfm0I1aAJ++gXl9qnfA5qLiH+x6aRiH7mAW5 zUZv9k+nuiJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5gAKCRD6PaqMvJYe 9YG1D/40auunKVvVoDGofklPD3crxDwf0t3XWtc9ifEcq1Es7pzT0bGRlJEA/QtVknEd/WoaMId VTEE0zkuesRfqrb7FWvPVzfmPypjevvBvfh5bzYBHykZM1weROy5rM50aCM8C8bcNycTnKtNiN4 35TvD/cCYulFpH0TCDuNFk6CyR4agCnmar6JtbbDNG4BgIW1fq0knzLAuAdK/nRnPMb1Flv+b/C KHPFKCC4FfCuauDhpk4ddsjJlGeLSu8XpLMuP6tWWV/LmDG6BfRtmP23yWXz3Pq8g+knewoN9GP odpXfOP1ZOA0HTW15vQsQiTypWsFnaHd/Mn2DqD/EvtAisfp102e47UJg6gKsU/6WwNbcIvhV6U mh6mfko8ilsMa2IkR4vmOYG/Guwa8DGkOfDiDhe397tHt9HzkBBPreIPVuuYVhbplrMGAcK/7jk U0cfZIOrGVE2hSF9Tcq7HUtk0UJQrZ22m5d2i7FWU1SbcuTRJ6iPLejmPWf2/5ZOyneZgWBpX2u /d650d6D3am8cYYyoqL0RtWdUt7knVMZ033HahQzpdkBObMxYkHiJYAGFWjfkV80CKXqnjwIIpj /AaG24xgseqw8ZH94ivjlxH6Swc6QYlVbMsoa/HID6JhXelZoBfdy6WjRvYPQmJMcYwrkwzfy6v tn0raEbb3/qropw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:19:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352725984837834 X-GMAIL-MSGID: 1781352725984837834 Use runtime PM autosuspend feature, with 1s timeout, to avoid unnecessary suspend-resume cycles when, e.g. the userspace temporarily turns off the crtcs when configuring the outputs. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index f403db11b846..64914331715a 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -43,7 +43,9 @@ void tidss_runtime_put(struct tidss_device *tidss) dev_dbg(tidss->dev, "%s\n", __func__); - r = pm_runtime_put_sync(tidss->dev); + pm_runtime_mark_last_busy(tidss->dev); + + r = pm_runtime_put_autosuspend(tidss->dev); WARN_ON(r < 0); } @@ -144,6 +146,9 @@ static int tidss_probe(struct platform_device *pdev) pm_runtime_enable(dev); + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); + #ifndef CONFIG_PM /* If we don't have PM, we need to call resume manually */ dispc_runtime_resume(tidss->dispc); @@ -215,6 +220,7 @@ static void tidss_remove(struct platform_device *pdev) /* If we don't have PM, we need to call suspend manually */ dispc_runtime_suspend(tidss->dispc); #endif + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); /* devm allocated dispc goes away with the dev so mark it NULL */ From patchwork Wed Nov 1 09:17:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282428vqx; Wed, 1 Nov 2023 02:19:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6orFxKtE0sNwBxvjg9y/hxrnFayq2LzxuYwpwcTsAU5pAA/wz4MjW5OGwKgyGK5mqo9TI X-Received: by 2002:a05:6a20:12d5:b0:14b:8b82:867f with SMTP id v21-20020a056a2012d500b0014b8b82867fmr13893269pzg.50.1698830349777; Wed, 01 Nov 2023 02:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830349; cv=none; d=google.com; s=arc-20160816; b=zyIsVZ//9xNHFeOCKZOVKxyZO1C7QGhtRahHzX3s6/V0TT+2/fiTMlYav4pUv4jsgH 0mcw4Nj9JFcRom6ottvtNdA8JqJSJ0prBbwj7JESS8kJcqfxH2GQmA/iiKH0e5aIajMU +mbBZ4OQ+jzhCJRwDK2GbjK6NfWckZtq0IHMdjHi7RUrCSbXMx58Y4f63geguCTDf1f7 uU+6KsW0UXW5xAYyFD03d06MrtWa+Yp+2qmDMS119t7vmkcLZJAOkODUPPFNalPmAUrf WAduUOpVoBY7jlf3xxD1si3vLURZgXEe1UMjEUY3DQKlCWviu6J6gEZ4+xkxwnDTEnKj TQoA== 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=h7GFy/Z71bmH4hJkSgoOQ1W8LPEiB7O4OQcF/cYeQM0=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=mwfTcX8STscUePuoXHN27i/KK1wq6dGGEbdRnQpGitlvYd12Mbu8pYOt7AEzp7Y0nx UqtQ1DdgeBQIzpESVPyg00hDVDT7DnMPBnu8P+H023t9+8iaRgmwxYEjh0yyNGbeHuG1 c0uhO9wMy4CjOGJnoQQkB1zIzoLobjMRhf2VHjg9hlUht4+LWmtCtET7v7sFFFVTrn4s aIeGAQCnuZXp8vJPfIS9F2yTv3aAeru4El8H8tKyO+7aYPP4FMXRkAjOxMJM5f/o/M+n uHKTwI4fjPX1fLd0wwwVvIflJ4Qix8tmqF7us2BvASrkszfXQF8xbgSkAztIjzvO8F7n aTtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=QtWevdGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w18-20020a170902e89200b001c72699dcd3si2782253plg.367.2023.11.01.02.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=QtWevdGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 08AAC80D31D5; Wed, 1 Nov 2023 02:19:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234854AbjKAJSz (ORCPT + 35 others); Wed, 1 Nov 2023 05:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234434AbjKAJSt (ORCPT ); Wed, 1 Nov 2023 05:18:49 -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 6C066C2 for ; Wed, 1 Nov 2023 02:18:44 -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 76788D8B; Wed, 1 Nov 2023 10:18:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830300; bh=cqr9qmnFL43Mi0X/si5rR0wyx9x15IoN3blFgEcAEhY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QtWevdGxZ8j6lFrOZSDySoZ8OFG//OIF6lsjV4Rfe1bhm4ZcUopLubuWCahTy4pRH Csc3evlzCSnuoaSdwACFMFKoLR/J6OqoXXNhnMOkbgQYkJ6pbmfQcMHrxXu3jfO5Kl eOuCzrLYjQ1Mx76jlI5T6wtE4bViQ670xn/0KjMU= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:40 +0200 Subject: [PATCH 03/10] drm/tidss: Drop useless variable init MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-3-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=708; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=cqr9qmnFL43Mi0X/si5rR0wyx9x15IoN3blFgEcAEhY=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfmZvrXwVfeAXpKfH/t84dOn0jl1YydKNIAp 4Tb85mAQMyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5gAKCRD6PaqMvJYe 9dq1D/9dvYn6n3xz8Hjqt40LO0+SBnW3EclIBin6YRnFpRYTkAcGD5/If7zbmwBilpE30tQs50H X8BE0m2ZZrWnSyC0zzWG0hUmdmSoalIR2kfNXS9l+hdJ4sTY1HCkMX30EbAXbCWdvFqi9N7xoYN btOEe49slqZhQczeK6/ILzdUnxUhMlvmktqb2Zd0A4xeGlxHBKur7rpB48+GiS1dH8veEJT5mAr FXd1kZjxAHjUZqYvXx293BAKaMtyh3FXsQVhCGx0MrmfpL4QnoCummdCZfiCuFn68LGTodiP2YB +c/bw7IMyu37R1Evmd409EBXE+pBiNbk3EcR9Qs7i4nal+KZubWHmhA6DSumDLy5rhXHBXD+B09 Ddr8qy02PgfLOXzS3QQxfS97ifltB6gZV26CNmbglV9DNPaK/qi4Neylwwy9ierje0zbaRriRuQ 0b7kruM7DKsHqvl3e60MHop9sYYICBWoOEFZEByuFA7b3eXw6YNzNrO8DuipN+YEwkrnxJN6bjG PZ8xHAY+LLDMpjsy2Iil2PqFBPc4GV3EuxNzYG89oqZ+jUJXwL6Zt0D9rXu/VraWyG3uZcCoFFp d80YfWbmFYs533LFOvrEIkd5MgNIPchPnwBW8Fk5ZIQAckMGk3isUWKt0EbcruvG4EiOgv2+1gd BogoFbcu0cTNDig== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:19:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352732597035889 X-GMAIL-MSGID: 1781352732597035889 No need to initialize the ret to 0 in dispc_softreset(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/tidss/tidss_dispc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 9d9dee7abaef..ad7999434299 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2705,7 +2705,7 @@ static void dispc_init_errata(struct dispc_device *dispc) static void dispc_softreset(struct dispc_device *dispc) { u32 val; - int ret = 0; + int ret; /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); From patchwork Wed Nov 1 09:17:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160484 Return-Path: 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 + 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 ); 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 ; 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 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 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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen 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: 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 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 Reviewed-by: Laurent Pinchart --- 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; } From patchwork Wed Nov 1 09:17:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282981vqx; Wed, 1 Nov 2023 02:20:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHl1tmVVJ5i4bmUV7BuStbXBC9gidZnYTU11XIHd6TL1VOjLnkTJLNCcxXbg08KXw7Q9lUy X-Received: by 2002:a05:6358:e490:b0:168:ec55:d164 with SMTP id by16-20020a056358e49000b00168ec55d164mr16958746rwb.25.1698830435256; Wed, 01 Nov 2023 02:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830435; cv=none; d=google.com; s=arc-20160816; b=RarBQkTXxB1oPnFfVYwb2Jr3cZquiTc16kGL/wTuzkqG9lyCTrP+YXQ6vUvaGufyvc pPsexEEMGbH9/pQXPM/XxmIAk0/8xVpoUKVhCG5LVFJwsC1I8JVrZKbhHy8NCNWrXP6R 1aiG7ZQ/MCpnMRtZ3A27rO2YQ+sBi/FdMJprYcYDSeypsomvg2iFsNv3rt/Y1JKBTTZQ 2jb1pAFk7oKuVeM1XONDjl/I5gOBxdbkgcFrixCV0Or+1z0adkeaVMYpZyP+nKnjCjI7 PgiMPWthyMvc7yniU36f/8idpPB3F+r4HKuWA36S76MH4IMtJunWkGWNxKbX15aVV1kC i8JA== 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=MVONHTOugWv2dAke+sKkXvQD/GwVZmvGqTPh/Zqd6nY=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=kpM14cDJoACO/XxkLcbpRXCBMpcjbPqz98PFxheeUoxY8IHx9u4AlOiCic/jVpAFNU 8pOyftiV3lF/xgzZIsqZf+f72eOPQ5qsohLPVWwN00mmz7P/NFgdTfWdlZE2IzuRTEPZ GzXoTsnAk7lc9GzqBkJinffUu+WsowDPwHofUNPVaK+9l3U3eQ5rhCaUdbkDSXyHu/Sl 1eFl6SJAeexcwS951eUKJuYHxdVRYc2zRTmktA0nzHV/j8UQGYlMlAOdIW929EtncAju B9ewtgwwnzIhmSTYi+rt9CJKoKXEf3qt2FU0eEBPU6Ih/O9kcNLOIcfGJUNFysEBjYQW K6vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=no3Grqbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id s17-20020a632c11000000b005b929886d2bsi2593293pgs.138.2023.11.01.02.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:20:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=no3Grqbz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 0B752804B25A; Wed, 1 Nov 2023 02:20:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234964AbjKAJTF (ORCPT + 35 others); Wed, 1 Nov 2023 05:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234893AbjKAJS5 (ORCPT ); Wed, 1 Nov 2023 05:18:57 -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 1550B107 for ; Wed, 1 Nov 2023 02:18:49 -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 13D1CEBA; Wed, 1 Nov 2023 10:18:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830301; bh=S/kuLWe0/nj3sw3ZBJIao5fLsRqSmlViPlkeBKEBUQc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=no3GrqbzK1UujstiZXCJVuUv7Mcpud6+l24s6as4ZbU3u/oLVHB2tRotlu5k19KxN 9+idXiFKTkvtoFWQTKaQg+q4Fg+JF2djnc7v47c1BB78L3apgD4PTQoG8h4MWF0/E8 fq+AP+6rSrszotUKmJIbcidaz/yWwEB1nZkFgf5A= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:42 +0200 Subject: [PATCH 05/10] drm/tidss: Return error value from from softreset MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-5-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1510; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=S/kuLWe0/nj3sw3ZBJIao5fLsRqSmlViPlkeBKEBUQc=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfnWpbjq0FmByn/it3hJbiT/5wcGPbCtB5wx x/FViL/nd6JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5wAKCRD6PaqMvJYe 9dMMEACfTV1kbW+dXwkE+Qjo8LSLkYv9SpTgPBR2Aa2pKpVsSVrR24lTlZSPr6rfbfSq6DiEsJa 1xWCBXpIDJKRpGMC71F1eJcxEM/LFAyheLlaUDWVVZHvpoBykIFdu3IM2uOj5YEJaK+eLfTbo8j sFAifLjFZW+jAlPewmtsrdoJ20STrj79yQfz+ecehp77UJqn4FUu8fKfC5iIunWSep4dVUAwBAI /0+rDy5391vbYY2goyXY5cJxC2WlCBkpLJtsdG1r9q7+axeas8KQ0L8K3HYe6P6iXNBIn+WKqku qLmbiveR+PKQ5KPYw0ZsQbm2t4ezTAMWbDob4p4GdPQ81ohHXXoVLLTjSMjPrU5fhDs612gj5mW EBsW0cTro9V3xSrn1UaWbU3fbeVNNPvUWGgIJDwVUVvZS8a3MC7idRsBtEebC0WbyoJTNTppaj5 d4Jv0JyJRmmTjZS4UgBRDXTypb3cVtjduQsGDXO/dMzUNWTfTgajF4kpAHxLPEVjurFEG3UfKFT YB3SAOsioj5XqH/iuwVRPBJNCdgANWh7mKdfwpi0M30yIfYSxGQJVkIOTzgJIc3unWGDZtKIBZI SrxLgRFRCty2R315gM9q5PKubhO5LKDUa9/dXPECgzXeytBXsL7X4uy5tOxGA6O2N4j4F/jtsOw GUNWxx5r7tmjHuw== 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:20:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352822297734980 X-GMAIL-MSGID: 1781352822297734980 Return an error value from dispc_softreset() so that the caller can handle the errors. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 9430625e2d62..cdbb88289082 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2702,7 +2702,7 @@ static void dispc_init_errata(struct dispc_device *dispc) } } -static void dispc_softreset(struct dispc_device *dispc) +static int dispc_softreset(struct dispc_device *dispc) { u32 val; int ret; @@ -2712,8 +2712,12 @@ static void dispc_softreset(struct dispc_device *dispc) /* Wait for reset to complete */ ret = readl_poll_timeout(dispc->base_common + DSS_SYSSTATUS, val, val & 1, 100, 5000); - if (ret) - dev_warn(dispc->dev, "failed to reset dispc\n"); + if (ret) { + dev_err(dispc->dev, "failed to reset dispc\n"); + return ret; + } + + return 0; } int dispc_init(struct tidss_device *tidss) @@ -2828,8 +2832,11 @@ 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); + if (feat->subrev != DISPC_K2G) { + r = dispc_softreset(dispc); + if (r) + return r; + } return 0; } From patchwork Wed Nov 1 09:17:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282534vqx; Wed, 1 Nov 2023 02:19:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH12mkcZPw6D8/E2Fnbww2PADqT6/Vd4gEjU1CMuYd8hkTAGee8Iqxstp21GqEmLlwzubmp X-Received: by 2002:a05:6808:6381:b0:3ae:5442:ed11 with SMTP id ec1-20020a056808638100b003ae5442ed11mr15933253oib.54.1698830365991; Wed, 01 Nov 2023 02:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830365; cv=none; d=google.com; s=arc-20160816; b=oRyTJj1TK9Rn53ShqtuxPL3yvD2ltdquYp2a7oOQQkjmM12HGnWsuIf51TRxU5jtqj ekJ9Q9Kz6QLOuoqnDgBF02VOycTLsFdpZ3+WjKJB9GX4sqoryucQEWIDPD8hiILqCrob sYMoG4qi+h2IkLa1pyPfK0GXBRqhRIh8nZ3QlTmwN4YGqwpBYDr/eUh9ysgUOdTcGszL LgvEiNVYm5pQJfM+i4ngTd5At3Aj+4YBr/uO1Y5+YPUeDFCtGOVL72FB9L5ipAV69BzY R/MjTD2UkSsIL2C4TRKFEgDIt0dQHoodpqUpaoMY7lBIkRfnU/AU2XGBmMIeTkC1cGLF 5MLg== 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=V/4Glbb8WcFRdLpTmg3SbNgOQJ5ISQyzcsfvwM6NYW4=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=SgWObjZRXk3Dlmu19ZmYhlg0icBjp/RIG78yu67bcRqdT/aCTYsHc6a6/A0hBjQHAn 6jEk2mUwPNvbmkvaKbZkFt4KWVH9n6XObI6E2jBen7DegD3Q4K6v4rDPpDuLI3SdnTyg 8YMh9c55XxAHz8k458jSuvxBNH/vkNRyAn1amOWDKzMDwfr/unhZXBIMYi/3v76v+f5V zCsiWOkK/sKh0Beu+HO34LEpm6S/gJVIqLcpNac9FIiHMaY5hfsV2J06wB+IeL/xcna3 9YqeR+vI41vNegE1FtCUH+s4HpL95FG13FtyqppYwSutrv39x772uHhU4XiSBntW7Rcm nM7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ZWszpq8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f11-20020a63f74b000000b005b9286ca94csi2624983pgk.700.2023.11.01.02.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ZWszpq8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 10F7080294CE; Wed, 1 Nov 2023 02:19:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234944AbjKAJTJ (ORCPT + 35 others); Wed, 1 Nov 2023 05:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234999AbjKAJTD (ORCPT ); Wed, 1 Nov 2023 05:19:03 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87DCC133 for ; Wed, 1 Nov 2023 02:18:54 -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 D612C1B3C; Wed, 1 Nov 2023 10:18:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830302; bh=4dopl98SADPr+tiIFKErvb5eH1nysDYoa2k3ZOY9EwM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZWszpq8oUANaP/RXTq+8FXQitKO5TmuevctXURULcSLeo0/8ZDCk9+mOfMsbYsrXP Ir47j0MBSyVwibN3gBjdS5yGtYdAtlEYfrvQ0gaA0xC2lp9ws82xRyGi79k+QwXrMv HJ1SLaOFbF0r5bdjEt/8NUty0KxuX/9rfHWFVGAs= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:43 +0200 Subject: [PATCH 06/10] drm/tidss: Check for K2G in in dispc_softreset() MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-6-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1267; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=4dopl98SADPr+tiIFKErvb5eH1nysDYoa2k3ZOY9EwM=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfnt2zJRKYOEVKle2omRjKY4to5bnItY7yFV UBMKQX0yUGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5wAKCRD6PaqMvJYe 9YfsD/0RXpaIgePYT1v7DAYeRrhQdYLoVaUMtVgsDAY4cJD5eEkA66MdctQi73YMwSZ5NOwdyjh lu+geIwMOA5veWkJoF1elBDtFM0v654tsHaYcnJFlDauFOebKT1YjIxTlEEsus1ZdA4m79gP+L6 aH1OF0PVmMmhx98F3/COFwgKb7m8V1vplYZrZ0YNcMlji5VpzNd4g50SsE6Z2A3P2ci/i8X/smY x3WUxrdlbRDbXyKCoLbCYXlShIFK0ow65O6uT3jTMl4FjbY2aKkUHGHoTgOGoZ91VxWgtcztj+f 76WWHvhG0LBIWY9vFkwEToQXqlPv8CS1cOuTUKjL6mirU7HdnJkIpx+XyHUJngnA9uh552jIM8G 8f8nWWlMgxAteilgs7C3PCOCXu2u7B/6lHYiXZLdOAoRQufVSHx+nOuSL5MsyTCexCk1K9IVsWg ok6X7WI9yYtF9Z9xDK91a2FV+JgiO22/Y1rN2B3N6KkpXARyzC8NFL+JrFxnEn2fZgI4aWCDMcn +kZDSyVvNuwZyt9e4ABFpTbrZ2P05PXiVKtyFQfKFI+yc6gU8S8LEkrBTS9nY5fiKgZuJJs39sF J0RjkNOPS9ycQTTKW4mk8WuPAcv5HowYqIgv3EtuJgsKIBz+eoOjKuABSZa9LBexI6RxgLjfjMj peHnDQyTmxnO5nA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:19:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352749630149233 X-GMAIL-MSGID: 1781352749630149233 K2G doesn't have softreset feature. Instead of having every caller of dispc_softreset() check for K2G, move the check into dispc_softreset(), and make dispc_softreset() return 0 in case of K2G. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index cdbb88289082..f204a0701e9f 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc) u32 val; int ret; + /* K2G display controller does not support soft reset */ + if (dispc->feat->subrev == DISPC_K2G) + return 0; + /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); /* Wait for reset to complete */ @@ -2831,12 +2835,9 @@ int dispc_init(struct tidss_device *tidss) tidss->dispc = dispc; - /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) { - r = dispc_softreset(dispc); - if (r) - return r; - } + r = dispc_softreset(dispc); + if (r) + return r; return 0; } From patchwork Wed Nov 1 09:17:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282547vqx; Wed, 1 Nov 2023 02:19:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEb3BySUFonenRqJGyKrGxJhkiPbeANTVkcZu/3AD9ua0wZc0pmm4TiLtoomQOfT//VLVfu X-Received: by 2002:a05:6358:7212:b0:168:e7fc:1209 with SMTP id h18-20020a056358721200b00168e7fc1209mr14701320rwa.22.1698830368233; Wed, 01 Nov 2023 02:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830368; cv=none; d=google.com; s=arc-20160816; b=AcqJ9FfKKK99VRuZeSMkoxUvvpRAw6gBh5e8Zu0M+f2AQq/CIhhzP2Zii1fpDCJGUo KrmFnSs79ISyb9O6ty6cRW/lsBlRO0hIe5wEWz8MRIk1CZ/Ekq/sRzrfdO4xFrpWXNuL VAp+6vDFfKaTX1B2jrd8cL4dIvY6CIVFwD6xqjd7FEG64XUYsyU6pUGaLcTCRKHnE+ra 3Koo4f376sLnAG0J58b5yhkh19gN614BuSYGu41V3xZR3T2ShUPLHQzQwQ27MAWei4WK GnOAG1gpbAb6y0p6UB/nJttoamVe/p5/nT3JaD5fW2Ve9J7i8HWb8i7HZEIk15EDlAoS yF5w== 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=QTE05KeiuezyEKTX9mkuL9VK77vBOJIH+1LpvM0ag34=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=R/sGsPGfQ+A9kglI1PTnZgNY4PPDXREzAOwRrPpOKBKCEZwUSmwP+oHpncvzFjo3YZ r6rVrORHC4xO418GhTzZYok1XbaVNRSvKTyHbKASX681wY1yJUvtwcHu9uRukPr6jboS qyRxODIgcYhOtSJCXl4BEmYM+JxAfYwP3u9QLaJpxM9ixxmW2azd2FCHCSooBAVqUjvJ O+9oX/Maa1NHJhzi9dDOebYmMiqXn52dX3Z72YSxqO6v5liUV7RkSh7F9UgAMZXScUAF uvNimdFF+d26nzyZymfykR2tvTgHpK0BhOAPMtmqZU7HQMeBZAt1UhyRpean4wD4AyKi lhWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=X28UD5Bs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e62-20020a636941000000b00585a6bdce46si2603299pgc.308.2023.11.01.02.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=X28UD5Bs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 60C3B80D44FC; Wed, 1 Nov 2023 02:19:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234999AbjKAJTR (ORCPT + 35 others); Wed, 1 Nov 2023 05:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234894AbjKAJTH (ORCPT ); Wed, 1 Nov 2023 05:19:07 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9F910F for ; Wed, 1 Nov 2023 02:18:56 -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 A4C6F1BAE; Wed, 1 Nov 2023 10:18:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830303; bh=dkl3jtDooC1JFtaD0YoyJ131w9qjC5vo5eQl2h7Sweo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=X28UD5BsxO8OYz1iBNC/hEargVmbvL7kBwjtoMi4DnBqAbZdZszrGVIWyp4s7IAbd 1AVMmwshLM8JHaJF9zrLfFeCQiw9mP3h8QvHnB7ZqeYqMGPxhnBQd1qdX8h6NcqhVh dXK95kbx1eUUPcBu2f0noTr9DHcB7CGyqUs9AbLc= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:44 +0200 Subject: [PATCH 07/10] drm/tidss: Fix dss reset MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-7-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2654; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=dkl3jtDooC1JFtaD0YoyJ131w9qjC5vo5eQl2h7Sweo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfnclbJel7gQ5GXPPWj5UOUtsFOinZZ0pugH /NxyVI+gV+JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX5wAKCRD6PaqMvJYe 9XdDD/9FXC7yP4L2ixb760gH7/wVpJyGAsTsAlYaoBTFTw5xeGwhs8RjwMtFnhLBbF5zmmMqyNF OxZnojctXWY/mBYxSHUjx/a9PELtelP094ZjhLD9EG4Ng4GiPRst8TMeE8DhioLT+b0E66EevUf /FObJE4gO2GA1AXutg7+AHqAXIoFXS5E67u4rJuRbOzbfTyOW5R/NhVp2IcCQGxMAMFcINI1/gW kKlX7uos1wVdGxsWnQkezqPjrLodBtph11X+URZvvnUlKtJDXc8+UwtJHx06axtrPHZd88NL6U/ EMmY6NQ5GHscG/6GmskW2ojmPIF1M1VyfFzFwkxt5pi95dhfOn02C8IOmyGY/tOBPWDZa237Yk7 G9xRRjuJ6jJTO/Cu6WKL0fW5HDkIA0kg3i93lvSOBHleAcvqBTo9FnvviNEPdlw+BJMbsMErdPH RFnvCGWdgEk/6F/JulnQ1UW5E9ObYsQ0RjmbmC1mO68zShNkdQ34cE+gJ9SRBRAr9QSBfF5XKHZ IbEr5z0JPIapFTgVYGFCxjXDS2rWq974WtIk/f1KBKKr7i10KU+cp/lY1omCsH1hjeGpMwWYVuL j01zWpoSgc3ciZJVzOOM3aNlZo3gABubkDqOPk2VKmhXhDJ9sC8pyCNZIvHRWWnJfHRayHKAQ2y 3uSypv0sboLvj8Q== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:19:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352752062398678 X-GMAIL-MSGID: 1781352752062398678 The probe function calls dispc_softreset() before runtime PM is enabled and without enabling any of the DSS clocks. This happens to work by luck, and we need to make sure the DSS HW is active and the fclk is enabled. To fix the above, add a new function, dispc_init_hw(), which does: - pm_runtime_set_active() - clk_prepare_enable(fclk) - dispc_softreset(). This ensures that the reset can be successfully accomplished. Note that we use pm_runtime_set_active(), not the normal pm_runtime_get(). The reason for this is that at this point we haven't enabled the runtime PM yet and also we don't want the normal resume callback to be called: the dispc resume callback does some initial HW setup, and it expects that the HW was off (no video ports are streaming). If the bootloader has enabled the DSS and has set up a boot time splash-screen, the DSS would be enabled and streaming which might lead to issues with the normal resume callback. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 45 ++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index f204a0701e9f..13db062892e3 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2724,6 +2724,49 @@ static int dispc_softreset(struct dispc_device *dispc) return 0; } +static int dispc_init_hw(struct dispc_device *dispc) +{ + struct device *dev = dispc->dev; + int ret; + + ret = pm_runtime_set_active(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to active\n"); + return ret; + } + + ret = clk_prepare_enable(dispc->fclk); + if (ret) { + dev_err(dev, "Failed to enable DSS fclk\n"); + goto err_runtime_suspend; + } + + ret = dispc_softreset(dispc); + if (ret) + goto err_clk_disable; + + clk_disable_unprepare(dispc->fclk); + ret = pm_runtime_set_suspended(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to suspended\n"); + return ret; + } + + return 0; + +err_clk_disable: + clk_disable_unprepare(dispc->fclk); + +err_runtime_suspend: + ret = pm_runtime_set_suspended(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to suspended\n"); + return ret; + } + + return ret; +} + int dispc_init(struct tidss_device *tidss) { struct device *dev = tidss->dev; @@ -2835,7 +2878,7 @@ int dispc_init(struct tidss_device *tidss) tidss->dispc = dispc; - r = dispc_softreset(dispc); + r = dispc_init_hw(dispc); if (r) return r; From patchwork Wed Nov 1 09:17:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp282942vqx; Wed, 1 Nov 2023 02:20:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpJPlsRYXkS8tb6M2dKeBaTUHhA8yBacr3u++MfcmM+R/kZtMzN677amHCZVVfBdnx2K8M X-Received: by 2002:a17:903:41cd:b0:1cc:4e81:36a4 with SMTP id u13-20020a17090341cd00b001cc4e8136a4mr9467860ple.5.1698830430652; Wed, 01 Nov 2023 02:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830430; cv=none; d=google.com; s=arc-20160816; b=Mjg3aIrPAUhVGS6pqBaZJ37UiB4ci25yZih9rnNck+IZxbPz+gRVCBQupsJ21PPnkk /2X7Hbri7tc0dx1I/aeLa6uM2iNio2JzTE6oaHWk1U36hbkV7WnmCFUFOJvwm/ImM81z 3w4XwL9ysdu7qVvRdHC8l0b34UOEMkFwYeYj7i40izAeVV3IutrcuBKrkzQ0u8TnnHJJ SOKV6pKNyDic/ZO3VfhuEzBKePRTaz7G5nE1URRrUEyOoDr0Vu5b36CMdhlELAvPYbsw 2VcogMPwDi7zIPX4jaSPjt5UT9YwxaZEEqo/QhF7kulL9/TlF/eaF+WVUgH/FgOMt/iT gB6g== 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=rTkgHUFMvxn4JcTUjQc+DNPxmIHMXGBQsHHL8tpXzFk=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=m9f5yWdU8j0QVCnHV5R61IDtRsJFhqVgjo0eeUGtKmzls3vDrn2FTPkJl6vbWF1usw /Jd7zZKZHXMtnH+fMLpurYrif3oK9RQTRSsHqu7K3d60u8I53IIgaxyjEu9Tl1Xs3JOw 9JhEuqIGdE8xRmPfWnn2H30+Y8jv+GyMaB2mAxZjkFiA+2sclxKH/SDIIBHF1z+ioMWp M02bE3hJNqmJfXws6n34HlYLBqKdbphG9zJ55Cr45Ikz3edHzrGjD2TLzCtdELDXJgLD kNPxPd4SwBQshA6GaLJCVdf0XJDL9yOSFDsTk0r9zCr1jMV3kU+6s4n0QxpavQETD6JM sPIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=N4Lf32+M; 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 n3-20020a170902d2c300b001c9d03042b6si2638472plc.7.2023.11.01.02.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:20:30 -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=N4Lf32+M; 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 2DE06805B9F7; Wed, 1 Nov 2023 02:20:15 -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 S232927AbjKAJT2 (ORCPT + 35 others); Wed, 1 Nov 2023 05:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234097AbjKAJT0 (ORCPT ); Wed, 1 Nov 2023 05:19:26 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 287BAD4B for ; Wed, 1 Nov 2023 02:19:03 -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 73F1F1BB1; Wed, 1 Nov 2023 10:18:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830304; bh=XebHXvtm9Gfpkkb4vxBLxt9Z+vX/euBnejSOchv4oXo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N4Lf32+MT3uYNIlocIzcnORczhVJRTG3EGbyQNJkYJ+uIw4qQIRTY1ccLlYdR4oFp 1VgWWQr4sCpl4Fua3bZPcz+uDottvhUeetdyYc9FKCcl2X9y1cilDYUGcg2vlPNdZ2 Z2N9MgEpQLQYU1FG744fbCxx6y0UNVFmb5QZaAAU= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:45 +0200 Subject: [PATCH 08/10] drm/tidss: Add dispc_is_idle() MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-8-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1637; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=XebHXvtm9Gfpkkb4vxBLxt9Z+vX/euBnejSOchv4oXo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfouctsmX1lsKBLN4hTuScM6P6dOalET/fhs HZs+OBlhFmJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX6AAKCRD6PaqMvJYe 9ZLdEACvwMBfXZe0UFUyJAWitzqcRdI8rq8Fv/GHlhHVRw6N5qjExuo05m0ZiCJ6WIRz9xkTK2K zAk+ELQ45A7rymVJBlRzVnEdfKOrpYltqBFjJKtN86fyj/9QuSmpnlgqMVvVeP0QjHEVbM1x67n /v1xfm0zSLtYWjB4sXzrDAHxcQUIVc6SCOGDGAITlg1Wblo5ZyRUzOeOGJTg7jovU6OCPXRY8jD c9x7sXrml0VY+hv/IvmVTDqE1opMxhcSBdOWmNAoRMPObo2jAMt5OnsdP3sGvVErVmFd6y3e5aK vnWSbTv4yGyZdwRueI9dIztZkn/hQj9HNHUTtokEI2yvGny8gI3tDIG7bR+WP5d7jNfT9i+sjp0 WggxHMj/poiPeMIZyTV8tLQx2kZ+repaWIw+1O4sFL+AIL6fvS0/pDx8cGDs23VY+A7+Je3dMIs VvD22BMSLeRDdilvHDEm5VhM27fxm5KZybEYtLWO2cfsdO1TzuFd9OjAHBNOkwg+0B2G5i2soET ZXakM7ynJ6Ywl6+Ougzskf3YSSJgQPZGrAuR2hOMAY6BTVMYaPuDC8aZrwRqRY6M7Fw2wwymt7K iDGIuOn5dXSMwPoiz2Yz6xyYumkGCHPWc+4r4NqZG6IFOCg0z2Nd7oqXdpL88td6UsveBDz/dz8 gxLsbPLhYe97xEg== 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: 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:20:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352817719330605 X-GMAIL-MSGID: 1781352817719330605 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. 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"); From patchwork Wed Nov 1 09:17:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp283666vqx; Wed, 1 Nov 2023 02:22:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGANkpFlAlW2XmTrQopTzVpTHuradoxn9iTmR+5/1KGVAQjJyVhkudOFn3aY9LDPn5Mu5dc X-Received: by 2002:aca:909:0:b0:3b0:da4a:4823 with SMTP id 9-20020aca0909000000b003b0da4a4823mr15854997oij.56.1698830548968; Wed, 01 Nov 2023 02:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830548; cv=none; d=google.com; s=arc-20160816; b=K+I4GsiBn0/mNVLLKMBR1QhiNP9A7XA7pwT/nn9FvC+HIwdxWQQ9MmMaHS0cEqqxSl yQ7/ygagwiHHLX8fO9iEEMsWqlblgjNPHj2Pz1kyCKVI8iZBPKis/EAwtJSvf2pZE8DV IkkDpmf2DWrpYTcTH2kDm4Hc9H4AAbfH32ivlvjlUznuxBHzhd1F55DhZsICt5tScYlW 87WuXVWkUKfcmePDe0rcfJzP3te9bo9wczkNglnejqJZSajMqVdxh+BlxG58rAhqGjT0 vgtmLkTqpA/p+PEnmAr/V04ovRN2d1tD7XKYE720l1ohxXtF5ypi2jY//2HhvJ50LHg8 PY5g== 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=M103NCND/NZfCGiX+O6t0WaXuzsBZk2UIMoUvJjqPVE=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=OigIX1BThd9rB2OXUzzsOKlRZzMM+aL2GSGhFHX35aprNYu7n0IZ0CMZ6eNA5zEiHh 3UEiSQ/rcJWA5Uo9aubmNn+m20qzx8nqdNAbu9iAbdxZ0OxaVWhUq1oPWYaBa+iHykgb B0Quecc637S6ginWYD+Gpj3mdcspNmfxZirCh7onsnyNA4sL561PtRNun3iKs9nEb84k KdAGY6I23AscL7NzpYQ58eYIw9S9NEfQpJV+2rd5enErg5tmsLFp4qjvodmS5YRC+9y1 9j+dpJ8kgehABfGkgqQlYXqmnqRl3+9gmxaenixLpEwjSMZXmgFUPno9StR1PxA7SmnF HKdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bxicC3Jq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bq9-20020a056a02044900b0059c02d055c4si2807512pgb.668.2023.11.01.02.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bxicC3Jq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 5E4CE807C577; Wed, 1 Nov 2023 02:20:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231967AbjKAJTn (ORCPT + 35 others); Wed, 1 Nov 2023 05:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbjKAJTm (ORCPT ); Wed, 1 Nov 2023 05:19:42 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07EF0D79 for ; Wed, 1 Nov 2023 02:19:07 -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 40B541BCF; Wed, 1 Nov 2023 10:18:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830304; bh=3IFzGY8oeGtxO2wTPUesFMIUoPVmmi/6+htUtk+hmMU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bxicC3Jq2ObCiLXFkkxIaCrLYIoMnPswexqgEjg8SUjH7lVGl94HZEavlfrxBUsdZ wz8Cmze3bRQvAtn1SOknfy4OhnadRb9dbc8FGdnlMyEhjchlBsjsFpLPul5pL3qwbw aRhtwaOP8nv0k3xnjSiLc++WwwpNriZreTA3GOl8= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:46 +0200 Subject: [PATCH 09/10] drm/tidss: IRQ code cleanup MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-9-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3782; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3IFzGY8oeGtxO2wTPUesFMIUoPVmmi/6+htUtk+hmMU=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfosECtSzzwvEaTrWTML4kgj007cpTx8f/P/ TAbV/DRdCuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX6AAKCRD6PaqMvJYe 9YocD/9tLemVTGiztuTbwCBaz1BWvl38Jfz8WJagRPJmto7sGPyNo9UqO/uxA2zhR/Yjq89IAYJ XooT8GZcZZ27w3VffTDbh23HNCqbZeBssaosJffxqs9PzUEvedQHTyOHs5YUTNSBoUGtcE+GEel p5+EIBvsXiLM9Xy91k6T5Z0Im/X5BsL/VNdTQjPx50Sx8KTnNeJeM7b5cyQH8yflC19ubvi7mJy SYEvzQRcrqGNdYwlg3lpsCZcEeITXRtRiWtbNwp4spud3GlCOppzUf8UG6kpHg0/T0HNf33/FI5 6UaBC0J7TVH2ieI7ESv27SXm5nnSqjkalnbyOD2iLWgkL60TI1dQfboUUlEuUOsCYDkbqnWonvQ kK1XgdplucnltZSGxq/+tN/etgxJUjAlu9u322dc5VT2h7uow6G33qzp0LWdt7MaB3iJYThW73l eY7OhelAM/1p/T7dcy4zE7ajHDCrJUXCuh7z/4kqdWtVHZMrkiPL7hiUpA10g8Hu2+ShJtjtGfo 6mFt28u1GRH1LPFODkjOvIazVGUANFA2J6rHIkL3fYoFPvNPAtuqJefB546y5SDXPXZv9iEA4kh aLi5VYr09/Xmb2HOT9M4EosYph0kPv6N5rnWVkVm4X7oOYR2XVGvmeUJLU7zHdmgBeqdmPQVQjh 3LMoGQ1pZh7u4vQ== 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:20:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352941515382398 X-GMAIL-MSGID: 1781352941515382398 The IRQ setup code is overly complex. All we really need to do is initialize the related fields in struct tidss_device, and request the IRQ. We can drop all the HW accesses, as they are pointless: the driver will set the IRQs correctly when it needs any of the IRQs, and at probe time we have done a reset, so we know that all the IRQs are masked by default in the hardware. Thus we can combine the tidss_irq_preinstall() and tidss_irq_postinstall() into the tidss_irq_install() function, drop the HW accesses, and drop the use of spinlock, as this is done at init time and there can be no races. We can also drop the HW access from the tidss_irq_uninstall(), as the driver will anyway disable and suspend the hardware at remove time. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 2 ++ drivers/gpu/drm/tidss/tidss_irq.c | 54 ++++++--------------------------------- 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index 64914331715a..37693f30d98b 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -138,6 +138,8 @@ static int tidss_probe(struct platform_device *pdev) platform_set_drvdata(pdev, tidss); + spin_lock_init(&tidss->wait_lock); + ret = dispc_init(tidss); if (ret) { dev_err(dev, "failed to initialize dispc: %d\n", ret); diff --git a/drivers/gpu/drm/tidss/tidss_irq.c b/drivers/gpu/drm/tidss/tidss_irq.c index 0c681c7600bc..604334ef526a 100644 --- a/drivers/gpu/drm/tidss/tidss_irq.c +++ b/drivers/gpu/drm/tidss/tidss_irq.c @@ -93,33 +93,21 @@ void tidss_irq_resume(struct tidss_device *tidss) spin_unlock_irqrestore(&tidss->wait_lock, flags); } -static void tidss_irq_preinstall(struct drm_device *ddev) -{ - struct tidss_device *tidss = to_tidss(ddev); - - spin_lock_init(&tidss->wait_lock); - - tidss_runtime_get(tidss); - - dispc_set_irqenable(tidss->dispc, 0); - dispc_read_and_clear_irqstatus(tidss->dispc); - - tidss_runtime_put(tidss); -} - -static void tidss_irq_postinstall(struct drm_device *ddev) +int tidss_irq_install(struct drm_device *ddev, unsigned int irq) { struct tidss_device *tidss = to_tidss(ddev); - unsigned long flags; - unsigned int i; + int ret; - tidss_runtime_get(tidss); + if (irq == IRQ_NOTCONNECTED) + return -ENOTCONN; - spin_lock_irqsave(&tidss->wait_lock, flags); + ret = request_irq(irq, tidss_irq_handler, 0, ddev->driver->name, ddev); + if (ret) + return ret; tidss->irq_mask = DSS_IRQ_DEVICE_OCP_ERR; - for (i = 0; i < tidss->num_crtcs; ++i) { + for (unsigned int i = 0; i < tidss->num_crtcs; ++i) { struct tidss_crtc *tcrtc = to_tidss_crtc(tidss->crtcs[i]); tidss->irq_mask |= DSS_IRQ_VP_SYNC_LOST(tcrtc->hw_videoport); @@ -127,28 +115,6 @@ static void tidss_irq_postinstall(struct drm_device *ddev) tidss->irq_mask |= DSS_IRQ_VP_FRAME_DONE(tcrtc->hw_videoport); } - tidss_irq_update(tidss); - - spin_unlock_irqrestore(&tidss->wait_lock, flags); - - tidss_runtime_put(tidss); -} - -int tidss_irq_install(struct drm_device *ddev, unsigned int irq) -{ - int ret; - - if (irq == IRQ_NOTCONNECTED) - return -ENOTCONN; - - tidss_irq_preinstall(ddev); - - ret = request_irq(irq, tidss_irq_handler, 0, ddev->driver->name, ddev); - if (ret) - return ret; - - tidss_irq_postinstall(ddev); - return 0; } @@ -156,9 +122,5 @@ void tidss_irq_uninstall(struct drm_device *ddev) { struct tidss_device *tidss = to_tidss(ddev); - tidss_runtime_get(tidss); - dispc_set_irqenable(tidss->dispc, 0); - tidss_runtime_put(tidss); - free_irq(tidss->irq, ddev); } From patchwork Wed Nov 1 09:17:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp283413vqx; Wed, 1 Nov 2023 02:21:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTIWACX6puFCPzeh7yfYuHZz+9W9lrDrAus8QTGjaYZTGdy1m9IbfTLEPpvUoHdN8zf0IP X-Received: by 2002:a17:902:d50d:b0:1cc:3875:e654 with SMTP id b13-20020a170902d50d00b001cc3875e654mr9012710plg.26.1698830502229; Wed, 01 Nov 2023 02:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698830502; cv=none; d=google.com; s=arc-20160816; b=z3jIdjgsnZOb8tB9DHhfOknvHZXUi5MV2eFXXeZH1uPfERFdUEacybG3J6FgjC+HaJ 9cFkawn+uTMRfGJNRH8Pb7NKMkb5SDSGkLbJNIn4Yc7OQA3wG+NwBAP1iDzw5/F0TjZC usnRfzXkgH9Eq66oKsczAKQ21MordrKIvPY6BBs6T4h9t8J1N0gkWXFtLd5vCsC8blQ8 4zPaxmUcESo3Sl+ladBTgUyS5EcM5V5/w/qGNkSAivzYOaFP8DSTA9EX2TMoGlROQh+K 0B+1FTdbAkfE0jcOA59onGJ0xHuk/+naLyENiIA1/q8cpMU+q6oetUwQH26bflrdl/sw mC8Q== 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=RT2JT2gBFWTktn7TIoBqKPO1iMcwDsIMympww+gk7WA=; fh=IpenHstmzluQ2qG4rgZds4W72uLPbZNMEjQq5GLr0+k=; b=UztNxoTMW9YzUnhIZvSnaR9FIv42s546SX/YoT5RgryYcKbbJgmmAjOBgWEiuNC4Gp wMQwyi2MS1EuUFQuWPcO0elTBvlMjBfK6+oRN0aJ02Qd/pC229wR1LK7+nuBcIsGSxEF QNTcycBEa7qYd7WklSf/L++LHVyXBtADi+mP4GnFUkDdoNSo0nTSO3uz50prKo3N3Ql9 ts4Fwm6i+qkQVNF9uUXOyot6Wug7agzHlDO45YydDhcSRQdBGvay8lIZHnB/OucpKGKt 0tARRuHhHowcO59MhDJtx8Vzh0lJotrCyYRWIkOPbwZcWj8e7734X2G8ziFTinECz1AR lO1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dAbxEauT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id kk6-20020a170903070600b001b8904eadb8si2519391plb.460.2023.11.01.02.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dAbxEauT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 2BEA48074CA6; Wed, 1 Nov 2023 02:21:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231926AbjKAJUJ (ORCPT + 35 others); Wed, 1 Nov 2023 05:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234822AbjKAJUG (ORCPT ); Wed, 1 Nov 2023 05:20:06 -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 1238611D for ; Wed, 1 Nov 2023 02:19:26 -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 0F6751C1D; Wed, 1 Nov 2023 10:18:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698830305; bh=OSH8ynuiJ2YVkYrZuWQq2MVjAg+Zul2OXF3bZ5EaKoY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dAbxEauTggKPBtvsLnTgVxvWaN51QrLuJNaTEEl3DVqw9QseUa8JBoFOKtKTJk4/B NKF+dbkFvR5sgddorjc/PJjo2yisNgv9W6fG56YeAYj6n7PuYRVrtOlFu5h4Yxx5pi wxL8hRRQqvGLAQlysHgUcHB6eIeSXf6GslDZexQ0= From: Tomi Valkeinen Date: Wed, 01 Nov 2023 11:17:47 +0200 Subject: [PATCH 10/10] drm/tidss: Fix atomic_flush check MIME-Version: 1.0 Message-Id: <20231101-tidss-probe-v1-10-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 , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=OSH8ynuiJ2YVkYrZuWQq2MVjAg+Zul2OXF3bZ5EaKoY=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlQhfowmaSVl6BO4E/HgJrUUSCbYheTzOdaTI7j cPYBH4VqoyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUIX6AAKCRD6PaqMvJYe 9eIYEACPcoPMlIy8n0o9G8hXcsLaHmiclB9/T6IHAxb7QlmvPnQG5uC4ENthjLwTslHTcm9AKI3 cZ9lB9izizrFbL0x/lKcOPbFBScAOw1ADcOXo/4ECGzcCcZaFXMSmR0lJkd4INJ9PGnCIR9Bb99 R55+b+J0BFFDqBd1GEMjWlrRHp7kZWFsNEm5eZgOcbSiX52yQwzF2+kam2CjGIeZ5vnuxS0wB6g YEm972d2h9Ffn728GLcoqlRb/r5wQmWVeHecmiKLkEmUKZOUzScS3s0XmtrfCAi64iDazfjT5/r F1JGSOsp6PWWoreiAhrDb77x4Y0K1B/2NAeIYeMcI8RzZw1hnnch8Il8D1pLjO9bqsbCN2WVDO+ bf7Q0zjCCv4Xlo2/6SP+bPr15R+VZWfjDne8l22OtOc/cFXUMjh4utEtuDAu5AGWgFEJyf5oi8I DGPku/a64Y9TmVtYTrvK7EWrk7tD2XU0piwij6GK1sidpzk1F4mysb0O6xVl4GfIk6S5k515MrS ws599EtVW10LYkxigCxnBtQcETXPA1tePRLPE/oBDJHgOVBw/adQ09KpmomET4rplN7FhSCGMjM CHraJxTbEKvPg9JdknRS1e2MTspW5EtMUvERx/b9S0ONGSLaw1AP0sNTAcFamjFSOvAQBouPhb9 ztjKjvBih4QbYmQ== 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:21:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781352892574411358 X-GMAIL-MSGID: 1781352892574411358 tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not, returns immediately as there's no reason to do any register changes. However, the code checks for 'crtc->state->enable', which does not reflect the actual HW state. We should instead look at the 'crtc->state->active' flag. This causes the tidss_crtc_atomic_flush() to proceed with the flush even if the active state is false, which then causes us to hit the WARN_ON(!crtc->state->event) check. Fix this by checking the active flag, and while at it, fix the related debug print which had "active" and "needs modeset" wrong way. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_crtc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 5e5e466f35d1..4c7009a5d643 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -169,13 +169,12 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc, struct tidss_device *tidss = to_tidss(ddev); unsigned long flags; - dev_dbg(ddev->dev, - "%s: %s enabled %d, needs modeset %d, event %p\n", __func__, - crtc->name, drm_atomic_crtc_needs_modeset(crtc->state), - crtc->state->enable, crtc->state->event); + dev_dbg(ddev->dev, "%s: %s active %d, needs modeset %d, event %p\n", + __func__, crtc->name, crtc->state->active, + drm_atomic_crtc_needs_modeset(crtc->state), crtc->state->event); /* There is nothing to do if CRTC is not going to be enabled. */ - if (!crtc->state->enable) + if (!crtc->state->active) return; /*