From patchwork Sun Jul 3 20:24:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 643815 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rjM8Z6MpXz9sXR for ; Mon, 4 Jul 2016 06:25:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=mork.no header.i=@mork.no header.b=g6jyEl0w; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932166AbcGCUZK (ORCPT ); Sun, 3 Jul 2016 16:25:10 -0400 Received: from canardo.mork.no ([148.122.252.1]:41695 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932120AbcGCUZI (ORCPT ); Sun, 3 Jul 2016 16:25:08 -0400 Received: from nemi.mork.no (nemi.mork.no [IPv6:2001:4641:0:2:e8b:fdff:fe08:971]) (authenticated bits=0) by canardo.mork.no (8.14.4/8.14.4) with ESMTP id u63KP173008128 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Sun, 3 Jul 2016 22:25:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=a; t=1467577503; bh=+oIrQntItl9DUojlV5HGh5gD7R6mlIbHrtLcpLyvG1c=; h=From:To:Cc:Date:Message-Id:From; b=g6jyEl0wYIltt+Iq8auHXx1nmgiEltur80ee/aW/dGc8b4kChllE3ZzBqWQ2pPHFp Giq1awG4ZYFeblqsvDoTdpv9JU73scVRt9+toQCMNvunSQxH/E5zr33rqIVT/LXLk+ eKv/ubVZIvGfBwF9aS91gXsbScH91E40MG3s9agH/Iw8bPYRI2PchjH4E8wpdtzobQ hmVLaSrm6S1QWnxJ4rjje5Q6IEWrSi2eGATaIGy0GbhsCJ+PRdQ8PDaol4uAXiS8Na sIjRSYcCsUjVWjhWHTdGZH9GhnLcS8FOlJTmyU2EoR6O2fqBlGX1WYDZ9Ox96M87Xn TI0Cwre6Mx9qQ== Received: from bjorn by nemi.mork.no with local (Exim 4.84_2) (envelope-from ) id 1bJnwr-0007FB-1D; Sun, 03 Jul 2016 22:25:01 +0200 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= To: netdev@vger.kernel.org Cc: Oliver Neukum , linux-usb@vger.kernel.org, =?UTF-8?q?Bj=C3=B8rn=20Mork?= Subject: [PATCH net, stable] cdc_ncm: workaround for EM7455 "silent" data interface Date: Sun, 3 Jul 2016 22:24:50 +0200 Message-Id: <1467577490-27810-1-git-send-email-bjorn@mork.no> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at canardo X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Several Lenovo users have reported problems with their Sierra Wireless EM7455 modem. The driver has loaded successfully and the MBIM management channel has appeared to work, including establishing a connection to the mobile network. But no frames have been received over the data interface. The problem affects all EM7455 and MC7455, and is assumed to affect other modems based on the same Qualcomm chipset and baseband firmware. Testing narrowed the problem down to what seems to be a firmware timing bug during initialization. Adding a short sleep while probing is sufficient to make the problem disappear. Experiments have shown that 1-2 ms is too little to have any effect, while 10-20 ms is enough to reliably succeed. Reported-by: Stefan Armbruster Reported-by: Ralph Plawetzki Reported-by: Andreas Fett Reported-by: Rasmus Lerdorf Reported-by: Samo Ratnik Reported-and-tested-by: Aleksander Morgado Signed-off-by: Bjørn Mork --- I hope this unconditional short sleep during probing is acceptable, as I don't want to start a new non-maintainable quirk device list for this. The EM7455 is already used by a number of laptop vendors, each using their own device ID. More are likely to come. And that's only the modems we *know* are affected... drivers/net/usb/cdc_ncm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 53759c315b97..877c9516e781 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -854,6 +854,13 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ if (cdc_ncm_init(dev)) goto error2; + /* Some firmwares need a pause here or they will silently fail + * to set up the interface properly. This value was decided + * empirically on a Sierra Wireless MC7455 running 02.08.02.00 + * firmware. + */ + usleep_range(10000, 20000); + /* configure data interface */ temp = usb_set_interface(dev->udev, iface_no, data_altsetting); if (temp) {