lkml.org 
[lkml]   [2010]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] IPC driver for Intel Mobile Internet Device (MID) platforms
On Thu, 22 Apr 2010 14:16:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > > +static inline int busy_loop(void) /* Wait till scu status is busy */
> > > +{
> > > + u32 status = 0;
> > > + u32 loop_count = 0;
> > > +
> > > + status = __raw_readl(IPC_STATUS_REG);
> > > + while (status & 1) {
> > > + udelay(1); /* scu processing time is in few u secods */
> > > + status = __raw_readl(IPC_STATUS_REG);
> > > + loop_count++;
> > > + /* break if scu doesn't reset busy bit after huge retry */
> > > + if (loop_count > 100000)
> > > + return -ETIMEDOUT;
>
> > This function has seven-odd callsites and is waaaaaaaay to fat and slow
> > to be inlined.
>
> Looking at the asm I'm not convinced.

I tried two version of gcc and both of them just refuse to inline
the function anyway.

If the function is changed to __always_inline, gcc will then inline it.

text data bss dec hex filename
inline 6182 960 1680 8822 2276 arch/x86/kernel/intel_scu_ipc.o
__always_inline 6582 928 1760 9270 2436 arch/x86/kernel/intel_scu_ipc.o

I agree with gcc ;)


\
 
 \ /
  Last update: 2010-04-22 18:47    [W:0.243 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site