Skip to contentSkip to conversation

linux-next: manual merge of the driver-core tree with the drm-rust tree

PATCH Mark Brown 2 participants 2 messages Jul 26

Subsystems (4)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

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

drivers/gpu/nova-core/gpu.rs

between commit:

f1aab4b1ab829 ("gpu: nova-core: avoid repeated calls to pci::Device::as_ref")

from the drm-rust tree and commit:

f7acb19abcd86 ("rust: device: make lifetime on Core and CoreInternal invariant")

from the driver-core tree.

I fixed it up (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.

drivers/gpu/nova-core/gpu.rs +0 -0
diff --cc drivers/gpu/nova-core/gpu.rs
index 42a4cd7971fa1,b603b0bd2692b..0000000000000
@@@ -277,61 -284,15 +277,61 @@@ struct GspResources<'gpu> 
      unload_bundle: Option<gsp::UnloadBundle>,
  }
  
 +/// Structure holding the resources required to operate the GPU.
 +#[pin_data]
 +pub(crate) struct Gpu<'gpu> {
 +    spec: Spec,
 +    /// Static GPU information as provided by the GSP.
 +    gsp_static_info: GetGspStaticInfoReply,
 +    /// GSP and its resources.
 +    #[pin]
 +    gsp_resources: GspResources<'gpu>,
 +    /// System memory page required for flushing all pending GPU-side memory writes done through
 +    /// PCIE into system memory, via sysmembar (A GPU-initiated HW memory-barrier operation).
 +    ///
 +    /// Must be kept declared *after* `gsp_resources`, as the latter's `PinnedDrop` implementation
 +    /// requires the sysmem flush page to be in place.
 +    sysmem_flush: SysmemFlush<'gpu>,
 +}
 +
 +#[pinned_drop]
 +impl PinnedDrop for GspResources<'_> {
 +    fn drop(self: Pin<&mut Self>) {
 +        let this = self.project();
 +        let device = *this.device;
 +        let bar = *this.bar;
 +        let bundle = this.unload_bundle.take();
 +
 +        let _ = this
 +            .gsp
 +            .as_ref()
 +            .get_ref()
 +            .unload(
 +                GspBootContext {
 +                    pdev: device,
 +                    bar,
 +                    chipset: this.spec.chipset,
 +                    gsp_falcon: &*this.gsp_falcon,
 +                    sec2_falcon: &*this.sec2_falcon,
 +                    fsp: this.fsp.as_mut(),
 +                    vgpu: &*this.vgpu,
 +                },
 +                bundle,
 +            )
 +            .inspect_err(|e| dev_err!(device, "failed to unload GSP: {:?}\n", e));
 +    }
 +}
 +
  impl<'gpu> Gpu<'gpu> {
-     pub(crate) fn new(
-         pdev: &'gpu pci::Device<device::Core<'_>>,
+     pub(crate) fn new<'a>(
+         pdev: &'gpu pci::Device<device::Core<'a>>,
          bar: Bar0<'gpu>,
-     ) -> impl PinInit<Self, Error> + 'gpu {
+     ) -> impl PinInit<Self, Error> + use<'gpu, 'a> {
 +        let dev = pdev.as_ref();
 +
          try_pin_init!(Self {
 -            device: pdev.as_ref(),
 -            spec: Spec::new(pdev.as_ref(), bar).inspect(|spec| {
 -                dev_info!(pdev,"NVIDIA ({})\n", spec);
 +            spec: Spec::new(dev, bar).inspect(|spec| {
 +                dev_info!(dev,"NVIDIA ({})\n", spec);
              })?,
  
              // We must wait for GFW_BOOT completion before doing any significant setup on the GPU.
maintainer
#1 lore raw
Quoted 10 lines · Mark Brown

Hi all,

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

drivers/gpu/nova-core/gpu.rs

between commit:

f1aab4b1ab829 ("gpu: nova-core: avoid repeated calls to pci::Device::as_ref")

Quoted 7 lines

from the drm-rust tree and commit:

f7acb19abcd86 ("rust: device: make lifetime on Core and CoreInternal invariant")

from the driver-core tree.

I fixed it up (see below) and can carry the fix as necessary.

LGTM, thanks!