|
@@ -2872,7 +2872,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
|
|
|
bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
|
|
|
}
|
|
|
|
|
|
- if (test_bit(PHY_RESET, &tp->flags))
|
|
|
+ if (test_and_clear_bit(PHY_RESET, &tp->flags))
|
|
|
bmcr |= BMCR_RESET;
|
|
|
|
|
|
if (tp->mii.supports_gmii)
|
|
@@ -2881,7 +2881,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
|
|
|
r8152_mdio_write(tp, MII_ADVERTISE, anar);
|
|
|
r8152_mdio_write(tp, MII_BMCR, bmcr);
|
|
|
|
|
|
- if (test_and_clear_bit(PHY_RESET, &tp->flags)) {
|
|
|
+ if (bmcr & BMCR_RESET) {
|
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < 50; i++) {
|