Linux USB
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Jeremy Figgins <kernel@jeremyfiggins.com>,
	zaitcev@redhat.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: usblp: add USBLP_QUIRK_NO_SET_INTF flag
Date: Mon, 18 Jan 2021 12:02:19 +0300	[thread overview]
Message-ID: <b86d1b77-602f-b365-533c-f6fc398fb717@gmail.com> (raw)
In-Reply-To: <YASt5wgOCkXhH2Dv@watson>

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@jeremyfiggins.com>
> ---
>   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

      parent reply	other threads:[~2021-01-18  9:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 21:36 [PATCH] USB: usblp: add USBLP_QUIRK_NO_SET_INTF flag Jeremy Figgins
2021-01-18  5:44 ` Pete Zaitcev
2021-01-18 16:31   ` Alan Stern
2021-01-18 16:43     ` Michael Sweet
2021-01-19  0:01       ` Jeremy Figgins
2021-01-21 19:21         ` Pete Zaitcev
2021-01-21 19:19     ` Pete Zaitcev
2021-01-21 19:29       ` Alan Stern
2021-01-21 23:02         ` Pete Zaitcev
2021-01-22  1:06           ` Jeremy Figgins
2021-01-22 16:22             ` Alan Stern
2021-01-23 18:46               ` Jeremy Figgins
2021-01-23 21:33                 ` Alan Stern
2021-01-22 16:20           ` Alan Stern
2021-01-18  9:02 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b86d1b77-602f-b365-533c-f6fc398fb717@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@jeremyfiggins.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox