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: <ZLw67dun2790l+9D@corigine.com>
Date:   Sat, 22 Jul 2023 21:24:13 +0100
From:   Simon Horman <simon.horman@...igine.com>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        linux-kernel@...r.kernel.org, bryan.whitehead@...rochip.com,
        andrew@...n.ch, linux@...linux.org.uk, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next 1/7] net: lan743x: Create separate PCS power
 reset function

On Fri, Jul 21, 2023 at 11:30:13AM +0530, Raju Lakkaraju wrote:
> Create separate PCS power reset function from lan743x_sgmii_config () to use
> as subroutine.
> 
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 54 ++++++++++---------
>  1 file changed, 29 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index a36f6369f132..dba5576a933b 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c

...

>  static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
>  {
>  	struct net_device *netdev = adapter->netdev;
> @@ -1207,31 +1235,7 @@ static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
>  		netif_dbg(adapter, drv, adapter->netdev,
>  			  "SGMII 1G mode enable\n");
>  
> -	/* SGMII/1000/2500BASE-X PCS power down */
> -	mii_ctl = lan743x_sgmii_read(adapter, MDIO_MMD_VEND2, MII_BMCR);
> -	if (mii_ctl < 0)
> -		return mii_ctl;
> -
> -	mii_ctl |= BMCR_PDOWN;
> -	ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
> -	if (ret < 0)
> -		return ret;
> -
> -	ret = lan743x_pcs_seq_state(adapter, PCS_POWER_STATE_DOWN);
> -	if (ret < 0)
> -		return ret;
> -
> -	/* SGMII/1000/2500BASE-X PCS power up */
> -	mii_ctl &= ~BMCR_PDOWN;
> -	ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
> -	if (ret < 0)
> -		return ret;
> -
> -	ret = lan743x_pcs_seq_state(adapter, PCS_POWER_STATE_UP);
> -	if (ret < 0)
> -		return ret;
> -
> -	return 0;
> +	return lan743x_pcs_power_reset(adapter);

Hi Raju,

It appears that the local variable mii_ctl is now unused
in lan743x_sgmii_config() and can be removed.

>  }
>  
>  static void lan743x_mac_set_address(struct lan743x_adapter *adapter,
> -- 
> 2.25.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ