Skip to content

Commit

Permalink
net: phy: mxl-gpy: extend interrupt fix to all impacted variants
Browse files Browse the repository at this point in the history
The interrupt fix in commit 97a89ed should be applied on all variants
of GPY2xx PHY and GPY115C.

Fixes: 97a89ed ("net: phy: mxl-gpy: disable interrupts on GPY215 by default")
Signed-off-by: Xu Liang <lxu@maxlinear.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230531074822.39136-1-lxu@maxlinear.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Xu Liang authored and Jakub Kicinski committed Jun 1, 2023
1 parent a60caf0 commit 519d648
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions drivers/net/phy/mxl-gpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,6 @@ static int gpy_config_init(struct phy_device *phydev)
return ret < 0 ? ret : 0;
}

static bool gpy_has_broken_mdint(struct phy_device *phydev)
{
/* At least these PHYs are known to have broken interrupt handling */
return phydev->drv->phy_id == PHY_ID_GPY215B ||
phydev->drv->phy_id == PHY_ID_GPY215C;
}

static int gpy_probe(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
Expand All @@ -300,8 +293,7 @@ static int gpy_probe(struct phy_device *phydev)
phydev->priv = priv;
mutex_init(&priv->mbox_lock);

if (gpy_has_broken_mdint(phydev) &&
!device_property_present(dev, "maxlinear,use-broken-interrupts"))
if (!device_property_present(dev, "maxlinear,use-broken-interrupts"))
phydev->dev_flags |= PHY_F_NO_IRQ;

fw_version = phy_read(phydev, PHY_FWV);
Expand Down Expand Up @@ -659,11 +651,9 @@ static irqreturn_t gpy_handle_interrupt(struct phy_device *phydev)
* frame. Therefore, polling is the best we can do and won't do any more
* harm.
* It was observed that this bug happens on link state and link speed
* changes on a GPY215B and GYP215C independent of the firmware version
* (which doesn't mean that this list is exhaustive).
* changes independent of the firmware version.
*/
if (gpy_has_broken_mdint(phydev) &&
(reg & (PHY_IMASK_LSTC | PHY_IMASK_LSPC))) {
if (reg & (PHY_IMASK_LSTC | PHY_IMASK_LSPC)) {
reg = gpy_mbox_read(phydev, REG_GPIO0_OUT);
if (reg < 0) {
phy_error(phydev);
Expand Down

0 comments on commit 519d648

Please sign in to comment.