From: sashiko-bot@kernel.org
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [RESEND RFC PATCH] PCI: Get the hotplug bridge window sizes from DT
Date: Mon, 06 Jul 2026 13:12:25 +0000 [thread overview]
Message-ID: <20260706131226.4DC6B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706130230.546108-1-manivannan.sadhasivam@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Command-line parameters matching default hotplug window sizes are incorrectly overridden by Device Tree sizes.
--
commit a20e61c301c97bb0b8018d5f602c3d28d1cc752e
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
PCI: Get the hotplug bridge window sizes from DT
This commit allows parsing the 'ranges' property from PCI bridge device tree
nodes to define hotplug bridge window sizes based on firmware requirements.
The DT sizes apply as additional reservations for the bridge windows.
Command-line overrides are intended to continue taking precedence over the
DT settings.
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index c0a949f2c9956..3fbd097728bd6 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
[ ... ]
> @@ -1430,9 +1480,34 @@ void __pci_bus_size_bridges(struct pci_bus *bus, struct list_head *realloc_head)
> case PCI_HEADER_TYPE_BRIDGE:
> pci_bridge_check_ranges(bus);
> if (bus->self->is_hotplug_bridge) {
> + struct resource dt_io = {}, dt_mmio = {}, dt_mmio_pref = {};
> +
> additional_io_size = pci_hotplug_io_size;
> additional_mmio_size = pci_hotplug_mmio_size;
> additional_mmio_pref_size = pci_hotplug_mmio_pref_size;
> +
> + /*
> + * If the bridge has a DT ranges property, use that to
> + * override the default window sizes. Command line
> + * parameters (hpmemsize etc...) take precedence over
> + * DT.
> + */
> + if (pci_bridge_of_get_window(bus->self,
> + &dt_io, &dt_mmio,
> + &dt_mmio_pref)) {
> + if (dt_io.flags &&
> + pci_hotplug_io_size == DEFAULT_HOTPLUG_IO_SIZE)
> + additional_io_size =
> + resource_size(&dt_io);
> + if (dt_mmio.flags &&
> + pci_hotplug_mmio_size == DEFAULT_HOTPLUG_MMIO_SIZE)
[Severity: Medium]
Will this correctly honor command line parameters if the user explicitly
requests the default size (e.g., pci=hpmemsize=2M)?
The commit message states that command line parameters continue to take
precedence over DT. However, checking against the default macros here fails
to distinguish between an unconfigured state and an explicitly configured
value that equals the default size.
If a user explicitly passes pci=hpmemsize=2M to restrict a large DT-provided
window size, wouldn't this condition incorrectly ignore their command-line
parameter and apply the DT size instead?
> + additional_mmio_size =
> + resource_size(&dt_mmio);
> + if (dt_mmio_pref.flags &&
> + pci_hotplug_mmio_pref_size == DEFAULT_HOTPLUG_MMIO_PREF_SIZE)
> + additional_mmio_pref_size =
> + resource_size(&dt_mmio_pref);
> + }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706130230.546108-1-manivannan.sadhasivam@oss.qualcomm.com?part=1
prev parent reply other threads:[~2026-07-06 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 13:02 [RESEND RFC PATCH] PCI: Get the hotplug bridge window sizes from DT Manivannan Sadhasivam
2026-07-06 13:12 ` sashiko-bot [this message]
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=20260706131226.4DC6B1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=sashiko-reviews@lists.linux.dev \
/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