Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp106888pxx; Tue, 27 Oct 2020 23:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDMQQ83DHFUqcJqmyYlPcLIzmaCJ5Huj6x01gNwopKYy6EBOPURJM7EFp/5Lsj/8IQeyAz X-Received: by 2002:a50:da8d:: with SMTP id q13mr6240074edj.370.1603865032015; Tue, 27 Oct 2020 23:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603865032; cv=none; d=google.com; s=arc-20160816; b=Hj3SmbGDbFeRI8wWPElVMr6MisspbejeFTgL1f1J1rlyB9U7zfmPam4IeM4nxU+vTe lYf8+tYHNj+hE5lOrydcFapC+ADbfjNuGJ15wmDkfvHYvRCwtpbG1vmVQKlz0hfDdzHM D5Ujuu/cKeyFDOnSJMy4s+xSVPPIpIrRloU4t8I2gaP5XwWdMhEMAU0FPc6pwr8hH0Z6 JPTRRQVLp8pO1uEqsU2ZtzeJYbC8wNFdo4rLqpm2GGPVEcMvXMzdpj9sA46G3j35CSzI qou9B84h7S/8YbxNjx+0xwunixS9oQBsTiP+io6XfyeiI6Kxsfokow04Mg+fSLgZmb5g bZww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uXfN2nL9LeSYV3zLDnaLGedHBdD3aPb7LFvSfE9v1Co=; b=xiMnXqvDWTAOF4q9Yoyr6a64+kbTN0OffZ7hLvuXpkrZIliCjQwOrr1spsu/SIjHtR LRiZw70YdgyeGVxdo7FSFePAa6TGdmmwUGqBPM3ujSr94wiTd1+jGToZk3dli9QsuMEU fXYsJ+x/E0WNWG3yoV6XH4/Sd/BcBnAff6ktBPLwJGLCoZDbB451Jn/RCveAWJBVBQgD Q1ARJ1fupGX9uiuAN5vi1Bn+mfOixUO/Kgf44skl7EqllIHU54Fb/tbhx1Y/OZu6hBPq RbUryoY0+psuou9dPxgUBz0qVCZMG7liL34KFlr/WQkSl10fArvUZgbqQPUqx6gQ1Se4 5S4w== 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 k25si3282573ejk.65.2020.10.27.23.03.30; Tue, 27 Oct 2020 23:03:51 -0700 (PDT) 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 S2895335AbgJ0JHm (ORCPT + 99 others); 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