Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ryan Chen" <ryan_chen@aspeedtech.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 6/8] EDAC/aspeed: Replace regmap with direct register access
Date: Mon, 24 Aug 2026 02:57:40 +0000	[thread overview]
Message-ID: <20260824025741.344181F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824-edac-v2-6-c8d8bb693586@aspeedtech.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Mixing scope-based cleanup helpers with traditional goto-based error handling within the same function.
--

--- Patch [6]: [PATCH v2 6/8] EDAC/aspeed: Replace regmap with direct register access ---
commit 707abf914ceaccc2e73503abf17a6380b0fc949b
Author: Ryan Chen <ryan_chen@aspeedtech.com>

EDAC/aspeed: Replace regmap with direct register access

The driver instantiates its own regmap purely as an MMIO wrapper: it has
no register cache, uses custom .reg_read()/.reg_write() callbacks, and is
not shared as a syscon with other drivers. So it brings nothing here
beyond the spinlock that regmap takes around each access when fast_io is
set.

> 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]
Is it okay to mix scoped_guard() with goto-based error handling in this
function?

According to include/linux/cleanup.h, the expectation is that usage of goto
and cleanup helpers should not be mixed in the same function.

In aspeed_probe(), we introduce scoped_guard() here, but the function still
has goto probe_exit01 and goto probe_exit02 later on:

aspeed_probe() {
    ...
    scoped_guard(raw_spinlock_irqsave, &aspeed_lock)
        aspeed_regs = regs;
    ...
    rc = init_csrows(mci);
    if (rc) {
        dev_err(&pdev->dev, "failed to init csrows\n");
        goto probe_exit02;
    }
    ...
probe_exit01:
    edac_mc_del_mc(&pdev->dev);
probe_exit02:
    edac_mc_free(mci);
    ...
}

Should the remaining error paths be converted to scope-based cleanups, or
would it be better to avoid using scope-based cleanup helpers here?

>  
>  	/* bail out if ECC mode is not configured */
> -	regmap_read(aspeed_regmap, ASPEED_MCR_CONF, &reg04);
> +	reg04 = readl(regs + ASPEED_MCR_CONF);
>  	if (!(reg04 & ASPEED_MCR_CONF_ECC)) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-edac-v2-0-c8d8bb693586@aspeedtech.com?part=6

  reply	other threads:[~2026-08-24  2:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24  2:42 [PATCH v2 0/8] Add Aspeed AST2700 SDRAM EDAC support Ryan Chen
2026-08-24  2:42 ` [PATCH v2 1/8] dt-bindings: edac: aspeed: Add AST2700 SDRAM EDAC Ryan Chen
2026-08-24  2:42 ` [PATCH v2 2/8] EDAC/aspeed: Set the DIMM grain Ryan Chen
2026-08-24  2:42 ` [PATCH v2 3/8] EDAC/aspeed: Free the interrupt before the mem_ctl_info on remove Ryan Chen
2026-08-24  2:42 ` [PATCH v2 4/8] EDAC/aspeed: Clean up whitespace and include ordering Ryan Chen
2026-08-24  2:42 ` [PATCH v2 5/8] EDAC/aspeed: Free the mem_ctl_info unconditionally on remove Ryan Chen
2026-08-24  2:42 ` [PATCH v2 6/8] EDAC/aspeed: Replace regmap with direct register access Ryan Chen
2026-08-24  2:57   ` sashiko-bot [this message]
2026-08-27  6:22     ` Ryan Chen
2026-08-24  2:42 ` [PATCH v2 7/8] EDAC/aspeed: Abstract SoC differences behind chip data Ryan Chen
2026-08-24  2:42 ` [PATCH v2 8/8] EDAC/aspeed: Add AST2700 support Ryan Chen
2026-08-24  2:54   ` sashiko-bot
2026-08-27  6:24     ` 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=20260824025741.344181F000E9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox