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: <20250228103411.4c203261@kmaincent-XPS-13-7390>
Date: Fri, 28 Feb 2025 10:34:11 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Kyle Hendry <kylehendrydev@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
 <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Rob Herring
 <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Heiner Kallweit <hkallweit1@...il.com>, Russell King
 <linux@...linux.org.uk>, Florian Fainelli <florian.fainelli@...adcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@...adcom.com>, Philipp Zabel
 <p.zabel@...gutronix.de>, noltari@...il.com, jonas.gorski@...il.com,
 netdev@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] net: phy: bcm63xx: add support for BCM63268 GPHY

On Thu, 27 Feb 2025 16:27:15 -0800
Kyle Hendry <kylehendrydev@...il.com> wrote:

> Add support for the internal gigabit PHY on the BCM63268 SoC.
> Some of the PHY functionality is configured out of band through
> memory mapped registers. The GPHY control register contains bits
> which need to be written to enable/disable low power mode. The
> register is part of the SoC's GPIO controller, so accessing it
> is done through a phandle to that syscon.

...

> +static int bcm63268_gphy_resume(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	ret = bcm63268_gphy_set(phydev, true);
> +	if (ret)
> +		return ret;
> +
> +	ret = genphy_resume(phydev);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

No need for the last check. You can simply do this:
	return genphy_resume(phydev);

> +}
> +
> +static int bcm63268_gphy_suspend(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	ret = genphy_suspend(phydev);
> +	if (ret)
> +		return ret;
> +
> +	ret = bcm63268_gphy_set(phydev, false);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

Same here.

> +}
> +
> +static int bcm63268_gphy_probe(struct phy_device *phydev)
> +{
> +	struct mdio_device *mdio = &phydev->mdio;
> +	struct device *dev = &mdio->dev;
> +	struct reset_control *reset;
> +	struct bcm_gphy_priv *priv;
> +	struct regmap *regmap;
> +	int ret;
> +
> +	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	phydev->priv = priv;
> +
> +	regmap = syscon_regmap_lookup_by_phandle(dev->of_node,
> "brcm,gpio-ctrl");
> +	if (IS_ERR(regmap))
> +		return PTR_ERR(regmap);
> +
> +	priv->gpio_ctrl = regmap;
> +
> +	reset = devm_reset_control_get_optional_exclusive(dev, NULL);
> +	if (IS_ERR(reset))
> +		return PTR_ERR(reset);
> +
> +	ret = reset_control_reset(reset);
> +	if (ret)
> +		return ret;
> +
> +	return 0;

Same here.



-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ