Return-Path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48252 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbeLGPw6 (ORCPT ); Fri, 7 Dec 2018 10:52:58 -0500 Date: Fri, 7 Dec 2018 15:52:53 +0000 From: Catalin Marinas To: Will Deacon Cc: stable@vger.kernel.org, james.morse@arm.com, hayashi.kunihiko@socionext.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: hibernate: Avoid sending cross-calling with interrupts disabled Message-ID: <20181207155253.GC11961@arrakis.emea.arm.com> References: <1544186830-27934-1-git-send-email-will.deacon@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544186830-27934-1-git-send-email-will.deacon@arm.com> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Dec 07, 2018 at 12:47:10PM +0000, Will Deacon wrote: > Since commit 3b8c9f1cdfc50 ("arm64: IPI each CPU after invalidating the > I-cache for kernel mappings"), a call to flush_icache_range() will use > an IPI to cross-call other online CPUs so that any stale instructions > are flushed from their pipelines. This triggers a WARN during the > hibernation resume path, where flush_icache_range() is called with > interrupts disabled and is therefore prone to deadlock: > > | Disabling non-boot CPUs ... > | CPU1: shutdown > | psci: CPU1 killed. > | CPU2: shutdown > | psci: CPU2 killed. > | CPU3: shutdown > | psci: CPU3 killed. > | WARNING: CPU: 0 PID: 1 at ../kernel/smp.c:416 smp_call_function_many+0xd4/0x350 > | Modules linked in: > | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0-rc4 #1 > > Since all secondary CPUs have been taken offline prior to invalidating > the I-cache, there's actually no need for an IPI and we can simply call > __flush_icache_range() instead. > > Cc: > Fixes: 3b8c9f1cdfc50 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings") > Reported-by: Kunihiko Hayashi > Tested-by: Kunihiko Hayashi > Tested-by: James Morse > Signed-off-by: Will Deacon Queued for 4.20. Thanks. -- Catalin