History

irq_work: Convert flags to atomic_t

We need to convert flags to atomic_t in order to later fix an ordering issue on atomic_cmpxchg() failure. This will allow us to use atomic_fetch_or(). Also clarify the nature of those flags. [ mingo: Converted two more usage site the original patch missed. ]

Frederic Weisbecker committed 7 years ago

Commit 153bedb1 parent 31f4f5b5 files · +19 −15Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/irq_work.h+7−3
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #define IRQ_WORK_CLAIMED (IRQ_WORK_PENDING | IRQ_WORK_BUSY)
2323
2424 struct irq_work {
25− unsigned long flags;
25+ atomic_t flags;
2626 struct llist_node llnode;
2727 void (*func)(struct irq_work *);
2828 };
@@ -30,11 +30,15 @@ struct irq_work { · 1 unmodified line
3030 static inline
3131 void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
3232 {
33− work->flags = 0;
33+ atomic_set(&work->flags, 0);
3434 work->func = func;
3535 }
3636
37−#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
37+#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { \
38+ .flags = ATOMIC_INIT(0), \
39+ .func = (_f) \
40+}
41+
3842
3943 bool irq_work_queue(struct irq_work *work);
4044 bool irq_work_queue_on(struct irq_work *work, int cpu);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t