netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Ismail, Mohammad Athari" <mohammad.athari.ismail@intel.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"hmehrtens@maxlinear.com" <hmehrtens@maxlinear.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"tmohren@maxlinear.com" <tmohren@maxlinear.com>,
	"vee.khee.wong@linux.intel.com" <vee.khee.wong@linux.intel.com>,
	"lxu@maxlinear.com" <lxu@maxlinear.com>
Subject: Re: [PATCH v3] net: phy: add Maxlinear GPY115/21x/24x driver
Date: Tue, 22 Jun 2021 15:16:08 +0200	[thread overview]
Message-ID: <YNHimAJNg0rO/Tt4@lunn.ch> (raw)
In-Reply-To: <CO1PR11MB477189838CFCDB952D4B064BD5099@CO1PR11MB4771.namprd11.prod.outlook.com>

On Tue, Jun 22, 2021 at 04:21:47AM +0000, Ismail, Mohammad Athari wrote:
> > -----Original Message-----
> > From: Ismail, Mohammad Athari <mohammad.athari.ismail@intel.com>
> > Sent: Tuesday, June 22, 2021 12:15 PM
> > To: Ismail, Mohammad Athari <mohammad.athari.ismail@intel.com>
> > Subject:
> > 
> > > Net-next:
> > >
> > > int genphy_loopback(struct phy_device *phydev, bool enable) {
> > >      if (enable) {
> > >          u16 val, ctl = BMCR_LOOPBACK;
> > >          int ret;
> > >
> > >          if (phydev->speed == SPEED_1000)
> > >              ctl |= BMCR_SPEED1000;
> > >          else if (phydev->speed == SPEED_100)
> > >              ctl |= BMCR_SPEED100;
> > >
> > >          if (phydev->duplex == DUPLEX_FULL)
> > >              ctl |= BMCR_FULLDPLX;
> > >
> > >          phy_modify(phydev, MII_BMCR, ~0, ctl);
> > >
> > >          ret = phy_read_poll_timeout(phydev, MII_BMSR, val,
> > >                          val & BMSR_LSTATUS,
> > >                      5000, 500000, true);
> > >          if (ret)
> > >              return ret;
> > >      } else {
> > >          phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0);
> > >
> > >          phy_config_aneg(phydev);
> > >      }
> > >
> > >      return 0;
> > > }
> 
> Hi Andrew,
> 

> We also observe same issue on Marvell88E1510 PHY (C22 supported PHY)
> as well. It works with v5.12.11's genphy_loopback() but not
> net-next's.

Ah, yes. The Marvell probably needs a software reset after the write
to the MII_BMSR register. But just setting the loopback bit also
probably needed a software reset as well, so i suspect it was broken
before this change.

Oleksij, rather that writing registers directly, we probably need to
use the phylib API calls to configure the PHY. That will handle
oddities like the Marvell needing a reset, or PHYs with other speeds
etc.

	Andrew

  reply	other threads:[~2021-06-22 13:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  4:21 [PATCH v3] net: phy: add Maxlinear GPY115/21x/24x driver Ismail, Mohammad Athari
2021-06-22 13:16 ` Andrew Lunn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-06-04 16:12 Xu Liang
2021-06-04 16:24 ` Florian Fainelli
2021-06-04 18:24   ` Liang Xu
2021-06-04 20:10     ` Andrew Lunn
2021-06-05  3:35       ` Liang Xu
2021-06-05 14:51         ` Andrew Lunn
2021-06-07  4:06           ` Liang Xu
2021-06-18  9:17             ` Liang Xu
2021-06-18 14:01               ` Andrew Lunn
2021-06-18 15:36                 ` Liang Xu
2021-06-21  2:30                   ` Andrew Lunn
2021-06-21  5:05                     ` Liang Xu
2021-06-21 12:48                       ` Andrew Lunn
2021-06-21 13:07                         ` Liang Xu
2021-06-04 18:37   ` Liang Xu
2021-06-04 19:44 ` Martin Blumenstingl
2021-06-05  3:32   ` Liang Xu
2021-06-05 17:24     ` Andrew Lunn
2021-06-07  4:37       ` Liang Xu
2021-06-07 20:28         ` Martin Blumenstingl
     [not found]           ` <MWHPR19MB0077D01E4EAFA9FE521D83ECBD0D9@MWHPR19MB0077.namprd19.prod.outlook.com>
     [not found]             ` <766ab274-25ff-c9a2-1ed6-fe2aa44b4660@maxlinear.com>
2021-06-23 21:09               ` Martin Blumenstingl
2021-06-24  1:06                 ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YNHimAJNg0rO/Tt4@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=hmehrtens@maxlinear.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=mohammad.athari.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tmohren@maxlinear.com \
    --cc=vee.khee.wong@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).