Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp531930ybb; Wed, 8 Apr 2020 05:01:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKtuKm0z0OpK67ONerXlzDeR6F25TDa1Gmk9tMPLe7ER/Ikr0r+C5cmZ5G2YDQ+gCsaAYaN X-Received: by 2002:a9d:6184:: with SMTP id g4mr5179258otk.38.1586347317091; Wed, 08 Apr 2020 05:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347317; cv=none; d=google.com; s=arc-20160816; b=OiF/yJJevRvCtPEE9dnxIlPyWHnW7bGNc7vKpiV/C0xyrNgRTWxcZrDJSGlr90SOa0 PhTJie5yCK/tKyL4vgPhiz2w4+Fhr1jL62adMYX8Ox0LXLtHG83FD5WVLAowZWgru1nf gfg+fjara7qfThzVQcVfyNWIHn2AlRdRTOdzxGP4xvsYSTwljq3HdiN7s9EaKvA9hrUn 0b+eJ3oIwoB1FVLHI/rIV09icWPe0Em4h00vBfMaBHUeeNb5RA+iIwu8iLZTN6ySAapc dlUG3uhx+fV/+07xtWPACK73RY3IDA+EhkWRL4RvNQB6bNetZ2jX32bJp0NBSTSDgAW9 7zDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UkWCzj5VA/Kj0yMTwjNvlANXK/barv9BzEerQT2PELk=; b=FV4Ds7MImFhumPYp1/tYn3UKUqHURaNhew8ubffFpA/6NWBkDigf5m7YYWDfX3pxKN jMg1lodKdGMLJBsG56SyH0+OrzEqILOgnxu76ecYp7aFavSkNAWpW16GMqYNkWRmmZ7D OmOCZYlGBx9Zcz+Skd+HBV7f00XyWqYd6dWylIfu79XzIsHrrsZFDCwturFnRTmegxbm 9s7Cfaxi/29WlO3upXhh/I3rUPhOwySMMZHGnGO296ebSZscjyK/FxHTx6lkyjLuO3IG z3J9ShTGkGgnGuZM/oDIUEMk8CP3MJyLTXx7fbrI9Ina0iLUZJHYec2TyFswzXgxerc1 0F5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21si2651703ota.291.2020.04.08.05.01.33; Wed, 08 Apr 2020 05:01:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728554AbgDHLoR (ORCPT + 99 others); Wed, 8 Apr 2020 07:44:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12697 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728492AbgDHLoQ (ORCPT ); Wed, 8 Apr 2020 07:44:16 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7EE04530F503E3351732; Wed, 8 Apr 2020 19:44:10 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.173.222.27) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Wed, 8 Apr 2020 19:43:59 +0800 From: Zenghui Yu To: CC: , , , , , Zenghui Yu Subject: [PATCH] irqchip/mbigen: Free msi_desc on device teardown Date: Wed, 8 Apr 2020 19:43:52 +0800 Message-ID: <20200408114352.1604-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.173.222.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using irq_domain_free_irqs_common() on the irqdomain free path will leave the MSI descriptor unfreed when platform devices get removed. Properly free it by MSI domain free function. Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-mbigen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 6b566bba263b..ff7627b57772 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain, return 0; } +static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq, + unsigned int nr_irqs) +{ + platform_msi_domain_free(domain, virq, nr_irqs); +} + static const struct irq_domain_ops mbigen_domain_ops = { .translate = mbigen_domain_translate, .alloc = mbigen_irq_domain_alloc, - .free = irq_domain_free_irqs_common, + .free = mbigen_irq_domain_free, }; static int mbigen_of_create_domain(struct platform_device *pdev, -- 2.19.1