linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>, bhelgaas@google.com
Cc: Guenter Roeck <linux@roeck-us.net>,
	"open list:PCI SUBSYSTEM" <linux-pci@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] PCI: Reinstate "PCI: Coalesce host bridge contiguous apertures"
Date: Wed, 17 Nov 2021 15:12:17 +0100	[thread overview]
Message-ID: <5331e942ff28bb191d62bb403b03ceb7d750856c.camel@sipsolutions.net> (raw)
In-Reply-To: <20210713125007.1260304-1-kai.heng.feng@canonical.com>

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

  parent reply	other threads:[~2021-11-17 14:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  7:57 [PATCH 1/1] PCI: Coalesce host bridge contiguous apertures without sorting Kai-Heng Feng
2021-07-13  8:45 ` Guenter Roeck
2021-07-13  8:49   ` Kai-Heng Feng
2021-07-13  9:06     ` Guenter Roeck
2021-07-13 12:50 ` [PATCH v2] PCI: Reinstate "PCI: Coalesce host bridge contiguous apertures" Kai-Heng Feng
2021-09-29 21:25   ` Bjorn Helgaas
2021-11-17 14:12   ` Johannes Berg [this message]
2022-07-13  9:36     ` Geert Uytterhoeven
2021-08-09  4:24 ` [PATCH] PCI/portdrv: Disallow runtime suspend when waekup is required but PME service isn't supported Kai-Heng Feng
2021-08-09  9:47   ` Lukas Wunner
2021-08-09 10:40     ` Kai-Heng Feng
2021-08-09 15:00       ` Lukas Wunner
2021-08-10 15:37         ` Kai-Heng Feng
2021-08-10 16:21           ` Lukas Wunner
2021-08-11  5:06             ` Kai-Heng Feng
2021-08-11  7:11               ` Lukas Wunner
2021-08-12  5:20                 ` Kai-Heng Feng

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=5331e942ff28bb191d62bb403b03ceb7d750856c.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=bhelgaas@google.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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;
as well as URLs for NNTP newsgroup(s).