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

From: Stephen Rothwell <[email-masked]>
Date: Wed, 19 Mar 2025 20:07:46 +1100

Hi all,

After merging the driver-core tree, today's linux-next build (x86_64
allmodconfig) failed like this:

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