On 18.01.2021 0:36, Jeremy Figgins wrote:
Certain devices such as Winbond Virtual Com Port, which is used in some usb printers, will stop responding after the usb_control_msg_send()
Hm, not usblp_set_protocol()?
calls in usb_set_interface(). These devices work fine without having usb_set_interface() called, so this flag prevents that call. The naming is designed to mirror the existing USB_QUIRK_NO_SET_INTF flag, but that flag is not sufficient to make these devices work.
Perhaps the handling of that flag should just be extended to yuor case?
Signed-off-by: Jeremy Figgins <kernel@xxxxxxxxxxxxxxxxx> --- drivers/usb/class/usblp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 134dc2005ce9..6e2d58813d7d 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c
[...]
@@ -1332,7 +1334,11 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol) alts = usblp->protocol[protocol].alt_setting; if (alts < 0) return -EINVAL; - r = usb_set_interface(usblp->dev, usblp->ifnum, alts); + if (usblp->quirks & USBLP_QUIRK_NO_SET_INTF) { + r = 0; + } else { + r = usb_set_interface(usblp->dev, usblp->ifnum, alts); + }
The braces above not needed at all. [...] MBR, Sergei