Re: [PATCH 02/13] alpha/PCI: Convert to pci_bus_size_and_assign_resources()
From: Magnus Lindholm
Date: Mon Nov 16 2026 - 14:50:56 EST
Hi Ilpo,
On Mon, Nov 16, 2026 at 4:24 PM Ilpo Järvinen
<ilpo.jarvinen@xxxxxxxxxxxxxxx> wrote:
>
> To serialize bridge window sizing and resource assignment, PCI core
> needs to hold locks across both phases. Alpha nautilus PCI code calls
> pci_bus_size_bridges() and pci_bus_assign_resources() separately
> because it needs to do special resource alignment and setup after the
> window sizes have been calculated. At least the former would seem to
> belong to some existing __weak pcibios_*() hook but the latter might
> need yet another pcibios_*() hook just for this single use.
>
> The nautilus code runs during init, so nothing is likely to race with
> it. Converting it is mainly about consolidating the sizing and
> assignment entry points of PCI core, which eventually allows removing
> pci_bus_assign_resources().
>
> Instead of trying to do a complex rework of the code, which is risky
> without the ability to test on the hardware, simply convert
> pci_bus_assign_resources() to pci_bus_size_and_assign_resources(). This
> adds a small bit of extra work by performing the sizing step again, but
> the calculations should yield the same sizes, so it seems safe
>
Agreed. By the second pass irongate_mem has been request_resource()d, so
pbus_size_mem() skips it as assigned, and ioport_resource is never picked
as a window (find_bus_resource_of_type()). Only the AGP bridge's
unassigned windows are sized again, from the same inputs.
That does rely on the assigned check, though: if your follow-up series
starts sizing assigned windows, nautilus' relocated root window
(size_windows = 1) must stay untouched by the second pass.
It builds at every patch for the generic and Nautilus configs. I have a
UP1100 (Nautilus), but it doesn't start up at the moment; if I get it
running again I'll give this a boot. But for the Alpha part of this series:
Acked-by: Magnus Lindholm <linmag7@xxxxxxxxx>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> ---
> arch/alpha/kernel/sys_nautilus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
> index 13b79960b4b9..23a74fd4a83f 100644
> --- a/arch/alpha/kernel/sys_nautilus.c
> +++ b/arch/alpha/kernel/sys_nautilus.c
> @@ -263,7 +263,7 @@ nautilus_init_pci(void)
> if ((IRONGATE0->dev_vendor >> 16) > 0x7006) /* Albacore? */
> IRONGATE0->pci_mem = pci_mem;
>
> - pci_bus_assign_resources(bus);
> + pci_bus_size_and_assign_resources(bus);
> pci_bus_add_devices(bus);
> }
>
> --
> 2.47.3
>