usb high speed device hang issue

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

usb high speed device hang issue

Jump to solution
7,973 Views
abdulhussain
Contributor III

Hi,

We are using IMX6D based custom board. When we frequently plug and remove usb pendrive in USB host port, we are getting error message as mentioned below and thereafter usb pendrive is not detecting.

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

[   38.632897] usb 1-1: New USB device found, idVendor=03f0, idProduct=5a07

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

[   38.646816] usb 1-1: Product: v220w

[   38.650312] usb 1-1: Manufacturer: HP

[   38.653997] usb 1-1: SerialNumber: 0410210000013931

[   39.470600] usb 1-1: USB disconnect, device number 2

[   40.340515] usb 1-1: new high-speed USB device number 3 using ci_hdrc

[   40.372894] usb 1-1: New USB device found, idVendor=03f0, idProduct=5a07

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

[   40.386807] usb 1-1: Product: v220w

[   40.390304] usb 1-1: Manufacturer: HP

[   40.393988] usb 1-1: SerialNumber: 0410210000013931

[   40.463327] usb 1-1: USB disconnect, device number 3

[   41.180524] usb 1-1: new high-speed USB device number 4 using ci_hdrc

[   41.306894] usb 1-1: device descriptor read/all, error -71

If we connect low speed device like usb keyword, it is detecting.

We are using 3.10.17 yocto bsp.

Any advice will be helpful,


Abdul Hussain

Labels (3)
Tags (3)
0 Kudos
1 Solution
5,915 Views
abdulhussain
Contributor III

Hi Igor,

The below patch solves this fast plug and unplug usb issue,

linux-2.6-imx.git - Freescale i.MX Linux Tree

Regards,

Abdul Hussain

View solution in original post

0 Kudos
8 Replies
5,915 Views
sumankumar
Contributor I

Hi Igor and Abdul,

 

The issue still seems to persist on kernel_imx 4.1.15 Series 4800.

The USB host controller 1 of imx6 is connected to USB hub which is connected to USB modem device.

If i perform fast plug/unplug the USB hub does not enumerated modem device.

 

usb 1-1: device not accepting address 5, error -110

usb usb1-port1: unable to enumerate USB device

 

Success case: (dmesgworking - logs attached)

/sys/kernel/debug/usb # lsusb

Bus 001 Device 002: ID 0424:2512

Bus 001 Device 001: ID 1d6b:0002

Bus 001 Device 004: ID 1519:0443

 

Failure case: (dmesghaveissue - logs attached)

/sys/kernel/debug/usb # lsusb

Bus 001 Device 001: ID 1d6b:0002

 

Success dmesg:

Ov5642_mipi probe called wrw
usb 1-1: new high-speed USB device number 2 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
usb 1-1: udev 2, busnum 1, minor = 1
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected
hub 1-1:1.0: enabling power on all ports
ov5640_reset(mipi): reset released
hub 1-1:1.0: SUMAN: -ENONET: synchronous unlink
hub 1-1:1.0: SUMAN: -ECONNRESET: Async unlink
hub 1-1:1.0: SUMAN: -ESHUTDOWN: hardware going away
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_read_reg(mipi):reg=300a,val=56
ov5640_read_reg(mipi):reg=300b,val=40
ov5640_read_reg(mipi):reg=3000,val=30
ov5640_read_reg(mipi):reg=3004,val=cf
ov5640_write_reg(mipi):reg=3004,val=ef
hub 1-0:1.0: SUMAN: -ENONET: synchronous unlink
hub 1-0:1.0: SUMAN: -ECONNRESET: Async unlink
hub 1-0:1.0: SUMAN: -ESHUTDOWN: hardware going away
Failure: (dmesghaveissue)
Ov5642_mipi probe called wrw
usb 1-1: new high-speed USB device number 2 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_reset(mipi): reset released
usb 1-1: new high-speed USB device number 3 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_read_reg(mipi):reg=300a,val=56
0 Kudos
5,915 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abdul

seems it is necessary to safely remove device

(commands may depend on distros) using unmount.

Ubuntu has Safely Remove option. After unmounting one can try

udisks --detach /dev/sdX

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
5,915 Views
abdulhussain
Contributor III

Hi igor,

I have not loaded any storage modules. This issue is happening during enumeration itself.

Regards,

Abdul Hussain.

0 Kudos
5,915 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abdul

during enumeration it is not

allowed to plug and remove usb pendrive.

Best regards

igor

0 Kudos
5,915 Views
abdulhussain
Contributor III

Hi Igor,

But in our use case, user may accidentally remove the usb pendrive during enumeration. So usb driver should not stop enumeraing the device after this error scenario.

We observed like the same error is happening in externally powered usb hub, but driver is automatically recovering and able to detect the device after that.

One more observation is like if i build the usbcore, ehci-hcd and chipidea driver into the loadable module, during error scenario if i rmmod the chipidea driver and load the chipidea module again, high speed usb device detection is happening.

Is  there any document which will give overview of usb driver flow?

Regards,

Abdul Hussain

0 Kudos
5,915 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abdul

one can look at Linux Manual in

L3.10.17_1.0.0_LINUX_DOCS

~igor

0 Kudos
5,916 Views
abdulhussain
Contributor III

Hi Igor,

The below patch solves this fast plug and unplug usb issue,

linux-2.6-imx.git - Freescale i.MX Linux Tree

Regards,

Abdul Hussain

0 Kudos
5,915 Views
sumankumar
Contributor I

Hi Igor and Abdul,

The issue still seems to persist on kernel_imx 4.1.15 Series 4800.

The USB host controller 1 of imx6 is connected to USB hub which is connected to USB modem device.

If i perform fast plug/unplug the USB hub does not enumerated modem device.

usb 1-1: device not accepting address 5, error -110

usb usb1-port1: unable to enumerate USB device

Success case:

/sys/kernel/debug/usb # lsusb

Bus 001 Device 002: ID 0424:2512

Bus 001 Device 001: ID 1d6b:0002

Bus 001 Device 004: ID 1519:0443

Failure case:

/sys/kernel/debug/usb # lsusb

Bus 001 Device 001: ID 1d6b:0002

Success dmesg:

Ov5642_mipi probe called wrw
usb 1-1: new high-speed USB device number 2 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
usb 1-1: udev 2, busnum 1, minor = 1
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected
hub 1-1:1.0: enabling power on all ports
ov5640_reset(mipi): reset released
hub 1-1:1.0: SUMAN: -ENONET: synchronous unlink
hub 1-1:1.0: SUMAN: -ECONNRESET: Async unlink
hub 1-1:1.0: SUMAN: -ESHUTDOWN: hardware going away
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_read_reg(mipi):reg=300a,val=56
ov5640_read_reg(mipi):reg=300b,val=40
ov5640_read_reg(mipi):reg=3000,val=30
ov5640_read_reg(mipi):reg=3004,val=cf
ov5640_write_reg(mipi):reg=3004,val=ef
hub 1-0:1.0: SUMAN: -ENONET: synchronous unlink
hub 1-0:1.0: SUMAN: -ECONNRESET: Async unlink
hub 1-0:1.0: SUMAN: -ESHUTDOWN: hardware going away
Failure: (dmesghaveissue)
Ov5642_mipi probe called wrw
usb 1-1: new high-speed USB device number 2 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_reset(mipi): reset released
usb 1-1: new high-speed USB device number 3 using ci_hdrc
ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xaa
ov5640_read_reg(mipi):reg=300a,val=56
0 Kudos