diff options
author | Bruce Evans <bde@FreeBSD.org> | 2004-04-05 07:43:18 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 2004-04-05 07:43:18 +0000 |
commit | 740a734c33ea72e0469ff82da1e4276483fa969c (patch) | |
tree | cc7c7d5f055d427ebf5ab297784099813b68cd30 | |
parent | 3a0ad2fe749cb43189098b2411e94fd964d4fd6c (diff) | |
download | src-740a734c33ea72e0469ff82da1e4276483fa969c.tar.gz src-740a734c33ea72e0469ff82da1e4276483fa969c.zip |
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.
Notes
Notes:
svn path=/head/; revision=127883
-rw-r--r-- | sys/dev/cy/cy.c | 12 | ||||
-rw-r--r-- | sys/dev/cy/cy_isa.c | 12 | ||||
-rw-r--r-- | sys/i386/isa/cy.c | 12 |
3 files changed, 18 insertions, 18 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 7207846b6380..218f57fa9f39 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/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( diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index 7207846b6380..218f57fa9f39 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.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( diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index 7207846b6380..218f57fa9f39 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( |