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: <20190415170104.GC9343@lunn.ch>
Date:   Mon, 15 Apr 2019 19:01:04 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     David Bauer <mail@...id-bauer.net>
Cc:     devicetree@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 2/3] net: phy: add support for reset-controller

On Mon, Apr 15, 2019 at 02:38:39PM +0200, David Bauer wrote:
> +static int mdiobus_register_reset(struct mdio_device *mdiodev)
> +{
> +	struct reset_control *reset = NULL;
> +
> +	if (mdiodev->dev.of_node)
> +		reset = devm_reset_control_get_exclusive(&mdiodev->dev,
> +							 "phy");
> +	if (PTR_ERR(reset) == -ENOENT ||
> +	    PTR_ERR(reset) == -ENOTSUPP)
> +		reset = NULL;
> +	else if (IS_ERR(reset))
> +		return PTR_ERR(reset);
> +
> +	mdiodev->reset_ctrl = reset;
> +
> +	/* Assert the reset signal */
> +	mdio_device_reset(mdiodev, 1);

Hi David

The mdiobus_register_gpiod() function also has a call to
mdio_device_reset(). So we end up resetting the GPIO twice.

It is probably better to pull this out of here, and
mdiobus_register_gpiod(), and do it once in mdiobus_register_device().

	  Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ