Changes since v3:
- Add a FIXME for an encountered Rust compiler bug. (Gary)
- Add new Rust files also to DRM drivers & common infrastructure
MAINTAINERS file. (Danilo)
- Reposition ECANCELED error code. (Miguel)
- Replace refcounted FenceCtx in DriverFenceData with a reference plus
life time. (Boris)
- Re-add rcu_barrier() patch, since we now can use it for dropping the
fence context. (Danilo)
- Add forgotten R-b from Alice, and Acks for MAINTAINERS from
Christian and Sumit.
Changes since v2:
- Don't drop DriverFenceData as a whole, but only the members we
really want to drop. Gives more robustness. (Gary).
- Break apart large pin_init_from_closure(). (Danilo, Onur)
- Remove rcu_barrier() and synchronize_rcu() from FenceCtx::drop().
FenceCtx might drop in atomic context, where you must not perform
those operations. With the current way C dma_fence is designed, the
driver must wait for a grace period manually until it unloads.
- Repair the DriverFenceBorrow implementation, properly injecting a
life time into it. (Danilo)
- Fix memory layout bug for rcu_head. (Onur)
- Drop RCU patches, since this series doesn't need them anymore.
Changes since v1:
- Remove unnecessary mutable references (Alice)
- Split up unsafe comments where possible (Danilo)
- Remove PhantomData + implement FenceCtx ops trait (Boris)
- Consistently call FenceCtx generic data `T`. FenceDataType is
derived from that. (Boris)
- Add abstractions for call_rcu() and synchronize_rcu() (Danilo)
- Add ECANCELED error code in Rust (Alice)
- Remove the rcu_barrier() from FenceCtx::drop() – because we now use
call_rcu(), there can be no UAF access to the FenceCtx anymore. In
any case, it is illegal to use either call_rcu() or
synchronize_rcu() in FenceCtx::drop(), because our new
drop_driver_fence_data() can run in atomic context and might put the
last fence_ctx reference.
So we now only have to guard against module unload, which it seems
either the driver or Rust driver-core / module unload infrastructure
must solve.
- Minor formatting etc. changes
- Add C helpers to MAINTAINERS. (Danilo)
- Ensure that `Fence::is_signaled()` is fully synchronized, i.e., all
callbacks really have run. See [1] and [2]. (Myself, Christian
König)
Changes since the RFCs:
- Include support for ForeignOwnable for ARef, so that a Fence can be
stuffed into an XArray et al. (Code by Danilo)
- Implement ForeignOwnable (with new borrow type) for DriverFence, so
that it can be stuffed into an XArray.
- Include the rcu::RcuBox data type to defer dropping data with RCU
(Cody by Alice)
- Port DmaFence to RcuBox to make UAF bugs through later, new dma_fence
callbacks (backend_ops) impossible.
- Force users to pass their fence data in an RcuBox (or have it not
need drop()) through a Sealed trait.
- Document the rules for the user's DriverFence::data's drop
implementation very clearly (deadlock danger).
- rustfmt, Clippy.
- Various style suggestions, safety comments, etc. (Önur)
- Add __rust_helper prefix to helper functions. (Önur)
Changes in RFC v3:
- Omit JobQueue patches for now
- Completely redesign the memory layout: Instead of a Fence
refcounting a DriverFence, both now live in the same allocation to
allow for future support the dma_fence backend_ops callbacks which
need to do container_of. (mostly Boris's feedback)
- Allow for pre-allocating fences to avoid deadlocks when submitting
jobs to a GPU. (Boris)
- Simultaneously, allow for pre-preparing fence callback objects, so
the driver can allocate them when it sees fit. (code largely stolen
and inspired by Daniel).
- Signal fences on drop, ensure synchronization.
- Force users to set an error code when signalling.
- Write more documentation
- A ton of minor other changes.
[1] https://lore.kernel.org/dri-devel/20260608142436.265820-2-phasta@kernel.org/
[2] https://lore.kernel.org/dri-devel/20260612104251.2264707-2-phasta@kernel.or…
Alright, so since the last RFCs did not reveal significant design
issues, I decided to transition this series to a v1 and hope that we can
get it upstream.
This now includes code for more common infrastructure that dma_fence
needs, contributed by Danilo and Alice.
---
Old cover letter for RFC:
So, this is the spiritual successor of the first / second RFC [1]. v2
also contained code for drm::JobQueue, but mostly to show how the fence
code would be used. JobQueue is under heavy rework right now, so I don't
want to bother your eyes with it. The docstring examples should show how
Rust fences are supposed to be used, though.
This v3 contains a huge amount of highly valuable feedback from a
variety of people, notably Boris, but also from Alice, Gary and Danilo.
There are some TODOs open (a better trait for fence backend_ops and RCU
support), but my hope is that this effort is now finally approaching its
end.
I would greatly appreciate feedback and especially more information
about what might be missing to make this usable, which is obviously
where Daniel's and Boris's feedback will be valuable once more.
Please regard this patch just as what it's titled: an RFC, to discuss a
bit more and to inform a broader community about what the current state
is and where this is heading at.
Many regards,
Philipp
[1] https://lore.kernel.org/rust-for-linux/20260203081403.68733-2-phasta@kernel…
Danilo Krummrich (1):
rust: types: implement ForeignOwnable for ARef<T>
Philipp Stanner (4):
rust: error: Add ECANCELED error code
rust: sync: Add abstraction for rcu_barrier()
rust: Add dma_fence abstractions
MAINTAINERS: Add entry for Rust dma-buf
MAINTAINERS | 5 +
rust/bindings/bindings_helper.h | 1 +
rust/helpers/dma_fence.c | 48 ++
rust/helpers/helpers.c | 1 +
rust/kernel/dma_buf/dma_fence.rs | 870 +++++++++++++++++++++++++++++++
rust/kernel/dma_buf/mod.rs | 14 +
rust/kernel/error.rs | 1 +
rust/kernel/lib.rs | 1 +
rust/kernel/sync/aref.rs | 39 ++
rust/kernel/sync/rcu.rs | 6 +
10 files changed, 986 insertions(+)
create mode 100644 rust/helpers/dma_fence.c
create mode 100644 rust/kernel/dma_buf/dma_fence.rs
create mode 100644 rust/kernel/dma_buf/mod.rs
base-commit: 848bf57e98e1678ce7a49eb4e0bf0502da95dc07
--
2.54.0
On Mon, Jun 22, 2026 at 06:22:27PM +0530, biren pandya wrote:
> On Mon, Jun 22, 2026 at 5:25 PM Laurent Pinchart wrote:
> > On Tue, Jun 16, 2026 at 11:49:57PM +0530, Biren Pandya wrote:
> > > Several GEM core functions manually managed mutex_lock() and
> > > mutex_unlock() over single scopes or error paths. This adds boilerplate
> > > and carries the risk of lock leaks if error paths are refactored.
> > >
> > > Modernize these locks by deploying the <linux/cleanup.h> scoped_guard()
> > > macro. This ensures that the locks are reliably dropped when the block
> > > exits, cleanly removing goto out_unlock paths and tightening the
> > > lifecycle.
> >
> > What's the reason for doing so in in drm_gem and not other areas in DRM
> > ?
>
> Hi Laurent,
>
> Thanks for taking a look.
> No deeper reason than it being where I happened to start — I didn't
> mean to single it out, and I'd rather the treatment be consistent than
> piecemeal.
>
> > > @@ -1021,37 +1018,34 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data,
> > > goto out;
> > > }
> > >
> > > - mutex_lock(&file_priv->prime.lock);
> > > + scoped_guard(mutex, &file_priv->prime.lock) {
> > > + spin_lock(&file_priv->table_lock);
> > > + ret = idr_alloc(&file_priv->object_idr, obj, handle, handle + 1,
> > > + GFP_NOWAIT);
> > > + spin_unlock(&file_priv->table_lock);
> >
> > And why don't you use guards for the spinlock as well ?
>
> Fair point — the spinlocks here are equally good candidates; I only
> kept v1 to mutexes to keep it small.
>
> That said, this is a pure cleanup with no functional change, so it's
> entirely your call whether it's worth carrying.
> If you'd like it, I'll send a v2 that converts both the mutexes and
> the spinlocks in drm_gem.c consistently. If you'd prefer not to take
> cleanup-only churn, I'm happy to drop it — no problem either way.
I'll let the maintainers of that code decide (I'm not one of them).
--
Regards,
Laurent Pinchart
BOVET RECITAL 16 Triple Time Zone Tourbillon Watch
Classic and traditional, the Bovet Recital collection is stunning, and this latest 16-time-zone triple time zone tourbillon watch is truly exceptional. Belonging to the Dimier series, its distinctive feature is the absence of the "ribbon" crown guard at 12 o'clock. Therefore, despite its complex and intricate design, the crown at 3 o'clock retains a very traditional style.
This watch is powered by the "Calibre Rising Star II" mechanical movement, displaying the time in major cities as well as two other cities. The highlight of this timepiece is that it is not merely an elegant timepiece, but a technical masterpiece and exquisite design. Like its watch collection, the brand is unique, producing not only its own movements but also many components such as the case and dial. Due to its superb craftsmanship, other brands seek their assistance.
https://www.chrono-wrist.co.uk/https://www.moon-watch.co.uk/https://www.perfectwrist.co/https://www.reviewluxurystore.com/
Bovet does not follow trends, adhering to its own path and setting the highest standards in the field of design. From top to bottom, the brand upholds a passion for creation, a dedication to quality, and an unyielding pursuit of excellence. The Recital 16 Three Time Zone Tourbillon watch is available in two styles: 18K red gold and 18K white gold. The white gold version is adorned with exquisite decorations, such as mother-of-pearl dials for the second and third time zones, and a bezel set with dazzling baguette-cut diamonds.
This 46mm watch is not a slim design, but this is precisely what gives it a masculine feel and makes it exceptionally comfortable to wear. A round blue sapphire crystal is set in the crown, reminiscent of a classic Cartier piece. Adjusting the time is a pleasure in itself, and the simultaneous movement of the three dials is a feast for the eyes. The function of adjusting all time zones simultaneously is simple yet sophisticated, and it can even synchronize the minute hand.
The Bovet Recital 16 watch strives to combine practicality with exquisite beauty. You might think that having two additional time zone displays is practical enough, but what's even more surprising is that each time zone also features an independent day/night indicator and a reference city indicator, making it a true travel essential. Since the time zones use a 12-hour system, the day/night indicator is equally useful in other aspects. Buttons on the side of the case allow for easy adjustment of the second and third time zone indicators on the dial.
This watch features a 7-day power reserve movement and an open design without a traditional dial, offering a wide field of vision. The hands and markers are coated with luminescent material for excellent legibility, complementing the overall style of the watch. This timepiece will undoubtedly be a collector's item, but the brand positions it as a niche timepiece, designed specifically for consumers who aspire to enter the luxury market.
Instead of following a linear storyline or mandatory tasks, sprunki game ( https://musicgames.io/sprunki-2 ) allows players to write their own journey through musical arrangements. Each drag-and-drop, each experiment with a new combination, produces unexpected results, keeping the experience fresh. Most appealing is the limitless power of imagination. Players can create cheerful melodies, deeply emotional tunes, or even mysterious sounds never before heard. This absolute freedom is what makes Sprunki one of the most creative and beloved games in the community today.
The biggest difference between Sprunki Game and many other music games lies in its approach to users. Instead of requiring players to perform actions according to pre-set rhythms, Sprunki encourages them to actively create music in their own way. Each character in the game is like a living instrument, possessing a distinct sound and personality. When characters are combined, they form a complete composition with a unique and unreplicable sound. Players don't need professional musical knowledge to create interesting works with just a few simple steps. This is why Sprunki is loved by both music enthusiasts and those who simply want a relaxing form of entertainment. The game makes creativity more accessible than ever and allows everyone to experience the joy of creating a product with their own personal touch.
Ulysse Nardin Introduces the Freak X Second Generation Watch
<p>Smaller, but Better.</p>
<p>The second-generation Ulysse Nardin (UN) Freak X watch embodies the concept of "small but perfectly formed," featuring a new micro-rotor movement that powers the Freak collection's iconic "flying carousel" caliber. This new movement debuts in a smaller 41mm stainless steel case and comes with a interchangeable strap system.</p>
<p>The new Freak X watch boasts many commendable features. It retains UN's signature "flying carousel" tourbillon structure and houses a new micro-rotor movement, upgraded with the brand's exclusive DiamonSil escapement. The new watch is significantly smaller than its predecessor and offers enhanced water resistance thanks to the collection's first screw-down crown.</p>
<p>The interchangeable strap system provides a wider range of strap options, including a stainless steel bracelet.</p>
<p>Some may lament the downgrade from titanium to steel, but given the smaller case size, this is a relatively minor issue, and a titanium version is almost certain to be released in the future.</p>
<p> </p>
<p><strong><a href="https://www.moon-watch.co.uk/ulysse-nardin-freak-watches-c-101_104.html">replica Ulysse Nardin Freak X</a></strong></p>
<p><strong><a href="https://www.moon-watch.co.uk">best replica watches</a></strong></p>
<p><strong><a href="https://www.moon-watch.co.uk/jacob-and-co-c-8.html">jacob and co replica</a></strong></p>
<p>Smaller, But Better</p>
<p>25 years ago, the Freak watch burst onto the scene, stunning the industry with its innovative structure that integrated the entire time train and escapement into a single large minute hand. While the Freak X simplifies the design concept slightly, incorporating the time train into the dial where the hour hand is located, the overall appearance remains largely unchanged.</p>
<p>One of the most striking design elements of the original Freak watch was the absence of a crown—the watch was wound via the case back and adjusted via the bezel. The simplified Freak X adopts a more traditional structure and features a standard crown at 3 o'clock, thus downplaying this design element.</p>
<p>The new Freak X retains the crown, but now features a screw-down design to achieve 100-meter water resistance. The crown screws down into a stainless steel case, now reduced from 43mm to 41mm, and the lug spacing has also been shortened to a more comfortable 47.3mm.</p>
<p>The case thickness is 13.6mm, roughly between the thinnest version of the previous generation and the version with the art dial (13.78mm). The new box-shaped sapphire crystal absorbs some of the thickness, making it appear even slimmer.</p>
<p><strong><a href="https://www.perfectwrist.ru">perfect watches review</a></strong> </p>
<p><strong><a href="https://www.perfectwrist.co/richard-mille-watches-c-24.html">replica Richard Mille watches</a></strong></p>
<p><strong><a href="https://www.perfectwrist.co/ulysse-nardin-watches-c-103.html">ulysse nardin replica watches</a></strong></p>
<p> </p>
<p>A damn miniature rotor</p>
<p>Although the movement model name has changed slightly—the previous automatic movement was named UN-230—the UN-232 is quite different. The most significant change is the adoption of a jewel-bearing miniature rotor, which differs from most other miniature rotor designs in that it has a supporting bridge above it.</p>
<p>This design is reminiscent of certain vintage Universal Geneve movements, such as the 12P, and recent automatic movements by designers like Laurent Ferrier and Romain Gauthier.</p>
<p>This movement still uses a mainspring barrel, but by Freak standards, the barrel is rather ordinary. This structure is quite different from the flagship Freak, which occupies almost the entire width of the movement to house a large mainspring barrel.</p>
<p>In other words, the upgraded Freak X shares more substantial similarities with its "big brother" in some aspects, such as its DiamonSil escapement. The DiamonSil escapement features a diamond-coated silicon escape wheel and integrated escape fork. The DiamonSil coating is a completely new design for the Freak X—previous versions only used uncoated silicon components.</p>
<p>This component transfers energy to a silicon balance wheel mounted on the brand's most advanced oval silicon hairspring, which is carefully designed to improve isochronism.</p>
<p><strong><a href="https://www.whereguidewatch.com">fake luxury watches</a></strong></p>
<p><strong><a href="https://www.whereguidewatch.com">high quality fake watches</a></strong> </p>
<p><strong><a href="https://www.whereguidewatch.com/jacob-co-c-4.html">replica jacob and co Astronomia watches</a></strong></p>
<p>Interestingly, UN claims that each of its movements is assembled from start to finish by a single watchmaker, a stark contrast to the increasingly prevalent assembly line production methods. While assembly line production can increase output and reduce costs, it is difficult to reconcile with the romantic ideals of haute horlogerie. Ulysse Nardin Freak X<br>
Models: 2323-500-1A/0A (Grey), 2323-500-3A/7A (Blue), 2323-500-2A/1A (Gold)</p>
<p>Diameter: 41 mm; Height: 13.6 mm; Material: Stainless Steel; Crystal: Sapphire Crystal; Water Resistance: 100 meters</p>
<p>Movement: UN-232<br>
Functions: Hours, Minutes<br>
Winding: Automatic<br>
Frequency: 21,600 vibrations per hour (3 Hz)<br>
Power Reserve: 72 hours</p>
<p>Strap: Leather strap with a folding clasp in the same color as the case, or stainless steel bracelet</p>