mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-29 13:23:23 +01:00
DRM ioctls do not guarantee that the parent bus device is still bound. However, since DRM device registration is managed through Devres, using drm_dev_unplug() on unregistration ensures that between drm_dev_enter() and drm_dev_exit() the parent device must be bound. Add RegistrationGuard, a guard object representing a drm_dev_enter/exit SRCU critical section that dereferences to &Device<T, Registered>. The guard is obtained from Device<T, Ioctl> and proves at runtime that the device is still registered. Switch Registration::drop from drm_dev_unregister() to drm_dev_unplug() to provide the SRCU barrier that RegistrationGuard's safety argument relies on. Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Tested-by: Deborah Brouwer <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Danilo Krummrich <[email protected]>
27 lines
588 B
Rust
27 lines
588 B
Rust
// SPDX-License-Identifier: GPL-2.0 OR MIT
|
|
|
|
//! DRM subsystem abstractions.
|
|
|
|
pub mod device;
|
|
pub mod driver;
|
|
pub mod file;
|
|
pub mod gem;
|
|
pub mod gpuvm;
|
|
pub mod ioctl;
|
|
|
|
pub use self::device::Device;
|
|
pub use self::device::DeviceContext;
|
|
pub use self::device::Ioctl;
|
|
pub use self::device::Normal;
|
|
pub use self::device::Registered;
|
|
pub use self::device::RegistrationGuard;
|
|
pub use self::device::UnregisteredDevice;
|
|
pub use self::driver::Driver;
|
|
pub use self::driver::DriverInfo;
|
|
pub use self::driver::Registration;
|
|
pub use self::file::File;
|
|
|
|
pub(crate) mod private {
|
|
pub trait Sealed {}
|
|
}
|