netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: David Thompson <dthompson@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	Jiri Pirko <jiri@mellanox.com>, Asmaa Mnebhi <Asmaa@mellanox.com>
Subject: Re: [PATCH net-next] Add Mellanox BlueField Gigabit Ethernet driver
Date: Wed, 12 Aug 2020 23:34:01 +0200	[thread overview]
Message-ID: <20200812213401.GI2141651@lunn.ch> (raw)
In-Reply-To: <CH2PR12MB3895636714ECACC888869058D7420@CH2PR12MB3895.namprd12.prod.outlook.com>

Hi Asmaa

Please wrap your emails at about 75 characters.

> So let me explain further and would greatly appreciate your input.

> Technically, when this driver gets loaded, we shouldn't need the interrupt when bringing up the link for the first time, do we?
> Correct me if I am wrong, "phy_start" should bring up the link. Phy_start calls phy_start_aneg, which eventually calls phy_check_link_status.
> phy_check_link_status , reads the link state bit of the BMSR register (only twice),  and based on that determines whether to bring up/down the link. In our case, that bit is still 0 when the read is donw. A little bit later, it gets set to 1.
> 
> This is why polling works in this case. Phy_start fails to bring up the link but the polling eventually bring it up. If we choose to use the interrupt, we should make sure that the 
> Interrupt is enabled a little bit after phy_start, otherwise, it would just be wasted.

When the PHY is connected to the MAC, phy_request_interrupt() is
called. That sets up the SoC side of the interrupt, so that
phy_interrupt() will be called on interrupt. It then calls
phy_enable_interrupts()->phy_config_interrupt() which calls into the
PHY driver to enable interrupts within the PHY.  It is then expected
that the PHY interrupts whenever there is a change in link status.

Sometime later phy_start() will be called which should kick off an
autoneg. That should result in the link going up, maybe 1.5 seconds
later if the link peer is present, maybe later if there is no
peer. The link up will trigger an interrupt, and the new status will
be read. If the link goes down, the interrupt should also trigger, and
the status will be updated.

   Andrew

  reply	other threads:[~2020-08-12 21:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 18:29 [PATCH net-next] Add Mellanox BlueField Gigabit Ethernet driver David Thompson
2020-07-29 19:41 ` David Thompson
2020-07-29 20:31   ` David Miller
2020-07-29 20:49 ` Jakub Kicinski
2020-07-30  4:03 ` kernel test robot
2020-07-31 17:42 ` Andrew Lunn
     [not found]   ` <VI1PR05MB4110070900CF42CB3E18983EDA4E0@VI1PR05MB4110.eurprd05.prod.outlook.com>
2020-07-31 19:54     ` Andrew Lunn
2020-07-31 21:38       ` Asmaa Mnebhi
2020-08-01  1:14         ` Andrew Lunn
2020-08-03 14:23           ` Asmaa Mnebhi
2020-08-11 19:53   ` Asmaa Mnebhi
2020-08-11 20:06     ` Andrew Lunn
2020-08-12 20:37       ` Asmaa Mnebhi
2020-08-12 21:34         ` Andrew Lunn [this message]
2020-07-31 18:37 ` Andrew Lunn
2020-08-28 14:29   ` Asmaa Mnebhi
2020-07-31 18:38 ` Andrew Lunn
2020-08-28 14:24   ` Asmaa Mnebhi
2020-08-28 14:36     ` Andrew Lunn
2020-07-31 18:41 ` 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=20200812213401.GI2141651@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Asmaa@mellanox.com \
    --cc=asmaa@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dthompson@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).