From: sashiko-bot@kernel.org
To: "Ryan Chen" <ryan_chen@aspeedtech.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 6/9] EDAC/aspeed: Replace regmap with direct register access
Date: Wed, 07 Oct 2026 06:22:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-162667@kernel.org> (raw)
In-Reply-To: <20261007-edac-v5-6-5c31fc5df4cf@aspeedtech.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] cleanup: mixing goto-based error handling with cleanup helpers
--
commit deee611aba8be1433a92290de22d7d73ee5ad14d
Author: Ryan Chen <ryan_chen@aspeedtech.com>
EDAC/aspeed: Replace regmap with direct register access
This commit replaces the driver's regmap implementation with direct readl()
and writel() accesses protected by an explicit raw spinlock. It also adds
context analysis annotations to ensure hardware register accesses are
properly locked.
> diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> index 610da8aa2a228..124e8a39eaaba 100644
> --- a/drivers/edac/aspeed_edac.c
> +++ b/drivers/edac/aspeed_edac.c
[ ... ]
> @@ -276,13 +248,11 @@ static int aspeed_probe(struct platform_device *pdev)
> if (IS_ERR(regs))
> return PTR_ERR(regs);
>
> - aspeed_regmap = devm_regmap_init(dev, NULL, (__force void *)regs,
> - &aspeed_regmap_config);
> - if (IS_ERR(aspeed_regmap))
> - return PTR_ERR(aspeed_regmap);
> + scoped_guard(raw_spinlock_irqsave, &aspeed_lock)
> + aspeed_regs = regs;
>
> /* bail out if ECC mode is not configured */
> - regmap_read(aspeed_regmap, ASPEED_MCR_CONF, ®04);
> + reg04 = readl(regs + ASPEED_MCR_CONF);
[ ... ]
> rc = init_csrows(mci);
> if (rc) {
> dev_err(&pdev->dev, "failed to init csrows\n");
> goto probe_exit02;
[Severity: Medium]
The aspeed_probe() function introduces a scope-based cleanup helper earlier
in the function with scoped_guard(), but continues to use legacy goto-based
error handling here and in other error paths.
The kernel cleanup subsystem guidelines specify that usage of goto and
cleanup helpers should not be mixed in the same function to prevent confusing
ownership semantics and LIFO ordering bugs.
Would it be possible to convert all resources in this routine to scope-based
cleanups (for example, using __free() for the EDAC MC data structure), or
alternatively, rely entirely on the existing goto-based error paths and skip
using scoped_guard() in this specific function?
> }
>
> platform_set_drvdata(pdev, mci);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261007-edac-v5-0-5c31fc5df4cf@aspeedtech.com?part=6
next prev parent reply other threads:[~2026-10-07 6:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 6:13 [PATCH v5 0/9] Add Aspeed AST2700 SDRAM EDAC support Ryan Chen
2026-10-07 6:13 ` [PATCH v5 1/9] EDAC/aspeed: Set the DIMM grain Ryan Chen
2026-10-07 6:13 ` [PATCH v5 2/9] EDAC/aspeed: Free the interrupt before the mem_ctl_info on remove Ryan Chen
2026-10-07 6:13 ` [PATCH v5 3/9] EDAC/aspeed: Clean up whitespace and include ordering Ryan Chen
2026-10-07 6:13 ` [PATCH v5 4/9] EDAC/aspeed: Free the mem_ctl_info unconditionally on remove Ryan Chen
2026-10-07 6:13 ` [PATCH v5 5/9] dt-bindings: edac: aspeed: Add AST2700 SDRAM EDAC Ryan Chen
2026-10-07 6:13 ` [PATCH v5 6/9] EDAC/aspeed: Replace regmap with direct register access Ryan Chen
2026-10-07 6:22 ` sashiko-bot [this message]
2026-10-07 6:13 ` [PATCH v5 7/9] EDAC/aspeed: Abstract SoC differences behind chip data Ryan Chen
2026-10-07 6:13 ` [PATCH v5 8/9] EDAC/aspeed: Add AST2700 support Ryan Chen
2026-10-07 6:13 ` [PATCH v5 9/9] MAINTAINERS: Step down as Aspeed AST2500 EDAC driver maintainer Ryan Chen
2026-10-07 20:32 ` Rob Herring (Arm)
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-162667@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=ryan_chen@aspeedtech.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