Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbcLBSng convert rfc822-to-8bit (ORCPT ); Fri, 2 Dec 2016 13:43:36 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:38434 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751608AbcLBSne (ORCPT ); Fri, 2 Dec 2016 13:43:34 -0500 Date: Fri, 02 Dec 2016 13:40:42 -0500 (EST) Message-Id: <20161202.134042.35902054506958012.davem@davemloft.net> To: kristian.evensen@gmail.com Cc: oliver@neukum.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATH net v2] cdc_ether: Fix handling connection notification From: David Miller In-Reply-To: <20161201132317.32324-1-kristian.evensen@gmail.com> References: <20161201132317.32324-1-kristian.evensen@gmail.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 02 Dec 2016 09:41:21 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1803 Lines: 37 From: Kristian Evensen Date: Thu, 1 Dec 2016 14:23:17 +0100 > Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") > introduced a work-around in usbnet_cdc_status() for devices that exported > cdc carrier on twice on connect. Before the commit, this behavior caused > the link state to be incorrect. It was assumed that all CDC Ethernet > devices would either export this behavior, or send one off and then one on > notification (which seems to be the default behavior). > > Unfortunately, it turns out multiple devices sends a connection > notification multiple times per second (via an interrupt), even when > connection state does not change. This has been observed with several > different USB LAN dongles (at least), for example 13b1:0041 (Linksys). > After bfe9b9d2df66, the link state has been set as down and then up for > each notification. This has caused a flood of Netlink NEWLINK messages and > syslog to be flooded with messages similar to: > > cdc_ether 2-1:2.0 eth1: kevent 12 may have been dropped > > This commit fixes the behavior by reverting usbnet_cdc_status() to how it > was before bfe9b9d2df66. The work-around has been moved to a separate > status-function which is only called when a known, affect device is > detected. > > v1->v2: > > * Do not open-code netif_carrier_ok() (thanks Henning Schild). > * Call netif_carrier_off() instead of usb_link_change(). This prevents > calling schedule_work() twice without giving the work queue a chance to be > processed (thanks Bj?rn Mork). > > Fixes: bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") > Reported-by: Henning Schild > Signed-off-by: Kristian Evensen Applied and queued up for -stable, thanks.