Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5413085rwb; Mon, 8 Aug 2022 19:13:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR7m0vLdtypoL3uG/xSQZ8UzSw9DeNUD+DBOS9rnKvSOkQ9LIjja2Y4an155pCwQIsA8TDld X-Received: by 2002:a17:90b:4d12:b0:1f5:5af8:c093 with SMTP id mw18-20020a17090b4d1200b001f55af8c093mr27569623pjb.33.1660011209444; Mon, 08 Aug 2022 19:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660011209; cv=none; d=google.com; s=arc-20160816; b=G2x9cT3ieEwwUxBdE/o9j0djtziWyr88a2bE/fpA40cggElHf9euuJ1v4+sNv1LKDT R5ZD7EUWZQV4gramZ545UntR4LSFSUff0SdYFaeV9IL98bz/Mm3PaYYh1teNF7Oi2Xpd csZ+V3ByPACuNsxknwdolXcJKxVZrAcUg6aTaHU0sIS7ICaSp8EihIu6hVjZHA3957sh i4HNUqUcsl2MKu7/uW6BkNaBTDLyG28n1UVOodTofDp4hfrg4rEECCD8YnrXdtdVWQCA 2caSRxTvl3yd5cmGj7P99+VBAwOwvBY5tKIX7ADwNNVfaupcn0tRHUGKV9wio0h/fMdd b/XA== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=mfplZHXj79DnlaJB5yFqH6RkA8orBckNoJNlMVuwnjQ=; b=hp7++3sMnP4zXNuZzY8dx/smur+E6sWE5rFIOhWnPMqe4hTCrlj8kTAW6p4qJADsMS acN26xupNiEEgCPKsXuzOF5qTtXQgQNNPNVsD9xMDlnNVIYEnIcbWqA/uhaoJZgb7XHi AbAJaJ5nDwGmvM64enTs2Ovy4Gfv8L3jsFmby92k5v8nQXMYv/DCyTY3vYXicoDzE5d3 6fLxb+LoxTz5iXNMxEBjs0xKNNeUUglyVHYPaHH9IJc+zrv5wgOvpdjmquAJGrSRzQlw 3gSh/v9uGW4sut1B0b7A/eMmm9mghWVheUpu6dRFZGvAuyrJPxzaWgjeYmluOOVNchUS H2jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="YXxD/RLy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a1709027c8f00b0016da773130asi6110556pll.221.2022.08.08.19.13.10; Mon, 08 Aug 2022 19:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="YXxD/RLy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232732AbiHIB1S (ORCPT + 99 others); Mon, 8 Aug 2022 21:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbiHIB1Q (ORCPT ); Mon, 8 Aug 2022 21:27:16 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868D712AFF; Mon, 8 Aug 2022 18:27:08 -0700 (PDT) X-UUID: 27e598429d0541afa06531cf86b97cd3-20220809 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=mfplZHXj79DnlaJB5yFqH6RkA8orBckNoJNlMVuwnjQ=; b=YXxD/RLyOqFTRphVVPPVt+FW+z0PvWhikqAnQLnTfypUmHm4P/V1UZbF+tzeNmxBhrQZq4zz2putGmxsYShnYkIrIVc7ZnlPnTWTdnpf3IYHeqfgE2B4Vd+LXFesifr7IFYb/Eir6OgU8lLJ4O7qAA8ABVdnI+QX5wSOQmXBwf4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.9,REQID:a5849bc3-2871-4064-9959-d6390f1d71ff,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_H am,ACTION:release,TS:0 X-CID-META: VersionHash:3d8acc9,CLOUDID:126c43ae-9535-44a6-aa9b-7f62b79b6ff6,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 27e598429d0541afa06531cf86b97cd3-20220809 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1292698929; Tue, 09 Aug 2022 09:27:01 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 9 Aug 2022 09:27:00 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 9 Aug 2022 09:26:59 +0800 Message-ID: <13b0813576f57add0d2eacb519eedec73fcf1920.camel@mediatek.com> Subject: Re: [PATCH] PCI: mvebu: Dispose INTx irqs prior to removing INTx domain From: Jianjun Wang To: Pali =?ISO-8859-1?Q?Roh=E1r?= , Bjorn Helgaas , Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , Krzysztof =?UTF-8?Q?Wilczy=C5=84ski?= , Hajo Noerenberg CC: , , Date: Tue, 9 Aug 2022 09:26:59 +0800 In-Reply-To: <20220710001421.lqwprzgn5jrblqcu@pali> References: <20220709161858.15031-1-pali@kernel.org> <20220710001421.lqwprzgn5jrblqcu@pali> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MTK: N X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY,URIBL_CSS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pali, On Sun, 2022-07-10 at 02:14 +0200, Pali Rohár wrote: > On Saturday 09 July 2022 18:18:58 Pali Rohár wrote: > > Documentation for irq_domain_remove() says that all mapping within > > the > > domain must be disposed prior to domain remove. > > > > Currently INTx irqs are not disposed in pci-mvebu.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: ec075262648f ("PCI: mvebu: Implement support for legacy INTx > > interrupts") > > Reported-by: Hajo Noerenberg > > Signed-off-by: Pali Rohár > > Just to note, Hajo Noerenberg observed this issue during testing and > debugging other unrelated issue in bugzilla [1] and triggered this > crash > just by calling: rmmod pci_mvebu && modprobe pci-mvebu && cat > /proc/interrupts > > I suppose that other pci controller drivers with unbind / rmmod > support > would suffer from same issues. FYI, we found the same issue after unloading the PCIe controller driver, if this is the proper way to dispose the INTx irqs, I'll send a similar patch for MediaTek's PCIe controller driver. Thanks.