All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linus Walleij" <linusw@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/mcde: Use power domain for display power
Date: Sun, 15 Nov 2026 18:30:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-215719@kernel.org> (raw)
In-Reply-To: <20261115-ux500-drm-mcde-powerdomain-v1-1-afdc326cceb7@kernel.org>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/mcde: TOCTOU race in mcde_clk_div_recalc_rate() [1]
--

commit b6626239eb4624a10d2245cb12fab62bbafe702d
Author: Linus Walleij <linusw@kernel.org>

drm/mcde: Use power domain for display power

This commit replaces explicit EPOD regulator handling in the MCDE DRM
driver with runtime PM calls while keeping the separate VANA analog supply
enabled during driver binding.

> diff --git a/drivers/gpu/drm/mcde/mcde_clk_div.c b/drivers/gpu/drm/mcde/mcde_clk_div.c
> index 8c5af2677357f..1a22e6233946c 100644
> --- a/drivers/gpu/drm/mcde/mcde_clk_div.c
> +++ b/drivers/gpu/drm/mcde/mcde_clk_div.c
> @@ -1,7 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include <linux/clk-provider.h>
>  #include <linux/io.h>
> -#include <linux/regulator/consumer.h>
> +#include <linux/pm_runtime.h>
>  
>  #include "mcde_drm.h"
>  #include "mcde_display_regs.h"
> @@ -95,7 +95,7 @@ static unsigned long mcde_clk_div_recalc_rate(struct clk_hw *hw,
>  	 * It will come up with 0 in the divider register bits, which
>  	 * means "divide by 2".
>  	 */
> -	if (!regulator_is_enabled(mcde->epod))
> +	if (!pm_runtime_active(mcde->dev))
>  		return DIV_ROUND_UP_ULL(prate, 2);
>  
>  	cr = readl(mcde->regs + cdiv->cr);

[Severity: High]
This problem wasn't introduced by this patch, but can mcde->dev runtime-suspend [1] between pm_runtime_active() and readl()?

pm_runtime_active() does not take a runtime PM reference, so a concurrent
suspend can power down the MCDE block before the register read completes:

CPU0                                  CPU1
mcde_clk_div_recalc_rate()
  pm_runtime_active(mcde->dev)
                                      pm_runtime_put_sync_suspend(mcde->dev)
  readl(mcde->regs + cdiv->cr)  <-- unpowered MMIO access

Reading MCDE registers while the power domain is off causes an unhandled
hardware fault.  Using pm_runtime_get_if_in_use() and dropping the
reference after readl() would keep the domain powered across the register
read.

[1] https://sashiko.dev/#/bug/linux-29030bde-9a9e-4287-978a-034b8c472d84

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-ux500-drm-mcde-powerdomain-v1-1-afdc326cceb7@kernel.org?part=1

  reply	other threads:[~2026-11-15 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 18:10 [PATCH] drm/mcde: Use power domain for display power Linus Walleij
2026-11-15 18:30 ` sashiko-bot [this message]
2026-11-15 22:44   ` Linus Walleij

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=sashiko-outbox-215719@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linusw@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.