Bug 103461 - i.MX USB runtime power management breaks the boot
Summary: i.MX USB runtime power management breaks the boot
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: ARM Linux
: P1 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 14:43 UTC by Vincent Stehlé
Modified: 2015-09-11 02:20 UTC (History)
2 users (show)

See Also:
Kernel Version: v4.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Boot log when stuck (18.50 KB, text/x-log)
2015-08-25 14:43 UTC, Vincent Stehlé
Details
Boot log when ok (with commit reverted) (19.92 KB, text/x-log)
2015-08-25 14:44 UTC, Vincent Stehlé
Details
"Quick and dirty" u-boot environment customization for USB booting (2.02 KB, patch)
2015-08-26 07:51 UTC, Vincent Stehlé
Details | Diff
imx_usb config file for the USB boot (1.64 KB, application/octet-stream)
2015-08-26 09:47 UTC, Vincent Stehlé
Details
Boot log when stuck, with 'debug' (15.80 KB, text/plain)
2015-08-31 07:46 UTC, Vincent Stehlé
Details
U-boot binary used (451.00 KB, application/octet-stream)
2015-08-31 07:48 UTC, Vincent Stehlé
Details
imx_usb and libusb binaries (74.24 KB, application/x-xz)
2015-08-31 07:52 UTC, Vincent Stehlé
Details
Peter v4.2-rc6 boot log (24.75 KB, text/plain)
2015-09-09 09:02 UTC, Peter Chen
Details
Boot log for zImage_v4.2_rc6 (15.75 KB, text/plain)
2015-09-10 12:37 UTC, Vincent Stehlé
Details

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

Note You need to log in before you can comment on or make changes to this bug.