From patchwork Mon Mar 20 06:31:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 740802 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vmmSJ49xzz9s1y for ; Mon, 20 Mar 2017 17:36:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CPbNO9YD"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vmmSJ37BpzDqZy for ; Mon, 20 Mar 2017 17:36:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CPbNO9YD"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vmmMC2Gg1zDqZY for ; Mon, 20 Mar 2017 17:32:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CPbNO9YD"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id b5so18200618pgg.1 for ; Sun, 19 Mar 2017 23:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RwR3DIPd/ppqqps6OWk8lqUNmLq87BdyNKowK+MtCBo=; b=CPbNO9YDtfL85jtZ+CFIYo5r3Q/tnR+oLZyhzaRFGmJYeubjc9SlcP+gAISd6MW+Ws cSjlyQ+LdpFjoNlB2xfRTtvQIFbW4ZCY4P3eMDSZyGuWXdg59SX11aB6yCQ+4UwP14Fg J8J7Amag6kfR0uBSyH0UX4U9wuRLdWT71fCIHVGftWvgamQb63Ad60ihYIg0ThHAjPQu nFgBBjMCT+AW6GPb/CwcY08hdV/4UtcRBFeTIWItkGTYBk0JLAy7NtsvuAIvRF2bYgri yiDsFiBRdHgog3kcUk49Rrcogr6SRol4fivemSeGZLGoUY/AUZL8pSh2DNXhAwz+4NEb 3UVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RwR3DIPd/ppqqps6OWk8lqUNmLq87BdyNKowK+MtCBo=; b=ItowtwFe5slnMZzVZvCKl1t6mygTmE/ZYMwszb73g8kIfD9aVAB6dL3Aic3Qg1AePc vkMjD1cnFsVTQUYfTpdnkgmPLZHV+sNTdJo8B1tvL9YbZs9i01spSM4SflKIs5Uq3qXw v6/QUgJTaabWMZpTHvlUrVkIK608Vwttxz/P5HWiPONxCO+9Vp9szQLz26qeeU7lSQn+ q6miQvlv7iuXxGKVrs2hYHFmAwDemXlrMDs4oWtL6K4Arl57/2V0sOxR/E3Usraw75KR kjjzuoZgE+10r70sxbcU9A7mjUkQKz6jN2cfizljpRfBkOem6PNTwJi/k+5MTEdBUzyZ KrHg== X-Gm-Message-State: AFeK/H3I0Zcj2pE6OLog829OjDohVFFCrSacTFy+ITopqsD5fCrZpQneW/cAb1vYms4gPw== X-Received: by 10.98.215.23 with SMTP id b23mr31188608pfh.87.1489991525718; Sun, 19 Mar 2017 23:32:05 -0700 (PDT) Received: from roar.au.ibm.com ([203.221.48.234]) by smtp.gmail.com with ESMTPSA id e76sm30492792pfk.75.2017.03.19.23.32.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Mar 2017 23:32:04 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/2] powerpc/cbe: do not process external or decremeter interrupts from sreset Date: Mon, 20 Mar 2017 16:31:49 +1000 Message-Id: <20170320063149.3068-3-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170320063149.3068-1-npiggin@gmail.com> References: <20170320063149.3068-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Cell will wake from low power state at the system reset interrupt, with the event encoded in SRR1, rather than waking at the interrupt vector that corresponds to that event. The system reset handler for this platform decodes SRR1 event reason and calls the interrupt handler to process it directly from the system reset handlre. A subsequent change will treat the system reset interrupt as a Linux NMI with its own per-CPU stack, and this will no longer work. Remove the external and decrementer handlers from the system reset handler. - The external exception remains raised and will fire again at the EE interrupt vector when system reset returns. - The decrementer is set to 1 so it will be raised again and fire when the system reset returns. It is possible to branch to an idle handler from the system reset interrupt (like POWER does), then restore a normal stack and restore this optimisation. But simplicity wins for now. Tested-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/cell/pervasive.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c index e7d075077cb0..a88944db9fc3 100644 --- a/arch/powerpc/platforms/cell/pervasive.c +++ b/arch/powerpc/platforms/cell/pervasive.c @@ -88,11 +88,14 @@ static void cbe_power_save(void) static int cbe_system_reset_exception(struct pt_regs *regs) { switch (regs->msr & SRR1_WAKEMASK) { - case SRR1_WAKEEE: - do_IRQ(regs); - break; case SRR1_WAKEDEC: - timer_interrupt(regs); + set_dec(1); + case SRR1_WAKEEE: + /* + * Handle these when interrupts get re-enabled and we take + * them as regular exceptions. We are in an NMI context + * and can't handle these here. + */ break; case SRR1_WAKEMT: return cbe_sysreset_hack();