From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96669C76191 for ; Thu, 18 Jul 2019 05:10:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5018A2173E for ; Thu, 18 Jul 2019 05:10:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5018A2173E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45q2JQ2MDczDqS3 for ; Thu, 18 Jul 2019 15:10:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=ozlabs.ru (client-ip=107.173.13.209; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from ozlabs.ru (ozlabs.ru [107.173.13.209]) by lists.ozlabs.org (Postfix) with ESMTP id 45q2Dc4X7YzDqZL for ; Thu, 18 Jul 2019 15:06:56 +1000 (AEST) Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 60682AE80053; Thu, 18 Jul 2019 01:06:19 -0400 (EDT) From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH kernel v4 1/2] powerpc: Add handler for orphaned interrupts Date: Thu, 18 Jul 2019 15:06:03 +1000 Message-Id: <20190718050604.74233-2-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190718050604.74233-1-aik@ozlabs.ru> References: <20190718050604.74233-1-aik@ozlabs.ru> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" The test on generic_handle_irq() catches interrupt events that were served on a target CPU while the source interrupt was being shutdown on another CPU. This may lead to a blocked interrupt queue on a target CPU so if there is another assigned irq on that CPU, that device stops working. This adds necessary infrastructure to allow platform to deal with it. The next patch implements it for XIVE. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/machdep.h | 3 +++ arch/powerpc/kernel/irq.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index c43d6eca9edd..6cc14e28e89a 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -59,6 +59,9 @@ struct machdep_calls { /* Return an irq, or 0 to indicate there are none pending. */ unsigned int (*get_irq)(void); + /* Drops irq if it does not have a valid descriptor */ + void (*orphan_irq)(unsigned int irq); + /* PCI stuff */ /* Called after allocating resources */ void (*pcibios_fixup)(void); diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 5645bc9cbc09..e0689dcb17f0 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -632,10 +632,13 @@ void __do_irq(struct pt_regs *regs) may_hard_irq_enable(); /* And finally process it */ - if (unlikely(!irq)) + if (unlikely(!irq)) { __this_cpu_inc(irq_stat.spurious_irqs); - else - generic_handle_irq(irq); + } else if (generic_handle_irq(irq)) { + if (ppc_md.orphan_irq) + ppc_md.orphan_irq(irq); + __this_cpu_inc(irq_stat.spurious_irqs); + } trace_irq_exit(regs); -- 2.17.1