[RFD]replace save_flags();cli(); with spin_lock_irqsave

From: pwaechtler@mac.com
Date: Fri Aug 16 2002 - 13:27:12 EST


I have a large patch (>130KB) against 2.5.31 converting most of oss
sound drivers to
use spinlocks instead of cli() - so that they compile on SMP systems.

Most changes are trivial but I think some drivers are simply not SMP
safe. I hope I haven't
break any drivers. Since one can argue that OSS in the kernel gets
obsolete and there are
no maintainers for individual drivers I would prefer NOT to split the
patches for each
individual driver.

Some like the GUS driver and the dmabuf.c were more complicated - I had
to change the
locking a lot. Now if I grep through the kernel source with

/usr/src/linux-2.5.31:>find . -name "*.c"| xargs egrep 'cli[ \t]*\(\)' |
wc -l
    1838

Is the usage of cli() really obsolete? Will all occurences will be fixed
as stated in

/usr/src/linux-2.5.31/include/linux/interrupt.h
/*
  * Temporary defines for UP kernels, until all code gets fixed.
  */
#if !CONFIG_SMP
# define cli() local_irq_disable()
# define sti() local_irq_enable()
# define save_flags(x) local_irq_save(x)
# define restore_flags(x) local_irq_restore(x)
# define save_and_cli(x) local_irq_save_off(x)
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Aug 23 2002 - 22:00:12 EST