public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Giacinto Cifelli <gciofono@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: usb composition without class
Date: Thu, 20 Jun 2024 11:58:54 +0200	[thread overview]
Message-ID: <2024062042-sandal-unending-44cd@gregkh> (raw)
In-Reply-To: <CAKSBH7HeKuP7gA7hk-RFFdnQpaSAOF46JRnQeqFgcA1deG3D6w@mail.gmail.com>

On Thu, Jun 20, 2024 at 11:25:43AM +0200, Giacinto Cifelli wrote:
> On Thu, Jun 20, 2024 at 8:41 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > > > On Thu, Jun 20, 2024 at 07:58:13AM +0200, Giacinto Cifelli wrote:
> > > > > greetings,
> > > > >
> > > > > question:
> > > > >
> > > > > on a system (yocto), I have a usb composition that doesn't assign the
> > > > > class for the interfaces:
> > > > >     |__ Port 3: Dev 3, If 10, Class=, Driver=cdc_mbim, 480M
> > > > >     |__ Port 3: Dev 3, If 8, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 6, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 4, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 2, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 11, Class=, Driver=cdc_mbim, 480M
> > > > >     |__ Port 3: Dev 3, If 0, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 9, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 7, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 5, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 3, Class=, Driver=cdc_acm, 480M
> > > > >     |__ Port 3: Dev 3, If 1, Class=, Driver=cdc_acm, 480M
> > > > > Kernel: Linux version 6.1.35 (oe-user@oe-host) (x86_64-poky-linux-gcc
> > > > > (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP
> > > > > PREEMPT_DYNAMIC Thu Jun 22 18:03:13 UTC 2023
> > > > >
> > > > > instead of (arch):
> > > > >     |__ Port 004: Dev 004, If 0, Class=Communications, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 1, Class=CDC Data, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 2, Class=Communications, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 3, Class=CDC Data, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 4, Class=Communications, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 5, Class=CDC Data, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 6, Class=Communications, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 7, Class=CDC Data, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 8, Class=Communications, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 9, Class=CDC Data, Driver=cdc_acm, 5000M
> > > > >     |__ Port 004: Dev 004, If 10, Class=Communications, Driver=cdc_mbim, 5000M
> > > > >     |__ Port 004: Dev 004, If 11, Class=CDC Data, Driver=cdc_mbim, 5000M
> > > > > Kernel: Linux 6.6.34-1-lts #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024
> > > > > 14:45:31 +0000 x86_64 GNU/Linux
> > > > >
> > > > > This lack of class creates too many /dev/ttyACMx ports, and
> > > > > ModemManager tries to access them all, perhaps also blocking the
> > > > > device, and the whole system doesn't work.
> > > > >
> > > > > For completeness, the device is:
> > > > >     Bus 002 Device 004: ID 1e2d:0065 Gemalto M2M GmbH LTE Modem
> > > > > which is supported without any customs in the cdc-acm and cdc_mbim drivers.
> > > > >
> > > > > I spotted only two options not compiled-in in the yocto .config
> > > > > (compared with the arch one), but I strongly doubt this is related:
> > > > >     CONFIG_USB_G_MULTI
> > > > >     CONFIG_USB_G_MULTI_CDC
> > > > >
> > > > > Would you know why the class is not assigned?
> > > >
> > > > This is just a userspace issue, right?
> > >
> > > I think the class is assigned by the kernel/driver.
> > >
> > > > Or are you saying that somehow
> > > > the same device plugged into two different systems works differently?
> > >
> > > correct: the same device works differently in the two systems...  in
> > > the sense of the class not assigned.
> >
> > It's not that it is not assigned, it's that something isn't figuring it
> > out properly.
> >
> > Can you provide the output of 'lsusb -v -d 1e2d:0065' for both systems?
> 
> they seem ok with -v, I don't understand it.

Nope, there are major differences, let's look at the start:

-yocto:
+arch:

-Bus 001 Device 003: ID 1e2d:0065 Cinterion LTE Modem
+Bus 002 Device 004: ID 1e2d:0065 Gemalto M2M GmbH LTE Modem

Ok, this means that for your yocto system you probably do NOT have an
updated hw.ids package installed for lsusb to use to figure out a lot of
different things in text form.  Things like:

   bLength                18
   bDescriptorType         1
-  bcdUSB               2.00
-  bDeviceClass          239
-  bDeviceSubClass         2
-  bDeviceProtocol         1
-  bMaxPacketSize0        64
-  idVendor           0x1e2d
-  idProduct          0x0065
+  bcdUSB               3.10
+  bDeviceClass          239 Miscellaneous Device
+  bDeviceSubClass         2 [unknown]
+  bDeviceProtocol         1 Interface Association
+  bMaxPacketSize0         9
+  idVendor           0x1e2d Gemalto M2M GmbH
+  idProduct          0x0065 LTE Modem


Class protocol defintions and the like.

But what's MOST important here is that right away, you see that on your
yocto device you are running at a 2.0 USB speed, not a 3.1 speed, right?

Perhaps that's the problem here?  The device looks quite different for
when it is in a 3.1 supported system, with different configurations
possible, and a different length entirely:

   Configuration Descriptor:
     bLength                 9
     bDescriptorType         2
-    wTotalLength       0x01a9
+    wTotalLength       0x0215

Are you _SURE_ this is the same device?  I would suggest getting your
yocto system updated and running at full USB 3 speeds and see if that
fixes the issues here.

hope this helps,

greg k-h

  reply	other threads:[~2024-06-20  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  5:58 usb composition without class Giacinto Cifelli
2024-06-20  6:06 ` Greg KH
2024-06-20  6:32   ` Giacinto Cifelli
2024-06-20  6:40     ` Greg KH
2024-06-20  9:25       ` Giacinto Cifelli
2024-06-20  9:58         ` Greg KH [this message]
2024-06-20 10:19           ` Giacinto Cifelli

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=2024062042-sandal-unending-44cd@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=gciofono@gmail.com \
    --cc=linux-usb@vger.kernel.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