Received: by 10.223.185.116 with SMTP id b49csp3348258wrg; Sun, 25 Feb 2018 20:51:00 -0800 (PST) X-Google-Smtp-Source: AG47ELvZWgnABsw6fbzeFbu88ICJm9DRG2SfxY6gysxk6q/rdn/Jh7odeJNiaMo6u03I1AFl7JLv X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr4446311pls.137.1519620660689; Sun, 25 Feb 2018 20:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519620660; cv=none; d=google.com; s=arc-20160816; b=caqr8hbkuDPXq4zt1IIJiC+sYtJ6G+QBidNW7A0d1IzHJnrvBryDcea9zXVMtZTKAY UG55zl4QSkM6LbhJG/ml1lfenqprRftsnKLaAD3Lwl8KrzAdy6cIWYSXVn5nusoNZT6T adQ7Y4sNNcfCnQGW/S79lrvjYBZ5S+sbGMl9RQBhhs/A35nfqqJTYQhjQkmlcy+wyqmN Gf7qrRppl6utxT8HQ+YvbgfV8G5O6e1lfAiAmPYeGg3Rm9ZptX4x6FZU5fjZVlPZkKSh VmxPXseD+vIHULEE/tx2w/iV2fwYvvFbgfjx7AlQiFWdSGx7AqaEMgldQwho2lUJNAXz wB4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=HUk1gztCkPEoENHM6xbuclxjcVr/ks0ylqbV6tmeXMI=; b=yKfI6JNGm0Na5e0f70cGiDi67YyfKlN7gqfjVfd1yXymA0agGC0ZoVcjmb4iEzdZls UvoB5Ob7MPNWjmSgVeJZXYsNSWnyAZ/nXFfghBkW8LGPXUALYlIyWhdYTPSVgvxRu02h Ed7UWTuJPKCwCV9uSpSDf33GIPOAdTGdb5bIGk/im95Sei/a90cYULGqP0zbyeQuPc8S /CJSWFR5Yr8a1gJmFt72NakHVFphLOCk4dqQ9fSdM89hkk2Czhm6q037o/HTHP1qcv9y 8sP1VpnbG2T1rL13H0Gx3vSSKv19ED784uNmEwpb9hJ/IP3Qc8PrAe46htFxWaqeBOlO xqhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si5012203pgd.787.2018.02.25.20.50.35; Sun, 25 Feb 2018 20:51:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbeBZErW (ORCPT + 99 others); Sun, 25 Feb 2018 23:47:22 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45044 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751947AbeBZErU (ORCPT ); Sun, 25 Feb 2018 23:47:20 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1Q4i0Uc105196 for ; Sun, 25 Feb 2018 23:47:19 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gc8wm4em0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 25 Feb 2018 23:47:19 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 25 Feb 2018 23:47:19 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 25 Feb 2018 23:47:15 -0500 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1Q4lFhP48300060; Mon, 26 Feb 2018 04:47:15 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A19E3124037; Mon, 26 Feb 2018 00:49:30 -0500 (EST) Received: from birb.localdomain (unknown [9.185.142.38]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 220E012403F; Mon, 26 Feb 2018 00:49:30 -0500 (EST) Received: by birb.localdomain (Postfix, from userid 1000) id 981844E09A8; Mon, 26 Feb 2018 15:47:12 +1100 (AEDT) From: Stewart Smith To: Akshay Adiga , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: npiggin@gmail.com, mpe@ellerman.id.au, Akshay Adiga Subject: Re: [PATCH] cpuidle/powernv : Restore different PSSCR for idle and hotplug In-Reply-To: <1519053500-31860-1-git-send-email-akshay.adiga@linux.vnet.ibm.com> References: <1519053500-31860-1-git-send-email-akshay.adiga@linux.vnet.ibm.com> Date: Mon, 26 Feb 2018 15:47:12 +1100 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18022604-0008-0000-0000-000002DB4C1A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008598; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00995190; UDB=6.00505831; IPR=6.00774523; MB=3.00019739; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-26 04:47:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022604-0009-0000-0000-00003862FE37 Message-Id: <87vaekmk6n.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-26_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802260063 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Akshay Adiga writes: > commit 1e1601b38e6e ("powerpc/powernv/idle: Restore SPRs for deep idle > states via stop API.") uses stop-api provided by the firmware to restore > PSSCR. PSSCR restore is required for handling special wakeup. When special > wakeup is completed, the core enters stop state based on restored PSSCR. > > Currently PSSCR is restored to deepest available stop state, causing > a idle cpu to enter deeper stop state on a special wakeup, which causes > the cpu to hang on wakeup. > > A "sensors" command which reads temperature (through DTS sensors) on idle > cpu can trigger special wakeup. > > Failed Scenario : > Request restore of PSSCR with RL = 11 > cpu enters idle state (stop5) > user triggers "sensors" command > Assert special wakeup on cpu > Restores PSSCR with RL = 11 <---- Done by firmware > Read DTS sensor > Deassert special wakeup > cpu enters idle state (stop11) <-- Instead of stop5 > > Cpu hang is caused because cpu ended up in a deeper state than it requested > > This patch fixes instability caused by special wakeup when stop11 is > enabled. Requests restore of PSSCR to deepest stop state used by cpuidle. > Only when offlining cpu, request restore of PSSCR to deepest stop state. > On onlining cpu, request restore of PSSCR to deepest stop state used by > cpuidle. > > Fixes : 1e1601b38e6e ("powerpc/powernv/idle: Restore SPRs for deep idle > states via stop API.") This should CC stable ? We'll need this to enable stop11 in firmware and not break things, right? -- Stewart Smith OPAL Architect, IBM.