Re: [PATCH v3 1/9] net: phy: new Asix Electronics PHY driver
Hi Andrew, I agree, that's much better. I had something like that in mind before I got distracted... /me looking for brown paper bag now. Cheers, Michael On Thu, Apr 19, 2018 at 12:13 AM, Andrew Lunnwrote: >> + >> +/** >> + * asix_soft_reset - software reset the PHY via BMCR_RESET bit >> + * @phydev: target phy_device struct >> + * >> + * Description: Perform a software PHY reset using the standard >> + * BMCR_RESET bit and poll for the reset bit to be cleared. >> + * Toggle BMCR_RESET bit off to accomodate broken PHY implementations >> + * such as used on the Individual Computers' X-Surf 100 Zorro card. >> + * >> + * Returns: 0 on success, < 0 on failure >> + */ >> +static int asix_soft_reset(struct phy_device *phydev) >> +{ >> + int ret; >> + >> + /* Asix PHY won't reset unless reset bit toggles */ >> + ret = phy_write(phydev, MII_BMCR, 0); >> + if (ret < 0) >> + return ret; >> + >> + phy_write(phydev, MII_BMCR, BMCR_RESET); >> + >> + return phy_poll_reset(phydev); >> +} > > Why not simply: > > static int asix_soft_reset(struct phy_device *phydev) > { > int ret; > > /* Asix PHY won't reset unless reset bit toggles */ > ret = phy_write(phydev, MII_BMCR, 0); > if (ret < 0) > return ret; > > return genphy_soft_reset(phydev); > } > > Andrew > -- > To unsubscribe from this list: send the line "unsubscribe linux-m68k" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 1/9] net: phy: new Asix Electronics PHY driver
> + > +/** > + * asix_soft_reset - software reset the PHY via BMCR_RESET bit > + * @phydev: target phy_device struct > + * > + * Description: Perform a software PHY reset using the standard > + * BMCR_RESET bit and poll for the reset bit to be cleared. > + * Toggle BMCR_RESET bit off to accomodate broken PHY implementations > + * such as used on the Individual Computers' X-Surf 100 Zorro card. > + * > + * Returns: 0 on success, < 0 on failure > + */ > +static int asix_soft_reset(struct phy_device *phydev) > +{ > + int ret; > + > + /* Asix PHY won't reset unless reset bit toggles */ > + ret = phy_write(phydev, MII_BMCR, 0); > + if (ret < 0) > + return ret; > + > + phy_write(phydev, MII_BMCR, BMCR_RESET); > + > + return phy_poll_reset(phydev); > +} Why not simply: static int asix_soft_reset(struct phy_device *phydev) { int ret; /* Asix PHY won't reset unless reset bit toggles */ ret = phy_write(phydev, MII_BMCR, 0); if (ret < 0) return ret; return genphy_soft_reset(phydev); } Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 1/9] net: phy: new Asix Electronics PHY driver
On 04/18/2018 06:26 AM, Michael Schmitz wrote: > The Asix Electronics PHY found on the X-Surf 100 Amiga Zorro network > card by Individual Computers is buggy, and needs the reset bit toggled > as workaround to make a PHY soft reset succed. ^^ typo -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `-GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html