From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=52.101.84.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796026972; b=vnGgRQMYSDyidoK0U+zMTdoyjc+wlyMNiOmBDpE4DrNmXyZxYhugSnt9FiNhBVUtDHvk 2+Hw5UVm1vxBcw2vQdVR7HmjZcV5Cu2Se/iTL2DQ/YJPe8JPUUwYo0s0M8Mdn9t89Ul4g UI0rwEt6YsLL0mDsR2Q9cQz+L7KQHC2KcI2fltgrLtMamAqzJx7jNEqPVm/6/9wCRA8oZ 5VkKAEJ2zyl6IYWZnf+nsV+NHFkOrgnORURTqJ55VYoWS5UxFOBO/CN4E8r4lN3rcbzQs oiWpP5kPWSC2xDCKFt2++pk5r8z8fMS58+oXq5EJLcf1+Ryc5tVXYzKkbBxi9hkwjQQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796026972; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=jBoxtpWSVpV7UhY/rOVXWygRTnoLldIOzer9IiDSt0w=; b=Qramt+FjFdh4X6klYzuTBNSURRDEmiflBlKLo/BbftvZkh47nrEb5zNsy/DWhig3NbYz FR9AI0qji/v8nUPOYuzjmUes5cCbs2uP75PM4ThAk18cmIu4Q5/0QN6QFWP4Gx+r7CEAZ CUTV3YsiKV/2oLQ9yiKOXkHza8f7ztoCLrusxhPLTfljCv6L8tcbSaRHk1sNi5gmDiqAC DLh2R2sNYydwWhdWRzmQrqKUulZgRFwZiuD0cuWQZVZofmzBAzzQnPexw9RXvI+fzXsnm eUmGc+mNsSgpcbauNHNXP/BYypiL54fY5n9spABY8dmdGP98rlLcTv74q2hWfwr9tSA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=fail reason="signature verification failed" header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector1 header.b=QLsiYzzV; arc=fail smtp.remote-ip=52.101.84.1 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11010001.outbound.protection.outlook.com [52.101.84.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97DA0606A329 for ; Mon, 30 Nov 2026 08:22:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 97DA0606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector1 header.b=QLsiYzzV ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x0qPuramzzrg+QdHWRroWxme/MyLHLhRXy78OuCkjGFdCijNdghVyXoGBN/6BSUDji3Wxn87j3M53ksG4/7osdxuJAk+nppX0YVdCSq4m3LsiUdZVzXa7AkfZ9f9btw97LNy4qg6g35A4Ni8y8Oe3cfgmlqvX9HXEAU9QMuGz1QHoOaT5T6CghB8qRn7rXC/OezmDiBt/0bRry0XFLfj9RsnSkWeawllOEpXeR8b42pwP3wjWApygd1zanO4z8+LAKW1qkp/1Pbg3/cfnUvGv8F2TrfDe/UY/O5MPeUrKNKX2umtPg3vscPqvpNNLZ4DjOTvDMz/krNGQHKcb4uk8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Cilk7tV/VMxhyQEMV4nhaayqYl1b0VqXJmx7bNWot2o=; b=TE6e6V5xoSHDQ3CbOuO4V4RZU9onsOxoUrZyqinmQ8+XjkvsfD485CcovCOKR6HueESF9sivsvql21OA4xaJwJWdpWxclIHWym9fwUcFbnUJsaxAmQeZ8l1fPOcPzUTL+WV7rPmGWUfHyjQEDUiDrurdJVahecMeUZlG3rriFGrHhjUT/7I6yyz82oJzKogeC7BcwjjIw1BGsw3sq9b8ctiD7FOcbWEdJ1QsZqN7csZ0Lk8n6iQJaGt3nOg7lVsa1exjtvH5yPRm09RIhCmkBvByDhBmPL/P2X4nVhKWb32STgW1ZxC+LouGicxic5BaM+cVxwivJynYJ+MDIy646g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cilk7tV/VMxhyQEMV4nhaayqYl1b0VqXJmx7bNWot2o=; b=QLsiYzzVrcjkGwA6UkHnh+VLZvmuW7BmakDXOCHQfQTezY8GzkIxKFu0Fhgs/BTPc2dpeGq2MpYTFjn7XmX1lAZyrreecGYrn0/RcQlUemkY1GuwRJWRuE3hGo2qKGaUWPbuoV9HzJLNPXDL8kSaZ9CZrEH5j0ZE39xXZu8wVjjJUhGr0yWLHU6Fb7L/TLzGSuGNUapS30UyauZAJxpAO+AYd6wuOMYxZnFhvziDU8+UMqnyANSf4Tj4HcJhK6IkqdRY4ogQ7hM4iL/PsodhJ1BLohaum0ma/uvK27Ml2nzf3oXf8SXC3LQLP0uuMeP8FS66aZYKBUyGxVkxirejtw== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from MI9PR04MB350878.eurprd04.prod.outlook.com (2603:10a6:290:c0::7) by AMBPR04MB12592.eurprd04.prod.outlook.com (2603:10a6:20b:778::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 08:22:49 +0000 Received: from MI9PR04MB350878.eurprd04.prod.outlook.com ([fe80::8537:1cdd:6c49:6151]) by MI9PR04MB350878.eurprd04.prod.outlook.com ([fe80::8537:1cdd:6c49:6151%4]) with mapi id 15.21.0662.007; Mon, 30 Nov 2026 08:22:48 +0000 Date: Mon, 30 Nov 2026 16:24:29 +0800 From: Liu Ying To: sashiko-reviews@lists.linux.dev Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org, Frank.Li@kernel.org Subject: Re: [PATCH v9 07/16] drm/imx: dc-crtc: Disable at boot Message-ID: References: <20261103-imx8-dc-prefetch-v9-0-3b985e7636e2@nxp.com> <20261103-imx8-dc-prefetch-v9-7-3b985e7636e2@nxp.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: SI2PR02CA0048.apcprd02.prod.outlook.com (2603:1096:4:196::23) To MI9PR04MB350878.eurprd04.prod.outlook.com (2603:10a6:290:c0::7) X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI9PR04MB350878:EE_|AMBPR04MB12592:EE_ X-MS-Office365-Filtering-Correlation-Id: 982636e4-8eb3-4876-64bf-08df4ebb1e16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|19092799006|366016|23010399003|1800799024|5023799004|11063799006|4143699003|6133799003|261009223027099003|18002099003|22082099003|10067099003|56012099006|261102123227099003|261028144727099003|261026140227099003|261022075727099003|261022105027099003|261021121427099003; X-Microsoft-Antispam-Message-Info: ZZO9qw2crr76dwRKx0jWC6hV7bUioqxlOlH5Z84Yixc+o/Oc8mG6af8B5bTLx+4CGLXfkVhMMZHNCj/0GBEJ247qq3uATnwZqIuA+GdDWIplTE8+a4ZqzzBzzoyLn97cxdXtrNS33J5zsVeX08Gvi/x//5+a3IFA03C7nOgRIueXkiHlwPEOvfZdeg7fiBCcrO3uDToWwcEIwN1GE9LsVz2/CAF3Ze50jR0lTAQcw8okhbSwU0KXuGnGWjwewOtuLVI6TrIxsANg8AmGXw07YVqtfZVvznp1RZ/zjAlohcdphjB2+0An9Eta8JND3oMVecAD0qmqE8B6691B20sz869K8XbEw0Qa7D/THF80Dx5xl1S+h9QXUd5c8/Sd/LqyRVuEl5q0lEtiqxok2yS1EJkf5W3c/BgJlNZPwF7Ti2j3/c0oa/9UH68q389GMrrGDRzsPfCRTNepIEkwo0Q9bMc36VOjp6LtnwcyRxR/utWv0pCFaIDW3uqhpz98dh9TCQn4VZiQgzA3GYE0rjybb+zXHB8lYI6O8bmYnnlEzXYd2Hovi94GLvg0Nrq0BfE8Tu+cil43JtOLoonGucDh5pPZk/DeFG6uPoKf9H79sOg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MI9PR04MB350878.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(19092799006)(366016)(23010399003)(1800799024)(5023799004)(11063799006)(4143699003)(6133799003)(261009223027099003)(18002099003)(22082099003)(10067099003)(56012099006)(261102123227099003)(261028144727099003)(261026140227099003)(261022075727099003)(261022105027099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?PCj/0KtNJMhjw+EU3uHlTZemglK3irk+aVxfal4aday1RlsBT8U08RaET6?= =?iso-8859-1?Q?zVtjoePALp4IzsWVWDBrHUtU/PCIABdFPU4JYhjKpPTSilj/fJcWL2eyvm?= =?iso-8859-1?Q?vCeqcz1awb3ic5PunLMt3+lbKtybumtFi7MEKgw/7A8JpW5waSFte05JUg?= =?iso-8859-1?Q?pqy+jBbOMzpL9Z933UcEsyQwZ88dHYj54J2rdKDMt5cNEPkS1Z+khBn6iF?= =?iso-8859-1?Q?4Im9hPOEqmCfHXq9LPs03oCcvfcUbFCkwNJAsvlvYs59Vwyl6iMeKRHIls?= =?iso-8859-1?Q?p9zm9spGNqBki8Ho5n4b0oi5iuYR/4pNl7CyZcJCP4Gw/WpMPfNHL69tEX?= =?iso-8859-1?Q?8CAcamZzWhHOiizETf7c7VE8KoOQpMJm8IizA5D+gxWa6Y3F173Z3/V0MI?= =?iso-8859-1?Q?5wfN6gFaJlpcgyo/4TutPy9jLMmHTk+17QyC1IGfsfkjSkec1XA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leL/KqfdIdSc0NjOf8LGvn2e9yhEFOeIl+5RV?= =?iso-8859-1?Q?csJTMSOhhMpu1b+nCUMG6pfyYB3xRZ9HK1XiPqRJ+ZkXnizxTycSfnKF4s?= =?iso-8859-1?Q?iq4z21U2y5OR+iN+kLNx1yAL7Vdx1LNrzMhUFG2tN/vMkxwWt5yrCJVbFX?= =?iso-8859-1?Q?2nDilHvWcd+seL+ufBiDVI3zYvTaLgESss+sTNw5ltODtHCpMfgVcbhRN7?= =?iso-8859-1?Q?KnEVe+l5/or+1nhEZWt2mOLjq6un765EMzJ6FFm0O3B/+hTbKBnxnjDTP2?= =?iso-8859-1?Q?/R8DzKDeUNV8YGuELra1PfwT2VzM2nDnu4F5sBe7YnG4wOXCG3x3ICByWp?= =?iso-8859-1?Q?l1qxZkJxYRVuwaZmnMRKPYrAHtZHG/dy4jwdmRGuEwHBRBzLZfn5Tt9qK3?= =?iso-8859-1?Q?5kR236xyPIy/+fDLtwdDv2x0w/RxF7TPR9Vd3kmnfEQwbfu5AGepFKYg2F?= =?iso-8859-1?Q?m3yZJosyJg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 982636e4-8eb3-4876-64bf-08df4ebb1e16 X-MS-Exchange-CrossTenant-AuthSource: MI9PR04MB350878.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 08:22:48.1459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PKLJMQcXK5ftRwP76HQatnzXVi4oS8wgKQtAjlb9IxkF4/MyyI5MN4kqNwTlPqfISbMEImTkKZZnZ5wMR8mjWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR04MB12592 On Tue, Nov 03, 2026 at 06:38:24AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] drm/imx: dc-crtc: premature clk_axi disable in dc_crtc_disable_at_boot() > -- > > commit 8bca21cfc221adc6d10d2019ff78d5b2dc5c6e91 > Author: Liu Ying > > drm/imx: dc-crtc: Disable at boot > > This commit adds a dc_crtc_disable_at_boot() helper and calls it for each > CRTC during driver bind to disable any running CRTCs and balance display > and AXI clock usage counts before registering the DRM device. > > > diff --git a/drivers/gpu/drm/imx/dc/dc-crtc.c b/drivers/gpu/drm/imx/dc/dc-crtc.c > > index 0d64186a99018..5bc952d6883e1 100644 > > --- a/drivers/gpu/drm/imx/dc/dc-crtc.c > > +++ b/drivers/gpu/drm/imx/dc/dc-crtc.c > > [ ... ] > > > @@ -331,6 +341,48 @@ dc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_commit *state) > > spin_unlock_irq(&crtc->dev->event_lock); > > } > > > > +int dc_crtc_disable_at_boot(struct drm_crtc *crtc) > > +{ > > + struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev); > > + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); > > + int ret; > > + > > + ret = pm_runtime_resume_and_get(dc_crtc->de->dev); > > + if (ret < 0) { > > + dc_crtc_err(crtc, "failed to get DC display engine RPM: %d\n", > > + ret); > > + goto out1; > > + } > > + > > + if (!dc_fg_wait_for_frame_index_moving(dc_crtc->fg)) { > > + dc_crtc_dbg(crtc, "FrameGen frame index isn't moving\n"); > > + goto out2; > > + } > > + > > + dc_crtc_dbg(crtc, "disabling FrameGen at boot\n"); > > + __dc_crtc_disable_fg(crtc); > > + > > + if (!dc_drv_crtc_is_enabled(dc_drm, drm_crtc_index(crtc))) > > + goto out2; > > + > > + dc_crtc_dbg(crtc, "disabling clocks at boot\n"); > > + > > + dc_fg_disable_clock(dc_crtc->fg); > > + > > + dc_drm->pe_clk_axi_needs_disable = true; > > + > > + dc_drv_set_crtc_disable(dc_drm, drm_crtc_index(crtc)); > > + > > +out2: > > + pm_runtime_put(dc_crtc->de->dev); > > +out1: > > + /* Let CRTC(with index == 1) disablement path disable AXI clock. */ > > + if (dc_drm->pe_clk_axi_needs_disable && drm_crtc_index(crtc) == 1) > > + clk_disable_unprepare(dc_drm->pe->clk_axi); > > + > > + return ret; > > +} > > [Severity: Medium] > As reported by Sashiko on v8 [1], can dc_crtc_disable_at_boot() in > drivers/gpu/drm/imx/dc/dc-crtc.c prematurely disable dc_drm->pe->clk_axi > when disabling CRTC 1 fails? > > In dc_drm_bind(), drm_for_each_crtc() invokes dc_crtc_disable_at_boot() > for CRTC 0 and then CRTC 1. When CRTC 0 was active at boot, its call sets > dc_drm->pe_clk_axi_needs_disable = true and clears CRTC_ENABLED(0). > > When dc_crtc_disable_at_boot() then runs for CRTC 1, if > pm_runtime_resume_and_get(dc_crtc->de->dev) fails and jumps to out1, > CRTC 1's FrameGen has not been stopped and CRTC_ENABLED(1) has not been > cleared. However, at out1, dc_drm->pe_clk_axi_needs_disable is already > true from CRTC 0 and drm_crtc_index(crtc) == 1, so > clk_disable_unprepare(dc_drm->pe->clk_axi) is called unconditionally. If pm_runtime_resume_and_get(dc_crtc->de->dev) fails, then we should fix the runtime PM in the first place. After all, if it fails, then we can't disable the actively running CRTC 1 and it's pixel clock with dc_fg_disable_clock(), which is an issue anyway. > > If CRTC 1 was also active at boot, wouldn't this gate the Pixel Engine > AXI clock while CRTC 1 is still scanning out from the Pixel Engine, and > leave CRTC_ENABLED(1) set in the general purpose register so that a > subsequent bind retry disables dc_drm->pe->clk_axi a second time? > > [1] https://lore.kernel.org/r/20261030-imx8-dc-prefetch-v8-6-c4f81afd4533@nxp.com > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20261103-imx8-dc-prefetch-v9-0-3b985e7636e2@nxp.com?part=7 -- Regards, Liu Ying