Bug 103461

Summary: i.MX USB runtime power management breaks the boot
Product: Drivers Reporter: Vincent Stehlé (vincent.stehle)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: NEW ---    
Severity: normal CC: peter.chen, vincent.stehle
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: v4.1 Subsystem:
Regression: No Bisected commit-id:
Attachments: Boot log when stuck
Boot log when ok (with commit reverted)
"Quick and dirty" u-boot environment customization for USB booting
imx_usb config file for the USB boot
Boot log when stuck, with 'debug'
U-boot binary used
imx_usb and libusb binaries
Peter v4.2-rc6 boot log
Boot log for zImage_v4.2_rc6

Description Vincent Stehlé 2015-08-25 14:43:48 UTC
Created attachment 185831 [details]
Boot log when stuck

Hi,

I am booting a Freescale i.MX6 SabreSD board in a specific way, and I found out that a recent modification in USB runtime power will prevent me to boot to the prompt.

After bisecting, it appears that the issue is caused by this commit:

  commit e14db48dfcf3ab6ebea212e82dc56036a00b0d6b
  Author: Peter Chen <peter.chen@freescale.com>
  Date:   Wed Feb 11 12:44:47 2015 +0800

    usb: chipidea: imx: add runtime power management support
    
    Add runtime pm support for imx, only imx6 series are supported and tested.
    
    Signed-off-by: Peter Chen <peter.chen@freescale.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

If I revert this on v4.2-rc8, the boot works for me again.

Kernel config that I use is imx_v6_v7_defconfig. The DTB is imx6q-sabresd.dtb.

Boot method:

- Boot u-boot with imx_usb through USB (otg)
- u-boot loads zImage and dtb with TFTP through ethernet
- Kernel boots on NFS root through ethernet, obtains its IP with DHCP

This means the SabreSD is connected with both a console UART on the FTDI USB debug port, and a USB cable on the OTG port as well. The board is powered by a 5V power supply plugged into the wall socket.
Comment 1 Vincent Stehlé 2015-08-25 14:44:41 UTC
Created attachment 185841 [details]
Boot log when ok (with commit reverted)
Comment 2 Greg Kroah-Hartman 2015-08-25 15:34:09 UTC
On Tue, Aug 25, 2015 at 02:43:48PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=103461
> 
>             Bug ID: 103461
>            Summary: i.MX USB runtime power management breaks the boot

Please send this to the linux-usb@vger.kernel.org mailing list.
Comment 3 Vincent Stehlé 2015-08-26 07:51:06 UTC
I am using "latest" u-boot (commit 7d31c6a, "Merge git://git.denx.de/u-boot-pxa") with a "quick and dirty" environment customization for USB booting (patch attached).
Comment 4 Vincent Stehlé 2015-08-26 07:51:55 UTC
Created attachment 185901 [details]
"Quick and dirty" u-boot environment customization for USB booting
Comment 5 Vincent Stehlé 2015-08-26 09:46:30 UTC
The PC tool I use is imx_usb_loader,
https://github.com/boundarydevices/imx_usb_loader
Commit f96aee286ea17c832b7ec922dd76842deb5ce299

(as used by buildroot, commit a123e7ed8e600c5b002962be6b0549f06ce34f12)

I will attach my config file for the USB boot, too.
Comment 6 Vincent Stehlé 2015-08-26 09:47:07 UTC
Created attachment 185911 [details]
imx_usb config file for the USB boot
Comment 7 Vincent Stehlé 2015-08-31 07:46:43 UTC
Created attachment 186271 [details]
Boot log when stuck, with 'debug'
Comment 8 Vincent Stehlé 2015-08-31 07:48:09 UTC
Created attachment 186281 [details]
U-boot binary used

This is u-boot Denx commit 7d31c6ab83d8a5875875eda041c0a1e756189917, with boot env customized.
Comment 9 Vincent Stehlé 2015-08-31 07:52:52 UTC
Created attachment 186291 [details]
imx_usb and libusb binaries

Binaries for imx-usb-loader commit f96aee286ea17c832b7ec922dd76842deb5ce299
This is extracted from buildroot.
You will need to set LD_LIBRARY_PATH.
Comment 10 Peter Chen 2015-09-09 09:02:22 UTC
Created attachment 187131 [details]
Peter v4.2-rc6 boot log
Comment 11 Peter Chen 2015-09-09 09:08:42 UTC
Since it larger than 5MB, I upload it to Freescale interal tftp which you can get it from below URL

http://transweb.freescale.net/index.cgi?go=KEYWORD&KEYWORD=ostn5403a
Comment 12 Vincent Stehlé 2015-09-10 12:37:22 UTC
Created attachment 187271 [details]
Boot log for zImage_v4.2_rc6

Hi Peter,

Thank you for your concern with this bug.

I booted your kernel binary image and as you can see from the log it is stuck in a similar manner.

This makes me think the boot step of u-boot through USB changes "something" in the way the USB (in general) is set when entering the kernel, which makes the boot fail.

(FYI latest mainline has the same issue still.)

Best regards,

V.
Comment 13 Peter Chen 2015-09-11 02:20:24 UTC
Hi Vincent,

I highly recommend you try this test with another imx6q sabresd board.
I upload one zImage (using my former dtb please), it will show where it hangs

 
http://transweb.freescale.net/index.cgi?go=KEYWORD&KEYWORD=icqn0891a