[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5331e942ff28bb191d62bb403b03ceb7d750856c.camel@sipsolutions.net>
Date: Wed, 17 Nov 2021 15:12:17 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Kai-Heng Feng <kai.heng.feng@...onical.com>, bhelgaas@...gle.com
Cc: Guenter Roeck <linux@...ck-us.net>,
"open list:PCI SUBSYSTEM" <linux-pci@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] PCI: Reinstate "PCI: Coalesce host bridge contiguous
apertures"
Hi!
So this patch landed now ... :)
> + /* Coalesce contiguous windows */
> + resource_list_for_each_entry_safe(window, n, &resources) {
> + if (list_is_last(&window->node, &resources))
> + break;
> +
> + next = list_next_entry(window, node);
> + offset = window->offset;
> + res = window->res;
> + next_offset = next->offset;
> + next_res = next->res;
> +
> + if (res->flags != next_res->flags || offset != next_offset)
> + continue;
> +
> + if (res->end + 1 == next_res->start) {
> + next_res->start = res->start;
> + res->flags = res->start = res->end = 0;
> + }
> + }
>
Maybe this was already a problem before - but I had a stupid thing in
arch/um/drivers/virt-pci.c (busn_resource has start == end == 0), and
your changes here caused that resource to be dropped off the list.
Now this wouldn't be a problem, but we add it using pci_add_resource()
and then that does a memory allocation, but you don't free it here? I'm
not sure it'd even be safe to free it here and I'll just set
busn_resource to have end==1 instead (it's all kind of virtual).
But I still wanted to ask if this might be a problem here for others.
johannes
Powered by blists - more mailing lists