.. | .. |
---|
566 | 566 | asmlinkage void do_softirq(void); |
---|
567 | 567 | asmlinkage void __do_softirq(void); |
---|
568 | 568 | |
---|
569 | | -#if defined(__ARCH_HAS_DO_SOFTIRQ) && !defined(CONFIG_PREEMPT_RT) |
---|
| 569 | +#ifdef __ARCH_HAS_DO_SOFTIRQ |
---|
570 | 570 | void do_softirq_own_stack(void); |
---|
571 | 571 | #else |
---|
572 | 572 | static inline void do_softirq_own_stack(void) |
---|
.. | .. |
---|
661 | 661 | TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ |
---|
662 | 662 | }; |
---|
663 | 663 | |
---|
664 | | -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) |
---|
| 664 | +#ifdef CONFIG_SMP |
---|
665 | 665 | static inline int tasklet_trylock(struct tasklet_struct *t) |
---|
666 | 666 | { |
---|
667 | 667 | return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); |
---|
668 | 668 | } |
---|
669 | 669 | |
---|
670 | | -void tasklet_unlock(struct tasklet_struct *t); |
---|
671 | | -void tasklet_unlock_wait(struct tasklet_struct *t); |
---|
672 | | -void tasklet_unlock_spin_wait(struct tasklet_struct *t); |
---|
| 670 | +static inline void tasklet_unlock(struct tasklet_struct *t) |
---|
| 671 | +{ |
---|
| 672 | + smp_mb__before_atomic(); |
---|
| 673 | + clear_bit(TASKLET_STATE_RUN, &(t)->state); |
---|
| 674 | +} |
---|
673 | 675 | |
---|
| 676 | +static inline void tasklet_unlock_wait(struct tasklet_struct *t) |
---|
| 677 | +{ |
---|
| 678 | + while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } |
---|
| 679 | +} |
---|
674 | 680 | #else |
---|
675 | | -static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } |
---|
676 | | -static inline void tasklet_unlock(struct tasklet_struct *t) { } |
---|
677 | | -static inline void tasklet_unlock_wait(struct tasklet_struct *t) { } |
---|
678 | | -static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) { } |
---|
| 681 | +#define tasklet_trylock(t) 1 |
---|
| 682 | +#define tasklet_unlock_wait(t) do { } while (0) |
---|
| 683 | +#define tasklet_unlock(t) do { } while (0) |
---|
679 | 684 | #endif |
---|
680 | 685 | |
---|
681 | 686 | extern void __tasklet_schedule(struct tasklet_struct *t); |
---|
.. | .. |
---|
698 | 703 | { |
---|
699 | 704 | atomic_inc(&t->count); |
---|
700 | 705 | smp_mb__after_atomic(); |
---|
701 | | -} |
---|
702 | | - |
---|
703 | | -/* |
---|
704 | | - * Do not use in new code. Disabling tasklets from atomic contexts is |
---|
705 | | - * error prone and should be avoided. |
---|
706 | | - */ |
---|
707 | | -static inline void tasklet_disable_in_atomic(struct tasklet_struct *t) |
---|
708 | | -{ |
---|
709 | | - tasklet_disable_nosync(t); |
---|
710 | | - tasklet_unlock_spin_wait(t); |
---|
711 | | - smp_mb(); |
---|
712 | 706 | } |
---|
713 | 707 | |
---|
714 | 708 | static inline void tasklet_disable(struct tasklet_struct *t) |
---|