replace save_flags();cli(); with spin_lock_irqsave

replace save_flags();cli(); with spin_lock_irqsave

Post by pwaecht.. » Sun, 18 Aug 2002 03:30:10



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

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

replace save_flags();cli(); with spin_lock_irqsave

Post by Andre Hedric » Thu, 05 Sep 2002 13:50:04


well I have a few places where

save_flags();sti() is called.

# define save_and_sti(x)        local_irq_save_on(x)

This is totally funky but until it can we cleared out the annoying
ide__sti() thing is painful.


> 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

> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Andre Hedrick
LAD Storage Consulting Group

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Olympic - Janitor Remove save_flags/cli/restore_flags

applied to 2.4 and 2.5
--
Jeff Garzik      | "Why is it that attractive girls like you
Building 1024    |  always seem to have a boyfriend?"
MandrakeSoft     | "Because I'm a nympho that owns a brewery?"
                 |             - BBC TV show "Coupling"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Themes.org -- Linux/X goodies...

3. 8/11 sound/oss replace cli()

4. Binary file compitability

5. 4/11 sound/oss replace cli()

6. iplanet calendar server 5.0P3: csbackup failed

7. 7/11 sound/oss replace cli()

8. Dual monitor on Matrox G400 Dualhead

9. 9/11 sound/oss replace cli()

10. 3/11 sound/oss replace cli()

11. 1/11 sound/oss replace cli()

12. 11/11 sound/oss replace cli()

13. 10/11 sound/oss replace cli()