Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2167594pxu; Fri, 18 Dec 2020 07:05:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3UiKV8I59v2cRK/CXP9LiG+oIus45yWbL+hLWQZMefFqExrPeR/xkC1uzO4LOdRvQl32m X-Received: by 2002:a17:906:3883:: with SMTP id q3mr4439254ejd.160.1608303922619; Fri, 18 Dec 2020 07:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608303922; cv=none; d=google.com; s=arc-20160816; b=0kUZsUATUulWge97cYyECPhcsdyV2psQLHaLFXiJyhxbuTGsNeBCirJ3Grv9kZ67vz wKysRSBmlOKUnGD8X6bbo42w9ieki8p2bes3k5kBzZg1zoO4WRzA0+IwrEEJStw6sMVq iwGegqjWf9deYHwY+jFFoMVVo4Uzn8Kwo6l7BueIs6t6nP4S1Ki94b8gwp/Bbo1ZDSOQ 21Ox9gQoTQvgizSv6sJ456ObzOn4SJTQalDpqX9dXM1rr4T1LNcIxsdy7dB5aI6BYUEC MEcHQFzFerpDD7IeLuVDFBC1d73xAn++N4AcjuuvOK1WfqLg/aLbcEE6vrtgnsRr5Pl3 PpyA== 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=OuFiWkNK4eslVsgUMlP3HkDJEkJdOoht2xbOL/jpRzY=; b=wf/YlxL8oosVWzAsE5TmYIgZCHwPgxqL1vphSvguyf/nvPCjSG702Nq0DRkluhgGeK 59RuOPbxl5OhYbVWEK6x3237tDfrQG7oe1GERFiVfin3qH0YMSZqFAVvSCkTqd88Ga+b NJzYlW5YNRt4b4k25T/ngOMgNf/4FA4xldhLGclN+GahlGHI1bYoiswTOgTmyiY+I0s0 /PLU8F8RGGRwre1jP7m4ZWjsbr0/q5LYpGD/5H8QoIOI/nkcUEQpYDCJEHXkaC7LPYmB YjO4yIy9lQ5volNrgLqdJMHgiiyVCIchZ4Zt7Uuisr0g7GzXKtEn1Q4scaJEwuWhGvyb GFJQ== 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 d23si4711204ejd.151.2020.12.18.07.04.44; Fri, 18 Dec 2020 07:05:22 -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 S1728282AbgLRPBQ (ORCPT + 99 others); Fri, 18 Dec 2020 10:01:16 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:60003 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgLRPBP (ORCPT ); Fri, 18 Dec 2020 10:01:15 -0500 Received: from orion.localdomain ([95.115.54.243]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5FtF-1k7Hmp0Rxl-0118Hm; Fri, 18 Dec 2020 15:58:02 +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: (repost) cleaning up handling of bad IRQs Date: Fri, 18 Dec 2020 15:57:23 +0100 Message-Id: <20201218145746.24205-1-info@metux.net> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K1:kDy23KicY6yANCRUU/uS27W+PiA6W2GQEJc1w+ZgwWxEjEL6wp+ O8q9sjFQjB+V0eXbRSVHReMrDSfLKWhKYaglZe/mGoKnGo+tKe78BIINCtGjVGRkQlVCPRT E0zs050IDCFNASTif7ntcdtcNCuqqIz4boa/lWXOWWv6+2VsptoinSFPTn2gbyoldCF3WLk LPxaYtQibJh05k9ukhkIw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:WqNj1TBcidE=:gp0GmOgW/MpqQGs+zxKh6i I0088aGoSzOIfC95i/SEDZNYBUDmgwLa8n4SXmJkOmu/GGWNmsBGg/Xf8yNQt9k/hZG1GWXPN xEBtNhEWsGOydmRhKc+SGqkOJt1MGEphhCucm67oCLQxZfaAVCyV1LE8fm4EHrJROazGyYjEq lH16F/3XvcljV+pCYiqIoRjM6+oypx0etdtwnLgAZmNyA9S6WTF37Yqa3INS1S7FwBDy3Kbkw IcBnm6E0VHQ4OPHXxABvAk2oIndJOeCt+tf9gc9//r1GcOSb4BYRCbTjQKkvol7Zx++hrz8D9 ayJibSTe5nhuLcL+SN4HlKtWfuz6RmVjv6c/fDlR3j/qL/eB03XvQh9FCZg3jiwKfX5w6bpnL fTy0MG7FyqXlq0+laGULoIs9JiSUAXz4NDEYbZiUPQeKZN9i2edp69JRiVoBK Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello friends, << reposting, since first queue didn't go through completely, due to mailer problem >> 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