aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire
diff options
context:
space:
mode:
authorAbdelkader Boudih <freebsd@seuros.com>2026-07-09 02:52:12 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2026-07-09 02:52:18 +0000
commit56d4dee82de1b5c8c77d5be79f7bf4183b327b57 (patch)
tree319c7bcd263d6553c9c2883cb8b9f70585b8d13c /sys/dev/firewire
parent750d429a228fb102d6e5d45bdc116489acbfff00 (diff)
Diffstat (limited to 'sys/dev/firewire')
-rw-r--r--sys/dev/firewire/fwcam.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/dev/firewire/fwcam.c b/sys/dev/firewire/fwcam.c
index 27451316d613..c5e5cf545fe9 100644
--- a/sys/dev/firewire/fwcam.c
+++ b/sys/dev/firewire/fwcam.c
@@ -288,7 +288,7 @@ fwcam_probe_task(void *arg, int pending __unused)
sc->state = FWCAM_STATE_PROBED;
FWCAM_UNLOCK(sc);
- if (sc->open_count > 0 &&
+ if (sc->dma_ch >= 0 &&
sc->state != FWCAM_STATE_DETACHING)
fwcam_iso_start(sc);
}
@@ -601,7 +601,6 @@ static int
fwcam_cdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
struct fwcam_softc *sc = dev->si_drv1;
- int err = 0;
FWCAM_LOCK(sc);
if (sc->state == FWCAM_STATE_DETACHING) {
@@ -615,18 +614,8 @@ fwcam_cdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
}
sc->open_count++;
- if (sc->open_count == 1 && sc->state == FWCAM_STATE_PROBED) {
- FWCAM_UNLOCK(sc);
- err = fwcam_iso_start(sc);
- if (err) {
- FWCAM_LOCK(sc);
- sc->open_count--;
- FWCAM_UNLOCK(sc);
- }
- } else {
- FWCAM_UNLOCK(sc);
- }
- return (err);
+ FWCAM_UNLOCK(sc);
+ return (0);
}
static int
@@ -657,6 +646,13 @@ fwcam_cdev_read(struct cdev *dev, struct uio *uio, int ioflag)
int err;
FWCAM_LOCK(sc);
+ if (sc->state == FWCAM_STATE_PROBED) {
+ FWCAM_UNLOCK(sc);
+ err = fwcam_iso_start(sc);
+ if (err)
+ return (err);
+ FWCAM_LOCK(sc);
+ }
while (!sc->frame_ready) {
if (sc->state != FWCAM_STATE_STREAMING) {
FWCAM_UNLOCK(sc);