From patchwork Mon Mar 20 06:31:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 740801 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vmmQR3j6sz9s2s for ; Mon, 20 Mar 2017 17:34:55 +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="aDl7PWAx"; 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 3vmmQR2ZjGzDqcl for ; Mon, 20 Mar 2017 17:34:55 +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="aDl7PWAx"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (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 3vmmM85w6KzDqZl for ; Mon, 20 Mar 2017 17:32:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aDl7PWAx"; dkim-atps=neutral Received: by mail-pg0-x242.google.com with SMTP id b5so18200451pgg.1 for ; Sun, 19 Mar 2017 23:32:04 -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=CTT3yZe0tI9lG/E4z5hKBYi0eFJneULkslArVsUvoNM=; b=aDl7PWAx4tBUg7k/i2oupt1FQryKVqdcACO541KiFyh6ftWObQLBX2PM1m50oVqoyJ GrhVEzLioK/ruErjf4teDVsjumCSG/0D7ArKBEslgB8M2GCZ1I3ndm00WkoK+B2hITXO LecKsQ4Exq2w+yQLAVDDXSBqw1FHwlbjRFNl/zyIN4URhGd2tYDs0LMH+5yg2lK2DP+z XjxY4aS4sWz13RKI3ZUw3XzWev2jj3kNvsYgKi28OXXm3xoUJf6WW3f21fgqObIdGNw1 4/umRfsWaK/A+7HsNQt6wyE7K0s7VHFrC2mSrLUmO3Impmp7heE8IZV5vlL419xiSI8I /LIg== 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=CTT3yZe0tI9lG/E4z5hKBYi0eFJneULkslArVsUvoNM=; b=XUjEEpbWaRTHxVUurOna2+eegG9UTm7jdnnWoCfuKlLFFCseYX78ZMsS7C0A1NDRP5 pEv77t5YX4miRxoyG7BvId9uMrLf6ZMW/NFdX+zWDMLwfUwjoO+r4OdbsVFriidn+2LZ LGuFxCsUSsyjiZO4T5374vXOySu1YrmyFC0s2wdGgm50ItsvB21K67a3adQ3lS6QklO7 Vh4zJsXS7UkVu9EifcdHjAvXZfPMzKPqmEoxBY0RsghGIiqIPqfTEputASLl4xsSxft3 WBDl5Xo7QyGRcMzn0OVnY9vZ3CpcbERURxf6yPYmAROBP1vePXZTgD20Kmmxh3YMRJQC m/PQ== X-Gm-Message-State: AFeK/H3kv46VHrgmmm3nrHz3zB75oexu0OjFXZYInjuMZYHqtvLQDVj4TXtrLy8c+A5W1g== X-Received: by 10.84.225.146 with SMTP id u18mr26011655plj.135.1489991522101; Sun, 19 Mar 2017 23:32:02 -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.31.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Mar 2017 23:32:01 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset Date: Mon, 20 Mar 2017 16:31:48 +1000 Message-Id: <20170320063149.3068-2-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" PA Semi 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: Christian Zigotzky Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pasemi/idle.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c index 75b296bc51af..44e0d9226f0a 100644 --- a/arch/powerpc/platforms/pasemi/idle.c +++ b/arch/powerpc/platforms/pasemi/idle.c @@ -53,11 +53,14 @@ static int pasemi_system_reset_exception(struct pt_regs *regs) regs->nip = regs->link; 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; default: /* do system reset */