Re: cpu_relax in busy loops question

2012-02-02 Thread Daniel Lezcano
On 02/01/2012 09:17 PM, Linus Walleij wrote: On Wed, Feb 1, 2012 at 12:34 PM, Daniel Lezcano wrote: Hi Linus, While looking at the drivers/mfd/db8500-prcmu.c file I noticed: 595 /* Grab the HW semaphore. */ 596 while ((readl(PRCM_SEM)& PRCM_SEM_PRCM_SEM) != 0) 597

Re: cpu_relax in busy loops question

2012-02-01 Thread Linus Walleij
On Wed, Feb 1, 2012 at 12:34 PM, Daniel Lezcano wrote: > > Hi Linus, > > While looking at the drivers/mfd/db8500-prcmu.c file I noticed: > > >  595         /* Grab the HW semaphore. */ >  596         while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) >  597                 cpu_relax(); > > > I was

cpu_relax in busy loops question

2012-02-01 Thread Daniel Lezcano
Hi Linus, While looking at the drivers/mfd/db8500-prcmu.c file I noticed: 595 /* Grab the HW semaphore. */ 596 while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) 597 cpu_relax(); I was wondering why is cpu_relax needed here as readl does a memory barrier ?