HomeFreeBSD

snd_dummy: Fix callout(9) races

Description

snd_dummy: Fix callout(9) races

Use callout_init_mtx(9) to associate the callback with the driver's
lock. Also make sure the callout is stopped properly during detach.

While here, introduce a dummy_active() function to know when it's
appropriate to stop or not reschedule the callout.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D47459

(cherry picked from commit 5bd08172b4150503c9cf60ffe3c97716c5bf6fa1)

Details

Provenance
christosAuthored on Nov 26 2024, 2:48 PM
Reviewer
dev_submerge.ch
Differential Revision
D47459: snd_dummy: Fix callout(9) races
Parents
rG0dd21407bd39: newsyslog.conf(5): Accept human unit suffix in the size filed
Branches
Unknown
Tags
Unknown