Re: [PATCH RFC 0/2] Generate device tree node for pci devicesgain,

Clément Léger
2022-10-10T08:41:01Z

Le Tue, 13 Sep 2022 12:41:28 -0500,
Frank Rowand <frowand.list@gmail.com> a écrit :

> >> I am not positive what part of what I wrote above is correct and would appreciate
> >> some confirmation of what is correct or incorrect.
> >
> > There are 2 series devices rely on this patch:
> >
> >     1) Xilinx Alveo Accelerator cards (FPGA based device)
> >
> >     2) lan9662 PCIe card
> >
> >           please see: https://lore.kernel.org/lkml/20220427094502.456111-1-clement.leger@bootlin.com/
>
> Thanks. Please include this information in future versions of the patch series.
>
> For device 2 I have strongly recommended using pre-boot apply of the overlay to the base
> device tree. I realize that this suggestion is only a partial solution if one wants to
> use hotplug to change system configuration (as opposed to using hotplug only to replace
> an existing device (eg a broken device) with another instance of the same device). I
> also realize that this increased the system administration overhead. On the other hand
> an overlay based solution is likely to be fragile and possibly flaky.

Again, applying overlays pre-boot is not an acceptable solution. Some
systems are not based on device-tree (x86 platforms with ACPI based
description, and I'm not even sure this is doable by modifying ACPI
tables). PCI is meant to be plug-and-play, so patching the ACPI
tables or device-tree pre-boot is likely not the correct answer to this
problem.

This would also require two different descriptions of the same card
(for ACPI and device-tree) and would require the final user to create a
specific overlay for its device based on the PCI slots the card is
plugged in.

The solution we proposed (Lizhi and I) allows to overcome these
problems and is way easier to use. Fixing the potential bugs that might
exists in the overlay layer seems a way better idea that just pushing
that away to the bootloader level. Moreover, this kind of devices is
likely to be more common with the increasing popularity of FPGA and a
proper solution must be found.

--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin