public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the driver-core tree with the drm-rust tree
@ 2025-11-17  5:06 Stephen Rothwell
  2025-11-17 14:47 ` Alice Ryhl
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2025-11-17  5:06 UTC (permalink / raw)
  To: Greg KH, Danilo Krummrich, Rafael J. Wysocki, Alice Ryhl
  Cc: Alexandre Courbot, Alistair Popple, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3901 bytes --]

Hi all,

Today's linux-next merge of the driver-core tree got a conflict in:

  drivers/gpu/nova-core/driver.rs

between commit:

  1101c442410c ("gpu: nova-core: Set correct DMA mask")

from the drm-rust tree and commits:

  0242623384c7 ("rust: driver: let probe() return impl PinInit<Self, Error>")
  e4e679c8608e ("rust: auxiliary: unregister on parent device unbind")

from the driver-core tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/nova-core/driver.rs
index d91bbc50cde7,ca0d5f8ad54b..000000000000
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@@ -1,20 -1,14 +1,21 @@@
  // SPDX-License-Identifier: GPL-2.0
  
  use kernel::{
 -    auxiliary, c_str,
 +    auxiliary,
 +    c_str,
      device::Core,
+     devres::Devres,
 +    dma::Device,
 +    dma::DmaMask,
      pci,
 -    pci::{Class, ClassMask, Vendor},
 +    pci::{
 +        Class,
 +        ClassMask,
 +        Vendor, //
 +    },
      prelude::*,
      sizes::SZ_16M,
 -    sync::Arc,
 +    sync::Arc, //
  };
  
  use crate::gpu::Gpu;
@@@ -67,31 -53,21 +69,26 @@@ impl pci::Driver for NovaCore 
      type IdInfo = ();
      const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;
  
-     fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
-         dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");
+     fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {
+         pin_init::pin_init_scope(move || {
+             dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");
  
-         pdev.enable_device_mem()?;
-         pdev.set_master();
+             pdev.enable_device_mem()?;
+             pdev.set_master();
  
-         // SAFETY: No concurrent DMA allocations or mappings can be made because
-         // the device is still being probed and therefore isn't being used by
-         // other threads of execution.
-         unsafe { pdev.dma_set_mask_and_coherent(DmaMask::new::<GPU_DMA_BITS>())? };
++            // SAFETY: No concurrent DMA allocations or mappings can be made because
++            // the device is still being probed and therefore isn't being used by
++            // other threads of execution.
++            unsafe { pdev.dma_set_mask_and_coherent(DmaMask::new::<GPU_DMA_BITS>())? };
 +
-         let devres_bar = Arc::pin_init(
-             pdev.iomap_region_sized::<BAR0_SIZE>(0, c_str!("nova-core/bar0")),
-             GFP_KERNEL,
-         )?;
+             let bar = Arc::pin_init(
+                 pdev.iomap_region_sized::<BAR0_SIZE>(0, c_str!("nova-core/bar0")),
+                 GFP_KERNEL,
+             )?;
  
-         // Used to provided a `&Bar0` to `Gpu::new` without tying it to the lifetime of
-         // `devres_bar`.
-         let bar_clone = Arc::clone(&devres_bar);
-         let bar = bar_clone.access(pdev.as_ref())?;
- 
-         let this = KBox::pin_init(
-             try_pin_init!(Self {
-                 gpu <- Gpu::new(pdev, devres_bar, bar),
-                 _reg: auxiliary::Registration::new(
+             Ok(try_pin_init!(Self {
+                 gpu <- Gpu::new(pdev, bar.clone(), bar.access(pdev.as_ref())?),
+                 _reg <- auxiliary::Registration::new(
                      pdev.as_ref(),
                      c_str!("nova-drm"),
                      0, // TODO[XARR]: Once it lands, use XArray; for now we don't use the ID.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: linux-next: manual merge of the driver-core tree with the drm-rust tree
  2025-11-17  5:06 linux-next: manual merge of the driver-core tree with the drm-rust tree Stephen Rothwell
@ 2025-11-17 14:47 ` Alice Ryhl
  0 siblings, 0 replies; 2+ messages in thread
From: Alice Ryhl @ 2025-11-17 14:47 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Greg KH, Danilo Krummrich, Rafael J. Wysocki, Alexandre Courbot,
	Alistair Popple, Linux Kernel Mailing List,
	Linux Next Mailing List

On Mon, Nov 17, 2025 at 04:06:21PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the driver-core tree got a conflict in:
> 
>   drivers/gpu/nova-core/driver.rs
> 
> between commit:
> 
>   1101c442410c ("gpu: nova-core: Set correct DMA mask")
> 
> from the drm-rust tree and commits:
> 
>   0242623384c7 ("rust: driver: let probe() return impl PinInit<Self, Error>")
>   e4e679c8608e ("rust: auxiliary: unregister on parent device unbind")
> 
> from the driver-core tree.
> 
> I fixed it up (I think - see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.

Thanks! Looks good.

Alice

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-17 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17  5:06 linux-next: manual merge of the driver-core tree with the drm-rust tree Stephen Rothwell
2025-11-17 14:47 ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox