Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Santhosh Kumar K" <s-k6@ti.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] memory: ti-k3-fsas: Add TI FSS_FSAS driver
Date: Mon, 29 Jun 2026 07:32:22 +0000	[thread overview]
Message-ID: <20260629073223.6CDAE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629072055.896322-3-s-k6@ti.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] Missing PM Runtime integration causes bus faults and silent state loss.
- [Critical] Lack of probe ordering guarantees between the FSAS wrapper and the OSPI driver risks DMA corruption.
--

commit d3b703966890d77f64fc1cc0139d8a00699e6a78
Author: Santhosh Kumar K <s-k6@ti.com>

memory: ti-k3-fsas: Add TI FSS_FSAS driver

This patch adds a platform driver for the TI Flash SubSystem Application
Subsystem in K3 SoCs. It configures the SYSCONFIG register to disable OSPI
XIP prefetch, preventing DMA data corruption.

> diff --git a/drivers/memory/ti-k3-fsas.c b/drivers/memory/ti-k3-fsas.c
> new file mode 100644
> index 0000000000000..a5f42afc694c5
> --- /dev/null
> +++ b/drivers/memory/ti-k3-fsas.c
[ ... ]
> +static int k3_fsas_probe(struct platform_device *pdev)
> +{
> +	struct k3_fsas *fsas;
> +
> +	fsas = devm_kzalloc(&pdev->dev, sizeof(*fsas), GFP_KERNEL);
> +	if (!fsas)
> +		return -ENOMEM;
> +
> +	fsas->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(fsas->base))
> +		return PTR_ERR(fsas->base);
> +
> +	platform_set_drvdata(pdev, fsas);
> +
> +	k3_fsas_disable_xip_prefetch(fsas);

[Severity: Critical]
Is it possible for the device to be unpowered when accessing the registers
here? 

Accessing fsas->base without first calling pm_runtime_enable() and
pm_runtime_get_sync() could cause a synchronous external abort on K3 SoCs.

[Severity: Critical]
Is there anything guaranteeing this probe finishes before the main OSPI
controller probes?

If the OSPI driver (cadence-quadspi) probes and initiates DMA transfers
before this independent platform driver runs, the transfers could occur with
XIP prefetch enabled, corrupting the data.

> +
> +	return 0;
> +}
> +
> +static int k3_fsas_resume(struct device *dev)
> +{
> +	k3_fsas_disable_xip_prefetch(dev_get_drvdata(dev));
> +	return 0;
> +}
> +
> +static DEFINE_SIMPLE_DEV_PM_OPS(k3_fsas_pm_ops, NULL, k3_fsas_resume);

[Severity: Critical]
Will the hardware state be lost during runtime suspend?

By using DEFINE_SIMPLE_DEV_PM_OPS without runtime PM callbacks, if the
domain goes into runtime suspend (e.g. when the OSPI controller is idle),
the hardware state could reset. 

Because there are no runtime_resume callbacks, the FSAS_SYSCONFIG_DISXIP
bit will remain lost. The OSPI controller could then perform subsequent DMA
transfers with XIP prefetch enabled, causing silent data corruption.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260629072055.896322-1-s-k6@ti.com?part=2

  reply	other threads:[~2026-06-29  7:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  7:20 [PATCH v2 0/2] Fix OSPI DMA corruption via FSS_FSAS driver Santhosh Kumar K
2026-06-29  7:20 ` [PATCH v2 1/2] dt-bindings: memory: Add TI FSS_FSAS binding Santhosh Kumar K
2026-07-02 16:33   ` Rob Herring (Arm)
2026-06-29  7:20 ` [PATCH v2 2/2] memory: ti-k3-fsas: Add TI FSS_FSAS driver Santhosh Kumar K
2026-06-29  7:32   ` sashiko-bot [this message]
2026-06-30  7:13 ` [PATCH v2 0/2] Fix OSPI DMA corruption via " Krzysztof Kozlowski

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=20260629073223.6CDAE1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s-k6@ti.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