cdc_ncm: toggle altsetting to force reset before setup
authorBjørn Mork <bjorn@mork.no>
Thu, 3 Mar 2016 21:20:53 +0000 (22:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jun 2016 08:42:49 +0000 (10:42 +0200)
commit13eec5c1f4aebb114fce51e7286562485bb8cd8c
tree7ff3c30db33f5d4f9941f2cf8ad816be4aac9789
parentabcb7fb8535f0e7f87150e0ffbeac5a0ff285718
cdc_ncm: toggle altsetting to force reset before setup

commit 48906f62c96cc2cd35753e59310cb70eb08cc6a5 upstream.

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.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/net/usb/cdc_ncm.c