lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z9hsAmiD9sZ_NAR-@makrotopia.org>
Date: Mon, 17 Mar 2025 18:37:54 +0000
From: Daniel Golle <daniel@...rotopia.org>
To: "Lucien.Jheng" <lucienx123@...il.com>
Cc: linux-clk@...r.kernel.org, andrew@...n.ch, hkallweit1@...il.com,
	linux@...linux.org.uk, kuba@...nel.org, davem@...emloft.net,
	edumazet@...gle.com, pabeni@...hat.com, ericwouds@...il.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	joseph.lin@...oha.com, wenshin.chung@...oha.com
Subject: Re: [PATCH v4 net-next PATCH 1/1] net: phy: air_en8811h: Add clk
 provider for CKO pin

On Mon, Mar 17, 2025 at 10:31:11PM +0800, Lucien.Jheng wrote:
> EN8811H outputs 25MHz or 50MHz clocks on CKO, selected by GPIO3.
> CKO clock activates on power-up and continues through md32 firmware loading.

Maybe add here:
"Implement clk provider driver so we can disable the clock output in case
it isn't needed, which also helps to reduce EMF noise"

Ie. the description you had was fine and good to have, just the lines had to
be shorter (ie. just insert linebreaks at 70~75 chars).

See more comments inline below:

> ...
> @@ -806,6 +817,84 @@ static int en8811h_led_hw_is_supported(struct phy_device *phydev, u8 index,
>  	return 0;
>  };
>  
> +static unsigned long en8811h_recalc_rate(struct clk_hw *hw, unsigned long parent)

calling this en8811h_clk_recalc_rate() would be better imho.

> +{
> +	struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> +	struct phy_device *phydev = priv->phydev;
> +	u32 pbus_value;
> +	int ret;
> +
> +	ret = air_buckpbus_reg_read(phydev, EN8811H_HWTRAP1, &pbus_value);
> +	if (ret < 0)
> +		return ret;
> +
> +	return (pbus_value & EN8811H_HWTRAP1_CKO) ? 50000000 : 25000000;
> +}
> +
> +static int en8811h_enable(struct clk_hw *hw)

call this en8811h_clk_enable()

> +{
> +	struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> +	struct phy_device *phydev = priv->phydev;
> +
> +	return air_buckpbus_reg_modify(phydev, EN8811H_CLK_CGM,
> +				EN8811H_CLK_CGM_CKO, EN8811H_CLK_CGM_CKO);
> +}
> +
> +static void en8811h_disable(struct clk_hw *hw)

call this en8811h_clk_disable()

> +{
> +	struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> +	struct phy_device *phydev = priv->phydev;
> +
> +	air_buckpbus_reg_modify(phydev, EN8811H_CLK_CGM,
> +				EN8811H_CLK_CGM_CKO, 0);
> +}
> +
> +static int en8811h_is_enabled(struct clk_hw *hw)

call this en8811h_clk_is_enabled()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ