Re: [PATCH v2] PCI: Fix BAR resize for devices on a root bus

Liz Fong-Jones <[email protected]> Fri, 31 Jul 2026 10:15:04 -0700
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <CAC0H+B-p5MT4M03MMkbxr_dLjsuThkxPv3--Ciant0i2MvvqDw@mail.gmail.com>
--00000000000008377a0657eb5512
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

>
> Maybe this is a tangent, but I'm curious about this topology.  Is this
> running as a virtualized guest?  At the hardware level, a PCIe
> endpoint must have a Root Port somewhere, even if it isn't visible to
> the OS (as is often the case in virtualized guests).
>
Defer to Jon on what the actual hardware configuration is, but this is
physical hardware, no virtualisation, running as the UEFI rather than U-Boo=
t
(devicetree) variant. See:
https://dev.solid-run.com/nxp/lx2160a/com-som/lx2160a
-com-hardware-user-manual#block-diagram

> @@ -2415,13 +2417,24 @@ int pci_do_resource_release_and_resize(struct
> pci_dev *pdev, int resno, int size
> >
> >       pci_resize_resource_set_size(pdev, resno, size);
> >
> > -     if (!bus->self)
> > -             goto out;
> > +     if (bus->self) {
>
> I think pci_upstream_bridge() would be better here.  Not that this
> device will be a VF (where pci_upstream_bridge() makes a difference),
> but just to be a little more generic.
>
I'll have a look at this and publish a v3 if appropriate.


Liz
---
=F0=9F=90=9D=F0=9F=8D=AF=F0=9F=90=9D Liz Fong-Jones, MACS (Snr) CP, Technic=
al Fellow =F0=9F=8D=AF=F0=9F=90=9D=F0=9F=8D=AF
honeycomb.io - The observability platform for teams who manage software
that matters.
lizthegrey.com // linkedin.com/in/efong // bsky.app/profile/lizthegrey.com

--00000000000008377a0657eb5512
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid=
 rgb(204,204,204);padding-left:1ex">Maybe this is a tangent, but I&#39;m cu=
rious about this topology.=C2=A0 Is this<br>
running as a virtualized guest?=C2=A0 At the hardware level, a PCIe<br>
endpoint must have a Root Port somewhere, even if it isn&#39;t visible to<b=
r>
the OS (as is often the case in virtualized guests).<br></blockquote><div>D=
efer to Jon on what the actual hardware configuration is, but this is</div>=
<div>physical hardware, no virtualisation, running as the UEFI rather than =
U-Boot</div><div><span style=3D"background-color:transparent">(de</span><sp=
an style=3D"background-color:transparent">vicetree) variant. See:</span></d=
iv><div><span style=3D"background-color:transparent"><a href=3D"https://dev=
.solid-run.com/nxp/lx2160a/com-som/lx2160a">https://dev.solid-run.com/nxp/l=
x2160a/com-som/lx2160a</a></span><span style=3D"background-color:transparen=
t">-com-hardware-user-manual#block-diagram</span></div><div><br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex">&gt; @@ -2415,13 +2417,24 @@ i=
nt pci_do_resource_release_and_resize(struct pci_dev *pdev, int resno, int =
size<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0pci_resize_resource_set_size(pdev, resno, si=
ze);<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 =C2=A0if (!bus-&gt;self)<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0if (bus-&gt;self) {<br>
<br>
I think pci_upstream_bridge() would be better here.=C2=A0 Not that this<br>
device will be a VF (where pci_upstream_bridge() makes a difference),<br>
but just to be a little more generic.<br></blockquote><div>I&#39;ll have a =
look at this and publish a v3 if appropriate.</div><div><br></div><div><br>=
</div><div>Liz<br>---</div><div>=F0=9F=90=9D=F0=9F=8D=AF=F0=9F=90=9D=C2=A0L=
iz Fong-Jones, MACS (Snr) CP, Technical Fellow=C2=A0=F0=9F=8D=AF=F0=9F=90=
=9D=F0=9F=8D=AF</div><div><a href=3D"http://honeycomb.io/" target=3D"_blank=
">honeycomb.io</a>=C2=A0- The observability platform for teams who manage s=
oftware that matters.<br></div><div><a href=3D"http://lizthegrey.com/" styl=
e=3D"background-color:transparent" target=3D"_blank">lizthegrey.com</a><spa=
n style=3D"background-color:transparent">=C2=A0</span><span style=3D"backgr=
ound-color:transparent">//</span><span style=3D"background-color:transparen=
t">=C2=A0</span><a href=3D"http://linkedin.com/in/efong" style=3D"backgroun=
d-color:transparent" target=3D"_blank">linkedin.com/in/efong</a><span style=
=3D"background-color:transparent">=C2=A0//</span><span style=3D"background-=
color:transparent">=C2=A0</span><a href=3D"http://bsky.app/profile/lizthegr=
ey.com" style=3D"background-color:transparent" target=3D"_blank">bsky.app/p=
rofile/lizthegrey.com</a></div></div></div>
</div>

--00000000000008377a0657eb5512--