Re: linux-next: build failure after merge of the driver-core tree

Danilo Krummrich
2025-03-19T11:16:44Z

Hi Stephen,

On Wed, Mar 19, 2025 at 08:07:46PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the driver-core tree, today's linux-next build (x86_64
> allmodconfig) failed like this:

The following diff should fix the below conflict.

diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index 63c19f140fbd..a08fb6599267 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0

-use kernel::{bindings, c_str, pci, prelude::*};
+use kernel::{bindings, c_str, device::Core, pci, prelude::*};

use crate::gpu::Gpu;

@@ -27,7 +27,7 @@ impl pci::Driver for NovaCore {
type IdInfo = ();
const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;

- fn probe(pdev: &mut pci::Device, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
+ fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");

pdev.enable_device_mem()?;

>
> error[E0053]: method `probe` has an incompatible type for trait
> --> drivers/gpu/nova-core/driver.rs:30:20
> |
> 30 | fn probe(pdev: &mut pci::Device, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
> | ^^^^^^^^^^^^^^^^ types differ in mutability
> |
> = note: expected signature `fn(&kernel::pci::Device<Core>, &()) -> core::result::Result<_, _>`
> found signature `fn(&mut kernel::pci::Device<kernel::device::Normal>, &()) -> core::result::Result<_, _>`
> help: change the parameter type to match the trait
> |
> 30 | fn probe(pdev: &kernel::pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> error[E0599]: no method named `enable_device_mem` found for mutable reference `&mut kernel::pci::Device` in the current scope
> --> drivers/gpu/nova-core/driver.rs:33:14
> |
> 33 | pdev.enable_device_mem()?;
> | ^^^^^^^^^^^^^^^^^ method not found in `&mut Device`
>
> error[E0599]: no method named `set_master` found for mutable reference `&mut kernel::pci::Device` in the current scope
> --> drivers/gpu/nova-core/driver.rs:34:14
> |
> 34 | pdev.set_master();
> | ^^^^^^^^^^ method not found in `&mut Device`
>
> error: aborting due to 3 previous errors
>
> Some errors have detailed explanations: E0053, E0599.
> For more information about an error, try `rustc --explain E0053`.
>
> Presumably caused by commit
>
> 7b948a2af6b5 ("rust: pci: fix unrestricted &mut pci::Device")
>
> interacting with commit
>
> 54e6baf123fd ("gpu: nova-core: add initial driver stub")
>
> from the drm tree.
>
> I have no idea how to fix this, so I have just used the driver-core tree
> from next-20250318 for today.
>
> --
> Cheers,
> Stephen Rothwell