From: Liu Ying <victor.liu@nxp.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Dmitry Baryshkov <lumag@kernel.org>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 07/14] drm/imx: dc: Add DPR channel support
Date: Wed, 24 Sep 2025 14:59:54 +0800 [thread overview]
Message-ID: <41bd1647-2bff-479c-9994-984d7fae5dc4@nxp.com> (raw)
In-Reply-To: <aNLnBbSr5BGDvmsG@lizhi-Precision-Tower-5810>
On 09/23/2025, Frank Li wrote:
> On Tue, Sep 23, 2025 at 10:07:57AM +0800, Liu Ying wrote:
[...]
>> +void dc_dprc_disable_at_boot(struct dc_dprc *dprc)
>> +{
>> + dc_prg_disable_at_boot(dprc->prg);
>> +
>> + clk_bulk_disable_unprepare(dprc->num_clks, dprc->clks);
>> +
>
> you have runtime functions dc_dprc_runtime_suspend()
>
> If runtime pm status is correct, needn't call clk_bulk_disable_unprepare().
The problem is that once drm_dev_unplug() is called from dc_drm_unbind()
due to imx8_dc_drm module removal, the RPM status of DC, DPRC and PRG is
"unsupported", which doesn't reflect the fact that the display controller
is running if it is before the removal. When the module is installed
again, these clocks need to be disabled out of the RPM management to
avoid clock enable/prepare count leaks if necessary.
See kerneldoc in drm_drv.c:
/*
* DOC: driver instance overview
...
* Drivers that want to support device unplugging (USB, DT overlay unload) should
* use drm_dev_unplug() instead of drm_dev_unregister(). The driver must protect
* regions that is accessing device resources to prevent use after they're
* released. This is done using drm_dev_enter() and drm_dev_exit(). There is one
* shortcoming however, drm_dev_unplug() marks the drm_device as unplugged before
* drm_atomic_helper_shutdown() is called. This means that if the disable code
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* paths are protected, they will not run on regular driver module unload,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* possibly leaving the hardware enabled.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
>
> Look like call pm_runtime_put() here to let runtime pm management clks.
>
> otherwise, runtime pm state will not match clock enable/disable state.
>
>> + dev_dbg(dprc->dev, "disable at boot\n");
>> +}
--
Regards,
Liu Ying
next prev parent reply other threads:[~2025-09-24 6:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 2:07 [PATCH v2 00/14] drm/imx: dc: Use prefetch engine Liu Ying
2025-09-23 2:07 ` [PATCH v2 01/14] dt-bindings: display: imx: Add i.MX8qxp/qm PRG binding Liu Ying
2025-09-23 2:07 ` [PATCH v2 02/14] dt-bindings: display: imx: Add i.MX8qxp/qm DPR channel binding Liu Ying
2025-09-23 2:07 ` [PATCH v2 03/14] MAINTAINERS: Add i.MX8qxp prefetch engine DT binding files Liu Ying
2025-09-23 2:07 ` [PATCH v2 04/14] drm/imx: dc-fu: Fix dimensions Liu Ying
2025-09-23 2:07 ` [PATCH v2 05/14] drm/imx: dc-crtc: Disable at boot Liu Ying
2025-09-23 18:08 ` Frank Li
2025-09-23 2:07 ` [PATCH v2 06/14] drm/imx: dc: Add PRG support Liu Ying
2025-09-23 2:07 ` [PATCH v2 07/14] drm/imx: dc: Add DPR channel support Liu Ying
2025-09-23 18:29 ` Frank Li
2025-09-24 6:41 ` Liu Ying
2025-09-24 15:26 ` Frank Li
2025-09-25 2:58 ` Liu Ying
2025-09-25 3:55 ` Frank Li
2025-09-25 9:09 ` Liu Ying
2025-09-25 15:58 ` Frank Li
2025-09-24 6:59 ` Liu Ying [this message]
2025-09-23 2:07 ` [PATCH v2 08/14] drm/imx: dc: Use TCON operation mode Liu Ying
2025-09-23 18:30 ` Frank Li
2025-09-23 2:07 ` [PATCH v2 09/14] drm/imx: dc-ed: Support getting source selection Liu Ying
2025-09-23 2:08 ` [PATCH v2 10/14] drm/imx: dc-lb: Support getting secondary input selection Liu Ying
2025-09-23 2:08 ` [PATCH v2 11/14] drm/imx: dc-ed: Drop initial source selection Liu Ying
2025-09-23 2:08 ` [PATCH v2 12/14] drm/imx: dc-lb: Drop initial primary and secondary input selections Liu Ying
2025-09-23 2:08 ` [PATCH v2 13/14] drm/imx: dc-fu: Get DPR channel Liu Ying
2025-09-23 2:08 ` [PATCH v2 14/14] drm/imx: dc: Use prefetch engine Liu Ying
2025-09-23 18:32 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41bd1647-2bff-479c-9994-984d7fae5dc4@nxp.com \
--to=victor.liu@nxp.com \
--cc=Frank.li@nxp.com \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox