Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ieee1394 Restore config pending stuff, adjusted to a...



details:   https://anonhg.NetBSD.org/src/rev/b8674811d3c8
branches:  trunk
changeset: 780734:b8674811d3c8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Aug 05 02:36:16 2012 +0000

description:
Restore config pending stuff, adjusted to avoid the race.

Leave a note about what this code probably should look like for
anyone who comes rummaging around with the intent to really fix it.
I would do that myself if I had time and resources to test this at
the moment, and more comfort with our firewire stack, but I don't.

diffstat:

 sys/dev/ieee1394/firewire.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 61739d2652d0 -r b8674811d3c8 sys/dev/ieee1394/firewire.c
--- a/sys/dev/ieee1394/firewire.c       Sun Aug 05 02:03:05 2012 +0000
+++ b/sys/dev/ieee1394/firewire.c       Sun Aug 05 02:36:16 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: firewire.c,v 1.40 2012/08/04 03:55:43 riastradh Exp $  */
+/*     $NetBSD: firewire.c,v 1.41 2012/08/05 02:36:16 riastradh Exp $  */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.40 2012/08/04 03:55:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.41 2012/08/05 02:36:16 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -255,6 +255,9 @@
 
        callout_schedule(&fc->timeout_callout, hz);
 
+       /* Tell config we will have started a thread to scan the bus.  */
+       config_pending_incr();
+
        /* create thread */
        if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL, fw_bus_probe_thread,
            fc, &fc->probe_thread, "fw%dprobe", device_unit(fc->bdev)))
@@ -1943,6 +1946,22 @@
 {
        struct firewire_comm *fc = (struct firewire_comm *)arg;
 
+       /*
+        * Tell config we've scanned the bus.
+        *
+        * XXX This is not right -- we haven't actually scanned it.  We
+        * probably ought to call this after the first bus exploration.
+        *
+        * bool once = false;
+        * ...
+        *      fw_attach_dev(fc);
+        *      if (!once) {
+        *              config_pending_decr();
+        *              once = true;
+        *      }
+        */
+       config_pending_decr();
+
        mutex_enter(&fc->wait_lock);
        while (fc->status != FWBUSDETACH) {
                if (fc->status == FWBUSEXPLORE) {



Home | Main Index | Thread Index | Old Index