From: sashiko-bot@kernel.org
To: "Linus Walleij" <linusw@kernel.org>
Cc: Frank.Li@kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, conor+dt@kernel.org,
dmaengine@vger.kernel.org, robh@kernel.org, vkoul@kernel.org
Subject: Re: [PATCH v3 15/18] dmaengine: ste_dma40: Use power domain for LCLA SRAM
Date: Sun, 20 Sep 2026 23:03:17 +0000 [thread overview]
Message-ID: <20260920230317.B8B731F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921-ux500-power-domains-v7-1-v3-15-9352be6b86b1@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] dmaengine: ste_dma40: pm_runtime_resume_and_get() sleeps in atomic context
- [Medium] dmaengine: ste_dma40: unnecessary LCLA SRAM power domain wakeup for physical channels
--
commit 711af1477e65e64325b0b0970b88c4b5d746ee74
Author: Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Use power domain for LCLA SRAM
This patch replaces the LCLA ESRAM regulator with runtime PM handling.
It adds a reference to the SRAM device that owns the ESRAM34 power domain
and holds that domain during descriptor preparation while transfers are
active.
> diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
> index eda3f91741ed5..2841af5b160b8 100644
> --- a/drivers/dma/ste_dma40.c
> +++ b/drivers/dma/ste_dma40.c
[ ... ]
> @@ -628,6 +632,36 @@ static struct device *chan2dev(struct d40_chan *d40c)
> return &d40c->chan.dev->device;
> }
>
> +static void d40_transfer_runtime_get(struct d40_base *base)
> +{
> + pm_runtime_get_sync(base->dev);
> +}
> +
> +static int d40_lcla_runtime_get(struct d40_base *base)
> +{
> + if (!base->lcla_dev)
> + return 0;
> +
> + return pm_runtime_resume_and_get(base->lcla_dev);
[Severity: High]
Does this sleep in atomic context?
When d40_prep_sg() in drivers/dma/ste_dma40.c prepares a transfer, it calls
d40_lcla_runtime_get(), which invokes pm_runtime_resume_and_get() here.
DMA clients can call dmaengine_prep_slave_sg() or dmaengine_prep_dma_cyclic()
while holding a spinlock or from an interrupt handler. Since lcla_dev is an
external platform device and is not marked pm_runtime_irq_safe(), the PM
core's rpm_resume() will attempt to sleep waiting for the power domain.
Could this cause a scheduling while atomic panic when clients prepare DMA
from an atomic context?
> +}
> +
> +static void d40_desc_lcla_runtime_put(struct d40_chan *d40c,
[ ... ]
> @@ -2246,6 +2283,7 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
> dma_addr_t dst_dev_addr;
> struct d40_desc *desc;
> unsigned long flags;
> + bool got_lcla_pm = false;
> int ret;
>
> if (!chan->phy_chan) {
> @@ -2255,11 +2293,20 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
>
> d40_set_runtime_config_write(dchan, &chan->slave_config, direction);
>
> + ret = d40_lcla_runtime_get(chan->base);
[Severity: Medium]
Could this unnecessarily activate the LCLA SRAM power domain for physical
channels?
In drivers/dma/ste_dma40.c, d40_prep_sg() unconditionally resumes the
domain here before checking if the channel is logical or physical. Since
physical channels map directly to hardware registers and do not use the
LCLA SRAM, does this unnecessarily keep the power domain active and
introduce wakeup latency for physical channels?
> + if (ret) {
> + chan_err(chan, "Failed to enable LCLA power domain\n");
> + return NULL;
> + }
> + got_lcla_pm = !!chan->base->lcla_dev;
> +
> spin_lock_irqsave(&chan->lock, flags);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-ux500-power-domains-v7-1-v3-0-9352be6b86b1@kernel.org?part=15
next prev parent reply other threads:[~2026-09-20 23:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 22:48 [PATCH v3 00/18] pmdomain: st: ux500: Implement ux500 power domains Linus Walleij
2026-09-20 22:48 ` [PATCH v3 01/18] dt-bindings: power: Convert Ux500 PM domains to schema Linus Walleij
2026-09-28 5:37 ` Krzysztof Kozlowski
2026-09-20 22:48 ` [PATCH v3 02/18] dt-bindings: arm: ux500: Drop NR_DOMAINS Linus Walleij
2026-09-20 22:48 ` [PATCH v3 03/18] dt-bindings: arm: Add the actual power domains on U8500 Linus Walleij
2026-09-20 22:48 ` [PATCH v3 04/18] dt-bindings: mfd: db8500-prcmu: Deprecate EPOD regulators Linus Walleij
2026-09-20 22:48 ` [PATCH v3 05/18] dt-bindings: display: ste,mcde: Allow power domains Linus Walleij
2026-09-20 22:48 ` [PATCH v3 06/18] pmdomain: st: ux500: Implement more " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 07/18] ARM: dts: ux500: Rename power domains node Linus Walleij
2026-09-20 22:48 ` [PATCH v3 08/18] dt-bindings: clock: stericsson,u8500-clks: Allow power domains Linus Walleij
2026-09-20 22:48 ` [PATCH v3 09/18] dt-bindings: timer: arm,twd-timer: " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 10/18] dt-bindings: watchdog: arm,twd-wdt: " Linus Walleij
2026-09-20 22:48 ` [PATCH v3 11/18] ARM: dts: ux500: Add " Linus Walleij
2026-09-20 23:04 ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 12/18] pmdomain: st: ux500: Control DB8500 EPODs Linus Walleij
2026-09-20 23:04 ` sashiko-bot
2026-09-24 13:44 ` Ulf Hansson
2026-09-20 22:48 ` [PATCH v3 13/18] drm/mcde: Use power domain for display power Linus Walleij
2026-09-20 22:58 ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 14/18] misc: sram: Enable runtime PM Linus Walleij
2026-09-20 23:02 ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 15/18] dmaengine: ste_dma40: Use power domain for LCLA SRAM Linus Walleij
2026-09-20 23:03 ` sashiko-bot [this message]
2026-09-21 16:36 ` Frank Li
2026-09-24 13:26 ` Ulf Hansson
2026-09-30 20:15 ` Frank Li
2026-10-06 13:21 ` Vinod Koul
2026-09-20 22:48 ` [PATCH v3 16/18] mfd/regulator: db8500-prcmu: Remove EPOD regulators Linus Walleij
2026-09-20 22:48 ` [PATCH v3 17/18] dt-bindings: display: ste,mcde: Deprecate EPOD supply Linus Walleij
2026-09-20 23:00 ` sashiko-bot
2026-09-20 22:48 ` [PATCH v3 18/18] ARM: dts: ux500: Remove DB8500 EPOD regulators Linus Walleij
2026-09-20 23:05 ` sashiko-bot
2026-09-21 7:06 ` Linus Walleij
2026-10-06 10:30 ` [PATCH v3 00/18] pmdomain: st: ux500: Implement ux500 power domains 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=20260920230317.B8B731F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linusw@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/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