Public

> From: Irshad, Luqmaan <[email protected]>
> +     /*
> +      * XCP minors redirect their device reference to this DRM device.
> +      * Reaching its final release guarantees that no open files still
> +      * reference those minors, so the backing XCP devices can now be
> freed.
> +      */
> +     amdgpu_xcp_dev_fini(adev);
>       amdgpu_device_fini_sw(adev);
>       pci_set_drvdata(adev->pdev, NULL);
>  }

> +             /*
> +              * Stop new opens, but keep the partition DRM device and its
> +              * minors alive. Existing drm_file objects still point at these
> +              * minors, whose ->dev was redirected to the primary DRM
> device
> +              * when the XCP device was allocated.
> +              */
> +             drm_dev_unplug(adev->xcp_mgr->xcp[i].ddev);
> +     }
> +}

When looking at the final code, these comments seem to come out of nowhere. 
These would be a better fit in the commit message.

> +              * Normally this was done by amdgpu_xcp_dev_unplug().

What does this mean?

> +              * The primary DRM device is in its final release callback, so
> +              * every file that acquired a reference through these redirected
> +              * minors has completed drm_minor_release(). It is now safe
> to
> +              * restore the partition device and free it.

Maybe something like: Since all the XCP minor files are released at this point, 
It is now safe to restore the partition device and free it.

Reply via email to