[iMX27] USB with 4.1 kernel stops working after boot time (from kernel.org and fslc github)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[iMX27] USB with 4.1 kernel stops working after boot time (from kernel.org and fslc github)

Jump to solution
3,236 Views
kesaco
Contributor II

Hi,

Before describing the issue I am working on, please note that my knowledge of the USB stack is not very strong so do not hesitate to point me out good articles about it.

The goal: I am working on enabling USB on an iMX27 with the following hardware configuration. I tried with Kernel 4.1.5 from kernel.org and also with 4.1.13 from Freescale Github with same results.

  • Used ports: OTG and Host 2
  • Interface: ULPI
  • PHY: ISP1504 or USB3340

The kernel configuration and the device tree are below.

Please note that USB works well with an old 2.6.32.x kernel.

For the moment, I had to hack the ci_hdrc_imx.c file in order to use the "otg_ulpi_create" function from drivers/usb/phy/phy-ulpi.c and access the ULPI viewport. Then I added a call to "ulpi_set_vbus" function (with the DRVVBUSEXT flag) so both ports are now well powered.

The observations:

At boot, the root hubs are enumerated, as well as any USB device plugged in. The devices are binded to the matching driver ("hub" for the root hubs, "usbhid" for the mouse, "usb-storage" for the pen drive). This is seen from lsusb as well as /sys/kernel/debug/usb/devices virtual file. But then, there is nothing "coming from" the devices, nothing happens. I can even unplug the USB devices, the kernel is not aware of that and the list of plugged devices do not evolves. Nothing is detected if I plug a new device after boot neither.

The relevant lines of the dmesg are below too.

Any idea of what could happen/miss ? What kind of investigation should I try ?

Thank you for helping and do not hesitate to ask me to clarify if needed.

DEFCONFIG

--> Device Drivers

--> USB support

Support for Host-side USB

USB announce new devices

Enables USB persist by default

OTG support

USB 2.0 OTG FSM implementation

USB monitor

EHCI HCD support

Root Hub transaction translators

Improved transaction translators

Support for Freescale i.MX on-chip EHCI USB controller

***

USB mass storage support

USB Attached SCSI

***

ChipIdea Highspeed Dual Role Controller

ChipIdea host controller

ChipIdea driver debug

***

USB LD driver

USB Physical Layer drivers

NOP USB transceiver driver

Generic ULPI Transceiver driver

USB Gadget support

DEVICE TREE

/ {

[...]

        regulators {

                compatible = "simple-bus";

                #address-cells = <1>;

                #size-cells = <0>;

                reg_5v0: regulator@2 {

                        compatible = "regulator-fixed";

                        reg = <2>;

                        regulator-name = "5V0";

                        regulator-min-microvolt = <5000000>;

                        regulator-max-microvolt = <5000000>;

                        //regulator-always-on;

                        //regulator-enable-ramp-delay;

                };

        };

        usbphy {

                compatible = "simple-bus";

                #address-cells = <1>;

                #size-cells = <0>;

               usbphy0: usbphy@0 {

                        compatible = "usb-nop-xceiv";

                        reg = <0>;

                        vcc-supply = <&reg_5v0>;

                        clocks = <&clks IMX27_CLK_DUMMY>;

                        clock-names = "main_clk";

                        vbus-regulator = <&reg_5v0>;

                };

                usbphy1: usbphy@1 {

                        compatible = "usb-nop-xceiv";

                        reg = <1>;

                        vcc-supply = <&reg_5v0>;

                        clocks = <&clks IMX27_CLK_DUMMY>;

                        clock-names = "main_clk";

                        vbus-regulator = <&reg_5v0>;

                };

        };

};

&usbh2 {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usbh2>;

        dr_mode = "host";

        phy_type = "ulpi";

        disable-over-current;

        fsl,usbphy = <&usbphy0>;

        vbus-supply = <&reg_5v0>;

        status = "okay";

};

&usbotg {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usbotg>;

        dr_mode = "otg";

        phy_type = "ulpi";

        disable-over-current;

        fsl,usbphy = <&usbphy1>;

        vbus-supply = <&reg_5v0>;

        maximum-speed = "low-speed";

        status = "okay";

};

[...]

&iomuxc {

[...]

                pinctrl_usbh2: usbh2grp {

                        fsl,pins = <

                                MX27_PAD_USBH2_CLK__USBH2_CLK           0x0

                                MX27_PAD_USBH2_DIR__USBH2_DIR           0x0

                                MX27_PAD_USBH2_NXT__USBH2_NXT           0x0

                                MX27_PAD_USBH2_STP__USBH2_STP           0x0

                                MX27_PAD_CSPI2_SCLK__USBH2_DATA0        0x0

                                MX27_PAD_CSPI2_MOSI__USBH2_DATA1        0x0

                                MX27_PAD_CSPI2_MISO__USBH2_DATA2        0x0

                                MX27_PAD_CSPI2_SS1__USBH2_DATA3         0x0

                                MX27_PAD_CSPI2_SS2__USBH2_DATA4         0x0

                                MX27_PAD_CSPI1_SS2__USBH2_DATA5         0x0

                                MX27_PAD_CSPI2_SS0__USBH2_DATA6         0x0

                                MX27_PAD_USBH2_DATA7__USBH2_DATA7       0x0

                        >;

                };

                pinctrl_usbotg: usbotggrp {

                        fsl,pins = <

                                MX27_PAD_USBOTG_CLK__USBOTG_CLK         0x0

                                MX27_PAD_USBOTG_DIR__USBOTG_DIR         0x0

                                MX27_PAD_USBOTG_NXT__USBOTG_NXT         0x0

                                MX27_PAD_USBOTG_STP__USBOTG_STP         0x0

                                MX27_PAD_USBOTG_DATA0__USBOTG_DATA0     0x0

                                MX27_PAD_USBOTG_DATA1__USBOTG_DATA1     0x0

                                MX27_PAD_USBOTG_DATA2__USBOTG_DATA2     0x0

                                MX27_PAD_USBOTG_DATA3__USBOTG_DATA3     0x0

                                MX27_PAD_USBOTG_DATA4__USBOTG_DATA4     0x0

                                MX27_PAD_USBOTG_DATA5__USBOTG_DATA5     0x0

                                MX27_PAD_USBOTG_DATA6__USBOTG_DATA6     0x0

                                MX27_PAD_USBOTG_DATA7__USBOTG_DATA7     0x0

                        >;

                };

[...]

};

DMESG (with a mouse plugged)

[    5.559445] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[    5.566680] ehci-pci: EHCI PCI platform driver

[    5.575045] ehci-mxc: Freescale On-Chip EHCI Host driver

[    5.586372] usbcore: registered new interface driver uas

[    5.593066] usbcore: registered new interface driver usb-storage

[    5.600061] usbcore: registered new interface driver ldusb

[    5.606670] usbcore: registered new interface driver usbtest

[    5.613307] usbcore: registered new interface driver lvs

[    5.628205] ci_hdrc ci_hdrc.0: ChipIdea HDRC found, revision: 10, lpm: 0; cap: f4424100 op: f4424140

[    5.638034] ci_hdrc ci_hdrc.0: It is OTG capable controller

[    5.647222] ci_hdrc ci_hdrc.0: doesn't support gadget

[    5.657084] ci_hdrc ci_hdrc.0: EHCI Host Controller

[    5.663035] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

[    5.695765] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00

[    5.701766] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

[    5.708807] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    5.716242] usb usb1: Product: EHCI Host Controller

[    5.721174] usb usb1: Manufacturer: Linux 4.1.5-nvp-00017-ge121ba5-dirty ehci_hcd

[    5.728788] usb usb1: SerialNumber: ci_hdrc.0

[    5.739998] hub 1-0:1.0: USB hub found

[    5.744161] hub 1-0:1.0: 1 port detected

[    5.776375] ULPI transceiver vendor/product ID 0x0424/0x0009

[    5.782074] Found SMSC USB334x ULPI transceiver.

[    5.786897] ULPI integrity check: passed.

[    5.790976] ULPI ulpi_set_vbus

[    5.818923] ci_hdrc ci_hdrc.1: ChipIdea HDRC found, revision: 10, lpm: 0; cap: f4424500 op: f4424540

[    5.836690] ci_hdrc ci_hdrc.1: EHCI Host Controller

[    5.842644] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2

[    5.875769] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00

[    5.881800] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002

[    5.888838] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    5.896274] usb usb2: Product: EHCI Host Controller

[    5.901209] usb usb2: Manufacturer: Linux 4.1.5-nvp-00017-ge121ba5-dirty ehci_hcd

[    5.908821] usb usb2: SerialNumber: ci_hdrc.1

[    5.920076] hub 2-0:1.0: USB hub found

[    5.924244] hub 2-0:1.0: 1 port detected

[    5.951158] ULPI transceiver vendor/product ID 0x0424/0x0009

[    5.957023] Found SMSC USB334x ULPI transceiver.

[    5.961699] ULPI integrity check: passed.

[    5.965935] ULPI ulpi_set_vbus on/off

[    6.097409] usbcore: registered new interface driver usbhid

[    6.103029] usbhid: USB HID core driver

[    7.225701] usb 1-1: new low-speed USB device number 2 using ci_hdrc

[    7.421435] usb 1-1: New USB device found, idVendor=1c4f, idProduct=0003

[    7.428700] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[    7.441492] usb 1-1: Product: Usb Mouse

[    7.445380] usb 1-1: Manufacturer: SIGMACHIP

[    7.504425] input: SIGMACHIP Usb Mouse as /devices/platform/soc/10020000.aipi/10024000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/0003:1C4F:0000

[    7.523995] hid-generic 0003:1C4F:0003.0001: input: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-ci_hdrc.0-1/input0

Edit: Backtrace when accessing an USB key

When my Intenso USB key is plugged at boot time, it is recognized (see following logs) bug when I want to mount it I get an error:

[...DMESG...]

[    6.226754] usb 2-1: new high-speed USB device number 2 using ci_hdrc

[    6.417956] usb 2-1: New USB device found, idVendor=1f75, idProduct=0817

[    6.424721] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[    6.437610] usb 2-1: Product: Intenso Rainbow Line

[    6.442931] usb 2-1: Manufacturer: is817

[    6.447529] usb 2-1: SerialNumber: 201404301057

[    6.478698] usb-storage 2-1:1.0: USB Mass Storage device detected

[    6.494697] scsi host0: usb-storage 2-1:1.0

[    7.524911] scsi 0:0:0:0: Direct-Access     Intenso  Rainbow Line     1.00 PQ: 0 ANSI: 6

[    7.572095] sd 0:0:0:0: [sda] 7905280 512-byte logical blocks: (4.04 GB/3.76 GiB)

[    7.594994] sd 0:0:0:0: Attached scsi generic sg0 type 0

[    7.611986] sd 0:0:0:0: [sda] Write Protect is off

[    7.630293] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00

[    7.651152] sd 0:0:0:0: [sda] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA

[    7.740637]  sda: sda1

[    7.799752] sd 0:0:0:0: [sda] Attached SCSI removable disk

[...INIT...]

mkdir: can't create directory '/run/media/sda1': No such file or directory

mount: mounting /dev/sda1 on /run/media/sda1 failed: No such file or directory

root@th7:~# lsusb

Bus 002 Device 002: ID 1f75:0817

Bus 001 Device 001: ID 1d6b:0002

Bus 002 Device 001: ID 1d6b:0002

root@th7:~# ls -l  /dev/sda*

brw-r-----    1 root     disk        8,   0 Dec 21 17:16 /dev/sda

brw-rw----    1 root     root        8,   1 Dec 21 17:16 /dev/sda1

root@th7:~# mount -t vfat /dev/sda1 /mnt/key/

[  135.572985] Unhandled fault: external abort on non-linefetch (0x008) at 0xf4424544

[  135.580611] pgd = c0004000

[  135.583345] [f4424544] *pgd=10000452(bad)

[  135.587419] Internal error: : 8 [#1] PREEMPT ARM

[  135.592060] Modules linked in:

[  135.595170] CPU: 0 PID: 493 Comm: usb-storage Not tainted 4.1.5-nvp-00017-ge121ba5-dirty #740

[  135.603717] Hardware name: NVP Th7 system based on Freescale i.MX27L

[  135.610793] task: c7987460 ti: c7bd6000 task.ti: c7bd6000

[  135.616243] PC is at ehci_poll_ASS+0x30/0xc8

[  135.620550] LR is at qh_link_async+0xac/0xd0

[  135.624851] pc : [<c02f5848>]    lr : [<c02f598c>]    psr: 60000093

[  135.624851] sp : c7bd7c48  ip : 00000000  fp : c7bd7c54

[  135.636356] r10: 00000002  r9 : a0000013  r8 : c7971be0

[  135.641604] r7 : 00000000  r6 : c798a540  r5 : a78b80c2  r4 : c7971be0

[  135.648155] r3 : c798a540  r2 : 00010005  r1 : f4424540  r0 : c798a540

[  135.654707] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel

[  135.662127] Control: 0005317f  Table: a71f0000  DAC: 00000017

[  135.667898] Process usb-storage (pid: 493, stack limit = 0xc7bd6190)

[  135.674275] Stack: (0xc7bd7c48 to 0xc7bd8000)

[  135.678672] 7c40:                   c7bd7c74 c7bd7c58 c02f598c c02f5828 00000003 c7abf900

[  135.686894] 7c60: c798a400 c7bd7ca0 c7bd7cdc c7bd7c78 c02f9d70 c02f58f0 c79bfef8 00000001

[  135.695114] 7c80: c7987490 c7bd7e3c c7bd7cbc c7bd7c98 c003c4b0 c003b8cc 00000010 c798a540

[  135.703332] 7ca0: c892d1b8 c892d1b8 00000002 c056e288 ffffffff c7abf900 c798a400 00000000

[  135.711553] 7cc0: 00000010 c79d1c00 00000003 c7bd6000 c7bd7d8c c7bd7ce0 c02daaf8 c02f9c8c

[  135.719771] 7ce0: c7bd7d14 c7bd7cf0 c03ee948 c0036d1c c7bd7d18 c7bd6000 00000001 00000001

[  135.727989] 7d00: 00000001 c7bd7ddc c7bd7d2c c7bd7d18 c03eec64 c03ee780 00000000 7fffffff

[  135.736208] 7d20: c7bd7d7c c7bd7d30 c03f1844 c03eec30 c7bd6000 00000002 00000000 00000000

[  135.744426] 7d40: c7bc5c50 00000000 c7bd7d9c c7bd7d58 00000201 c7abf580 c7bd6000 00000001

[  135.752645] 7d60: 00000001 c7abf900 00000010 00000002 00000004 c79d1c00 00000003 c7bd6000

[  135.760864] 7d80: c7bd7dd4 c7bd7d90 c02dc730 c02daa48 00002893 00000000 c7987490 00000000

[  135.769083] 7da0: c7bd7dcc 00000001 c054baf0 c7bc5bb0 00000000 c7bd7ddc 00000000 00000000

[  135.777303] 7dc0: 0000001f c7bd6000 c7bd7e04 c7bd7dd8 c02fe6a8 c02dc464 ffffffff 00000000

[  135.785523] 7de0: c7bd7de0 c7bd7de0 c7bc5bb0 0000001f c0010200 00000000 c7bd7e2c c7bd7e08

[  135.793742] 7e00: c02feb10 c02fe634 ffffffff c78233c0 c89b2000 c7bc5bb0 c7bcfe20 c89b200f

[  135.801961] 7e20: c7bd7e64 c7bd7e30 c02fed80 c02fead4 00000000 00000001 00000001 c7bc5c68

[  135.810180] 7e40: c7bc5bb0 c7bcfe20 c7bc5c68 c054c9d0 00000000 00000000 c7bd7efc c7bd7e68

[  135.818399] 7e60: c02ff5f4 c02fecc0 c7bd7e9c c7bd7e78 c0037ff8 c0036c88 c7bd7eac c7bd7e88

[  135.826617] 7e80: c003377c c78233c0 00000000 c7bc5c68 c7bd6000 00000001 00000001 00000001

[  135.834837] 7ea0: c7bc5c68 00000000 c7bd7efc c7bd7eb8 c03ef67c c03f16d0 c7bd7ed4 c7bd7ec8

[  135.843056] 7ec0: c001c498 00000001 c7987460 c0038150 00100100 c7bc5bb0 00000000 c7bc5c68

[  135.851276] 7ee0: c054c9d0 00000000 00000000 c7bd6000 c7bd7f0c c7bd7f00 c02fe3b0 c02ff5dc

[  135.859496] 7f00: c7bd7f64 c7bd7f10 c0300b4c c02fe3b0 00000000 00000000 c7bd7f4c c7bd7f28

[  135.867715] 7f20: c03ee854 c003b938 c7bd7f50 c7bd6000 00000000 c7bc5bb0 c0300970 c79be840

[  135.875933] 7f40: 00000000 c7bc5bb0 c0300970 00000000 00000000 00000000 c7bd7fac c7bd7f68

[  135.884153] 7f60: c0032834 c0300980 c7bd7f94 00000000 c0036e40 c7bc5bb0 00000000 c7bd7f7c

[  135.892373] 7f80: c7bd7f7c 00000000 c7bd7f88 c7bd7f88 c79be840 c003276c 00000000 00000000

[  135.900592] 7fa0: 00000000 c7bd7fb0 c000a480 c003277c 00000000 00000000 00000000 00000000

[  135.908808] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[  135.917025] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000

[  135.925218] Backtrace:

[  135.927738] [<c02f5818>] (ehci_poll_ASS) from [<c02f598c>] (qh_link_async+0xac/0xd0)

[  135.935538] [<c02f58e0>] (qh_link_async) from [<c02f9d70>] (ehci_urb_enqueue+0xf4/0xfe0)

[  135.943651]  r6:c7bd7ca0 r5:c798a400 r4:c7abf900 r3:00000003

[  135.949428] [<c02f9c7c>] (ehci_urb_enqueue) from [<c02daaf8>] (usb_hcd_submit_urb+0xc0/0x958)

[  135.957974]  r10:c7bd6000 r9:00000003 r8:c79d1c00 r7:00000010 r6:00000000 r5:c798a400

[  135.965913]  r4:c7abf900

[  135.968499] [<c02daa38>] (usb_hcd_submit_urb) from [<c02dc730>] (usb_submit_urb+0x2dc/0x4e4)

[  135.976957]  r10:c7bd6000 r9:00000003 r8:c79d1c00 r7:00000004 r6:00000002 r5:00000010

[  135.984894]  r4:c7abf900

[  135.987477] [<c02dc454>] (usb_submit_urb) from [<c02fe6a8>] (usb_stor_msg_common+0x84/0x148)

[  135.995935]  r10:c7bd6000 r9:0000001f r8:00000000 r7:00000000 r6:c7bd7ddc r5:00000000

[  136.003873]  r4:c7bc5bb0

[  136.006456] [<c02fe624>] (usb_stor_msg_common) from [<c02feb10>] (usb_stor_bulk_transfer_buf+0x4c/0x88)

[  136.015869]  r7:00000000 r6:c0010200 r5:0000001f r4:c7bc5bb0

[  136.021637] [<c02feac4>] (usb_stor_bulk_transfer_buf) from [<c02fed80>] (usb_stor_Bulk_transport+0xd0/0x358)

[  136.031486]  r7:c89b200f r6:c7bcfe20 r5:c7bc5bb0 r4:c89b2000

[  136.037256] [<c02fecb0>] (usb_stor_Bulk_transport) from [<c02ff5f4>] (usb_stor_invoke_transport+0x28/0x578)

[  136.047017]  r9:00000000 r8:00000000 r7:c054c9d0 r6:c7bc5c68 r5:c7bcfe20 r4:c7bc5bb0

[  136.054895] [<c02ff5cc>] (usb_stor_invoke_transport) from [<c02fe3b0>] (usb_stor_transparent_scsi_command+0x10/0x14)

[  136.065439]  r10:c7bd6000 r9:00000000 r8:00000000 r7:c054c9d0 r6:c7bc5c68 r5:00000000

[  136.073382]  r4:c7bc5bb0

[  136.075969] [<c02fe3a0>] (usb_stor_transparent_scsi_command) from [<c0300b4c>] (usb_stor_control_thread+0x1dc/0x2e8)

[  136.086549] [<c0300970>] (usb_stor_control_thread) from [<c0032834>] (kthread+0xc8/0xe4)

[  136.094657]  r10:00000000 r9:00000000 r8:00000000 r7:c0300970 r6:c7bc5bb0 r5:00000000

[  136.102597]  r4:c79be840

[  136.105188] [<c003276c>] (kthread) from [<c000a480>] (ret_from_fork+0x14/0x34)

[  136.112431]  r7:00000000 r6:00000000 r5:c003276c r4:c79be840

[  136.118197] Code: e59010a0 e3120020 13a0c902 03a0c000 (e5912004)

[  136.124318] ---[ end trace 8bbfaff994fa3bba ]---

[  136.128964] note: usb-storage[493] exited with preempt_count 1

Labels (2)
0 Kudos
1 Solution
1,881 Views
kesaco
Contributor II

After some testing the problem was related to the 4.1.5 version. When I pulled from the official repo and got updated to the 4.1.15 the issues were gone :smileyhappy:

View solution in original post

0 Kudos
4 Replies
1,881 Views
alexandreschneg
Contributor I

Hello,

Can you tell me exactly what modifications have you made to the ci_hdrc_imx.c file ?

I'm using the same setup as you but I'm getting a kernel oops on boot:

[    0.852571] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[    0.860030] ehci-mxc: Freescale On-Chip EHCI Host driver

[    0.867649] usbcore: registered new interface driver cdc_acm

[    0.874168] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

[    0.883203] usbcore: registered new interface driver usblp

[    0.889776] usbcore: registered new interface driver usb-storage

[    0.897190] usbcore: registered new interface driver usbserial

[    0.904330] usbcore: registered new interface driver ftdi_sio

[    0.910976] usbserial: USB Serial support registered for FTDI USB Serial Device

[    0.919036] usbcore: registered new interface driver pl2303

[    0.925543] usbserial: USB Serial support registered for pl2303

[    0.942033] ci_hdrc ci_hdrc.0: EHCI Host Controller

[    0.948459] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

[    0.973051] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00

[    0.979068] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

[    0.986207] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    0.993677] usb usb1: Product: EHCI Host Controller

[    0.998616] usb usb1: Manufacturer: Linux 4.1.16 ehci_hcd

[    1.004230] usb usb1: SerialNumber: ci_hdrc.0

[    1.011734] hub 1-0:1.0: USB hub found

[    1.016318] hub 1-0:1.0: 1 port detected

[    1.025049] ci_hdrc ci_hdrc.1: EHCI Host Controller

[    1.031228] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2

[    1.053027] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00

[    1.059034] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002

[    1.066127] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

[    1.073604] usb usb2: Product: EHCI Host Controller

[    1.078543] usb usb2: Manufacturer: Linux 4.1.16 ehci_hcd

[    1.084152] usb usb2: SerialNumber: ci_hdrc.1

[    1.091641] hub 2-0:1.0: USB hub found

[    1.096205] hub 2-0:1.0: 1 port detected

[    1.100770] Unhandled fault: external abort on non-linefetch (0x808) at 0xf4424584

[    1.108388] pgd = c0004000

[    1.111119] [f4424584] *pgd=10000452(bad)

[    1.115196] Internal error: : 808 [#1] PREEMPT ARM

[    1.120010] Modules linked in:

[    1.123118] CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.16 #3

[    1.128892] Hardware name: Freescale i.MX27 (Device Tree Support)

[    1.135014] task: c3825b60 ti: c382e000 task.ti: c382e000

[    1.140465] PC is at ehci_port_power+0x6c/0x74

[    1.144951] LR is at ehci_hub_control+0xa5c/0xd28

[    1.149688] pc : [<c0310d58>]    lr : [<c0313cd0>]    psr: 60000013

[    1.149688] sp : c382f8d8  ip : 80001000  fp : 00000001

[    1.161196] r10: 80000013  r9 : 00000001  r8 : 80000013

[    1.166443] r7 : 00000000  r6 : 80000000  r5 : 00000000  r4 : c3a32c00

[    1.172995] r3 : f4424580  r2 : 00000001  r1 : 00000000  r0 : c3a32d40

[    1.179548] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel

[    1.186882] Control: 0005317f  Table: a0004000  DAC: 00000017

[    1.192655] Process swapper (pid: 1, stack limit = 0xc382e190)

[    1.198518] Stack: (0xc382f8d8 to 0xc3830000)

[    1.202910] f8c0:                                                       00000000 c3a32c00

[    1.211135] f8e0: f4424580 c0313cd0 00000000 f44245c0 00000000 c382f92c c3825b60 c3801888

[    1.219358] f900: 00000001 c3909980 c3a32c00 00000000 00000000 00000000 00002303 c3a53b00

[    1.227580] f920: 00000000 c02fd580 c3a53b00 00000000 00000001 00000008 00000001 00000000

[    1.235805] f940: c0657a78 00000005 c3909580 00000000 c3801888 c0206a3c c3801888 00000001

[    1.244030] f960: 001000d0 c381b948 00000000 c00b2438 00000007 c3801888 001080d0 c3a3c6c8

[    1.252252] f980: c3801888 00000001 001000d0 80000000 c3a32800 20000013 c3a57200 c02071cc

[    1.260477] f9a0: 00000000 c3909980 c382f9c8 00000000 c382f9fc 000003e8 c3a32800 80000100

[    1.268703] f9c0: 00000003 c0300084 00000000 c382f9cc c382f9cc c3a53ba0 c3a53ba0 00000000

[    1.276924] f9e0: 00000001 00000008 00000000 c03002c8 00000000 00000023 c3825b60 c0626050

[    1.285146] fa00: 00000000 00000001 c3a57400 00000000 00000001 c3a57620 00000000 c3a32800

[    1.293369] fa20: 00000000 c02f4824 00000008 00000001 00000000 00000000 000003e8 00000017

[    1.301593] fa40: 00000000 c02f77a8 c3a57400 c3a57400 0000000a c02f7bd8 60000093 60000093

[    1.309816] fa60: ffffffe1 00000001 60000013 c3a57600 c3a32800 c3a57620 00000001 c3a57400

[    1.318038] fa80: c3a57600 c3a32800 00000001 c3a57620 00000001 00000002 00000000 c02fadcc

[    1.326259] faa0: 00002900 00000000 c3a53be0 0000000f 00001388 c063c5b0 c3a21480 c3a32c00

[    1.334485] fac0: c063c644 00000000 c3a212c8 c3a57620 c3a32800 c063c5b0 00000000 c3a57600

[    1.342709] fae0: 00000000 c04b0cfc c3a212c8 c030352c c3a57620 c065ca90 00000000 c063c5b0

[    1.350932] fb00: 00000000 c063c644 00000000 c027cd70 00000000 c3a57620 c027cea8 c3a32868

[    1.359155] fb20: c065ca6c c027b40c c394013c c3892d34 c3a57620 c3a57654 c3a57620 c027cb70

[    1.367381] fb40: c3a57620 c063c67c c3a57620 c027c2a0 c3a57620 00000000 c3a57628 c027a738

[    1.375604] fb60: c382fb88 00000000 00000010 c3a57620 c3a57600 00000000 c3a32868 00000000

[    1.383827] fb80: c3a32800 00000001 c3a57850 c030125c 00000001 00000000 00000000 00000000

[    1.392050] fba0: 00001388 c0113420 00000002 c3a3cee8 c3a53c80 00000001 c3a32868 c3a57800

[    1.400273] fbc0: 00000001 c3a32804 c3a53c80 00000001 00000000 c3a32c00 c3a3cee8 c3a32800

[    1.408495] fbe0: 00000001 00000000 c063ccfc 00000000 c063c540 00000000 00000000 c030a9e8

[    1.416719] fc00: c030a9bc c063ccfc c3a32800 c03035f4 c03035d0 c3a32868 c065ca90 c027cd70

[    1.424944] fc20: 00000000 c3a32868 c027cea8 c3a57c10 c384fc40 c027b40c c394013c c3892cd4

[    1.433169] fc40: c3a32868 c3a3289c c3a32868 c027cb70 c3a32868 c063c67c c3a32868 c027c2a0

[    1.441391] fc60: c3a32868 00000000 c3a32870 c027a738 39383113 3832313a 00000000 00000000

[    1.449614] fc80: c3a32800 c3a32868 c3a53d60 c3a32c00 00000001 00000000 c3a57c10 c02f8850

[    1.457837] fca0: 00000001 00000012 c3a53dc0 c3a53dc0 00000001 00000012 c3a53dc0 c3a32800

[    1.466061] fcc0: 00000012 c3a32c00 00000012 00000000 c3a32800 00000001 00000000 c3a57c10

[    1.474284] fce0: 00000000 c02fcfb4 00000000 c0620568 c3a57c10 c3a32800 00000000 c3a32c00

[    1.482509] fd00: c38bd010 ffffffff c3a57c00 00000000 c3940c30 c032beb0 c38bd010 c3a57c10

[    1.490733] fd20: ffffffff c03286fc 00000000 f4424500 f4424540 c3a57c10 c3a57c10 ffffffed

[    1.498958] fd40: c3a57c10 fffffdfb c064081c 00000000 00000000 c027e24c c027e204 c3a57c10

[    1.507182] fd60: c065ca90 00000000 c064081c c027cd70 00000000 c3a57c10 c027cea8 c3929210

[    1.515408] fd80: c065ca6c c027b40c c385adfc c3a2e854 c3a57c10 c3a57c44 c3a57c10 c027cb70

[    1.523631] fda0: c3a57c10 c0631d00 c3a57c10 c027c2a0 c3a57c10 00000000 c3a57c18 c027a738

[    1.531853] fdc0: 00000000 c3a213c0 00000000 c3a57c00 00000002 c3a57c00 c3a57c10 c3a57c00

[    1.540076] fde0: 00000002 00000001 c384f6c0 c027e3d8 10024400 00000000 00000000 c382fe2c

[    1.548302] fe00: c3a57c00 c03280a8 c3929210 c3929200 c3a21450 c3a21450 c04b9798 0000009e

[    1.556526] fe20: 00000000 c032db70 c0577964 c38a28e0 00000100 00000000 00000000 c3940c30

[    1.564747] fe40: 00000003 00000008 00000001 00000000 c3a21400 00000000 c3929210 ffffffed

[    1.572970] fe60: c3929210 fffffdfb c0640a58 00000000 00000000 c027e24c c027e204 c3929210

[    1.581195] fe80: c065ca90 00000000 c0640a58 c027cd70 c3929210 c0640a58 c3929244 00000000

[    1.589419] fea0: c060a218 c027cea4 00000000 c0640a58 c027ce18 c027b4ac c385adec c3938fd0

[    1.597646] fec0: c0640a58 c3a2e640 c0631d00 c027c490 c058c4e8 00000006 c0640a58 c0640a58

[    1.605871] fee0: c06227f8 c3a11200 c0649c80 c027d52c 00000000 c06227f8 c06227f8 c0009648

[    1.614094] ff00: c0650054 c3874380 c0489dbc 0000004f 00000000 00000000 00000000 c010aebc

[    1.622317] ff20: c3ffc9c6 c049d29c 0000009e c0030770 00000000 c058d654 00000000 c05cbd88

[    1.630540] ff40: 00000006 00000006 00000000 c3ffc900 c061d5f4 00000006 c0615df4 c0649c80

[    1.638763] ff60: c05f5594 0000009e c0615e00 c05f5d00 00000006 00000006 c05f5594 00000000

[    1.646984] ff80: 00000000 00000000 00000000 c047e814 00000000 00000000 00000000 00000000

[    1.655204] ffa0: 00000000 c047e81c 00000000 c000a3e0 00000000 00000000 00000000 00000000

[    1.663424] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[    1.671643] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000

[    1.679909] [<c0310d58>] (ehci_port_power) from [<c0313cd0>] (ehci_hub_control+0xa5c/0xd28)

[    1.688330] [<c0313cd0>] (ehci_hub_control) from [<c02fd580>] (usb_hcd_submit_urb+0x264/0x928)

[    1.697001] [<c02fd580>] (usb_hcd_submit_urb) from [<c0300084>] (usb_start_wait_urb+0x44/0xbc)

[    1.705671] [<c0300084>] (usb_start_wait_urb) from [<c03002c8>] (usb_control_msg+0xb4/0xe8)

[    1.714090] [<c03002c8>] (usb_control_msg) from [<c02f4824>] (set_port_feature+0x48/0x50)

[    1.722330] [<c02f4824>] (set_port_feature) from [<c02f77a8>] (hub_power_on+0x28/0xa0)

[    1.730302] [<c02f77a8>] (hub_power_on) from [<c02f7bd8>] (hub_activate+0x3b8/0x520)

[    1.738102] [<c02f7bd8>] (hub_activate) from [<c02fadcc>] (hub_probe+0x678/0x7e4)

[    1.745648] [<c02fadcc>] (hub_probe) from [<c030352c>] (usb_probe_interface+0x150/0x1f4)

[    1.753808] [<c030352c>] (usb_probe_interface) from [<c027cd70>] (driver_probe_device+0x1c8/0x270)

[    1.762826] [<c027cd70>] (driver_probe_device) from [<c027b40c>] (bus_for_each_drv+0x44/0x8c)

[    1.771409] [<c027b40c>] (bus_for_each_drv) from [<c027cb70>] (device_attach+0x70/0x88)

[    1.779468] [<c027cb70>] (device_attach) from [<c027c2a0>] (bus_probe_device+0x84/0xac)

[    1.787525] [<c027c2a0>] (bus_probe_device) from [<c027a738>] (device_add+0x33c/0x528)

[    1.795497] [<c027a738>] (device_add) from [<c030125c>] (usb_set_configuration+0x558/0x78c)

[    1.803901] [<c030125c>] (usb_set_configuration) from [<c030a9e8>] (generic_probe+0x2c/0x78)

[    1.812395] [<c030a9e8>] (generic_probe) from [<c03035f4>] (usb_probe_device+0x24/0x3c)

[    1.820459] [<c03035f4>] (usb_probe_device) from [<c027cd70>] (driver_probe_device+0x1c8/0x270)

[    1.829215] [<c027cd70>] (driver_probe_device) from [<c027b40c>] (bus_for_each_drv+0x44/0x8c)

[    1.837794] [<c027b40c>] (bus_for_each_drv) from [<c027cb70>] (device_attach+0x70/0x88)

[    1.845853] [<c027cb70>] (device_attach) from [<c027c2a0>] (bus_probe_device+0x84/0xac)

[    1.853908] [<c027c2a0>] (bus_probe_device) from [<c027a738>] (device_add+0x33c/0x528)

[    1.861889] [<c027a738>] (device_add) from [<c02f8850>] (usb_new_device+0x268/0x4ec)

[    1.869688] [<c02f8850>] (usb_new_device) from [<c02fcfb4>] (usb_add_hcd+0x4a4/0x80c)

[    1.877568] [<c02fcfb4>] (usb_add_hcd) from [<c032beb0>] (host_start+0x124/0x204)

[    1.885119] [<c032beb0>] (host_start) from [<c03286fc>] (ci_hdrc_probe+0x3b8/0x668)

[    1.892830] [<c03286fc>] (ci_hdrc_probe) from [<c027e24c>] (platform_drv_probe+0x48/0xa4)

[    1.901070] [<c027e24c>] (platform_drv_probe) from [<c027cd70>] (driver_probe_device+0x1c8/0x270)

[    1.910000] [<c027cd70>] (driver_probe_device) from [<c027b40c>] (bus_for_each_drv+0x44/0x8c)

[    1.918580] [<c027b40c>] (bus_for_each_drv) from [<c027cb70>] (device_attach+0x70/0x88)

[    1.926638] [<c027cb70>] (device_attach) from [<c027c2a0>] (bus_probe_device+0x84/0xac)

[    1.934694] [<c027c2a0>] (bus_probe_device) from [<c027a738>] (device_add+0x33c/0x528)

[    1.942662] [<c027a738>] (device_add) from [<c027e3d8>] (platform_device_add+0xac/0x200)

[    1.950811] [<c027e3d8>] (platform_device_add) from [<c03280a8>] (ci_hdrc_add_device+0x194/0x1e0)

[    1.959748] [<c03280a8>] (ci_hdrc_add_device) from [<c032db70>] (ci_hdrc_imx_probe+0x1f0/0x324)

[    1.968498] [<c032db70>] (ci_hdrc_imx_probe) from [<c027e24c>] (platform_drv_probe+0x48/0xa4)

[    1.977079] [<c027e24c>] (platform_drv_probe) from [<c027cd70>] (driver_probe_device+0x1c8/0x270)

[    1.986007] [<c027cd70>] (driver_probe_device) from [<c027cea4>] (__driver_attach+0x8c/0x90)

[    1.994499] [<c027cea4>] (__driver_attach) from [<c027b4ac>] (bus_for_each_dev+0x58/0x88)

[    2.002730] [<c027b4ac>] (bus_for_each_dev) from [<c027c490>] (bus_add_driver+0xd4/0x1d4)

[    2.010963] [<c027c490>] (bus_add_driver) from [<c027d52c>] (driver_register+0x78/0xf4)

[    2.019025] [<c027d52c>] (driver_register) from [<c0009648>] (do_one_initcall+0x80/0x1e0)

[    2.027278] [<c0009648>] (do_one_initcall) from [<c05f5d00>] (kernel_init_freeable+0xe8/0x1b0)

[    2.035952] [<c05f5d00>] (kernel_init_freeable) from [<c047e81c>] (kernel_init+0x8/0xe4)

[    2.044093] [<c047e81c>] (kernel_init) from [<c000a3e0>] (ret_from_fork+0x14/0x34)

[    2.051706] Code: e583c004 eafffff1 e3ccc02a e38cca01 (e583c004)

Best regards

Alexandre Schnegg

0 Kudos
1,881 Views
kesaco
Contributor II

Hi Alexandre,

Actually I edited a bit more than only the ci_hdrc_imx.c file since I wanted to use the phy-ulpi.c functions.

So there is the hack (not beautiful but functional).

The patch has been created based on 07cc49f66973f49a391c91bf4b158fa0f2562ca8 commit (tagged "Linux 4.1.15" by Greg KH from linux-stable).

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c

index 846ceb9..254a858 100644

--- a/drivers/usb/chipidea/ci_hdrc_imx.c

+++ b/drivers/usb/chipidea/ci_hdrc_imx.c

@@ -22,6 +22,9 @@

#include "ci.h"

#include "ci_hdrc_imx.h"

+#include "linux/usb/ulpi.h"

+

+#define ULPI_VIEWPORT_OFFSET (0x170) // From ehci-mxc.c

struct ci_hdrc_imx_platform_flag {

        unsigned int flags;

@@ -235,6 +238,16 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)

                        of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev);

        const struct ci_hdrc_imx_platform_flag *imx_platform_flag = of_id->data;

+        unsigned int dev_address; /* Needed for following ioremap */

+        char *dev_address_s = "0x00000000";

+        strncpy(&dev_address_s[2], pdata.name, 8);

+        ret = kstrtouint(dev_address_s, 16, &dev_address);

+        if (ret) {

+               dev_err(&pdev->dev, "Convertion of %s to number returned %d.\n",

+                       pdata.name, ret);

+               return ret;

+       }

+

        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);

        if (!data)

                return -ENOMEM;

@@ -300,6 +313,20 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)

        device_set_wakeup_capable(&pdev->dev, true);

+        ret = otg_ulpi_update(data->phy,

+                       &ulpi_viewport_access_ops,

+                       ULPI_OTG_DRVVBUS|ULPI_OTG_DRVVBUS_EXT,

+                       (u32 *)ioremap_nocache(dev_address + ULPI_VIEWPORT_OFFSET, 4));

+        if (ret) {

+               dev_err(&pdev->dev,

+                       "Update of phy/otg with viewport functions returned %d.\n", ret);

+               goto disable_device;

+        }

+

+        data->phy->init(data->phy);

+       /* Vbus logic is classic with ISP1504 but reversed with USB3340 */

+        data->phy->otg->set_vbus(data->phy->otg,(usb_phy_io_read(data->phy, 3) == 0x15));

+

        return 0;

disable_device:

diff --git a/drivers/usb/phy/phy-ulpi.c b/drivers/usb/phy/phy-ulpi.c

index f48a7a2..0c644f6 100644

--- a/drivers/usb/phy/phy-ulpi.c

+++ b/drivers/usb/phy/phy-ulpi.c

@@ -284,3 +284,27 @@ otg_ulpi_create(struct usb_phy_io_ops *ops,

}

EXPORT_SYMBOL_GPL(otg_ulpi_create);

+int

+otg_ulpi_update(struct usb_phy *phy, struct usb_phy_io_ops *ops,

+               unsigned int flags, u32 *io_priv)

+{

+       if ((!phy) || (!phy->otg)) {

+               pr_err("Given usb_phy is not correct.\n");

+               return -ENXIO;

+       } else if(!io_priv) {

+               pr_err("Given io_priv is Null.\n");

+               return -ENXIO;

+       }

+

+       phy->flags         += flags;

+       phy->io_ops         = ops;

+       phy->init           = ulpi_init;

+       phy->io_priv        = io_priv;

+

+       phy->otg->usb_phy   = phy;

+       phy->otg->set_host  = ulpi_set_host;

+       phy->otg->set_vbus  = ulpi_set_vbus;

+

+       return 0;

+}

+EXPORT_SYMBOL_GPL(otg_ulpi_update);

diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h

index 5c295c2..e83b788 100644

--- a/include/linux/usb/ulpi.h

+++ b/include/linux/usb/ulpi.h

@@ -184,12 +184,23 @@

#if IS_ENABLED(CONFIG_USB_ULPI)

struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,

                                        unsigned int flags);

+int otg_ulpi_update(struct usb_phy *phy,

+               struct usb_phy_io_ops *ops,

+               unsigned int flags,

+               u32 *io_priv);

#else

static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,

                                              unsigned int flags)

{

        return NULL;

}

+static inline int otg_ulpi_update(struct usb_phy phy,

+                               struct usb_phy_io_ops *ops,

+                               unsigned int flags,

+                               u32 *io_priv)

+{

+        return -ENODEV;

+}

#endif

#ifdef CONFIG_USB_ULPI_VIEWPORT

Hope it will help you.

Kind regards,

Miquèl

0 Kudos
1,881 Views
alexandreschneg
Contributor I

Hello Miquèl,

Thank you for your reply.

It was a hardware error. The ULPI clock signal was not properly generated due to a reset problem.

Best regards,

Alexandre Schnegg

0 Kudos
1,882 Views
kesaco
Contributor II

After some testing the problem was related to the 4.1.5 version. When I pulled from the official repo and got updated to the 4.1.15 the issues were gone :smileyhappy:

0 Kudos