Skip to contentSkip to conversation

Patch "cdc_ncm: toggle altsetting to force reset before setup" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 16, 2016

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

cdc_ncm: toggle altsetting to force reset before setup

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
cdc_ncm-toggle-altsetting-to-force-reset-before-setup.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Sat Apr 16 10:02:53 PDT 2016

From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>
Date: Thu, 3 Mar 2016 22:20:53 +0100
Subject: cdc_ncm: toggle altsetting to force reset before setup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>

[ Upstream commit 48906f62c96cc2cd35753e59310cb70eb08cc6a5 ]

Some devices will silently fail setup unless they are reset first. This is necessary even if the data interface is already in altsetting 0, which it will be when the device is probed for the first time. Briefly toggling the altsetting forces a function reset regardless of the initial state.

This fixes a setup problem observed on a number of Huawei devices, appearing to operate in NTB-32 mode even if we explicitly set them to NTB-16 mode.

---
 drivers/net/usb/cdc_ncm.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/usb/cdc_ncm.c +5 -1
@@ -794,7 +794,11 @@ int cdc_ncm_bind_common(struct usbnet *d
 
 	iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber;
 
-	/* reset data interface */
+	/* Reset data interface. Some devices will not reset properly
+	 * unless they are configured first.  Toggle the altsetting to
+	 * force a reset
+	 */
+	usb_set_interface(dev->udev, iface_no, data_altsetting);
 	temp = usb_set_interface(dev->udev, iface_no, 0);
 	if (temp) {
 		dev_dbg(&intf->dev, "set interface failed\n");

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/qmi_wwan-add-sierra-wireless-em74xx-device-id.patch queue-4.4/qmi_wwan-add-d-link-dwm-221-b1-device-id.patch queue-4.4/cdc_ncm-toggle-altsetting-to-force-reset-before-setup.patch