From 55bb5011e40885f4f7c13a04d76c8befe7817799 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Thu, 11 Jul 2024 21:14:50 +0900 Subject: [PATCH] fixup! rust: drm: sched: Add GPU scheduler abstraction --- rust/kernel/drm/sched.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/kernel/drm/sched.rs b/rust/kernel/drm/sched.rs index bee9b612fd21a3..596d4f8a3e746d 100644 --- a/rust/kernel/drm/sched.rs +++ b/rust/kernel/drm/sched.rs @@ -270,8 +270,10 @@ impl Entity { /// Create a new job on this entity. /// /// The entity must outlive the pending job until it transitions into the submitted state, - /// after which the scheduler owns it. - pub fn new_job(&self, credits: u32, inner: T) -> Result> { + /// after which the scheduler owns it. Since jobs must be submitted in creation order, + /// this requires a mutable reference to the entity, ensuring that only one new job can be + /// in flight at once. + pub fn new_job(&mut self, credits: u32, inner: T) -> Result> { let mut job: Box>> = Box::try_new_zeroed()?; // SAFETY: We hold a reference to the entity (which is a valid pointer),