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.
This commit is contained in:
Bruce Evans 2004-04-05 07:43:18 +00:00
parent 3a0ad2fe74
commit 740a734c33
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127883
3 changed files with 18 additions and 18 deletions

View File

@ -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(

View File

@ -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(

View File

@ -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(