public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: John Garry <john.garry@huawei.com>,
	Andrew Murray <andrew.murray@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>,
	"luojiaxing@huawei.com" <luojiaxing@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: PCI/kernel msi code vs GIC ITS driver conflict?
Date: Thu, 5 Sep 2019 14:50:24 +0100	[thread overview]
Message-ID: <a90e6f99-cad3-8eda-dd08-0ab05ed9ca04@kernel.org> (raw)
In-Reply-To: <a73262e6-6ece-4946-896b-2dad5ca28417@huawei.com>

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
> 
> <snip>
> 
> [   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...

  reply	other threads:[~2019-09-05 13:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 14:09 PCI/kernel msi code vs GIC ITS driver conflict? John Garry
2019-09-03 16:16 ` Marc Zyngier
2019-09-04  8:56   ` John Garry
2019-09-04 10:25     ` Andrew Murray
2019-09-05  8:38       ` Marc Zyngier
2019-09-05  9:39         ` John Garry
2019-09-05 10:02           ` Marc Zyngier
2019-09-05 10:35             ` John Garry
2019-09-05 11:22               ` Marc Zyngier
2019-09-05 13:26                 ` John Garry
2019-09-05 13:50                   ` Marc Zyngier [this message]
2019-09-05 14:23                     ` John Garry
2019-09-05 14:32                       ` Marc Zyngier
2019-09-05 14:53                         ` John Garry
2019-09-05 15:09                           ` Marc Zyngier
2019-09-06 11:08 ` [tip: irq/core] irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices tip-bot2 for Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a90e6f99-cad3-8eda-dd08-0ab05ed9ca04@kernel.org \
    --to=maz@kernel.org \
    --cc=andrew.murray@arm.com \
    --cc=bhelgaas@google.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=luojiaxing@huawei.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox