Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp971100ybe; Fri, 6 Sep 2019 09:57:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwowKKXDc4NePbjUPc7lpI2Z9H3B1z26mF4zBSc1/3ikYxWTjZ9E+zsG25lD+JWTkwgKgBN X-Received: by 2002:a63:3112:: with SMTP id x18mr8879121pgx.385.1567789022063; Fri, 06 Sep 2019 09:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567789022; cv=none; d=google.com; s=arc-20160816; b=RJJZJiwW8UxsrYXR3sqwAGtoPLg85P6PiDaaIZFEhkRK6qLXv2Qp3LXsYGXFgHR5N4 iC8Cpul8yDNY1V41x0WmbeYyP2Il9Y6l88pDMFRGfIXDkyYbzrLTc0Yt5tLuUINXZbHF 8tptpP8gvjqqCPo7z0gDQ6h43aXBVosbUbLkKVeYPSuDunYnwwpQyLS1au7tRs8Utcn2 uuW3GD80FaFZ+wT60ujHcfcV7eXO+heiVspEXO8NFxLWzMy5AzzHiXKIUrT6JRYrs86M 7876P0cI/XR2cUk/nydg1OMtn8lzq8JRE5PKMVU2J+1MTZop+lhfffkmYt/5a1GO6y8t 5Vhg== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=Wdab70gpXWNmImzerW1XTJ+zydz6Q4VZolmZMvmb5pE=; b=ZcexjeSKMq0i9IJ15ycwg1Evr1RJ+ax8ytZFmawACrB7clQ8qMk284WEZiualucr9z +6ZlnprZLO7iGQ6j/vvqugsF/Z/WeZKkXUX03XHd81z3W51IQmvo9EgTcFEPmp1bBb4Y S7p/b1txOdEUdcm75qc9c6yYDtosAbEIv5tCMRoQdGRYjK6KJwsB310adxFEZydsnuFi aJaR6fEoEyVPYJN6Jp/S+uASJUajmSej5VJOc0MTZflbUqvBDChONY6964g26gcdUi6R gXeA2D1WkXhLD4IDhs0QqrXJxNypO9XZloKlQFUrHL99yvnwNUudx8V+4KMPbSbJikNh bYhA== 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 v2si6269173pfm.195.2019.09.06.09.56.45; Fri, 06 Sep 2019 09:57:02 -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 S2391035AbfIFLK0 (ORCPT + 99 others); Fri, 6 Sep 2019 07:10:26 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47000 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392178AbfIFLIV (ORCPT ); Fri, 6 Sep 2019 07:08:21 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i6C6A-00072A-Qd; Fri, 06 Sep 2019 13:08:15 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id F2E311C0744; Fri, 6 Sep 2019 13:08:13 +0200 (CEST) Date: Fri, 06 Sep 2019 11:08:13 -0000 From: "tip-bot2 for Marc Zyngier" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices Cc: Jiaxing Luo , John Garry , Marc Zyngier , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <156776809389.24167.18399116865141253707.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: c9c96e30ecaa0aafa225aa1a5392cb7db17c7a82 Gitweb: https://git.kernel.org/tip/c9c96e30ecaa0aafa225aa1a5392cb7db17c7a82 Author: Marc Zyngier AuthorDate: Thu, 05 Sep 2019 14:56:47 +01:00 Committer: Marc Zyngier CommitterDate: Thu, 05 Sep 2019 16:03:48 +01:00 irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices When allocating a range of LPIs for a Multi-MSI capable device, this allocation extended to the closest power of 2. But on the release path, the interrupts are released one by one. This results in not releasing the "extra" range, leaking the its_device. Trying to reprobe the device will then fail. Fix it by releasing the LPIs the same way we allocate them. Fixes: 8208d1708b88 ("irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size") Reported-by: Jiaxing Luo Tested-by: John Garry Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/f5e948aa-e32f-3f74-ae30-31fee06c2a74@huawei.com --- drivers/irqchip/irq-gic-v3-its.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 9380aa4..62e54f1 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -2641,14 +2641,13 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, struct its_node *its = its_dev->its; int i; + bitmap_release_region(its_dev->event_map.lpi_map, + its_get_event_id(irq_domain_get_irq_data(domain, virq)), + get_count_order(nr_irqs)); + for (i = 0; i < nr_irqs; i++) { struct irq_data *data = irq_domain_get_irq_data(domain, virq + i); - u32 event = its_get_event_id(data); - - /* Mark interrupt index as unused */ - clear_bit(event, its_dev->event_map.lpi_map); - /* Nuke the entry in the domain */ irq_domain_reset_irq_data(data); }