All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 1/3] net: phy: check that PHY is stopped when entering phy_disconnect
Date: Wed, 16 Jan 2019 22:48:30 +0100	[thread overview]
Message-ID: <20190116214830.GK29244@lunn.ch> (raw)
In-Reply-To: <36d66609-9d1f-a116-c12b-266802eb61de@gmail.com>

On Wed, Jan 16, 2019 at 09:25:15PM +0100, Heiner Kallweit wrote:
> Every driver should have called phy_stop() before calling
> phy_disconnect(). Let's check for this and ensure PHY is stopped
> when starting with the actual work in phy_disconnect().

Hi Heiner

Looking at the patch, i think why must the MAC driver call phy_stop()
before phy_disconnect()? It keeps is symmetrical, you need
phy_connect() and then phy_start(). But if the core can detect that
phy_stop() has not been called, and can call phy_stop() when needed,
we can probably simplify the MAC drivers by removing many of the
phy_stop() calls.

I think it might come down to where the phy_connect()/phy_disconnect()
is performed. Sometimes it is in probe()/remove(), sometimes it is in
open()/close(). If phy_disconnect() is in remove(), phy_stop() is
needed in close(). But if phy_disconnect() is called in close() the
phy_stop() could be skipped?

Before we start adding warning, we probably should first document the
expectations. Documentation/networking/phy.txt seems like a good
place.

	Andrew

  reply	other threads:[~2019-01-16 21:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 20:24 [PATCH v2 net-next 0/3] net: phy: improve stopping PHY Heiner Kallweit
2019-01-16 20:25 ` [PATCH v2 net-next 1/3] net: phy: check that PHY is stopped when entering phy_disconnect Heiner Kallweit
2019-01-16 21:48   ` Andrew Lunn [this message]
2019-01-17  6:19     ` Heiner Kallweit
2019-01-17 18:55       ` Heiner Kallweit
2019-01-16 20:25 ` [PATCH v2 net-next 2/3] net: phy: ensure phylib state machine is stopped after calling phy_stop Heiner Kallweit
2019-01-16 21:59   ` Andrew Lunn
2019-01-17  6:10     ` Heiner Kallweit
2019-01-16 20:26 ` [PATCH v2 net-next 3/3] net: phy: remove phy_stop_interrupts Heiner Kallweit
2019-01-16 22:00   ` 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=20190116214830.GK29244@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.