Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1125290ybe; Thu, 5 Sep 2019 10:39:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWiwFBiu56f3gQ6inHEGMgSPEKtjU/5f+pV1RCLxAUuaetU/8lpiUez74T49+iWOCh/CvF X-Received: by 2002:a63:7b4d:: with SMTP id k13mr4187957pgn.182.1567705190348; Thu, 05 Sep 2019 10:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567705190; cv=none; d=google.com; s=arc-20160816; b=MOuLahnNg37HTlqk+CJ/RCIw2IozQcEV2mKWhRoAuzCvZ+IhB8dWmJkCmZjdlxWqTo Jju9sWn9j0LafoGm7ouMgRZWiecbBPbgzSImOQYUnJsflzy9i0B5Ovcns/VxXCEtifhS +TedIWOspjUETF0eXiB6pJBcR5rfzZ1m2HZ3OFKUxGhq8XzI5Ad6ZZ5vc4/X7Gj1MWy4 StHovgSIkBjEb46rBzQNPyVZZtNV5RXbnOKOWQSPbbLkQCk+cUImY3EpxDOmZaXekTvm 4g0n8lXXdvhxYVGD3QS65HKZsrlXZOtMAYEZ2AiM2HnAZMU7Tazh6liJkfX3rOGEXqxi otIg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=9iWGyUp99PiIiZmPCbFqvixh4PTnvYF1vG7M3NNhj20=; b=s7nb/+Tn1caTTCqhr1MUS0o9GEJnybcjluoe1EIWaE9cDjUUEjvyQ0s4JJJkdDPQPO R/q+jkX4tLXTuRQEFdFJpeJvMOPq4GXCT4mfJeOzmQ+LnLJ6yw40u3TkDVLk+BzyxN8M rJfHrj8AabZHWQjQUIykIllGHmE9eKMq6spsNFcR97LSo0AUO1HRPz8ZQIbKKnIXbfjg 60Pdbf4AsrdmuW+qEzcZOfcWq43mo0bbBtjiMqXCxRygdDdUGnLPQ/ZE7vTdZu9aR6dx DAM9SeKt/0b3IpRCgmwob7JUAyn0rGfqVM2FEKQbfDRQ+r/X7kD0vKtEsj0KvKLOuMjp 6Xrw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si2341475pgl.7.2019.09.05.10.39.34; Thu, 05 Sep 2019 10:39:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731976AbfIENu2 (ORCPT + 99 others); Thu, 5 Sep 2019 09:50:28 -0400 Received: from foss.arm.com ([217.140.110.172]:45654 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731008AbfIENu1 (ORCPT ); Thu, 5 Sep 2019 09:50:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BCEBC28; Thu, 5 Sep 2019 06:50:26 -0700 (PDT) Received: from [10.1.197.61] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B7CB63F67D; Thu, 5 Sep 2019 06:50:25 -0700 (PDT) Subject: Re: PCI/kernel msi code vs GIC ITS driver conflict? To: John Garry , Andrew Murray Cc: Thomas Gleixner , Bjorn Helgaas , Linux PCI , Linuxarm , "luojiaxing@huawei.com" , "linux-kernel@vger.kernel.org" References: <5fd4c1cf-76c1-4054-3754-549317509310@kernel.org> <20190904102537.GV9720@e119886-lin.cambridge.arm.com> <8f1c1fe6-c0d4-1805-b119-6a48a4900e6d@kernel.org> <84f6756f-79f2-2e46-fe44-9a46be69f99d@huawei.com> <651b4d5f-2d86-65dc-1232-580445852752@kernel.org> <8ac8e372-15a0-2f95-089c-c189b619ea62@huawei.com> <73c22eaa-172e-0fba-7a44-381106dee50d@kernel.org> From: Marc Zyngier Organization: Approximate Message-ID: Date: Thu, 5 Sep 2019 14:50:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2019 14:26, John Garry wrote: > On 05/09/2019 12:22, Marc Zyngier wrote: >> OK, debug was slightly off, but it is interesting that the driver didn't >> unmap the device, either because it is flagged as shared (with what?) or >> that additional interrupts are allocated in the lpi_map for this >> instance. >> >> Here's an updated debug patch. Can you please run the same thing again? >> > > As requested: > > root@(none)$ echo 0000:74:02.0 > ./sys/bus/pci/drivers/hisi_sas_v3_hw/unbind > > > > [ 78.593897] Freed devid 7410 event 0 LPI 0 > [ 78.597990] Freed devid 7410 event 1 LPI 0 > [ 78.602080] Freed devid 7410 event 2 LPI 0 > [ 78.606169] Freed devid 7410 event 3 LPI 0 > [ 78.610253] Freed devid 7410 event 4 LPI 0 > [ 78.614337] Freed devid 7410 event 5 LPI 0 > [ 78.618422] Freed devid 7410 event 6 LPI 0 > [ 78.622506] Freed devid 7410 event 7 LPI 0 > [ 78.626590] Freed devid 7410 event 8 LPI 0 > [ 78.630674] Freed devid 7410 event 9 LPI 0 > [ 78.634758] Freed devid 7410 event 10 LPI 0 > [ 78.638930] Freed devid 7410 event 11 LPI 0 > [ 78.643101] Freed devid 7410 event 12 LPI 0 > [ 78.647272] Freed devid 7410 event 13 LPI 0 > [ 78.651445] Freed devid 7410 event 14 LPI 0 > [ 78.655616] Freed devid 7410 event 15 LPI 0 > [ 78.659787] Freed devid 7410 event 16 LPI 0 > [ 78.663959] Unmap devid 7410 shared 0 lpi_map 17-31 Bah. Try this for size... M. diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 1b5c3672aea2..c3a8d732805f 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); } -- Jazz is not dead, it just smells funny...