From: jason77.wang@gmail.com (Hui Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: imx6q restart is broken
Date: Thu, 9 Aug 2012 11:18:47 +0800 [thread overview]
Message-ID: <50232C17.9000700@gmail.com> (raw)
In-Reply-To: <50224547.9020000@de.bosch.com>
Dirk Behme wrote:
> On 08.08.2012 12:18, Shawn Guo wrote:
>> Thanks Dirk for reporting that imx6q restart (reboot command) is broken.
>>
>> I tracked down the issue a little bit and found imx6q_restart hangs
>> on the of_iomap/ioremap call. The following change, moving the call
>> somewhere else than imx6q_restart, will just fix the problem.
>>
>> Does that mean ioremap call is not allowed in platform restart hook?
>> I'm not sure about that, because I found it works just fine if I build
>> imx_v6_v7_defconfig with V6 (imx3) platforms excluded (IOW, build a V7
>> only kernel - imx5 and imx6), which is the case how I tested imx6q
>> restart feature when I was adding it.
>>
>> To summarize, the imx6q_restart hangs at ioremap call on a V6 + V7
>> kernel, while it works fine on a V7 only image. I need some help to
>> understand that.
>
> Some additional information from my debugging:
>
> a) Having a JTAG debugger attached to the i.MX6 SabreLite board I use
> (kernel built with imx_v6_v7_defconfig) the reboot does work. No hang.
> This does mean I can't debug the reboot hang with a JTAG debugger.
> Therefore I added some printk debugging:
>
> b) Adding some printk statements [1] in the of_iomap/ioremap call, it
> looks to me that the system hangs in
>
> of_iomap() -> ... -> set_pte_at() -> set_pte_ext() /
> cpu_v7_set_pte_ext() <= hang
>
I noticed this problem several weeks ago, and did some debug, what i
found is following:
- at the last stage of reset, all non-boot cpus will call
ipi_cpu_stop()->cpu_relax(), the cpu_relax() is defined to smp_mb() for
V6, and smp_mb() is defined to dmb ("mcr p15, 0, %0, c7, c10, 5")
- the boot cpu will call cpu_v7_set_pte_ext() in the proc-v7-2level.S,
at the end of this function, boot cpu will call flush_pte (mcr p15, 0,
r0, c7, c10, 1), after executing this function, the system will hang.
That is to say, all non-boot cpus repeatedly call ("mcr p15, 0, %0, c7,
c10, 5"), if boot cpu call flush_pte (mcr p15, 0, r0, c7, c10, 1), the
system will hang, this occurs on the cortexa9 r2p10 cpus (freescale
i.MX6Q), i don't know the root cause for this problem, but if we split
imx_v6_v7_defconfig into v7_only and use v7_only to build kernel image
for imx6q, this problem will disappear, since the cpu_relax() will be
defined to barrier().
- i think we should split imx_v6_v7_defconfig into v6_only and v7_only,
since when we use imx_v6_v7_defconfig, we will introduce
"-D__LINUX_ARM_ARCH__=6" unconditionally, this macro is OK for V6
platforms (imx3), but it is not good for V7 platforms (imx5, imx6). lets
grep "__LINUX_ARM_ARCH__" occurrence under the arch/arm, all (#if
__LINUX_ARM_ARCH__ == 6) and (#if __LINUX_ARM_ARCH__ >= 7) occurrence
will affect V7 platforms.
Regards,
Hui.
next prev parent reply other threads:[~2012-08-09 3:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 10:18 imx6q restart is broken Shawn Guo
2012-08-08 10:53 ` Dirk Behme
2012-08-09 3:18 ` Hui Wang [this message]
2012-08-09 4:41 ` Shawn Guo
2012-08-09 6:32 ` Sascha Hauer
2012-08-09 8:06 ` Catalin Marinas
2012-08-09 8:18 ` Shawn Guo
2012-08-09 9:20 ` Russell King - ARM Linux
2012-08-09 12:01 ` Shawn Guo
2012-08-09 12:22 ` Shawn Guo
2012-08-09 13:57 ` Russell King - ARM Linux
2012-08-09 14:01 ` Russell King - ARM Linux
2012-08-09 14:24 ` Shawn Guo
2012-08-09 19:03 ` Matt Sealey
2012-08-09 21:07 ` Russell King - ARM Linux
2012-08-10 13:33 ` Matt Sealey
2012-08-10 13:53 ` Russell King - ARM Linux
2012-08-15 15:07 ` Rob Herring
2012-08-15 21:44 ` Russell King - ARM Linux
2012-08-16 2:31 ` Shawn Guo
2012-08-16 17:21 ` Matt Sealey
2012-08-16 22:34 ` Russell King - ARM Linux
2012-08-17 3:48 ` Shawn Guo
2012-08-17 8:11 ` Hui Wang
2012-08-19 15:26 ` Shawn Guo
2012-08-16 8:41 ` Catalin Marinas
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=50232C17.9000700@gmail.com \
--to=jason77.wang@gmail.com \
--cc=linux-arm-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.