[U-Boot] [PATCH v2 45/50] Revert "pci: Scale MAX_PCI_REGIONS based on CONFIG_NR_DRAM_BANKS"
Bin Meng
bmeng.cn at gmail.com
Wed May 8 03:25:19 UTC 2019
Hi Simon,
On Wed, May 8, 2019 at 11:04 AM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Bin,
>
> On Tue, 7 May 2019 at 03:28, Bin Meng <bmeng.cn at gmail.com> wrote:
> >
> > Hi Simon, Thierry,
> >
> > On Fri, May 3, 2019 at 12:22 AM Simon Glass <sjg at chromium.org> wrote:
> > >
> > > Hi Thierry,
> > >
> > > On Thu, 2 May 2019 at 03:25, Thierry Reding <treding at nvidia.com> wrote:
> > > >
> > > > On Thu, May 02, 2019 at 12:09:49AM +0800, Bin Meng wrote:
> > > > > +Thierry
> > > > >
> > > > > On Fri, Apr 26, 2019 at 12:00 PM Simon Glass <sjg at chromium.org> wrote:
> > > > > >
> > > > > > This reverts commit aec4298ccb337106fd0115b91d846a022fdf301d.
> > > > > >
> > > > > > Unfortunately this has a dramatic impact on the pre-relocation memory
> > > > > > used on x86 platforms (increasing it by 2KB) since it increases the
> > > > > > overhead for each PCI device from 220 bytes to 412 bytes.
> > > > > >
> > > > > > The offending line is in UCLASS_DRIVER(pci):
> > > > > >
> > > > > > .per_device_auto_alloc_size = sizeof(struct pci_controller),
> > > > > >
> > > > > > This means that all PCI devices have the controller struct associated
> > > > > > with them. The solution is to move the regions[] member out of the array,
> > > > > > makes its size dynamic, or split UCLASS_PCI into controllers and
> > > > > > non-controllers, as the comment suggests.
> > > > > >
> > > > > > For now, revert the commit to get things running again.
> > > > > >
> > > > > > Signed-off-by: Simon Glass <sjg at chromium.org>
> > > > > > ---
> > > > > >
> > > > > > Changes in v2: None
> > > > > >
> > > > > > include/pci.h | 6 +-----
> > > > > > 1 file changed, 1 insertion(+), 5 deletions(-)
> > > > > >
> > > > >
> > > > > Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
> > > >
> > > > Ugh... so we're trading one regression for another? Can we not live with
> > > > the 2 KiB increase on x86 until this has been properly fixed? Currently
> > > > this will cause Jetson TX2 to crash if it starts using PCI.
> > >
> > > Unfortunately this breaks several boards since we are out of memory.
> > >
> > > I think this needs a better solution to reduce the memory usage down
> > > to sensible levels. This is something I should have considered when
> > > implementing the PCI uclass, but unfortunately I did not.
> > >
> >
> > Could you please suggest whether I should apply this revert patch for now?
>
> I suggest a temporary revert since this breaks some x86 boards.
>
> I think the real fix is to reduce the memory used by PCI devices.
> Thierry, do you have time to look at this?
OK, I will apply this patch then.
Regards,
Bin
More information about the U-Boot
mailing list