Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751638AbdCHHtD (ORCPT ); Wed, 8 Mar 2017 02:49:03 -0500 Received: from ozlabs.org ([103.22.144.67]:56031 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbdCHHtC (ORCPT ); Wed, 8 Mar 2017 02:49:02 -0500 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 424f8acd328a111319ae30bf384e5dfb9bc8f8cb In-Reply-To: <1488174007-8732-1-git-send-email-ego@linux.vnet.ibm.com> To: "Gautham R. Shenoy" , Benjamin Herrenschmidt , Michael Neuling , Vaidyanathan Srinivasan , "Shreyas B. Prabhu" , Shilpasri G Bhat , Balbir Singh , Akshay Adiga , Anton Blanchard From: Michael Ellerman Cc: "Gautham R. Shenoy" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [v2] powernv:idle: Fix bug due to labeling ambiguity in power_enter_stop Message-Id: <3vdQ6p4LMRz9sNG@ozlabs.org> Date: Wed, 8 Mar 2017 18:25:54 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 41 On Mon, 2017-02-27 at 05:40:07 UTC, "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > Commit 09206b600c76 ("powernv: Pass PSSCR value and mask to > power9_idle_stop") added additional code in power_enter_stop() to > distinguish between stop requests whose PSSCR had ESL=EC=1 from those > which did not. When ESL=EC=1, we do a forward-jump to a location > labelled by "1", which had the code to handle the ESL=EC=1 case. > > Unforunately just a couple of instructions before this label, is the > macro IDLE_STATE_ENTER_SEQ() which also has a label "1" in its > expansion. > > As a result, the current code can result in directly executing stop > instruction for deep stop requests with PSSCR ESL=EC=1, without saving > the hypervisor state. > > Fix this BUG by labeling the location that handles ESL=EC=1 case with > a more descriptive label ".Lhandle_esl_ec_set" (local label suggestion > a la .Lxx from Anton Blanchard). > > While at it, rename the label "2" labelling the location of the code > handling entry into deep stop states with ".Lhandle_deep_stop". > > For a good measure, change the label in IDLE_STATE_ENTER_SEQ() macro > to an not-so commonly used value in order to avoid similar mishaps in > the future. > > Fixes: 09206b600c76 ("powernv: Pass PSSCR value and mask to > power9_idle_stop") > > Cc: Michael Neuling > Cc: Vaidyanathan Srinivasan > Cc: Michael Ellerman > Signed-off-by: Gautham R. Shenoy Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/424f8acd328a111319ae30bf384e5d cheers