diff --git a/Cargo.lock b/Cargo.lock index 58844cfb04..f7463c8d9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1458,9 +1458,9 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pci_types" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4325c6aa3cca3373503b1527e75756f9fbfe5fd76be4b4c8a143ee47430b8e0" +checksum = "f0c2a105c657261a938ff68ee231c199a3d80eef33976004829de761ef5b1a9b" dependencies = [ "bit_field", "bitflags 2.10.0", diff --git a/drivers/pcid-spawner/src/main.rs b/drivers/pcid-spawner/src/main.rs index 9a22d72ef4..74019c4425 100644 --- a/drivers/pcid-spawner/src/main.rs +++ b/drivers/pcid-spawner/src/main.rs @@ -40,14 +40,20 @@ fn main() -> Result<()> { let mut handle = match PciFunctionHandle::connect_by_path(&device_path) { Ok(handle) => handle, - Err(err) => { - // Either the device is gone or it is already in-use by a driver. + Err(err) if err.raw_os_error() == Some(syscall::ENOLCK) => { log::debug!( "pcid-spawner: {} already in use: {err}", device_path.display(), ); continue; } + Err(err) => { + log::error!( + "pcid-spawner: failed to open channel for {}: {err}", + device_path.display(), + ); + continue; + } }; let full_device_id = handle.config().func.full_device_id; diff --git a/drivers/pcid/Cargo.toml b/drivers/pcid/Cargo.toml index c51e87d0ca..5bab8d11a9 100644 --- a/drivers/pcid/Cargo.toml +++ b/drivers/pcid/Cargo.toml @@ -16,7 +16,7 @@ bincode = "1.2" fdt = "0.1.5" libc.workspace = true log.workspace = true -pci_types = "=0.10.0" +pci_types = "0.10.1" pico-args = { version = "0.5", features = ["combined-flags"] } plain = "0.2" redox-scheme.workspace = true diff --git a/drivers/pcid/src/driver_interface/mod.rs b/drivers/pcid/src/driver_interface/mod.rs index 97538c3cf4..bbc7304ee5 100644 --- a/drivers/pcid/src/driver_interface/mod.rs +++ b/drivers/pcid/src/driver_interface/mod.rs @@ -331,8 +331,7 @@ impl PciFunctionHandle { device_path.join("channel").to_str().unwrap(), libredox::flag::O_RDWR, 0, - ) - .map_err(|err| io::Error::other(format!("failed to open pcid channel: {}", err)))?; + )?; Ok(Self::connect_common(channel_fd as RawFd)) } diff --git a/drivers/pcid/src/scheme.rs b/drivers/pcid/src/scheme.rs index b13d31b9a1..ce55b33f9a 100644 --- a/drivers/pcid/src/scheme.rs +++ b/drivers/pcid/src/scheme.rs @@ -436,7 +436,8 @@ impl PciScheme { } fn parse_pci_addr(addr: &str) -> Option { - let (segment, rest) = addr.split_once('-')?; + // FIXME use : instead of -- as separator once the old scheme format is no longer supported. + let (segment, rest) = addr.split_once("--")?; let segment = u16::from_str_radix(segment, 16).ok()?; // FIXME use : instead of -- as separator once the old scheme format is no longer supported.