mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denis Du <dudenis2000@yahoo.ca>
To: David Miller <davem@davemloft.net>
Cc: khc@pm.waw.pl, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Carrier detect ok, don't turn off negotiation
Date: Tue, 6 Feb 2018 16:50:42 +0000 (UTC)	[thread overview]
Message-ID: <2005408285.4065183.1517935842178@mail.yahoo.com> (raw)
In-Reply-To: <20180206.102943.1688399898359622454.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]



Ok, I submit it  again.


In drivers/net/wan/hdlc_ppp.c, some noise on physical line can cause the carrier detect still ok, but the protocol will fail. So if carrier detect ok, don't turn off protocol negotiation

This patch is against the kernel version Linux 4.15-rc8





On Tuesday, February 6, 2018, 10:29:53 AM EST, David Miller <davem@davemloft.net> wrote: 





From: Denis Du <dudenis2000@yahoo.ca>

Date: Tue, 6 Feb 2018 15:15:28 +0000 (UTC)

> How  do you think my patch?
> 
> As you see, Krzysztof  think my patch is ok to be accepted.
> But if you have a better idea to fix it,I am glad to see it. Anyway, this issue have to be fixed.


Please resubmit it and I'll think about it again, thank you.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-netdev-carrier-detect-ok-don-t-turn-off-negotiation.patch --]
[-- Type: text/x-patch, Size: 1258 bytes --]

From b5902a4dfc709b62b704997ab64f31c9ef69a6db Mon Sep 17 00:00:00 2001
From: Denis Du <dudenis2000@yahoo.ca>
Date: Mon, 15 Jan 2018 17:26:06 -0500
Subject: [PATCH] netdev: carrier detect ok, don't turn off negotiation

Sometimes when physical lines have a just good noise to make the protocol
handshaking fail, but the carrier detect still good. Then after remove of
the noise, nobody will trigger this protocol to be start again to cause
the link to never come back. The fix is when the carrier is still on, not
terminate the protocol handshaking.

Signed-off-by: Denis Du <dudenis2000@yahoo.ca>
---
 drivers/net/wan/hdlc_ppp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index afeca6b..ab8b3cb 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -574,7 +574,10 @@ static void ppp_timer(struct timer_list *t)
 			ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0,
 				     0, NULL);
 			proto->restart_counter--;
-		} else
+		} else if (netif_carrier_ok(proto->dev))
+			ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0,
+				     0, NULL);
+		else
 			ppp_cp_event(proto->dev, proto->pid, TO_BAD, 0, 0,
 				     0, NULL);
 		break;
-- 
2.1.4


  reply	other threads:[~2018-02-06 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <751079597.1884905.1516121905374.ref@mail.yahoo.com>
2018-01-16 16:58 ` Denis Du
2018-01-22 20:25   ` David Miller
2018-01-22 22:17     ` Denis Du
2018-01-23 17:08     ` Denis Du
2018-01-28 14:24       ` Krzysztof Halasa
2018-02-06 15:18         ` Denis Du
     [not found]         ` <438911112.3985245.1517930128335@mail.yahoo.com>
2018-02-06 15:29           ` David Miller
2018-02-06 16:50             ` Denis Du [this message]
2018-02-21  3:35               ` Denis Du
2018-02-22 19:04                 ` 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=2005408285.4065183.1517935842178@mail.yahoo.com \
    --to=dudenis2000@yahoo.ca \
    --cc=davem@davemloft.net \
    --cc=khc@pm.waw.pl \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®