netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH v3 net-next 1/3] net: phy: stop PHY if needed when entering phy_disconnect
Date: Thu, 17 Jan 2019 20:07:54 +0100	[thread overview]
Message-ID: <f0248feb-f58a-b59e-a041-0421ec1f8151@gmail.com> (raw)
In-Reply-To: <317e1806-c820-9a2a-dadd-5d7121b3047a@gmail.com>

Stop PHY if needed when entering phy_disconnect. This allows drivers
that don't need a separate call to phy_stop() to omit this call.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b5f5cda4c..9e588f03e 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -999,6 +999,9 @@ EXPORT_SYMBOL(phy_connect);
  */
 void phy_disconnect(struct phy_device *phydev)
 {
+	if (phy_is_started(phydev))
+		phy_stop(phydev);
+
 	if (phydev->irq > 0)
 		phy_stop_interrupts(phydev);
 
-- 
2.20.1



  reply	other threads:[~2019-01-17 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 19:06 [PATCH v3 net-next 0/3] net: phy: improve stopping PHY Heiner Kallweit
2019-01-17 19:07 ` Heiner Kallweit [this message]
2019-01-17 19:08 ` [PATCH v3 net-next 2/3] net: phy: ensure phylib state machine is stopped after calling phy_stop Heiner Kallweit
2019-01-17 19:09 ` [PATCH v3 net-next 3/3] net: phy: remove phy_stop_interrupts Heiner Kallweit
2019-01-18 22:12 ` [PATCH v3 net-next 0/3] net: phy: improve stopping PHY David Miller

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=f0248feb-f58a-b59e-a041-0421ec1f8151@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@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 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).