All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rustam Adilov" <adilov@disroot.org>, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [RFC PATCH net-next 2/6] net: dsa: realtek: add new mmio interface for drivers
Date: Sat, 05 Dec 2026 18:29:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-251793@kernel.org> (raw)
In-Reply-To: <20261204182553.33952-3-adilov@disroot.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] net: dsa: realtek: typo ev_err in rtl83xx_probe() breaks
  compilation
- [Medium] net: dsa: realtek: syscon_node_to_regmap() conflicts with
  reset_ctl
--

commit a99121781fa35662391557be96c8afc97592c136
Author: Rustam Adilov <adilov@disroot.org>

net: dsa: realtek: add new mmio interface for drivers

This commit adds a platform driver interface for MMIO-connected Realtek
switches using syscon to obtain the regmap, and updates rtl83xx_probe()
to support syscon-backed regmaps.

> diff --git a/drivers/net/dsa/realtek/rtl83xx.c b/drivers/net/dsa/realtek/rtl83xx.c
> index ad42c05d0a88d..f8b8d16003a93 100644
> --- a/drivers/net/dsa/realtek/rtl83xx.c
> +++ b/drivers/net/dsa/realtek/rtl83xx.c

[ ... ]

> @@ -189,20 +188,29 @@ rtl83xx_probe(struct device *dev,
>  	if (ret)
>  		return ERR_PTR(ret);
>  
> -	rc.lock_arg = priv;
> -	priv->map = devm_regmap_init(dev, NULL, priv, &rc);
> -	if (IS_ERR(priv->map)) {
> -		ret = PTR_ERR(priv->map);
> -		dev_err(dev, "regmap init failed: %d\n", ret);
> -		return ERR_PTR(ret);
> -	}
> +	if (interface_info->syscon) {
> +		priv->map = syscon_node_to_regmap(dev->of_node);
> +		if (IS_ERR(priv->map))
> +			return dev_err_cast_probe(dev, priv->map,
> +						  "regmap init failed\n");

[Severity: Medium]
Can this syscon_node_to_regmap() call conflict with priv->reset_ctl later
in rtl83xx_probe()?

When a syscon-compatible MMIO switch DT node defines a resets property,
syscon_node_to_regmap() -> of_syscon_register() acquires the reset line
via of_reset_control_get_optional_exclusive() and keeps it held.  Later in
rtl83xx_probe(), devm_reset_control_get_optional() requests the same
exclusive reset control again, which triggers WARN_ON(!rstc->shared ||
!shared) in __reset_control_get_internal() and fails probe with -EBUSY.

of_syscon_register() also deasserts the reset immediately, which happens
before rtl83xx_probe() enables var->supplies.

> +	} else {
> +		rc.reg_read = interface_info->reg_read;
> +		rc.reg_write = interface_info->reg_write;
> +		rc.lock_arg = priv;
> +		priv->map = devm_regmap_init(dev, NULL, priv, &rc);
> +		if (IS_ERR(priv->map)) {
> +			ret = PTR_ERR(priv->map);
> +			ev_err(dev, "regmap init failed: %d\n", ret);
> +			return ERR_PTR(ret);
> +		}

[Severity: High]
Typo: ev_err() should be dev_err().  This breaks compilation whenever
CONFIG_NET_DSA_REALTEK is enabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204182553.33952-1-adilov@disroot.org?part=2

  reply	other threads:[~2026-12-05 18:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 18:25 [RFC PATCH net-next 0/6] net: dsa: realtek: add support for RTL9607C switch Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 1/6] net: dsa: tag_rtl8_4: add support for RTL9607C tag variant Rustam Adilov
2026-12-05 18:29   ` sashiko-bot
2026-12-04 18:25 ` [RFC PATCH net-next 2/6] net: dsa: realtek: add new mmio interface for drivers Rustam Adilov
2026-12-05 18:29   ` sashiko-bot [this message]
2026-12-04 18:25 ` [RFC PATCH net-next 3/6] dt-bindings: net: dsa: realtek: add new rtl9607c switch compatible Rustam Adilov
2026-12-05 18:29   ` sashiko-bot
2026-12-04 18:25 ` [RFC PATCH net-next 4/6] net: dsa: realtek: add support for RTL9607C switch Rustam Adilov
2026-12-05 18:29   ` sashiko-bot
2026-12-04 18:25 ` [RFC PATCH net-next 5/6] net: phy: realtek: use mdio.addr instead of 0 in rtlgen_read/write_vend2 Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 6/6] net: phy: realtek: add support for RTL9607C internal PHYs Rustam Adilov
2026-12-05 18:29   ` sashiko-bot

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-251793@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=adilov@disroot.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --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.