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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201128190334.GE2191767@lunn.ch>
Date:   Sat, 28 Nov 2020 20:03:34 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Steen Hegelund <steen.hegelund@...rochip.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        Bjarni Jonasson <bjarni.jonasson@...rochip.com>,
        Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Microsemi List <microsemi@...ts.bootlin.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/3] net: sparx5: Add Sparx5 switchdev driver

> +static int sparx5_port_open(struct net_device *ndev)
> +{
> +	struct sparx5_port *port = netdev_priv(ndev);
> +	int err = 0;
> +
> +	sparx5_port_enable(port, true);
> +	if (port->conf.phy_mode != PHY_INTERFACE_MODE_NA) {
> +		err = phylink_of_phy_connect(port->phylink, port->of_node, 0);
> +		if (err) {
> +			netdev_err(ndev, "Could not attach to PHY\n");
> +			return err;
> +		}
> +	}

This looks a bit odd. PHY_INTERFACE_MODE_NA means don't touch,
something else has already configured the MAC-PHY mode in the PHY.
You should not not connect the PHY because of this.

> +void sparx5_destroy_netdev(struct sparx5 *sparx5, struct sparx5_port *port)
> +{
> +	if (port->phylink) {
> +		/* Disconnect the phy */
> +		if (rtnl_trylock()) {

Why do you use rtnl_trylock()?

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ