linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Bjørn Mork" <bjorn-yOkvZcmFvRU@public.gmane.org>
Cc: "Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Johan Hovold" <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Greg Kroah-Hartman"
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"Dan Carpenter"
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Matthias Urlichs"
	<smurf-ci3XGGwdvIcvfNposrsB4g@public.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
Date: Thu, 3 Apr 2014 12:17:29 +0200	[thread overview]
Message-ID: <20140403101729.GG22587@localhost> (raw)
In-Reply-To: <87wqf696wx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>

On Thu, Apr 03, 2014 at 10:03:10AM +0200, Bjørn Mork wrote:
> Rafał Miłecki <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> 
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        0
> >       bAlternateSetting       0
> >       bNumEndpoints           0
> >       bInterfaceClass       255 Vendor Specific Class
> >       bInterfaceSubClass    255 Vendor Specific Subclass
> >       bInterfaceProtocol    255 Vendor Specific Protocol
> >       iInterface              0 
> >       ** UNRECOGNIZED:  05 24 00 10 01
> >       ** UNRECOGNIZED:  05 24 15 00 01
> >       ** UNRECOGNIZED:  05 24 06 00 00
> >       ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
> >       ** UNRECOGNIZED:  06 24 13 00 01 10
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        0
> >       bAlternateSetting       1
> >       bNumEndpoints           2
> >       bInterfaceClass       255 Vendor Specific Class
> >       bInterfaceSubClass    255 Vendor Specific Subclass
> >       bInterfaceProtocol    255 Vendor Specific Protocol
> >       iInterface              0 
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x81  EP 1 IN
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0200  1x 512 bytes
> >         bInterval              32
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x01  EP 1 OUT
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0200  1x 512 bytes
> >         bInterval              32
> >   
> 
> 
> Hmm, AFAICS we never change altsettings in the option/usb_wwan/
> usb-serial probing, so this function ends up without any endpoints at all.
> As such it should just have failed the probe.  But the option driver has
> a static num_ports = 1, which looks like it is overriding the endpoint
> based calculation in usb_serial_probe() even for the case where
> num_bulk_out == 0.  That cannot be right...

You're right. We should probably require both bulk in and out endpoints
in usb_wwan port_probe or return -ENODEV.

The (original option) driver was apparently written under the assumption
that either endpoint could be missing. It would handle opening a device
without bulk-in (but would blow up during resume which was likely
implemented later), but not a missing bulk-out in write() (although it
is handled in some places).

But since it also got the missing-end-point test wrong, this was never
a (critical) issue...

> I believe we should both change altsettings and fail if there still
> aren't enough endpoints available.

The option driver currently does not implement changing altsettings for
any device as you noted. And in fact, this wouldn't even be necessary
for all 19d2:0031. A quick search for lsusb -v output reveals that not
all devices have these altsettings. As we haven't heard of this issue
before, my guess is that the device in question is the odd one.

Would only using interface 3 be sufficient for now? I'd assume so as
this is reported as a regression (which triggers the oops, but the first
two interfaces can obviously never have been used for anything).

I'll cook up a patch for the end-point test during port_probe.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-03 10:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03  6:49 usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation) Rafał Miłecki
     [not found] ` <CACna6ry7WCou6kacACpQK6qhWffCGNGFyLQU8H9WbrVDLoB7Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03  7:18   ` Johan Hovold
2014-04-03  7:23     ` Rafał Miłecki
     [not found]       ` <CACna6rzgnU_=2Gg4v1xk3-KX+zx6G85NksoJiZvbzGyzf+GQ_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03  8:03         ` Bjørn Mork
     [not found]           ` <87wqf696wx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2014-04-03 10:17             ` Johan Hovold [this message]
2014-04-03 11:06               ` [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints Johan Hovold
2014-04-03 11:32                 ` Rafał Miłecki
2014-04-03 14:21                   ` Johan Hovold
2014-04-03 15:20                 ` Rafał Miłecki

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=20140403101729.GG22587@localhost \
    --to=jhovold-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=bjorn-yOkvZcmFvRU@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smurf-ci3XGGwdvIcvfNposrsB4g@public.gmane.org \
    --cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).