From: sashiko-bot@kernel.org
To: "Ryan Chen" <ryan_chen@aspeedtech.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 6/9] EDAC/aspeed: Replace regmap with direct register access
Date: Wed, 16 Sep 2026 05:40:10 +0000 [thread overview]
Message-ID: <20260916054010.AADE81F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916-edac-v3-6-23e9ed2fbdf9@aspeedtech.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] cleanup: mixing goto and scoped_guard() in aspeed_probe()
--
commit c14b25ad0230e696e88f285c08700b9c02f83c19
Author: Ryan Chen <ryan_chen@aspeedtech.com>
EDAC/aspeed: Replace regmap with direct register access
This commit replaces the regmap-based MMIO access in the aspeed-edac driver
with direct register access using readl()/writel(). It introduces an
explicit raw spinlock and annotates the register base with __guarded_by()
to allow compiler-based context analysis checks.
> diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> index 352910e1defc5..26d2c456cc0d6 100644
> --- a/drivers/edac/aspeed_edac.c
> +++ b/drivers/edac/aspeed_edac.c
[ ... ]
> @@ -274,13 +246,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;
[Severity: Low]
Does this mix scope-based cleanup helpers with goto-based error handling in
the same function? The subsystem cleanup guidelines explicitly forbid mixing
goto-based error handling with scope-based cleanup helpers (like
scoped_guard) to prevent ownership confusion and leaks.
Looking further down in aspeed_probe(), the function still relies on goto
for error cleanup:
> - /* bail out if ECC mode is not configured */
> - regmap_read(aspeed_regmap, ASPEED_MCR_CONF, ®04);
> + reg04 = readl(regs + ASPEED_MCR_CONF);
[ ... ]
> /* register interrupt handler and enable interrupts */
> rc = config_irq(mci, pdev);
> if (rc) {
> dev_err(&pdev->dev, "failed setting up irq\n");
> goto probe_exit01;
> }
>
> return 0;
>
> probe_exit01:
> edac_mc_del_mc(&pdev->dev);
> probe_exit02:
> edac_mc_free(mci);
> return rc;
> }
Should this function either be completely converted to scope-based cleanup,
or stick entirely to goto-based cleanup to avoid this pattern violation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-edac-v3-0-23e9ed2fbdf9@aspeedtech.com?part=6
next prev parent reply other threads:[~2026-09-16 5:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 5:30 [PATCH v3 0/9] Add Aspeed AST2700 SDRAM EDAC support Ryan Chen
2026-09-16 5:30 ` [PATCH v3 1/9] dt-bindings: edac: aspeed: Add AST2700 SDRAM EDAC Ryan Chen
2026-09-16 5:30 ` [PATCH v3 2/9] EDAC/aspeed: Set the DIMM grain Ryan Chen
2026-09-25 5:45 ` Borislav Petkov
2026-09-29 6:59 ` Ryan Chen
2026-09-16 5:30 ` [PATCH v3 3/9] EDAC/aspeed: Free the interrupt before the mem_ctl_info on remove Ryan Chen
2026-09-16 5:30 ` [PATCH v3 4/9] EDAC/aspeed: Clean up whitespace and include ordering Ryan Chen
2026-09-16 5:30 ` [PATCH v3 5/9] EDAC/aspeed: Free the mem_ctl_info unconditionally on remove Ryan Chen
2026-09-16 5:30 ` [PATCH v3 6/9] EDAC/aspeed: Replace regmap with direct register access Ryan Chen
2026-09-16 5:40 ` sashiko-bot [this message]
2026-09-16 5:46 ` Ryan Chen
2026-09-16 5:30 ` [PATCH v3 7/9] EDAC/aspeed: Abstract SoC differences behind chip data Ryan Chen
2026-09-16 5:30 ` [PATCH v3 8/9] EDAC/aspeed: Add AST2700 support Ryan Chen
2026-09-16 5:30 ` [PATCH v3 9/9] MAINTAINERS: Add a reviewer for the Aspeed EDAC driver Ryan Chen
2026-09-22 2:53 ` [PATCH v3 0/9] Add Aspeed AST2700 SDRAM EDAC support Ryan Chen
2026-09-22 3:19 ` Borislav Petkov
2026-09-22 5:25 ` Ryan Chen
2026-09-25 5:44 ` Borislav Petkov
2026-09-29 3:26 ` Ryan Chen
2026-09-29 3:31 ` Borislav Petkov
2026-09-29 5:28 ` Ryan Chen
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=20260916054010.AADE81F000FF@smtp.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 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.