From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066AbdEPIuh (ORCPT ); Tue, 16 May 2017 04:50:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44676 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbdEPIuL (ORCPT ); Tue, 16 May 2017 04:50:11 -0400 From: "Gautham R. Shenoy" To: Nicholas Piggin , Michael Ellerman , Michael Neuling , Vaidyanathan Srinivasan , Shilpasri G Bhat , Akshay Adiga , Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Gautham R. Shenoy" Subject: [PATCH 0/6] Enable support for deep-stop states on POWER9 Date: Tue, 16 May 2017 14:19:42 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17051608-0040-0000-0000-0000033E8641 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007070; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00861181; UDB=6.00427106; IPR=6.00640844; BA=6.00005351; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015477; XFM=3.00000015; UTC=2017-05-16 08:50:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051608-0041-0000-0000-00000732B3A7 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-16_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705160077 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gautham R. Shenoy" Hi, This patch series contains some of the fixes required for enabling support for deep stop states such as STOP4 and STOP11 via CPU-Hotplug. These fixes mainly ensure that some of the hypervisor resources which are lost during the deep stop state are correctly restored on a wakeup. There are 6 patches in the series. Patch 1 correctly initializes the core_idle_state_ptr based on the threads_per_core. core_idle_state_ptr is used to determine if a thread is the last thread entering a deep stop state or a first thread waking up from deep stop state in order to save/restore per-core resources. Patch 2 decouples restoring timebase from restoring hypervisor resources, as there are stop states which lose hypervisor state but not the timebase. Patch 3 saves the LPCR value before executing deep stop and restores it back to the saved value on the wakeup from stop. Patch 4 programs the restoration of some of one-time initialized SPRs via the stop-api. Patch 5 provides a workaround for a hardware issue on POWER9 DD1 chips where the PLS value cannot be relied upon on a wakeup from deep stop. Patch 6 fixes the cpuidle-powernv initialization code to allow deep states that don't lose timebase. These patches are based on the Linux upstream and have been tested with the corresponding skiboot patches in https://lists.ozlabs.org/pipermail/skiboot/2017-May/007183.html to get STOP4 working via CPU-Hotplug. Akshay Adiga (1): powernv:idle: Restore SPRs for deep idle states via stop API. Gautham R. Shenoy (5): powernv:idle: Correctly initialize core_idle_state_ptr powernv:idle: Decouple Timebase restore & Per-core SPRs restore powernv:idle: Restore LPCR on wakeup from deep-stop powernv:idle: Use Requested Level for restoring state on P9 DD1 cpuidle-powernv: Allow Deep stop states that don't stop time arch/powerpc/include/asm/paca.h | 2 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kernel/idle_book3s.S | 33 +++++++--- arch/powerpc/platforms/powernv/idle.c | 112 +++++++++++++++++++++------------- drivers/cpuidle/cpuidle-powernv.c | 16 +++-- 5 files changed, 110 insertions(+), 54 deletions(-) -- 1.8.3.1