Signed-off-by: Ralf Baechle To: linux-kernel@vger.kernel.org lib/Kconfig | 6 ++++++ lib/Makefile | 1 + lib/i8253-lock.c | 11 +++++++++++ 3 files changed, 18 insertions(+) Index: linux-i8253/lib/i8253-lock.c =================================================================== --- /dev/null +++ linux-i8253/lib/i8253-lock.c @@ -0,0 +1,11 @@ +#include +#include + +/* + * Protects access to I/O ports + * + * 0040-0043 : timer0, i8253 / i8254 + * 0061-0061 : NMI Control Register which contains two speaker control bits. + */ +DEFINE_RAW_SPINLOCK(i8253_lock); +EXPORT_SYMBOL(i8253_lock); Index: linux-i8253/lib/Makefile =================================================================== --- linux-i8253.orig/lib/Makefile +++ linux-i8253/lib/Makefile @@ -37,6 +37,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o +obj-$(CONFIG_I8253_LOCK) += i8253-lock.o lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o Index: linux-i8253/lib/Kconfig =================================================================== --- linux-i8253.orig/lib/Kconfig +++ linux-i8253/lib/Kconfig @@ -237,6 +237,12 @@ config CPU_RMAP bool depends on SMP +config I8253_LOCK + bool + help + Enable the shared lock for the i8253 PIT. Any system that uses + the i8253 should select this. + # # Netlink attribute parsing support is select'ed if needed #