Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2146172pxu; Fri, 18 Dec 2020 06:38:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwegtDdgCxjCJ7SGE0pYbabML3QyHElvKq+4Ni1+rbJjJ03x0hgCIoKcl0yCJk1YYEl1oxd X-Received: by 2002:a17:906:4146:: with SMTP id l6mr4272250ejk.341.1608302313923; Fri, 18 Dec 2020 06:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608302313; cv=none; d=google.com; s=arc-20160816; b=amHF8SAiz2pMmAsGhm1VUdbNzTWlHXqOkj9VWql8vM2i/iAF9CWSTonhzbbS4IKuE6 WggkigGTUK+tBd7Km4JtsqXhN13GCtK7vviKB5XmKls1pgLcx9AaOBSCBa7XI4yVFTUZ YFLgAqIdgX9V1MP08co34GKdMRPUJTyKUoGM2rCRwIUC2knmhrjLfHAJVMINrk8pzMiu 7MOknUQjNf3VuawKJ8nf9XsSBfDhE8Se600RuyrFsmcrOSPB5RcCMpu8HT5viLPbN3Bg IwpMYlzLG+qVihwjLCyRkg1NN0zcElDVXJl1oI3x9hub3kK3q+j/OrxzYBItBLkbfv+E 43WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=LDv5DA8iz754MRE6AichAnBNBuP8EpxPnYoNCD4uZiE=; b=HgLV9wMaAJoZZnCXY9a3wjLA3D+D31ef3ZxTq57xAl0kZJJRd9mVvSl1fJK+qb3/Pu EHXA48WRpnRur2gGKGCfgICTfD44nQv5UYOIkSh2psqzMLTOBgkSuuLQCV7fwaUa/4I4 gtl5cD8wjPHGAV+k9/xb0upNQ6ZUQDhva2nA17fk3Kiqn9WSG/vxKwc0v9b8FFN6oOLF 9qyCgz1IL7gOSEQDwkjYi9D78WXH4asQibOINnOS9yvFMKi18AHWBpZdSVpTOtiNwn8h TkzbeMghB8inVWUWdEMlL/FV+Dhw1HUIE6EJtCx5J4WASMdV6SZfg4p/NVNFr/Xztc58 CVjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho39si4908694ejc.745.2020.12.18.06.38.11; Fri, 18 Dec 2020 06:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbgLROfO (ORCPT + 99 others); Fri, 18 Dec 2020 09:35:14 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:46385 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbgLROfJ (ORCPT ); Fri, 18 Dec 2020 09:35:09 -0500 Received: from orion.localdomain ([95.115.54.243]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M2wCi-1kmxPC1v92-003Pjz; Fri, 18 Dec 2020 15:31:38 +0100 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, catalin.marinas@arm.com, will@kernel.org, msalter@redhat.com, jacquiot.aurelien@gmail.com, gerg@linux-m68k.org, geert@linux-m68k.org, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, deller@gmx.de, benh@kernel.crashing.org, paulus@samba.org, ysato@users.sourceforge.jp, dalias@libc.org, davem@davemloft.net, tglx@linutronix.de, bp@alien8.de, x86@kernel.org, hpa@zytor.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, maz@kernel.org, tony@atomide.com, arnd@arndb.de, linux-alpha@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, linux-arch@vger.kernel.org Subject: cleanup handling of bad IRQs Date: Fri, 18 Dec 2020 15:30:59 +0100 Message-Id: <20201218143122.19459-1-info@metux.net> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K1:GCc9gbsI9eyOCfdNmRX4o9bXX1pOCTy0AyznDchDYs0oM1Puh0V HaUshqI/aGp8nZ32pIa3W6umlwkDU/2qcylknjRG07xPj3Phd4Hi7sPh0w6jCYT7br8wP9r fsQ6guhbrEZJsPZNI8LuMeU1nvpg4pLhQC4hxQMx4DspP5teK6wAXTnJgWzY/Mk0t7irqLX kur37BKvbPWU7xvonpMrg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:/sbNIRVafqs=:7E0S8ysTyADzbE8lkSM6eP 3TWEq16dIlocEj3ixPEv4zX+3uTZPLFNfZxuuLVDe5vQethUoPCGbLrF+TJzqQS6i9ZiPDOWV +MEyUwQsMabb9a7q9A0f4yZPbmnRvOUDPtXYvFQYiaQf8++meO3+CL9+AQCaHZpZU5Lu4zk3h DHvOcIL0N3IkgsS8EOQdWctpP0notp1p3/QtKqWrA0uwnQO8udkYh4oSleqescXu70z7m0miq aQx+1M87gYUAFYOUnCysSU1ZhyZRm3NivHaA+X1Bi0lbdEx0v1kCrv+PamjVlz+r4tOy1m2VO 7GBJGicMrEiBxqRit0qr0sJg1PjhIfT/u0Up/KxPuvMs/TGlnv05ySaqY98K0u1+80NKHB60f iftFYU5etid5UzRqKbNb+YFzN9b3C5t5lHQzh4h/GALhKjmHZEoAm9bm1bb// Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello friends, here's a patch queue for cleaning up the IRQ handling. Inspired by a discussion we had on a previous patch of mine: "arch: fix 'unexpected IRQ trap at vector' warnings" https://www.spinics.net/lists/kernel/msg3763137.html Turned out that the whole message, as it is right now, doesn't make much sense at at all - not just incorrect wording, but also not quite useful information. And the whole ack_bad_irq() thing deserves a cleanup anyways. So, I've had a closer look and came to these conclusions: 1. The warning message doesn't need to be duplicated in the per architecture ack_bad_irq() functions. All, but one callers already do their own warning. Thus just adding a pr_warn() call there, printing out more useful data like the hardware IRQ number, and dropping all warnings from all the ack_bad_irq() functions. 2. Many of the ack_bad_irq()'s count up the spurious interrupts - lots of duplications over the various archs. Some of them using atomic_t, some just plain ints. Consolidating this by introducing a global counter with inline'd accessors and doing the upcounting in the (currently 3) call sites of ack_bad_irq(). After that, step by step changing all archs to use the new counter. 3. For all but one arch (x86), ack_bad_irq() became a no-op. On x86, it's just a call to ack_APIC_irq(), in order to prevent lockups when IRQs missed to be ack'ed on the APIC. Could we perhaps do this in some better place ? In that case, ack_bad_irq() could easily be removed entirely. have fun, --mtx