]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: Add the reference count to avoid unloading ACPI video bus twice
authorZhao Yakui <yakui.zhao@intel.com>
Tue, 16 Jun 2009 03:23:13 +0000 (11:23 +0800)
committerLen Brown <len.brown@intel.com>
Wed, 24 Jun 2009 03:38:41 +0000 (23:38 -0400)
commit206756f6ce8e6699080ee45b03dde9bca900a8e6
treeac6ec8b6ac4f96ce7ef7b5e9fa057099d7ce9af1
parent0b4e5213d176b9dedee7e7fa69254bee8bd46fd4
ACPI: Add the reference count to avoid unloading ACPI video bus twice

Sometimes both acpi video and i915 driver are compiled as modules.
And there exists the strict dependency between the two drivers.
The acpi video bus will be unloaded in course of unloading the i915 driver.
If we unload the acpi video driver, then the kernel oops will be triggered.

Add the reference count to avoid unloading the ACPI video bus twice.
The reference count should be checked before unregistering the acpi video bus.
If the reference count is already zero, it won't unregister it again.
And after the acpi video bus is already unregistered, the reference count
will be set to zero.

http://bugzilla.kernel.org/show_bug.cgi?id=13396

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/video.c
drivers/gpu/drm/i915/i915_opregion.c
include/acpi/video.h