[PATCH 0/2] irq_work: A couple fixes v2

2012-11-02 Thread Frederic Weisbecker
Hey, After some discussion with Steve, this is a respin with changelogs and comments sanitized. The code itself hasn't changed. Thanks. Frederic Weisbecker (2): irq_work: Fix racy IRQ_WORK_BUSY flag setting irq_work: Fix racy check on work pending flag kernel/irq_work.c | 21

Re: [PATCH 0/2] irq_work: A couple fixes

2012-10-30 Thread Frederic Weisbecker
2012/10/30 Steven Rostedt : > On Tue, 2012-10-30 at 17:25 +0100, Frederic Weisbecker wrote: > >> No I was worried about the cpu_relax() in irq_work_sync() > > That one is fine too, as this is the purpose of cpu_relax(). Not only to > relax the cpu, but also to tell gcc that the loop needs to be rer

Re: [PATCH 0/2] irq_work: A couple fixes

2012-10-30 Thread Steven Rostedt
On Tue, 2012-10-30 at 17:25 +0100, Frederic Weisbecker wrote: > No I was worried about the cpu_relax() in irq_work_sync() That one is fine too, as this is the purpose of cpu_relax(). Not only to relax the cpu, but also to tell gcc that the loop needs to be reread. -- Steve -- To unsubscribe fr

Re: [PATCH 0/2] irq_work: A couple fixes

2012-10-30 Thread Frederic Weisbecker
2012/10/30 Steven Rostedt : > On Tue, 2012-10-30 at 16:34 +0100, Frederic Weisbecker wrote: >> Hi, > >> And I still wonder if cpu_relax() is enough to prevent the compiler >> from correctly reloading work->flags in irq_work_sync() loop. >> Do we need ACCESS_ONCE()? > > You mean this loop: > >

Re: [PATCH 0/2] irq_work: A couple fixes

2012-10-30 Thread Steven Rostedt
On Tue, 2012-10-30 at 16:34 +0100, Frederic Weisbecker wrote: > Hi, > And I still wonder if cpu_relax() is enough to prevent the compiler > from correctly reloading work->flags in irq_work_sync() loop. > Do we need ACCESS_ONCE()? You mean this loop: flags = work->flags & ~IRQ_WORK_PENDING

[PATCH 0/2] irq_work: A couple fixes

2012-10-30 Thread Frederic Weisbecker
Hi, The first patch is extracted from my printk patches, with changelog reworked. The second patch is an addition. And I still wonder if cpu_relax() is enough to prevent the compiler from correctly reloading work->flags in irq_work_sync() loop. Do we need ACCESS_ONCE()? Thanks. Frederic Weisbec