diff options
author | bde <bde@FreeBSD.org> | 2004-04-05 07:43:18 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-04-05 07:43:18 +0000 |
commit | e061b47c7ce99c64b583508213a4121e588085f6 (patch) | |
tree | cc7c7d5f055d427ebf5ab297784099813b68cd30 /sys/i386/isa | |
parent | dfeeeaf38c52be58a1dd8d4d0ec53741bad8fe76 (diff) | |
download | FreeBSD-src-e061b47c7ce99c64b583508213a4121e588085f6.zip FreeBSD-src-e061b47c7ce99c64b583508213a4121e588085f6.tar.gz |
Moved initialization of the lock from the (isa) probe function to the
common attach function so that the lock gets initialized in all cases.
This fixes breakage of the initialization of the lock in the pci case
in rev.1.135 (between the releases of 5.1 and 5.2). The lock is only
used in the SMP case, so this bug was not always fatal.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/cy.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index 7207846..218f57f 100644 --- a/sys/i386/isa/cy.c +++ b/sys/i386/isa/cy.c @@ -428,12 +428,6 @@ sioprobe(dev) { cy_addr iobase; - while (sio_inited != 2) - if (atomic_cmpset_int(&sio_inited, 0, 1)) { - mtx_init(&sio_lock, driver_name, NULL, MTX_SPIN); - atomic_store_rel_int(&sio_inited, 2); - } - iobase = (cy_addr)dev->id_maddr; /* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */ @@ -538,6 +532,12 @@ cyattach_common(cy_iobase, cy_align) int ncyu; int unit; + while (sio_inited != 2) + if (atomic_cmpset_int(&sio_inited, 0, 1)) { + mtx_init(&sio_lock, driver_name, NULL, MTX_SPIN); + atomic_store_rel_int(&sio_inited, 2); + } + adapter = cy_total_devices; if ((u_int)adapter >= NCY) { printf( |