All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corcodel Marian <corcodel.marian@gmail.com>
To: netdev@vger.kernel.org
Cc: Corcodel Marian <corcodel.marian@gmail.com>
Subject: [PATCH, net-next] r8169: Deny functions membet of array rtl_work
Date: Sat, 29 Aug 2015 13:43:49 +0300	[thread overview]
Message-ID: <1440845029-3079-1-git-send-email-corcodel.marian@gmail.com> (raw)

Deny functions member of array rtl_work to run when link  is
 ok.After rtl8169_init_phy exist 10 sec  timeout.On many  cases link is ok and
 no need to destroy all work.

Signed-off-by: Corcodel Marian <corcodel.marian@gmail.com>

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2d712a4..fc2fe38 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4377,17 +4377,17 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 
 	assert(tp->mac_version > RTL_GIGA_MAC_VER_01);
 
+	if (tp->link_ok(ioaddr))
+		return;
+
 	if (tp->phy_reset_pending(tp)) {
 		/*
 		 * A busy loop could burn quite a few cycles on nowadays CPU.
 		 * Let's delay the execution of the timer for a few ticks.
 		 */
-		timeout = HZ/10;
 		goto out_mod_timer;
 	}
 
-	if (tp->link_ok(ioaddr))
-		return;
 
 	netif_dbg(tp, link, tp->dev, "PHY reset until link up\n");
 
@@ -6890,8 +6890,12 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
 static void rtl_reset_work(struct rtl8169_private *tp)
 {
 	struct net_device *dev = tp->dev;
+	void __iomem *ioaddr = tp->mmio_addr;
 	int i;
 
+	if (tp->link_ok(ioaddr))
+		return;
+
 	napi_disable(&tp->napi);
 	netif_stop_queue(dev);
 	synchronize_sched();
-- 
2.1.4

             reply	other threads:[~2015-08-29 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 10:43 Corcodel Marian [this message]
2015-08-29 11:26 ` [PATCH, net-next] r8169: Deny functions membet of array rtl_work Francois Romieu
     [not found]   ` <CAGg4U=HQwGhQ95+FNumjLOH0m5Bnm8-3kOgfbMUGOV=Lzsyd6A@mail.gmail.com>
2015-08-30  8:13     ` Francois Romieu

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=1440845029-3079-1-git-send-email-corcodel.marian@gmail.com \
    --to=corcodel.marian@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.