public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: John Madieu <john.madieu.xa@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Subject: Re: [PATCH 6.1.y-cip 20/25] net: stmmac: provide generic implementation for set_clk_tx_rate method
Date: Tue, 4 Nov 2025 13:57:17 +0100	[thread overview]
Message-ID: <aQn4LbAIUWBOFMFN@duo.ucw.cz> (raw)
In-Reply-To: <20251103113608.36240-21-john.madieu.xa@bp.renesas.com>

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

Hi!

> + * plat_data->clk_tx_i must be filled in.
> + */
> +int stmmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
> +			   phy_interface_t interface, int speed)
> +{
> +	long rate = rgmii_clock(speed);
> +
> +	/* Silently ignore unsupported speeds as rgmii_clock() only
> +	 * supports 10, 100 and 1000Mbps. We do not want to spit
> +	 * errors for 2500 and higher speeds here.
> +	 */
> +	if (rate < 0)
> +		return 0;
> +
> +	return clk_set_rate(clk_tx_i, rate);
> +}

Silently ignoring errors is ugly. Author clearly understood that, and
wrote a comment, but failed to explain why ignoring the errors is good
idea here. Maybe this should be WARN_ON? Better comment would be
certainly welcome.

Best regards,
								Pavel
-- 
In cooperation with DENX Software Engineering GmbH, HRB 165235 Munich,
Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2025-11-04 12:57 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 11:35 [PATCH 6.1.y-cip 00/25] Add RZ/G3E GBETH support John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 01/25] pinctrl: renesas: rzg2l: Suppress binding attributes John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 02/25] soc: renesas: Add config option for RZ/V2N (R9A09G056) SoC John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 03/25] dt-bindings: pinctrl: renesas: Document RZ/V2N SoC John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 04/25] pinctrl: renesas: rzg2l: Add support for " John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 05/25] pinctrl: renesas: rzg2l: Fix invalid unsigned return in rzg3s_oen_read() John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 06/25] pinctrl: renesas: rzg2l: Parameterize OEN register offset John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 07/25] pinctrl: renesas: rzg2l: Unify OEN access by making pin-to-bit mapping configurable John Madieu
2025-11-04 12:50   ` Pavel Machek
2025-11-04 17:27     ` John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 08/25] pinctrl: renesas: rzg2l: Remove OEN ops for RZ/G3E John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 09/25] pinctrl: renesas: rzg2l: Unify OEN handling across RZ/{G2L,V2H,V2N} John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 10/25] pinctrl: renesas: rzg2l: Add PFC_OEN support for RZ/G3E SoC John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 11/25] pinctrl: renesas: rzg2l: Drop oen_read and oen_write callbacks John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 12/25] pinctrl: renesas: rzg2l: Fix OEN resume John Madieu
2025-11-04 12:55   ` Pavel Machek
2025-11-04 20:56     ` John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 13/25] clk: renesas: r9a09g047: Add clock and reset signals for the GBETH IPs John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 14/25] dt-bindings: net: Document support for Renesas RZ/V2H(P) GBETH John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 15/25] dt-bindings: net: renesas-gbeth: Add support for RZ/G3E (R9A09G047) SoC John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 16/25] dt-bindings: net: Rename renesas,r9a09g057-gbeth.yaml John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 17/25] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 18/25] net: phy: Add helper for mapping RGMII link speed to clock rate John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 19/25] net: stmmac: provide set_clk_tx_rate() hook John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 20/25] net: stmmac: provide generic implementation for set_clk_tx_rate method John Madieu
2025-11-04 12:57   ` Pavel Machek [this message]
2025-11-04 19:42     ` John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 21/25] net: stmmac: provide stmmac_pltfr_find_clk() John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 22/25] net: stmmac: Add DWMAC glue layer for Renesas GBETH John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 23/25] arm64: dts: renesas: r9a09g047: Add GBETH nodes John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 24/25] arm64: dts: renesas: rzg3e-smarc-som: Enable eth{0-1} (GBETH) interfaces John Madieu
2025-11-03 11:35 ` [PATCH 6.1.y-cip 25/25] arm64: dts: renesas: r9a09g047: Enable Tx coe support John Madieu
2025-11-03 18:30 ` [PATCH 6.1.y-cip 00/25] Add RZ/G3E GBETH support Pavel Machek
2025-11-03 18:38   ` John Madieu
2025-11-06 19:15 ` Pavel Machek

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=aQn4LbAIUWBOFMFN@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=cip-dev@lists.cip-project.org \
    --cc=john.madieu.xa@bp.renesas.com \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    /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