diff mbox series

[2/4] eth/r8152: reset PHY after setting it

Message ID 1394712342-15778-379-Taiwan-albertk@realtek.com
State Superseded
Headers show
Series r8152: support more chips | expand

Commit Message

Hayes Wang June 9, 2020, 8:53 a.m. UTC
Some settings of PHY have to work after resetting PHY.

Signed-off-by: Hayes Wang <hayeswang at realtek.com>
---
 drivers/usb/eth/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut June 9, 2020, 2:22 p.m. UTC | #1
On 6/9/20 10:53 AM, Hayes Wang wrote:
> Some settings of PHY have to work after resetting PHY.
> 
> Signed-off-by: Hayes Wang <hayeswang at realtek.com>
> ---
>  drivers/usb/eth/r8152.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c
> index dbb1721882..d774a0fa63 100644
> --- a/drivers/usb/eth/r8152.c
> +++ b/drivers/usb/eth/r8152.c
> @@ -947,7 +947,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
>  			return -EINVAL;
>  		}
>  
> -		bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
> +		bmcr = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET;

Do you really need to reset a PHY while resetting the autonegotiation ?
I think if you reset the PHY , then the ANEG operation is restarted by
default or undefined, no ?
Hayes Wang June 10, 2020, 9:47 a.m. UTC | #2
Marek Vasut [mailto:marex at denx.de]
> Sent: Tuesday, June 09, 2020 10:22 PM
[...]
> > -		bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
> > +		bmcr = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET;
> 
> Do you really need to reset a PHY while resetting the autonegotiation ?
> I think if you reset the PHY , then the ANEG operation is restarted by
> default or undefined, no ?

The setting is from the HW engineer. And I follow
the rule for a long time. I think they know what
they do.

Best Regards,
Hayes
Marek Vasut June 10, 2020, 11:06 a.m. UTC | #3
On 6/10/20 11:47 AM, Hayes Wang wrote:
> Marek Vasut [mailto:marex at denx.de]
>> Sent: Tuesday, June 09, 2020 10:22 PM
> [...]
>>> -		bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
>>> +		bmcr = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET;
>>
>> Do you really need to reset a PHY while resetting the autonegotiation ?
>> I think if you reset the PHY , then the ANEG operation is restarted by
>> default or undefined, no ?
> 
> The setting is from the HW engineer. And I follow
> the rule for a long time. I think they know what
> they do.

If the hardware is OK with it, then that's fine.
diff mbox series

Patch

diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c
index dbb1721882..d774a0fa63 100644
--- a/drivers/usb/eth/r8152.c
+++ b/drivers/usb/eth/r8152.c
@@ -947,7 +947,7 @@  static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
 			return -EINVAL;
 		}
 
-		bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
+		bmcr = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET;
 	}
 
 	if (tp->supports_gmii)