From: sashiko-bot@kernel.org
To: "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 09/10] drm/tidss: Drop WARN_ON() from tidss_runtime_put()
Date: Thu, 03 Sep 2026 12:23:46 +0000 [thread overview]
Message-ID: <20260903122346.E82EE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260903-tidss-pre-beagley-v1-9-93928baa8b12@ideasonboard.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Callers of `tidss_runtime_get()` ignore its return value, proceeding to access hardware even if the device fails to resume.
- [High] Pending asynchronous suspend is cancelled by `pm_runtime_disable()` during device removal, leaving hardware powered on.
--
commit 1177f415f04c015bad856d54b014b7b1a387e7b9
Author: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drm/tidss: Drop WARN_ON() from tidss_runtime_put()
This commit removes the WARN_ON() check for the return value of
pm_runtime_put_autosuspend() in tidss_runtime_put(). The change is made to
avoid spurious warnings when an OLDI auxiliary device is active, which
legitimately causes the autosuspend to return -EBUSY due to a non-zero
child count.
> diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
> index 5cb3e746aeb37..44b0b009c29a9 100644
> --- a/drivers/gpu/drm/tidss/tidss_drv.c
> +++ b/drivers/gpu/drm/tidss/tidss_drv.c
> @@ -40,10 +40,7 @@ int tidss_runtime_get(struct tidss_device *tidss)
>
> void tidss_runtime_put(struct tidss_device *tidss)
> {
[Severity: High]
This isn't a bug introduced by this patch, but since we are modifying the PM
handling here, is it safe for callers of tidss_runtime_get() to ignore its
return value?
If pm_runtime_resume_and_get() fails (e.g., due to power domain or clock
issues), the error is ignored, and the driver immediately accesses display
hardware registers which could cause a kernel panic (synchronous external
abort).
For example, in tidss_crtc_atomic_enable():
drivers/gpu/drm/tidss/tidss_crtc.c:tidss_crtc_atomic_enable() {
...
tidss_runtime_get(tidss);
r = dispc_vp_set_clk_rate(tidss->dispc, tcrtc->hw_videoport,
mode->crtc_clock * 1000);
...
}
The same happens in tidss_atomic_commit_tail() and tidss_crtc_enable_vblank().
Should these callers check the return value of tidss_runtime_get() before
proceeding to access hardware?
> - int r;
> -
> - r = pm_runtime_put_autosuspend(tidss->dev);
> - WARN_ON(r < 0);
> + pm_runtime_put_autosuspend(tidss->dev);
> }
[Severity: High]
This is a pre-existing issue, but does tidss_remove() safely handle the
asynchronous suspend scheduled here?
During module unload, tidss_remove() calls drm_atomic_helper_shutdown(),
which queues an async suspend via tidss_runtime_put(). Immediately after,
it calls pm_runtime_disable():
drivers/gpu/drm/tidss/tidss_drv.c:tidss_remove() {
...
drm_atomic_helper_shutdown(ddev);
...
pm_runtime_dont_use_autosuspend(dev);
pm_runtime_disable(dev);
...
}
Calling pm_runtime_disable() cancels the pending autosuspend timer. Does this
leave the hardware powered on after driver removal, causing a power leak and
leaving the PM core state machine in RPM_ACTIVE?
If the device is left in RPM_ACTIVE, could its parent power domain be pinned
active forever, preventing the entire SoC from entering deep sleep states?
Should this teardown sequence ensure the device is synchronously suspended
before disabling runtime PM?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260903-tidss-pre-beagley-v1-0-93928baa8b12@ideasonboard.com?part=9
next prev parent reply other threads:[~2026-09-03 12:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 12:09 [PATCH 00/10] drm/tidss: Preparation for AM62P and BeagleY-AI display support Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 01/10] dt-bindings: display: ti: Move ti,am62l-dss binding to a new binding file Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 02/10] dt-bindings: display: ti,am65x-dss: Simplify binding Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 03/10] dt-bindings: display: ti,am625-oldi: Add optional power-domain for OLDI Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 04/10] drm/tidss: Remove extra pm_runtime_mark_last_busy Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 05/10] drm/tidss: oldi: Remove define for unused register OLDI_LB_CTRL Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 06/10] drm/tidss: Add mechanism to detect DPI output Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 07/10] drm/tidss: Add support for DPIENABLE bit Tomi Valkeinen
2026-09-03 12:09 ` [PATCH 08/10] drm/tidss: oldi: Fix OLDI signal polarities Tomi Valkeinen
2026-09-03 12:21 ` sashiko-bot
2026-09-03 12:09 ` [PATCH 09/10] drm/tidss: Drop WARN_ON() from tidss_runtime_put() Tomi Valkeinen
2026-09-03 12:23 ` sashiko-bot [this message]
2026-09-03 12:10 ` [PATCH 10/10] drm/tidss: oldi: Fix missing of_node_put()s in error paths Tomi Valkeinen
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=20260903122346.E82EE1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tomi.valkeinen@ideasonboard.com \
/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