From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:42694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031520AbdAFLTw (ORCPT ); Fri, 6 Jan 2017 06:19:52 -0500 Date: Fri, 6 Jan 2017 11:19:51 +0000 From: Will Deacon To: Stephen Boyd Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, Russell King , stable@vger.kernel.org Subject: Re: [PATCH] ARM: hw_breakpoint: blacklist Scorpion CPUs Message-ID: <20170106111951.GA15333@arm.com> References: <1483637556-3974-1-git-send-email-mark.rutland@arm.com> <20170105232324.GL17126@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170105232324.GL17126@codeaurora.org> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Jan 05, 2017 at 03:23:24PM -0800, Stephen Boyd wrote: > On 01/05, Mark Rutland wrote: > > On APQ8060, the kernel crashes in arch_hw_breakpoint_init, taking an > > undefined instruction trap within write_wb_reg. This is because Scorpion > > CPUs erroneously appear to set DBGPRSR.SPD when WFI is issued, even if > > the core is not powered down. When DBGPRSR.SPD is set, breakpoint and > > watchpoint registers are treated as undefined. > > > > It's possible to trigger similar crashes later on from userspace, by > > requesting the kernel to install a breakpoint or watchpoint, as we can > > go idle at any point between the reset of the debug registers and their > > later use. This has always been the case. > > > > Given that this has always been broken, no-one has complained until now, > > and there is no clear workaround, disable hardware breakpoints and > > watchpoints on Scorpion to avoid these issues. > > I believe the workaround is to read DBGPRSR after exit from WFI? That might be do-able via cpuidle, but it's probably better for somebody familiar with the SoC PM to write that patch. > I'm fine with the blacklisting approach though. > > Reviewed-by: Stephen Boyd Thanks, Will