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: <53A49622.80908@cogentembedded.com>
Date:	Sat, 21 Jun 2014 00:14:26 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
CC:	davem@...emloft.net
Subject: Re: [PATCH net 2/2] net: systemport: fix UniMAC reset logic

Hello.

On 06/21/2014 12:01 AM, Florian Fainelli wrote:

> The UniMAC CMD_SW_RESET bit is not a self-clearing bit, so we need to
> assert it, wait a bit and clear it manually. As a result, umac_reset()
> is updated not to return any value.

> By setting CMD_SW_RESET and only that bit, we were also clearing the

    I wonder where you were setting this bit before -- the only umac_writel() 
there was wrote 0 to UMAC_CMD...

> other 31 bits, overriding the hardware reset defaults which are
> correctly set on purpose.

> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>   drivers/net/ethernet/broadcom/bcmsysport.c | 33 ++++++++----------------------
>   1 file changed, 9 insertions(+), 24 deletions(-)

> diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
> index f6bccd847ee6..d31f7d239064 100644
> --- a/drivers/net/ethernet/broadcom/bcmsysport.c
> +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
> @@ -1254,28 +1254,17 @@ static inline void umac_enable_set(struct bcm_sysport_priv *priv,
>   		usleep_range(1000, 2000);
>   }
>
> -static inline int umac_reset(struct bcm_sysport_priv *priv)
> +static inline void umac_reset(struct bcm_sysport_priv *priv)
>   {
> -	unsigned int timeout = 0;
>   	u32 reg;
> -	int ret = 0;
> -
> -	umac_writel(priv, 0, UMAC_CMD);
> -	while (timeout++ < 1000) {
> -		reg = umac_readl(priv, UMAC_CMD);
> -		if (!(reg & CMD_SW_RESET))
> -			break;
> -
> -		udelay(1);
> -	}
> -
> -	if (timeout == 1000) {
> -		dev_err(&priv->pdev->dev,
> -			"timeout waiting for MAC to come out of reset\n");
> -		ret = -ETIMEDOUT;
> -	}
>
> -	return ret;
> +	reg = umac_readl(priv, UMAC_CMD);
> +	reg |= CMD_SW_RESET;
> +	umac_writel(priv, reg, UMAC_CMD);
> +	udelay(10);
> +	reg = umac_readl(priv, UMAC_CMD);
> +	reg &= ~CMD_SW_RESET;
> +	umac_writel(priv, reg, UMAC_CMD);
>   }
>
>   static void umac_set_hw_addr(struct bcm_sysport_priv *priv,
[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ