From: "Albert, Elmar" <EAlbert@data-modul.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: barebox for iMX8MMini crashes while usb_rescan for USB type A
Date: Mon, 13 Jan 2020 07:54:54 +0000 [thread overview]
Message-ID: <99c3d904-b27d-57ad-89ee-ee2510391618@data-modul.com> (raw)
Hello everybody,
I'm working on a customer board based on an iMX8MMini using Barebox
based on version 2019.05.0. We have problems to bring-up the USB with
type A connector,
we are not using type C as on the NXP EVK.
I added the iMX8MMini to the drivers/usb/imx/imx-usb-misc.c completely
separated from the already implementation for the iMX7D.
When starting an usb_rescan using the usb command, barebox crashes with
an exception. I updated the usb driver to version 2019.12.0, but get the
same behaviour,
it crashes with an exception:
DABT (current EL) exception (ESR 0x96000061) at 0x000000005ff4005c
elr: 000000007fe70cec lr : 000000007fe25464
x0 : 000000005ff4005c x1 : 0000000000000000
x2 : 0000000000000014 x3 : 0000000030c51835
x4 : 0000000000000004 x5 : 0000000000000043
x6 : 0000000000000001 x7 : 0000000000000000
x8 : 000000005ff4005c x9 : 0000000060189d70
x10: 000000005fefd360 x11: 0000000000000200
x12: 000000007fea7eb0 x13: 000000005fefd360
x14: 0000000000000005 x15: 000000007fe70934
x16: 000000007fe6fe38 x17: 00000000000043b0
x18: 00000000000045f0 x19: 00000000601374e0
x20: 000000005ff3f3e8 x21: 0000000000011800
x22: 0000000000000040 x23: 0000000001180001
x24: 000000006018bd40 x25: 000000005ff40040
x26: 000000005ff40000 x27: 0000000000000006
x28: 000000005ff4005c x29: 000000007ffeeef0
Call trace:
[<7fe70cec>] (__arch_memset+0x4c/0x160) from [<7fe25e90>]
(submit_control_msg+0x61c/0x620)
[<7fe25e90>] (submit_control_msg+0x61c/0x620) from [<7fe1cc78>]
(usb_control_msg+0xe0/0x15c)
[<7fe1cc78>] (usb_control_msg+0xe0/0x15c) from [<7fe1cd74>]
(usb_get_descriptor+0x80/0xac)
[<7fe1cd74>] (usb_get_descriptor+0x80/0xac) from [<7fe1d40c>]
(usb_new_device+0x8c/0x7e4)
[<7fe1d40c>] (usb_new_device+0x8c/0x7e4) from [<7fe1e350>]
(usb_hub_port_connect_change+0x16c/0x1fc)
[<7fe1e350>] (usb_hub_port_connect_change+0x16c/0x1fc) from [<7fe1e670>]
(usb_hub_detect+0x290/0x3b0)
[<7fe1e670>] (usb_hub_detect+0x290/0x3b0) from [<7fe1dc58>]
(usb_host_detect+0xf4/0x104)
[<7fe1dc58>] (usb_host_detect+0xf4/0x104) from [<7fe1dcf4>]
(usb_rescan+0x8c/0xa4)
[<7fe1dcf4>] (usb_rescan+0x8c/0xa4) from [<7fe4c0a0>] (do_usb+0x5c/0x12c)
[<7fe4c0a0>] (do_usb+0x5c/0x12c) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0ec24>]
(run_shell+0x54/0x98)
[<7fe0ec24>] (run_shell+0x54/0x98) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0e3fc>]
(run_list_real+0x3e8/0x8fc)
[<7fe0e3fc>] (run_list_real+0x3e8/0x8fc) from [<7fe0e3fc>]
(run_list_real+0x3e8/0x8fc)
[<7fe0e3fc>] (run_list_real+0x3e8/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0dfbc>]
(parse_string_outer+0x9c/0xf4)
[<7fe0dfbc>] (parse_string_outer+0x9c/0xf4) from [<7fe0e998>]
(source_script+0x88/0xb0)
[<7fe0e998>] (source_script+0x88/0xb0) from [<7fe0ea0c>]
(do_source+0x4c/0x8c)
[<7fe0ea0c>] (do_source+0x4c/0x8c) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0dfbc>]
(parse_string_outer+0x9c/0xf4)
[<7fe0dfbc>] (parse_string_outer+0x9c/0xf4) from [<7fe0ebb4>]
(run_command+0x3c/0x58)
[<7fe0ebb4>] (run_command+0x3c/0x58) from [<7fe0145c>]
(start_barebox+0x74/0xe4)
[<7fe0145c>] (start_barebox+0x74/0xe4) from [<7fe70360>]
(barebox_non_pbl_start+0x130/0x164)
[<7fe70360>] (barebox_non_pbl_start+0x130/0x164) from [<7fe0000c>]
(__bare_init_start+0x0/0x4)
[<7fe0000c>] (__bare_init_start+0x0/0x4) from [<4020523c>] (0x4020523c)
[<4020523c>] (0x4020523c) from [<40204ed0>] (0x40204ed0)
panic: unhandled exception
Call trace:
[<7fe70e54>] (unwind_backtrace+0x0/0x84) from [<7fe018e8>] (panic+0x5c/0x78)
[<7fe018e8>] (panic+0x5c/0x78) from [<7fe6fa20>] (do_fiq+0x0/0x24)
[<7fe6fa20>] (do_fiq+0x0/0x24) from [<7fe6fb64>] (do_error+0x0/0x24)
[<7fe6fb64>] (do_error+0x0/0x24) from [<7fe6f668>] (_do_sync+0x94/0x98)
[<7fe6f668>] (_do_sync+0x94/0x98) from [<7fe25e90>]
(submit_control_msg+0x61c/0x620)
[<7fe25e90>] (submit_control_msg+0x61c/0x620) from [<7fe1cc78>]
(usb_control_msg+0xe0/0x15c)
[<7fe1cc78>] (usb_control_msg+0xe0/0x15c) from [<7fe1cd74>]
(usb_get_descriptor+0x80/0xac)
[<7fe1cd74>] (usb_get_descriptor+0x80/0xac) from [<7fe1d40c>]
(usb_new_device+0x8c/0x7e4)
[<7fe1d40c>] (usb_new_device+0x8c/0x7e4) from [<7fe1e350>]
(usb_hub_port_connect_change+0x16c/0x1fc)
[<7fe1e350>] (usb_hub_port_connect_change+0x16c/0x1fc) from [<7fe1e670>]
(usb_hub_detect+0x290/0x3b0)
[<7fe1e670>] (usb_hub_detect+0x290/0x3b0) from [<7fe1dc58>]
(usb_host_detect+0xf4/0x104)
[<7fe1dc58>] (usb_host_detect+0xf4/0x104) from [<7fe1dcf4>]
(usb_rescan+0x8c/0xa4)
[<7fe1dcf4>] (usb_rescan+0x8c/0xa4) from [<7fe4c0a0>] (do_usb+0x5c/0x12c)
[<7fe4c0a0>] (do_usb+0x5c/0x12c) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0ec24>]
(run_shell+0x54/0x98)
[<7fe0ec24>] (run_shell+0x54/0x98) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0e3fc>]
(run_list_real+0x3e8/0x8fc)
[<7fe0e3fc>] (run_list_real+0x3e8/0x8fc) from [<7fe0e3fc>]
(run_list_real+0x3e8/0x8fc)
[<7fe0e3fc>] (run_list_real+0x3e8/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0dfbc>]
(parse_string_outer+0x9c/0xf4)
[<7fe0dfbc>] (parse_string_outer+0x9c/0xf4) from [<7fe0e998>]
(source_script+0x88/0xb0)
[<7fe0e998>] (source_script+0x88/0xb0) from [<7fe0ea0c>]
(do_source+0x4c/0x8c)
[<7fe0ea0c>] (do_source+0x4c/0x8c) from [<7fe05a48>]
(execute_command+0x40/0x88)
[<7fe05a48>] (execute_command+0x40/0x88) from [<7fe0e8a4>]
(run_list_real+0x890/0x8fc)
[<7fe0e8a4>] (run_list_real+0x890/0x8fc) from [<7fe0deb8>]
(parse_stream_outer+0x1b0/0x218)
[<7fe0deb8>] (parse_stream_outer+0x1b0/0x218) from [<7fe0dfbc>]
(parse_string_outer+0x9c/0xf4)
[<7fe0dfbc>] (parse_string_outer+0x9c/0xf4) from [<7fe0ebb4>]
(run_command+0x3c/0x58)
[<7fe0ebb4>] (run_command+0x3c/0x58) from [<7fe0145c>]
(start_barebox+0x74/0xe4)
[<7fe0145c>] (start_barebox+0x74/0xe4) from [<7fe70360>]
(barebox_non_pbl_start+0x130/0x164)
[<7fe70360>] (barebox_non_pbl_start+0x130/0x164) from [<7fe0000c>]
(__bare_init_start+0x0/0x4)
[<7fe0000c>] (__bare_init_start+0x0/0x4) from [<4020523c>] (0x4020523c)
[<4020523c>] (0x4020523c) from [<40204ed0>] (0x40204ed0)
I did some further investigations by adding printks and I found, that it
crashes here:
eal: ehci_submit_async: ---------------- 5
eal: qh->qt_buffer = 0x5FF4005C
which is the command:
memset(qh->qt_buffer, 0, sizeof(qh->qt_buffer));
in function:
static int
ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
int length, struct devrequest *req, int timeout_ms)
in file: drivers/usb/host/ehci-hcd.c
It seems to be an issue regarding buffer handling.
The buffers are allocated (using memset function in
/arch/arm/lib64/string.c) during startup of the barebox and then will be
re-allocated during usb_rescan
without freeing before.
To make sure that this is the reason for the exception, I excluded the
mem-area (here 0x5FF4005C) in function void *memset(void *dst, int c,
__kernel_size_t size) in file
/arch/arm/lib64/string.c from calling __arch_memset(dst, c, size) when
already set. Then the usb is working.
So please would there be someone who can take care of this problem so
that the USB with type A can be used in barebox for iMX8MMini.
Thank you in advance.
--
Mit freundlichen Grüßen / Best Regards
Elmar Albert
Embedded R&D
DATA MODUL AG
Landsberger Str. 322
80687 Munich
Germany
Tel: +49 89 56017 197
Fax: +49 89 56017 345
Mail to: ealbert@data-modul.com
Internet: http://www.data-modul.com
Vertrauliche E-Mail von / Confidential e-mail from: DATA MODUL AG
Vorstand / CEO: Dr. Florian Pesahl
Vorsitzende des Aufsichtsrates / Chairwoman of the Supervisory Board: Kristin D. Russell
Sitz der Gesellschaft / Registered Office: München
Registergericht / Registration Court: München Handelsregister B 85 591
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2020-01-13 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 7:54 Albert, Elmar [this message]
2020-01-13 11:04 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99c3d904-b27d-57ad-89ee-ee2510391618@data-modul.com \
--to=ealbert@data-modul.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox