linux-mips
[Top] [All Lists]

Re: [PATCH V2] MIPS: Fix poweroff failure when HOTPLUG_CPU configured.

To: Linux MIPS Mailing List <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH V2] MIPS: Fix poweroff failure when HOTPLUG_CPU configured.
From: Kevin Cernekee <cernekee@gmail.com>
Date: Sat, 18 Aug 2012 10:50:20 -0700
Cc: linux-kernel@vger.kernel.org, Fuxin Zhang <zhangfx@lemote.com>, Zhangjin Wu <wuzhangjin@gmail.com>, Hongliang Tao <taohl@lemote.com>, Hua Yan <yanh@lemote.com>, Yong Zhang <yong.zhang@windriver.com>, stable@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5cbwiIiBjZYJxobxgmPJR56stCDW7dhU+YFdIT8yItM=; b=vlycQ3EGpPsBFeoOmUhZsfe21xg2/Q3Ehw3q+BozfsGAcnaSAPfNo0thndzXmt89R5 acAoUfyH+p4adCTwR9EzYALzYCd9WJ1XMJvFGaWoUDrNI/p15Two9z+ywCozpMVVwUWh I7cYnv5Fb2xZOzrNDKCoERY4y++7uWbRKHJ5HWLramC4J679tETOeyb/iBj7HsxcvLgq YzOjEwfARm9fxwVA1f08ucW4ioOnT3Q4UOCBXMmPV0wFzXnlR8Uzt5SFV6YMvF3+b5rK gfeQTxSyEWfAgWOjcYVnUu2+8Q9iXhqKFu2+cBaRpjWxr2cD1zpeNOY//kjI58mmdU99 CWig==
In-reply-to: <1344862344-27434-1-git-send-email-chenhc@lemote.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1344862344-27434-1-git-send-email-chenhc@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
On Mon, Aug 13, 2012 at 5:52 AM, Huacai Chen <chenhc@lemote.com> wrote:
> When poweroff machine, kernel_power_off() call disable_nonboot_cpus().
> And if we have HOTPLUG_CPU configured, disable_nonboot_cpus() is not an
> empty function but attempt to actually disable the nonboot cpus. Since
> system state is SYSTEM_POWER_OFF, play_dead() won't be called and thus
> disable_nonboot_cpus() hangs. Therefore, we make this patch to avoid
> poweroff failure.

I have seen the same problem; sometimes it causes a kernel oops too.

>  #ifdef CONFIG_HOTPLUG_CPU
> -               if (!cpu_online(cpu) && !cpu_isset(cpu, cpu_callin_map) &&
> -                   (system_state == SYSTEM_RUNNING ||
> -                    system_state == SYSTEM_BOOTING))
> +               if (!cpu_online(cpu) && !cpu_isset(cpu, cpu_callin_map))
>                         play_dead();

This fix works for me.

Acked-by: Kevin Cernekee <cernekee@gmail.com>

I do see SMP boot problems ("Attempted to kill the idle task!" panic)
on a 4-way box if the !cpu_isset() check is removed.

<Prev in Thread] Current Thread [Next in Thread>