On 24.09.2025 09:59, Mykyta Poturai wrote:
> --- a/xen/arch/arm/include/asm/pci.h
> +++ b/xen/arch/arm/include/asm/pci.h
> @@ -23,6 +23,7 @@
> #define pci_to_dev(pcidev) (&(pcidev)->arch.dev)
>
> extern bool pci_passthrough_enabled;
> +extern bool pci_scan_enabled;
At this point of the series this isn't needed, ...
> @@ -155,6 +156,8 @@ bool arch_pci_device_physdevop(void);
>
> #else /*!CONFIG_HAS_PCI*/
>
> +#define pci_scan_enabled false
... this is entirely unused, and ...
> --- a/xen/arch/arm/pci/pci.c
> +++ b/xen/arch/arm/pci/pci.c
> @@ -91,8 +91,14 @@ bool arch_pci_device_physdevop(void)
> bool __read_mostly pci_passthrough_enabled;
> boolean_param("pci-passthrough", pci_passthrough_enabled);
>
> +/* By default pci scan is disabled. */
> +bool __ro_after_init pci_scan_enabled;
... and hence this wants to be static __initdata. Otherwise, strictly
speaking, this is "unreachable data" post-init as per Misra's unreachable
code criteria (which surely ought to extend to data as well).
> @@ -104,9 +110,23 @@ static int __init pci_init(void)
> panic("Could not initialize PCI segment 0\n");
>
> if ( acpi_disabled )
> - return dt_pci_init();
> + ret = dt_pci_init();
> else
> - return acpi_pci_init();
> + ret = acpi_pci_init();
> +
> + if ( ret < 0 )
> + return ret;
I understand this is merely transforming existing code, but I don't see
what actual use the returning of an error here and hence also ...
> + if ( pci_scan_enabled )
> + {
> + ret = scan_pci_devices();
> +
> + if ( ret < 0 )
> + return ret;
... here has. The system will continue booting nevertheless, iirc without
even a diagnostic from caller.
Jan