Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Igor Paunovic" <royalnet026@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] accel/rocket: restore the NPU clock boot rate before powering the cores down
Date: Tue, 22 Sep 2026 08:13:26 +0000	[thread overview]
Message-ID: <20260922081326.B46651F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922080114.44662-9-royalnet026@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] kexec: missing hardware quiesce and DMA halt in rocket_shutdown
--

commit a41629401e441e7353babe8449ad03dc39082ce0
Author: Igor Paunovic <royalnet026@gmail.com>

accel/rocket: restore the NPU clock boot rate before powering the cores down

This commit records the initial NPU clock rate at probe and restores it during
runtime suspend when the last core goes away. It also introduces a shutdown
hook to restore the rate before system reboot or kexec, ensuring the hardware
does not fault when the domain is subsequently powered back on.

> diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c
> --- a/drivers/accel/rocket/rocket_drv.c
> +++ b/drivers/accel/rocket/rocket_drv.c
[ ... ]
> +/*
> + * A kexec hands the next kernel whatever rate is set here, and that kernel
> + * will power the islands up before it looks at the clock.
> + */
> +static void rocket_shutdown(struct platform_device *pdev)
> +{
> +	struct rocket_device *rdev = dev_get_drvdata(&pdev->dev);
> +	int core;
> +
> +	if (!rdev)
> +		return;
> +
> +	core = find_core_for_dev(&pdev->dev);
> +	if (core >= 0)
> +		rocket_npu_restore_boot_rate(&rdev->cores[core]);

[Severity: High]
Does this code leave the hardware executing active jobs and performing DMA?

If the system reboots or executes a kexec while the NPU is actively
executing a job, lowering the clock rate here does not halt the hardware or
stop active jobs. Because this is a platform device, there is no automatic
bus-master clearing.

Can this lead to the NPU continuing to perform asynchronous DMA into memory
while the new kernel boots, potentially causing memory corruption or fatal
bus faults?

Should the driver explicitly halt jobs, mask DMA, and reset the core (for
example, via rocket_core_reset) before returning from this shutdown hook?

> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922080114.44662-1-royalnet026@gmail.com?part=8

  reply	other threads:[~2026-09-22  8:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  8:01 [PATCH v2 00/11] accel/rocket: DVFS for the RK3588 NPU Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 01/11] accel/rocket: search every core slot when a core is removed Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 02/11] accel/rocket: number the cores by devicetree position, not bind order Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 03/11] accel/rocket: search every core slot when looking up a scheduler Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 04/11] accel/rocket: keep core slots stable across unbind and rebind Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 05/11] accel/rocket: request the core clocks by name Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 06/11] dt-bindings: npu: rockchip: allow DVFS and thermal properties Igor Paunovic
2026-09-22 16:06   ` Rob Herring
2026-09-23  8:57     ` Igor Paunovic
2026-09-23  9:15       ` Diederik de Haas
2026-09-23  9:43         ` Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 07/11] arm64: dts: rockchip: rk3588: add an OPP table for the NPU Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 08/11] accel/rocket: restore the NPU clock boot rate before powering the cores down Igor Paunovic
2026-09-22  8:13   ` sashiko-bot [this message]
2026-09-22  8:55     ` Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 09/11] accel/rocket: add devfreq support Igor Paunovic
2026-09-22  8:18   ` sashiko-bot
2026-09-22  8:56     ` Igor Paunovic
2026-09-23 13:14   ` Sidong Yang
2026-09-23 14:26     ` Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 10/11] accel/rocket: register a devfreq cooling device Igor Paunovic
2026-09-22  8:01 ` [PATCH v2 11/11] arm64: dts: rockchip: rk3588: add passive cooling to the NPU thermal zone Igor Paunovic
2026-09-23 19:29 ` [PATCH v2 00/11] accel/rocket: DVFS for the RK3588 NPU Nicolas Dufresne
2026-09-23 19:54   ` Igor Paunovic
2026-09-24  5:37   ` Tomeu Vizoso
2026-09-24  7:36     ` Igor Paunovic

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=20260922081326.B46651F000FF@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=royalnet026@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox