usb-serial debugging, missing LSB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm trying to debug a problem I'm having with a usb-serial device
(modem) when it's plugged into a USB port on a custom i.MX6 board.

If I connect a USB to Serial converter (I'm using Prolific PL2303),
and I short the RX and TX lines together so I read back what I write,
I've noticed that I can send data correctly, but when I receive data
it is missing the LSB.  I've verified this by using a logic analyzer
to make sure that when I type "A", the logic analyzer also reads "A".
But when looking at the echo from minicom, it shows "@" instead.  "B"
= "B", "C" = "B", "D" = "D", "E" = "D", and so on.  This same problem
happens to the 3G and 4G modems, as they create ttyACMx ports and
ModemManager is unable to talk to them because of this same issue.
This happens on every board we had made, and I've tried using both
Buildroot and Debian in case it was a rootfs issue... it's not.  I
also tried using a 3.14 kernel and 4.1.15 kernel - same problem exists
in both versions.

I also noticed that if I paste text into the terminal, it often is
successful in echoing back the data.  In other words, if I type in
"ATI", it will echo "@TH".  But if I paste the text "ATI", it will
echo "ATI".  Strange, right?

To add more to the weirdness, I also noticed that with a modem, if I
remove the cdc_acm module, and let use the usb-serial module instead,
the modem will echo back the incorrect characters, but the modem will
respond to the command correctly.  So even though the echo says "@TH",
the modem will report the name of the device correctly.

I'd like to debug this in the usbserial.c driver by adding some
dev_dbg statements when bytes are received in the buffer from the
modem, but it wasn't super clear to me where this happens?  I can see
where bytes are written, but not sure where to look for bytes that are
read. Can you point me into the right direction?  Or has anyone else
ever experienced this issue?  Thanks!

Here are the USB devices attached:
# lsusb
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 003: ID 1546:1104 U-Blox AG
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Here is the dmesg output relating to USB:
# dmesg | grep usb
[    0.215527] usbcore: registered new interface driver usbfs
[    0.215594] usbcore: registered new interface driver hub
[    0.215672] usbcore: registered new device driver usb
[    0.215841] 2000000.aips-bus:usbphy_nop1 supply vcc not found,
using dummy regulator
[    0.215949] 2000000.aips-bus:usbphy_nop2 supply vcc not found,
using dummy regulator
[    0.549706] usbcore: registered new interface driver usb-storage
[    0.549777] usbcore: registered new interface driver usb_ehset_test
[    0.550922] 2184800.usbmisc supply vbus-wakeup not found, using
dummy regulator
[    0.602830] usbcore: registered new interface driver bcm203x
[    0.602914] usbcore: registered new interface driver btusb
[    0.603044] usbcore: registered new interface driver ath3k
[    0.894295] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[    1.323528] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
[    1.563517] usb 1-1.3: new full-speed USB device number 4 using ci_hdrc
[    1.601280] usbcore: registered new interface driver usbhid
[    1.601286] usbhid: USB HID core driver
[    3.676453] usbcore: registered new interface driver usbserial
[    3.676520] usbcore: registered new interface driver usbserial_generic
[    3.676526] usbserial: generic: using generic open
[    3.676530] usbserial: generic: using generic write
[    3.676534] usbserial: generic: using generic close
[    3.676538] usbserial: generic: using generic write_room
[    3.676541] usbserial: generic: using generic chars_in_buffer
[    3.676545] usbserial: generic: using generic read_bulk_callback
[    3.676549] usbserial: generic: using generic write_bulk_callback
[    3.676553] usbserial: generic: using generic process_read_urb
[    3.676557] usbserial: generic: using generic prepare_write_buffer
[    3.676608] usbserial: USB Serial support registered for generic
[    3.692044] usbcore: registered new interface driver pl2303
[    3.692056] usbserial: pl2303: using generic write
[    3.692060] usbserial: pl2303: using generic write_room
[    3.692064] usbserial: pl2303: using generic chars_in_buffer
[    3.692069] usbserial: pl2303: using generic read_bulk_callback
[    3.692073] usbserial: pl2303: using generic write_bulk_callback
[    3.692077] usbserial: pl2303: using generic prepare_write_buffer
[    3.692143] usbserial: USB Serial support registered for pl2303
[    3.699696] usb 1-1.3: pl2303 converter now attached to ttyUSB0
[    3.817184] cdc_ether 1-1.1:1.8 usb0: register 'cdc_ether' at
usb-ci_hdrc.1-1.1, CDC Ethernet Device, 6a:dc:65:00:ec:f6
[    3.817323] usbcore: registered new interface driver cdc_ether
[    4.113888] usbcore: registered new interface driver cdc_acm


Here's my device tree:
reg_usbotg_vbus: regulator@3 {
        compatible = "regulator-fixed";
        reg = <3>;
        regulator-name = "usb_otg_vbus";
        regulator-min-microvolt = <5000000>;
        regulator-max-microvolt = <5000000>;
        regulator-always-on;
};

...

pinctrl_usbh1: usbh1grp {
        fsl,pins = <
                #define GP_USBH1_HUB_RESET      <&gpio1 1 GPIO_ACTIVE_LOW>
                MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x0b0b0
        >;
};

pinctrl_usbotg: usbotggrp {
        fsl,pins = <
                MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x17059
        >;
};

...

&usbh1 {
        vbus-supply = <&reg_usbotg_vbus>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usbh1>;
        disable-over-current;
        reset-gpios = GP_USBH1_HUB_RESET;
        status = "okay";
};

&usbotg {
        vbus-supply = <&reg_usbotg_vbus>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usbotg>;
        disable-over-current;
        status = "okay";
};

Let me know what else you need.

-- 
-brent
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux