Page 1 of 1

Huawei E5785Lh-22c - strange behavior?

Posted: 05 Aug 2022, 20:38
by tomeq_
Hi,

It looks like that Huawei E5785Lh-22c can work as an USB modem as well as Wifi router. Suprisingly, it is being detected quite fine in latest Ubuntu 22.04 with recent kernel. But, there seem to be a problem with this device. It detects all devices at once - CD ROM, ttyUSB0 as "option" serial and proper wwan0 adapter. However, the CDROM part is dropping enormous number of errors like:

Code: Select all

ug  5 19:07:21 ubuntu-2204 kernel: [  430.276664] sr 33:0:0:0: [sr2] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.276669] sr 33:0:0:0: [sr2] tag#0 Sense Key : Medium Error [current]
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.276670] sr 33:0:0:0: [sr2] tag#0 Add. Sense: Unrecovered read error
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.276671] sr 33:0:0:0: [sr2] tag#0 CDB: Read(10) 28 00 00 00 17 fc 00 00 02 00
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.276672] blk_update_request: critical medium error, dev sr2, sector 24560 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.305948] sr 33:0:0:0: [sr2] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.305951] sr 33:0:0:0: [sr2] tag#0 Sense Key : Medium Error [current]
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.305953] sr 33:0:0:0: [sr2] tag#0 Add. Sense: Unrecovered read error
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.305954] sr 33:0:0:0: [sr2] tag#0 CDB: Read(10) 28 00 00 00 17 fa 00 00 02 00
Aug  5 19:07:21 ubuntu-2204 kernel: [  430.305955] blk_update_request: critical medium error, dev sr2, sector 24552 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
and in the end it clogs the machine (high CPU usage and load average) and drops some kernel errors:

Code: Select all


Aug  5 19:12:10 ubuntu-2204 kernel: [  719.197468] perf: interrupt took too long (3305 > 3191), lowering kernel.perf_event_max_sample_rate to 60500
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341980] INFO: task scsi_eh_33:2394 blocked for more than 120 seconds.
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341986]       Not tainted 5.15.0-43-generic #46-Ubuntu
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341987] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341988] task:scsi_eh_33      state:D stack:    0 pid: 2394 ppid:     2 flags:0x00004000
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341992] Call Trace:
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341994]  <TASK>
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.341998]  __schedule+0x23d/0x590
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342003]  schedule+0x4e/0xb0
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342004]  schedule_preempt_disabled+0xe/0x10
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342006]  __mutex_lock.constprop.0+0x263/0x490
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342007]  ? update_load_avg+0x82/0x620
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342011]  __mutex_lock_slowpath+0x13/0x20
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342012]  mutex_lock+0x34/0x40
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342016]  device_reset+0x22/0x50 [usb_storage]
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342020]  scsi_eh_bus_device_reset+0xee/0x2a0
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342023]  scsi_eh_ready_devs+0x67/0x240
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342024]  ? finish_task_switch.isra.0+0xa6/0x270
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342026]  scsi_unjam_host+0x101/0x1c0
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342028]  scsi_error_handler+0x139/0x180
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342029]  ? scsi_unjam_host+0x1c0/0x1c0
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342030]  kthread+0x12a/0x150
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342033]  ? set_kthread_struct+0x50/0x50
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342034]  ret_from_fork+0x22/0x30
Aug  5 19:12:17 ubuntu-2204 kernel: [  726.342037]  </TASK>

some usb_modeswitch outputs:

Code: Select all

sudo usb_modeswitch -v 12d1 -p 1506 -J -W
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1506
HuaweiNewMode=1

Look for default devices ...
  found USB ID 12d1:1506
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
  found USB ID 0e0f:0002
  found USB ID 0e0f:0003
  found USB ID 1d6b:0001
 Found devices in default mode (1)
Access device 005 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
Error: can't use storage command in MessageContent with interface 0; interface class is 255, expected 8. Abort

sudo usb_modeswitch -v 12d1 -p 1506 -W -H
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1506
HuaweiMode=1

Look for default devices ...
  found USB ID 12d1:1506
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
  found USB ID 0e0f:0002
  found USB ID 0e0f:0003
  found USB ID 1d6b:0001
 Found devices in default mode (1)
Access device 005 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Mobile
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Send old Huawei control message ...
Error: Huawei control message failed (error -9). Abort

sudo usb_modeswitch -v 12d1 -p 1506 -W -X
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1506
HuaweiAltMode=1

Look for default devices ...
  found USB ID 12d1:1506
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
  found USB ID 0e0f:0002
  found USB ID 0e0f:0003
  found USB ID 1d6b:0001
 Found devices in default mode (1)
Access device 005 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
Error: can't use storage command in MessageContent with interface 0; interface class is 255, expected 8. Abort

 sudo usb_modeswitch -v 12d1 -p 1506 -W -K
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1506

StandardEject=1

Look for default devices ...
  found USB ID 12d1:1506
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
  found USB ID 0e0f:0002
  found USB ID 0e0f:0003
  found USB ID 1d6b:0001
 Found devices in default mode (1)
Access device 005 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 255
Error: can't use storage command in MessageContent with interface 0; interface class is 255, expected 8. Abort

Generally, it seems that the device responds to AT commands on ttyUSB0 and gets DHCP address from the box itself, but it is unusable until the CDROM part is "gone" or "disabled". But when I detach the CDROM device, all other get disabled and unloaded too...

Is there anything that can be done on usb_modeswitch part?