From: Sudeep Holla <sudeep.holla@arm.com>
To: Marc Zyngier <maz@kernel.org>, John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Linuxarm <linuxarm@huawei.com>,
wanghuiqiang <wanghuiqiang@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: PSCI checker query
Date: Thu, 5 Dec 2019 16:53:31 +0000 [thread overview]
Message-ID: <20191205165331.GA21023@bogus> (raw)
In-Reply-To: <50f79699a2de7856eb201c8cc1dc51d7@www.loen.fr>
On Thu, Dec 05, 2019 at 03:55:22PM +0000, Marc Zyngier wrote:
> Hi John,
>
> On 2019-12-05 12:38, John Garry wrote:
> > Hi guys,
> >
> > I enabled the kernel PSCI checker and it kills my Huawei D05:
>
> [...]
>
> > [ 18.521459] CPU52: shutdown
> > [ 18.524256] psci: CPU52 killed.
> > [ 18.528634] CPU53: shutdown
> > [ 18.531461] psci: CPU53 killed.
> > [ 18.535847] CPU54: shutdown
> > [ 18.538645] psci: CPU54 killed.
> > [ 18.542977] CPU55: shutdown
> > [ 18.545761] psci: CPU55 killed.
> > [ 18.550050] CPU56: shutdown
> > [ 18.552836] psci: CPU56 killed.
> > [ 18.557059] CPU57: shutdown
> > [ 18.559855] psci: CPU57 killed.
> > [ 18.564012] CPU58: shutdown
> > [ 18.566809] psci: CPU58 killed.
> > [ 18.570941] CPU59: shutdown
> > [ 18.573725] psci: CPU59 killed.
> > [ 18.577778] CPU60: shutdown
> > [ 18.580576] psci: CPU60 killed.
> > [ 18.584592] CPU61: shutdown
> > [ 18.587400] psci: CPU61 killed.
> > [ 18.591351] CPU62: shutdown
> > [ 18.594148] psci: CPU62 killed.
> > [ 18.597997] usb 1-2.1: new full-speed USB device number 4 using
> > ehci-platform
> > rxx�
> > �c�� � ������aC�BV�� 8%�� ������ ���� b��Q����>��{(�ZhF�
> > "@��r �
> > Մ�� �@���Q
> >
> >
> > [cut remaining garbage]
>
> I get the same garbage, and a couple of:
>
> [ 10.986303] CPU0: failed to come online
> [ 10.986405] CPU0: failed in unknown state : 0x0
> [ 10.986585] psci_checker: Error occurred (-5) while trying to power up
> CPU 0
> [...]
> [ 12.468864] ------------[ cut here ]------------
> [ 12.468995] WARNING: CPU: 2 PID: 1 at
> drivers/firmware/psci/psci_checker.c:135 down_and_up_cpus+0x1d4/0x1f4
> [ 12.469242] Modules linked in:
> [ 12.469324] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G W
> 5.4.0-00079-g0a881ca5de9a #214
> [ 12.469556] Hardware name: Huawei Technologies Co., Ltd. D05/D05, BIOS
> Hisilicon D05 IT21 Nemo 2.0 RC0 04/18/2018
> [ 12.469816] pstate: 20000005 (nzCv daif -PAN -UAO)
> [ 12.469939] pc : down_and_up_cpus+0x1d4/0x1f4
> [ 12.470051] lr : down_and_up_cpus+0x1b4/0x1f4
> [ 12.470162] sp : ffff80001172bcd0
> [ 12.470246] x29: ffff80001172bcd0 x28: ffff800010d73010
> [ 12.470382] x27: ffff001fb6524660 x26: 0000000000000001
> [ 12.470518] x25: ffff800010d72eb0 x24: ffff80001134a390
> [ 12.470654] x23: ffff80001172bd98 x22: 0000000000000100
> [ 12.470789] x21: 0000000000000000 x20: 0000000000000001
> [ 12.470925] x19: ffff80001172bd98 x18: 0000000000000001
> [ 12.471061] x17: 0000000000000000 x16: 0000000000000000
> [ 12.471196] x15: 0000000000000000 x14: 0000000000000000
> [ 12.471331] x13: 0000000000000000 x12: 0000000000000000
> [ 12.471467] x11: 0000000000000000 x10: 0000000000000a60
> [ 12.471602] x9 : ffff80001172b940 x8 : ffff002fb7e81940
> [ 12.471737] x7 : 0000000000000000 x6 : 0000000000000001
> [ 12.471873] x5 : ffff80001135c0e8 x4 : 0000000000000000
> [ 12.472008] x3 : 0000000000000000 x2 : 0000000000000100
> [ 12.472143] x1 : 0000000000000040 x0 : 000000000000003f
> [ 12.472279] Call trace:
> [ 12.472344] down_and_up_cpus+0x1d4/0x1f4
> [ 12.472451] psci_checker+0x250/0x4cc
> [ 12.472547] do_one_initcall+0x54/0x220
> [ 12.472646] kernel_init_freeable+0x1ec/0x2b4
> [ 12.472760] kernel_init+0x18/0x108
> [ 12.472851] ret_from_fork+0x10/0x18
> [ 12.472942] ---[ end trace c328815eb39fc505 ]---
>
> where the psci checker is unhappy about the number of CPUs. So CPU0 doesn't
> come back up, and probably has taken down a few things with it.
>
> The console seems to be on a rather bizarre baud rate, and I can't manage
> to reset it. On reboot, the console recovers though, so the firmware is
> able to restore some level of sanity (yay!).
>
> You can also reproduce it as:
>
> root@hot-poop:/home/maz# echo 0 >/sys/devices/system/cpu/cpu0/online
> root@hot-poop:/home/maz# echo 1 >/sys/devices/system/cpu/cpu0/online
> bash: echo: write error: Input/output error
>
> The kernel log says:
>
> [ 47.145006] IRQ 254: no longer affine to CPU0
> [ 47.149380] IRQ 382: no longer affine to CPU0
> [ 47.153844] CPU0: shutdown
> [ 47.156551] psci: CPU0 killed.
> [ 60.904531] CPU0: failed to come online
> [ 60.904634] CPU0: failed in unknown state : 0x0
>
> and the console is dead. I guess nobody ever turned CPU0 off... :-/
>
For a moment, I thought PSCI checker found some issue that normal hotplug
operation didn't. Guess what, I am wrong :). Normal HP tests from the
kernel triggers this, which is good as not all normally run this PSCI
tests.
Anyways, looks like the firmware is broken. If there are hardware
limitations, the firmware can fail to poweroff as a workaround. If
it is anything to do with some secure service or OS, we have PSCI
ways to convey the same and we now avoid starting the CPU down sequence
by marking it not hotpluggable. PSCI tests may not be able to use it
but I expect the firmware to return error for CPU_DOWN in that case.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-05 16:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 12:38 PSCI checker query John Garry
2019-12-05 13:30 ` Sudeep Holla
2019-12-05 14:22 ` John Garry
2019-12-05 15:48 ` Sudeep Holla
2019-12-05 15:55 ` Marc Zyngier
2019-12-05 16:53 ` Sudeep Holla [this message]
2019-12-05 16:59 ` Marc Zyngier
2019-12-05 17:12 ` John Garry
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=20191205165331.GA21023@bogus \
--to=sudeep.holla@arm.com \
--cc=john.garry@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=wanghuiqiang@huawei.com \
/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