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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 72815C388F9 for ; Tue, 27 Oct 2020 09:07:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CE0020714 for ; Tue, 27 Oct 2020 09:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895339AbgJ0JHm (ORCPT ); Tue, 27 Oct 2020 05:07:42 -0400 Received: from ozlabs.ru ([107.174.27.60]:42990 "EHLO ozlabs.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408749AbgJ0JHm (ORCPT ); Tue, 27 Oct 2020 05:07:42 -0400 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id F3461AE80024; Tue, 27 Oct 2020 05:06:27 -0400 (EDT) From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , "Oliver O'Halloran" , Marc Zyngier , Michael Ellerman , Qian Cai , Rob Herring , Thomas Gleixner , linux-kernel@vger.kernel.org, Frederic Barrat , =?UTF-8?q?Michal=20Such=C3=A1nek?= , Alexey Kardashevskiy Subject: [RFC PATCH kernel 0/2] irq: Add reference counting to IRQ mappings Date: Tue, 27 Oct 2020 20:06:53 +1100 Message-Id: <20201027090655.14118-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an attempt to fix a bug with PCI hot unplug with a bunch of PCIe bridges and devices sharing INTx. This did not hit us before as even if we did not call irq_domain_ops::unmap, the platform (PowerVM) would not produce an error but with POWER9's XIVE interrupt controller there is an error if unmap is not called at all (2/2 fixes that) or an error if we unmapped an interrupt which is still in use by another device (1/2 fixes that). One way of fixing that is doing reference counting in the POWERPC code but since there is a kobj in irq_desc already, I thought I'll give it a try first. This is based on sha1 4525c8781ec0 Linus Torvalds "scsi: qla2xxx: remove incorrect sparse #ifdef". Please comment. Thanks. Alexey Kardashevskiy (1): irq: Add reference counting to IRQ mappings Oliver O'Halloran (1): powerpc/pci: Remove LSI mappings on device teardown arch/powerpc/kernel/pci-common.c | 21 +++++++++++++++++++ kernel/irq/irqdesc.c | 35 +++++++++++++++++++++----------- kernel/irq/irqdomain.c | 27 ++++++++++++------------ 3 files changed, 57 insertions(+), 26 deletions(-) -- 2.17.1