From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH v2] ARM: avoid Cortex-A9 livelock on tight dmb loops Date: Fri, 25 Jan 2019 15:20:20 -0800 Message-ID: <20190125232020.GX5720@atomide.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Russell King Cc: Rajendra Nayak , Paul Walmsley , linux-omap@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org List-Id: linux-omap@vger.kernel.org * Russell King [190125 21:04]: > Executing loops such as: > > while (1) > cpu_relax(); > > with interrupts disabled results in a livelock of the entire system, > as other CPUs are prevented making progress. This is most noticable > as a failure of crashdump kexec, which stops just after issuing: > > Loading crashdump kernel... > > to the system console. A workaround for this is to use 10 nops in > cpu_relax(). > > We also use wfe() in while (1) loops to avoid burning cycles in a > tight loop, giving the CPU a hint that we're not doing anything > useful. > > Signed-off-by: Russell King > --- > It's been a while since this was posted, Will's suggestion was to use > 10 nops in cpu_relax() last time around. I still prefer wfe() in > these infinite-not-doing-anything-ever loops. Works for me: Tested-by: Tony Lindgren