All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v15 5/5] clk: en7523: add support for Airoha AN7583 clock
Date: Sat, 21 Nov 2026 21:33:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-227407@kernel.org> (raw)
In-Reply-To: <20261121212738.170775-6-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] clk: en7523: AN7583 MDIO clocks lack rate ops in
  en7581_register_clocks()
--

commit 5161709c892ed291b31ad266a1982ac038057eb0
Author: Christian Marangi <ansuelsmth@gmail.com>

clk: en7523: add support for Airoha AN7583 clock

This commit adds clock and reset controller support for the Airoha AN7583
SoC to the en7523 clock driver.

> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index a4a75b8063a58..d044841cdc05a 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c

[ ... ]

> @@ -369,6 +378,138 @@ static const struct en_clk_desc en7581_base_clks[] = {
>  	}
>  };
>  
> +static const struct en_clk_desc an7583_base_clks[] = {

[ ... ]

> +	}, {
> +		.id = AN7583_CLK_MDIO0,
> +		.name = "mdio0",
> +
> +		.base_reg = REG_CRYPTO_CLKSRC2,
> +
> +		.base_value = 25000000,
> +
> +		.div_bits = 4,
> +		.div_shift = 15,
> +		.div_step = 1,
> +		.div_offset = 1,
> +	}, {
> +		.id = AN7583_CLK_MDIO1,
> +		.name = "mdio1",
> +
> +		.base_reg = REG_CRYPTO_CLKSRC2,
> +
> +		.base_value = 25000000,
> +
> +		.div_bits = 4,
> +		.div_shift = 19,
> +		.div_step = 1,
> +		.div_offset = 1,
> +	}
> +};

[ ... ]

> @@ -1144,6 +1343,43 @@ static int en7581_clk_hw_init(struct platform_device *pdev,
>  	return en7581_serdes_phy_register(&pdev->dev);
>  }
>  
> +static int an7583_clk_hw_init(struct platform_device *pdev,
> +			      struct clk_hw_onecell_data *clk_data)
> +{
> +	struct en_clk_priv *priv = platform_get_drvdata(pdev);
> +	struct device *dev = &pdev->dev;
> +	struct regmap *map;
> +	void __iomem *base;
> +	u32 val;
> +	int ret;
> +
> +	map = syscon_regmap_lookup_by_phandle(dev->of_node, "airoha,chip-scu");
> +	if (IS_ERR(map))
> +		return PTR_ERR(map);
> +
> +	base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
> +
> +	priv->base = base;
> +
> +	en7581_register_clocks(dev, clk_data, map, base);

[Severity: Medium]
As reported by Brian Masney on v13 [1], does registering AN7583_CLK_MDIO0
and AN7583_CLK_MDIO1 via en7581_register_clocks() leave their hardware
dividers unprogrammed when clk_set_rate() is called?

en7581_register_clocks() registers every entry in an7583_base_clks with
devm_clk_hw_register_fixed_rate(), which attaches clk_fixed_rate_ops and
provides no .set_rate, .round_rate, or .determine_rate callbacks.  When
airoha_mdio_probe() in drivers/net/mdio/mdio-airoha.c calls
clk_set_rate(priv->clk, freq) to divide the 25 MHz default down to 2.5 MHz,
clk_set_rate() returns 0 without updating the 4-bit divider fields in
REG_CRYPTO_CLKSRC2, leaving the MDIO bus clock at 25 MHz.

Prior discussion on v10 and v13 noted that adjustable clock rate support was
planned for a separate series, while Brian Masney confirmed on v13 that the
missing rate callbacks here are an issue.

[1] https://lore.kernel.org/r/179513295004.301584.12820965897975670200.b4-review@b4

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261121212738.170775-1-ansuelsmth@gmail.com?part=5

  reply	other threads:[~2026-11-21 21:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 21:27 [PATCH v15 0/5] clk: add support for Airoha AN7583 clock Christian Marangi
2026-11-21 21:27 ` [PATCH v15 1/5] dt-bindings: clock: airoha: Document support for " Christian Marangi
2026-11-21 21:27 ` [PATCH v15 2/5] clk: en7523: use devm variant for clk_hw_register and fixed clock Christian Marangi
2026-11-21 21:27 ` [PATCH v15 3/5] clk: en7523: protect concurrent access to reset and PCI register Christian Marangi
2026-11-29 23:50   ` Brian Masney
2026-11-21 21:27 ` [PATCH v15 4/5] clk: en7523: generalize register clocks function Christian Marangi
2026-11-29 23:50   ` Brian Masney
2026-11-30  0:31     ` Christian Marangi
2026-11-21 21:27 ` [PATCH v15 5/5] clk: en7523: add support for Airoha AN7583 clock Christian Marangi
2026-11-21 21:33   ` sashiko-bot [this message]
2026-11-29 23:50   ` Brian Masney

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-227407@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@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.