2015-11-02 10:57:29

by Neil Armstrong

[permalink] [raw]
Subject: [RFC PATCH net-next 2/6] net: dsa: mv88e6060: use the correct InitReady bit

According to the mv88e6060 datasheet, the InitReady bit position
is 11 and the polarity is inverted.
Use the bit correctly to detect the end of initialization.

Signed-off-by: Neil Armstrong <[email protected]>
---
drivers/net/dsa/mv88e6060.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
index 6885ef5..c10880f 100644
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -102,7 +102,7 @@ static int mv88e6060_switch_reset(struct dsa_switch *ds)
timeout = jiffies + 1 * HZ;
while (time_before(jiffies, timeout)) {
ret = REG_READ(REG_GLOBAL, 0x00);
- if ((ret & 0x8000) == 0x0000)
+ if ((ret & 0x800) != 0x0000)
break;

usleep_range(1000, 2000);
--
1.9.1


2015-11-02 13:02:55

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [RFC PATCH net-next 2/6] net: dsa: mv88e6060: use the correct InitReady bit

Hello.

On 11/2/2015 1:57 PM, Neil Armstrong wrote:

> According to the mv88e6060 datasheet, the InitReady bit position
> is 11 and the polarity is inverted.
> Use the bit correctly to detect the end of initialization.
>
> Signed-off-by: Neil Armstrong <[email protected]>
> ---
> drivers/net/dsa/mv88e6060.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
> index 6885ef5..c10880f 100644
> --- a/drivers/net/dsa/mv88e6060.c
> +++ b/drivers/net/dsa/mv88e6060.c
> @@ -102,7 +102,7 @@ static int mv88e6060_switch_reset(struct dsa_switch *ds)
> timeout = jiffies + 1 * HZ;
> while (time_before(jiffies, timeout)) {
> ret = REG_READ(REG_GLOBAL, 0x00);
> - if ((ret & 0x8000) == 0x0000)
> + if ((ret & 0x800) != 0x0000)

You could as well drop != 0.

[...]

MBR, Sergei