diff options
author | jhb <jhb@FreeBSD.org> | 2009-08-20 19:17:53 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-08-20 19:17:53 +0000 |
commit | 9b0755de9f1e9517732f96a37f0ef30b8db23811 (patch) | |
tree | ee9b2a74c07c732ee357d4810494c3b6aecd6e71 /sys/dev/acpica | |
parent | ab0b6203abac22f7fa981c24cf452d3dab032727 (diff) | |
download | FreeBSD-src-9b0755de9f1e9517732f96a37f0ef30b8db23811.zip FreeBSD-src-9b0755de9f1e9517732f96a37f0ef30b8db23811.tar.gz |
Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.
Approved by: re (kib), attilio
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi.c | 14 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_battery.c | 15 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_cpu.c | 2 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_dock.c | 8 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_thermal.c | 3 |
5 files changed, 16 insertions, 26 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index c3e4e52..63f95d3 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -675,6 +675,8 @@ acpi_suspend(device_t dev) device_t child, *devlist; int error, i, numdevs, pstate; + GIANT_REQUIRED; + /* First give child devices a chance to suspend. */ error = bus_generic_suspend(dev); if (error) @@ -717,6 +719,8 @@ acpi_resume(device_t dev) int i, numdevs, error; device_t child, *devlist; + GIANT_REQUIRED; + /* * Put all devices in D0 before resuming them. Call _S0D on each one * since some systems expect this. @@ -741,6 +745,8 @@ static int acpi_shutdown(device_t dev) { + GIANT_REQUIRED; + /* Allow children to shutdown first. */ bus_generic_shutdown(dev); @@ -2528,7 +2534,11 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state) thread_unlock(curthread); #endif - newbus_xlock(); + /* + * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE + * drivers need this. + */ + mtx_lock(&Giant); slp_state = ACPI_SS_NONE; @@ -2601,7 +2611,7 @@ backout: if (slp_state >= ACPI_SS_SLEPT) acpi_enable_fixed_events(sc); - newbus_xunlock(); + mtx_unlock(&Giant); #ifdef SMP thread_lock(curthread); diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c index 1ec1413..dd2b3fa 100644 --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -329,7 +329,6 @@ acpi_battery_find_dev(u_int logical_unit) dev = NULL; found_unit = 0; - newbus_slock(); batt_dc = devclass_find("battery"); maxunit = devclass_get_maxunit(batt_dc); for (i = 0; i < maxunit; i++) { @@ -341,7 +340,6 @@ acpi_battery_find_dev(u_int logical_unit) found_unit++; dev = NULL; } - newbus_sunlock(); return (dev); } @@ -371,17 +369,13 @@ acpi_battery_ioctl(u_long cmd, caddr_t addr, void *arg) */ switch (cmd) { case ACPIIO_BATT_GET_UNITS: - newbus_slock(); *(int *)addr = acpi_battery_get_units(); - newbus_sunlock(); error = 0; break; case ACPIIO_BATT_GET_BATTINFO: if (dev != NULL || unit == ACPI_BATTERY_ALL_UNITS) { bzero(&ioctl_arg->battinfo, sizeof(ioctl_arg->battinfo)); - newbus_slock(); error = acpi_battery_get_battinfo(dev, &ioctl_arg->battinfo); - newbus_sunlock(); } break; case ACPIIO_BATT_GET_BIF: @@ -422,11 +416,6 @@ acpi_battery_sysctl(SYSCTL_HANDLER_ARGS) { int val, error; - /* - * Tolerate a race here because newbus lock can't be acquired before - * acpi_battery_get_battinfo() as it can create a LOR with the sysctl - * lock. - */ acpi_battery_get_battinfo(NULL, &acpi_battery_battinfo); val = *(u_int *)oidp->oid_arg1; error = sysctl_handle_int(oidp, &val, 0, req); @@ -438,10 +427,6 @@ acpi_battery_units_sysctl(SYSCTL_HANDLER_ARGS) { int count, error; - /* - * Tolerate a race here in order to avoid a LOR between sysctl lock - * and newbus lock. - */ count = acpi_battery_get_units(); error = sysctl_handle_int(oidp, &count, 0, req); return (error); diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 37134e2..5d8ad53 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -732,9 +732,7 @@ acpi_cpu_startup(void *arg) int i; /* Get set of CPU devices */ - newbus_slock(); devclass_get_devices(acpi_cpu_devclass, &cpu_devices, &cpu_ndevices); - newbus_sunlock(); /* * Setup any quirks that might necessary now that we have probed diff --git a/sys/dev/acpica/acpi_dock.c b/sys/dev/acpica/acpi_dock.c index 95b9fae..b7d2e3e 100644 --- a/sys/dev/acpica/acpi_dock.c +++ b/sys/dev/acpica/acpi_dock.c @@ -188,12 +188,12 @@ acpi_dock_attach_later(void *context) dev = (device_t)context; - newbus_xlock(); if (!device_is_enabled(dev)) device_enable(dev); + mtx_lock(&Giant); device_probe_and_attach(dev); - newbus_xunlock(); + mtx_unlock(&Giant); } static ACPI_STATUS @@ -299,11 +299,11 @@ acpi_dock_eject_child(ACPI_HANDLE handle, UINT32 level, void *context, "ejecting device for %s\n", acpi_name(handle)); dev = acpi_get_device(handle); - newbus_xlock(); if (dev != NULL && device_is_attached(dev)) { + mtx_lock(&Giant); device_detach(dev); + mtx_unlock(&Giant); } - newbus_xunlock(); acpi_SetInteger(handle, "_EJ0", 0); out: diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index 1e58d52..962fdb7 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -936,8 +936,6 @@ acpi_tz_thread(void *arg) sc = NULL; for (;;) { - newbus_slock(); - /* If the number of devices has changed, re-evaluate. */ if (devclass_get_count(acpi_tz_devclass) != devcount) { if (devs != NULL) { @@ -950,7 +948,6 @@ acpi_tz_thread(void *arg) for (i = 0; i < devcount; i++) sc[i] = device_get_softc(devs[i]); } - newbus_sunlock(); /* Check for temperature events and act on them. */ for (i = 0; i < devcount; i++) { |