From patchwork Mon Jul 11 12:06:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12913445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DB9DC43334 for ; Mon, 11 Jul 2022 12:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mWmnwKt2gsg8qDhXEwLEgxAH2plChnhKYM5NNoH4rHs=; b=Pq+5t3LJYDsWv4 EZs9BQi9yOtfCoz0p6SlqMuf2xFqKkHr8kZ6YdJIX+eoOh5jRjXPwFEH5vLvLRsl6GB5dVKZALXTF upVEctfI5E05EJ9jbYxtYNQ/6y2A56rmMucjNdmcaCyFYB5yF/0taKwO6VvjrUdIuIhZwJD1/XpDi P6eu6G9+QoOi81GBTwdrdDgxkQH2TiG5c0xcNqR/0xnefSCjbDyi05bSdPMdv/uJJgOD775zrUYKk QAKzhIklfCmkK+3Fx2bii+JyvzVgPGvHo7S3KxR8qludF/HhQozbEb/ywFEzg+WMEJe+SjhN9uh5d VvVp+zAZMRdD6XV9pNhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsFm-001JQC-Ff; Mon, 11 Jul 2022 12:11:06 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsFT-001JJT-Kh for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 12:10:49 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B6A5EB80EC0; Mon, 11 Jul 2022 12:10:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ED5AC341CD; Mon, 11 Jul 2022 12:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657541444; bh=s2hcWfrzOt/eRRX9Dn00HKwF/BMj8aqOvof1DioxKO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tchk8X2Ik8KgJcy+3Y30fPgbo8x29dRap611vgKQ+8IpK46gQ54jszkZisuYrYLT1 TSTfOo7iNglhfmhlhhBzSdGnTSKPlH0pulGY3yPulajIKXLWAm5RBI0JDPRykuUzjP Ab5kDOQE4xZa4tH6NQKnfvyDtAWYdLsAVxvkXW1Ii4hVjdMFATkBsXarvP7uPwPN6X M77McHeZF9lsDpQiqvZ3WI5OcPJxVL24BjHPLUb+ycd7OOVlv4qTqkRpMu8FHWcmxz u4T5wtL4/tCZm5QAkkpiQxQ0ucmq6CbcPXzYp+Y8m8wL9c/SL19XBaHl14QbPSzJm8 pYg/0t9Yr1Aiw== Received: by pali.im (Postfix) id E5673276E; Mon, 11 Jul 2022 14:10:41 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , =?utf-8?q?Marek_Beh=C3=BAn?= Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] PCI: aardvark: Dispose bridge irq prior to removing bridge domain Date: Mon, 11 Jul 2022 14:06:25 +0200 Message-Id: <20220711120626.11492-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220711120626.11492-1-pali@kernel.org> References: <20220711120626.11492-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_051047_868860_2777CF29 X-CRM114-Status: GOOD ( 12.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Documentation for irq_domain_remove() says that all mapping within the domain must be disposed prior to domain remove. Currently bridge irq is not disposed in pci-aardvark.c device unbind callback which cause that kernel crashes after unloading driver and trying to read /sys/kernel/debug/irq/irqs/ or /proc/interrupts. Fixes: 815bc3136867 ("PCI: aardvark: Use separate INTA interrupt for emulated root bridge") Signed-off-by: Pali Rohár --- drivers/pci/controller/pci-aardvark.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 6cb65e64859d..8bea5801d50a 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -1479,6 +1479,12 @@ static int advk_pcie_init_rp_irq_domain(struct advk_pcie *pcie) static void advk_pcie_remove_rp_irq_domain(struct advk_pcie *pcie) { + int virq; + + virq = irq_find_mapping(pcie->rp_irq_domain, 0); + if (virq > 0) + irq_dispose_mapping(virq); + irq_domain_remove(pcie->rp_irq_domain); }