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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42f11110-7071-43c8-a4fe-df99a60bc12d@wanadoo.fr>
Date: Sun, 8 Dec 2024 16:13:50 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Christian Marangi <ansuelsmth@...il.com>, Lee Jones <lee@...nel.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, 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>,
 Vladimir Oltean <olteanv@...il.com>,
 Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
 Heiner Kallweit <hkallweit1@...il.com>, Russell King
 <linux@...linux.org.uk>, Matthias Brugger <matthias.bgg@...il.com>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
 netdev@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, upstream@...oha.com
Subject: Re: [net-next PATCH v10 6/9] net: mdio: Add Airoha AN8855 Switch MDIO
 Passtrough

Le 08/12/2024 à 01:20, Christian Marangi a écrit :
> Add Airoha AN8855 Switch driver to register a MDIO passtrough as switch
> address is shared with the internal PHYs and require additional page
> handling.
> 
> This requires the upper Switch MFD to be probed and init to actually
> work.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
>   MAINTAINERS                    |   1 +
>   drivers/net/mdio/Kconfig       |   9 +++
>   drivers/net/mdio/Makefile      |   1 +
>   drivers/net/mdio/mdio-an8855.c | 113 +++++++++++++++++++++++++++++++++
>   4 files changed, 124 insertions(+)
>   create mode 100644 drivers/net/mdio/mdio-an8855.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7f4d7c48b6e1..38c7b2362c92 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -722,6 +722,7 @@ F:	Documentation/devicetree/bindings/net/airoha,an8855-mdio.yaml
>   F:	Documentation/devicetree/bindings/net/dsa/airoha,an8855-switch.yaml
>   F:	Documentation/devicetree/bindings/nvmem/airoha,an8855-efuse.yaml
>   F:	drivers/mfd/airoha-an8855.c
> +F:	drivers/net/mdio/mdio-an8855.c
>   
>   AIROHA ETHERNET DRIVER
>   M:	Lorenzo Bianconi <lorenzo@...nel.org>
> diff --git a/drivers/net/mdio/Kconfig b/drivers/net/mdio/Kconfig
> index 4a7a303be2f7..64fc5c3ef38b 100644
> --- a/drivers/net/mdio/Kconfig
> +++ b/drivers/net/mdio/Kconfig
> @@ -61,6 +61,15 @@ config MDIO_XGENE
>   	  This module provides a driver for the MDIO busses found in the
>   	  APM X-Gene SoC's.
>   
> +config MDIO_AN8855
> +	tristate "Airoha AN8855 Switch MDIO bus controller"
> +	depends on MFD_AIROHA_AN8855
> +	depends on OF_MDIO
> +	help
> +	  This module provides a driver for the Airoha AN8855 Switch
> +	  that require a MDIO passtrough as switch address is shared

requires?

> +	  with the internal PHYs and require additional page handling.

requires?

> +
>   config MDIO_ASPEED
>   	tristate "ASPEED MDIO bus controller"
>   	depends on ARCH_ASPEED || COMPILE_TEST

...

> +static int an8855_mdio_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct an8855_mfd_priv *priv;
> +	struct mii_bus *bus;
> +	int ret;
> +
> +	/* Get priv of MFD */
> +	priv = dev_get_drvdata(dev->parent);

Ok, forget the related comment made on patch 5/9.

> +
> +	bus = devm_mdiobus_alloc(dev);
> +	if (!bus)
> +		return -ENOMEM;
> +
> +	bus->priv = priv;
> +	bus->name = KBUILD_MODNAME "-mii";
> +	snprintf(bus->id, MII_BUS_ID_SIZE, KBUILD_MODNAME "-%d",
> +		 priv->switch_addr);
> +	bus->parent = dev;
> +	bus->read = an8855_phy_read;
> +	bus->write = an8855_phy_write;
> +
> +	ret = devm_of_mdiobus_register(dev, bus, dev->of_node);
> +	if (ret)
> +		dev_err(dev, "failed to register MDIO bus: %d", ret);

Nitpick: Missing ending \n.
dev_err_probe() could be used.

> +
> +	return ret;
> +}

...

CJ




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ