Joan Lledó via Bug reports for the GNU Hurd, le mer. 05 janv. 2022 13:08:01 
+0100, a ecrit:
> @@ -523,18 +637,18 @@ pci_system_hurd_create(void)
>  
>      pci_sys->num_devices = 0;
>  
> -    if ((err = get_privileged_ports (NULL, &device_master)) || 
> (device_master == MACH_PORT_NULL)) {
> -        pci_system_cleanup();
> -        return err;
> -    }
> -
> -    err = device_open (device_master, D_READ|D_WRITE, "pci", &pci_port);
> -    if (!err) {
> -        root = file_name_lookup_under (pci_port, ".", O_DIRECTORY | O_RDWR | 
> O_EXEC, 0);
> -    }
> -
> -    if (!root) {
> -        root = file_name_lookup (_SERVERS_BUS_PCI, O_RDWR, 0);
> +    if ((err = get_privileged_ports (NULL, &device_master))
> +            || (device_master == MACH_PORT_NULL)) {
> +        root = file_name_lookup (_SERVERS_BUS_PCI, O_RDONLY, 0);
> +    } else {
> +        err = device_open (device_master, D_READ, "pci", &pci_port);
> +        mach_port_deallocate (mach_task_self (), device_master);
> +        if (!err) {
> +            root = file_name_lookup_under (pci_port, ".",
> +                                           O_DIRECTORY | O_RDONLY | O_EXEC, 
> 0);
> +            device_close (pci_port);
> +            mach_port_deallocate (mach_task_self (), pci_port);
> +        }

Err, this is breaking everything when pci-arbiter is not running as a
bootstrap translator. In that case e.g. netdde succeeds getting the
privileged port, and thus tries to open pci, but fails, and thus the
whole thing aborts. What problem the older approach had?

Samuel, not amused having to debug such thing.

Reply via email to