Re: enabling COMPILE_TEST support for GCC plugins in v4.11

2017-06-23 Thread Tony Breeds
On Fri, Jun 23, 2017 at 03:43:58PM +1000, Michael Ellerman wrote:
> [Old thread just popped up in my inbox]
> 
> Kees Cook  writes:
> > On Thu, Dec 8, 2016 at 5:52 PM, Paul Gortmaker
> >  wrote:
> >> On Thu, Dec 8, 2016 at 2:00 PM, Kees Cook  wrote:
> >>> Hi,
> >>>
> >>> I'd like to get the GCC plugins building under
> >>> allyesconfig/allmodconfig for -next soon (with the intention of
> >>> landing the change in v4.11). Specifically, I intend to revert
> >>> a519167e753e ("gcc-plugins: disable under COMPILE_TEST").
> >>
> >> If I recall correctly, I noted that the plugins broke the kernel.org
> >> cross compiler toolchains which led to the above disable.
> >
> > Do you mean these?
> > https://www.kernel.org/pub/tools/crosstool/
> 
> I think those are the ones Paul is talking about.
> 
> Those were mostly built by Tony, who is know, sadly, an Openstack
> developer and for some reason doesn't seem to have time to build
> toolchains for kernel hackers :P

Yeah sad but true.  Building a full suit took a couple of days and I'm
just not going to find that anytime soon.

I don't really want to build them one at a time but I could I suppose,
I'd play favotites x64_86, ppc64le and then the others if and when time
becomes an option.  My problem with that is it kinda defeats the aim on
why I put th etoolchains up there.  to enable testing accross the range
of architectures in a consistent way.

Another option would clearly be to find someone that is closer to the
kernel to do this thing.

Ho hum thoughts?

> As folks may have seen on LWN, there are now pre-built toolchains for
> many architectures available from the Free Electrons guys, so that may
> help to unblock this situation somewhat:
> 
> http://toolchains.free-electrons.com/

So ubuntu and Fedora each have cross toolschains in the distro and we
that those ^^.  Perhaps this no longer needs to be provided by the
kernel community?

Yours Tony.


signature.asc
Description: PGP signature


Re: enabling COMPILE_TEST support for GCC plugins in v4.11

2017-06-23 Thread Tony Breeds
On Fri, Jun 23, 2017 at 03:43:58PM +1000, Michael Ellerman wrote:
> [Old thread just popped up in my inbox]
> 
> Kees Cook  writes:
> > On Thu, Dec 8, 2016 at 5:52 PM, Paul Gortmaker
> >  wrote:
> >> On Thu, Dec 8, 2016 at 2:00 PM, Kees Cook  wrote:
> >>> Hi,
> >>>
> >>> I'd like to get the GCC plugins building under
> >>> allyesconfig/allmodconfig for -next soon (with the intention of
> >>> landing the change in v4.11). Specifically, I intend to revert
> >>> a519167e753e ("gcc-plugins: disable under COMPILE_TEST").
> >>
> >> If I recall correctly, I noted that the plugins broke the kernel.org
> >> cross compiler toolchains which led to the above disable.
> >
> > Do you mean these?
> > https://www.kernel.org/pub/tools/crosstool/
> 
> I think those are the ones Paul is talking about.
> 
> Those were mostly built by Tony, who is know, sadly, an Openstack
> developer and for some reason doesn't seem to have time to build
> toolchains for kernel hackers :P

Yeah sad but true.  Building a full suit took a couple of days and I'm
just not going to find that anytime soon.

I don't really want to build them one at a time but I could I suppose,
I'd play favotites x64_86, ppc64le and then the others if and when time
becomes an option.  My problem with that is it kinda defeats the aim on
why I put th etoolchains up there.  to enable testing accross the range
of architectures in a consistent way.

Another option would clearly be to find someone that is closer to the
kernel to do this thing.

Ho hum thoughts?

> As folks may have seen on LWN, there are now pre-built toolchains for
> many architectures available from the Free Electrons guys, so that may
> help to unblock this situation somewhat:
> 
> http://toolchains.free-electrons.com/

So ubuntu and Fedora each have cross toolschains in the distro and we
that those ^^.  Perhaps this no longer needs to be provided by the
kernel community?

Yours Tony.


signature.asc
Description: PGP signature


Re: crosstool builds - https://www.kernel.org/pub/tools/crosstool/

2016-05-23 Thread Tony Breeds
On Thu, May 19, 2016 at 11:48:39PM -0400, Jon Masters wrote:
> Hi Tony,
> 
> I'm wondering whether you know of anyone who has picked up where you
> left off, building cross toolchains for various and sundry alternative
> architectures? I wanted to download an IA64 compiler recently (really)
> and noticed that the most recent builds were against GCC 4.6.3.

Chris (on CC) is a co-worker (ish, it's complicated) that I've been nagging to
take over where I left off.

I'm sure there is a process for getting Chris access to the korg infrastructure
but in the mean time I'm *sure* he can fond somewhere to build them.

All my patches and scripts are public so go nuts :)

> Thanks in advance, and for making these before!

No problem it was fun, but (as happens in our community) I've changed focus and
can't make the time for them.

Yours Tony.


signature.asc
Description: PGP signature


Re: crosstool builds - https://www.kernel.org/pub/tools/crosstool/

2016-05-23 Thread Tony Breeds
On Thu, May 19, 2016 at 11:48:39PM -0400, Jon Masters wrote:
> Hi Tony,
> 
> I'm wondering whether you know of anyone who has picked up where you
> left off, building cross toolchains for various and sundry alternative
> architectures? I wanted to download an IA64 compiler recently (really)
> and noticed that the most recent builds were against GCC 4.6.3.

Chris (on CC) is a co-worker (ish, it's complicated) that I've been nagging to
take over where I left off.

I'm sure there is a process for getting Chris access to the korg infrastructure
but in the mean time I'm *sure* he can fond somewhere to build them.

All my patches and scripts are public so go nuts :)

> Thanks in advance, and for making these before!

No problem it was fun, but (as happens in our community) I've changed focus and
can't make the time for them.

Yours Tony.


signature.asc
Description: PGP signature


Re: [tip:timers/core] timekeeping: Fixup typo in update_vsyscall_old definition

2014-08-12 Thread Tony Breeds
On Tue, Aug 12, 2014 at 08:30:40AM -0700, John Stultz wrote:

> Thanks for pointing it out. I'll send a fix here shortly (though I only
> have the ppc64le toolchain handy, so forgive me if its not quite right).

/me pimps the kernel.org toolchains:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_powerpc64-linux.tar.xz

and gets back in his box.

Yours Tony


pgpu3TpovSj1r.pgp
Description: PGP signature


Re: [tip:timers/core] timekeeping: Fixup typo in update_vsyscall_old definition

2014-08-12 Thread Tony Breeds
On Tue, Aug 12, 2014 at 08:30:40AM -0700, John Stultz wrote:

 Thanks for pointing it out. I'll send a fix here shortly (though I only
 have the ppc64le toolchain handy, so forgive me if its not quite right).

/me pimps the kernel.org toolchains:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_powerpc64-linux.tar.xz

and gets back in his box.

Yours Tony


pgpu3TpovSj1r.pgp
Description: PGP signature


Re: [PATCH 3.2 153/200] powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly

2014-03-30 Thread Tony Breeds
On Mon, Mar 31, 2014 at 12:23:35AM +0100, Ben Hutchings wrote:
> 3.2.56-rc1 review patch.  If anyone has any objections, please let me know.

This patch doesn't need to go back beyond 3.10, so it's safe to drop
from your queue.

Thanks Ben.

Yours Tony


pgpWVFxHj6PTy.pgp
Description: PGP signature


Re: [PATCH 3.2 153/200] powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly

2014-03-30 Thread Tony Breeds
On Mon, Mar 31, 2014 at 12:23:35AM +0100, Ben Hutchings wrote:
 3.2.56-rc1 review patch.  If anyone has any objections, please let me know.

This patch doesn't need to go back beyond 3.10, so it's safe to drop
from your queue.

Thanks Ben.

Yours Tony


pgpWVFxHj6PTy.pgp
Description: PGP signature


Re: Linux kernel cross-compilers

2013-08-15 Thread Tony Breeds
On Thu, Aug 15, 2013 at 01:46:16PM +0400, Max Filippov wrote:
 
> Yes, xtensa compiler/linker is known to have issues with link-time
> relaxation; e.g. it may fail to build linux image without CONFIG_LD_NO_RELAX.

Is there something I can do at linker build time to help with this?

Yours Tony


pgpfaHO3TmWlK.pgp
Description: PGP signature


Re: Linux kernel cross-compilers

2013-08-15 Thread Tony Breeds
On Thu, Aug 15, 2013 at 02:07:05AM -0700, Guenter Roeck wrote:
> Hi Tony,
> 
> would it be possible to provide an arm64 cross-compiler on 
> https://www.kernel.org/pub/tools/crosstool/ ?

I have one built I just need to upload it.  I'll try and do it this
weekend.

> Also, the xtensa compiler fails for me with an odd error message on one of my 
> servers.
> Have you heard about any problems with it from others ?

Nope.  Sorry, but it looks like you're being looked after there.

> c6x is supposed to be supported by gcc now. No idea if that helps anything, 
> though.

Thanks.  I have tried to build a 4.8.1 cx6 toolchain but It hasn't
worked todate.  I'll keep trying as time permits.
> 
> Thanks,
> Guenter
> 

Yours Tony


pgpbYYVRdMEZ2.pgp
Description: PGP signature


Re: Linux kernel cross-compilers

2013-08-15 Thread Tony Breeds
On Thu, Aug 15, 2013 at 02:07:05AM -0700, Guenter Roeck wrote:
 Hi Tony,
 
 would it be possible to provide an arm64 cross-compiler on 
 https://www.kernel.org/pub/tools/crosstool/ ?

I have one built I just need to upload it.  I'll try and do it this
weekend.

 Also, the xtensa compiler fails for me with an odd error message on one of my 
 servers.
 Have you heard about any problems with it from others ?

Nope.  Sorry, but it looks like you're being looked after there.

 c6x is supposed to be supported by gcc now. No idea if that helps anything, 
 though.

Thanks.  I have tried to build a 4.8.1 cx6 toolchain but It hasn't
worked todate.  I'll keep trying as time permits.
 
 Thanks,
 Guenter
 

Yours Tony


pgpbYYVRdMEZ2.pgp
Description: PGP signature


Re: Linux kernel cross-compilers

2013-08-15 Thread Tony Breeds
On Thu, Aug 15, 2013 at 01:46:16PM +0400, Max Filippov wrote:
 
 Yes, xtensa compiler/linker is known to have issues with link-time
 relaxation; e.g. it may fail to build linux image without CONFIG_LD_NO_RELAX.

Is there something I can do at linker build time to help with this?

Yours Tony


pgpfaHO3TmWlK.pgp
Description: PGP signature


Re: [patch 02/34] arch: Consolidate tsk_is_polling()

2013-03-21 Thread Tony Breeds
On Thu, Mar 21, 2013 at 09:52:57PM -, Thomas Gleixner wrote:
 
> +/*
> + * Idle thread specific functions to determine the need_resched
> + * polling state. We have two versions, one based on TS_POLLING in
> + * thread_info.status and one based on TIF_POLLING_NRFLAG in
> + * thread_info.flags
> + */
> +#ifdef TS_POLLING
> +static inline int tsk_is_polling(struct task_struct *p)
> +{
> + return task_thread_info(p)->status & TS_POLLING;
> +}
> +#elif defined(TIF_POLLING_NRFLAG)
> +static inline int tsk_is_polling(struct task_struct *p)
> +{
> + test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
> +}

On powerpc (at least) this is used before it's declared.  Also I think
you're missing a 'return' in that function.

*cough* https://www.kernel.org/pub/tools/crosstool/ *cough*

Yours Tony


pgpVkdKEDNLIV.pgp
Description: PGP signature


Re: [patch 02/34] arch: Consolidate tsk_is_polling()

2013-03-21 Thread Tony Breeds
On Thu, Mar 21, 2013 at 09:52:57PM -, Thomas Gleixner wrote:

> Index: linux-2.6/arch/powerpc/include/asm/thread_info.h
> ===
> --- linux-2.6.orig/arch/powerpc/include/asm/thread_info.h
> +++ linux-2.6/arch/powerpc/include/asm/thread_info.h
> @@ -182,10 +182,6 @@ static inline bool test_thread_local_fla
>  #define is_32bit_task()  (1)
>  #endif
>  
> -#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
> -
> -#endif   /* !__ASSEMBLY__ */
> -

I think taking out this #endif is wrong.  probably wrong in the other
arches as well.
 

Yours Tony


pgpkvSfjKSD2S.pgp
Description: PGP signature


Re: [patch 02/34] arch: Consolidate tsk_is_polling()

2013-03-21 Thread Tony Breeds
On Thu, Mar 21, 2013 at 09:52:57PM -, Thomas Gleixner wrote:

 Index: linux-2.6/arch/powerpc/include/asm/thread_info.h
 ===
 --- linux-2.6.orig/arch/powerpc/include/asm/thread_info.h
 +++ linux-2.6/arch/powerpc/include/asm/thread_info.h
 @@ -182,10 +182,6 @@ static inline bool test_thread_local_fla
  #define is_32bit_task()  (1)
  #endif
  
 -#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
 -
 -#endif   /* !__ASSEMBLY__ */
 -

I think taking out this #endif is wrong.  probably wrong in the other
arches as well.
 

Yours Tony


pgpkvSfjKSD2S.pgp
Description: PGP signature


Re: [patch 02/34] arch: Consolidate tsk_is_polling()

2013-03-21 Thread Tony Breeds
On Thu, Mar 21, 2013 at 09:52:57PM -, Thomas Gleixner wrote:
 
 +/*
 + * Idle thread specific functions to determine the need_resched
 + * polling state. We have two versions, one based on TS_POLLING in
 + * thread_info.status and one based on TIF_POLLING_NRFLAG in
 + * thread_info.flags
 + */
 +#ifdef TS_POLLING
 +static inline int tsk_is_polling(struct task_struct *p)
 +{
 + return task_thread_info(p)-status  TS_POLLING;
 +}
 +#elif defined(TIF_POLLING_NRFLAG)
 +static inline int tsk_is_polling(struct task_struct *p)
 +{
 + test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
 +}

On powerpc (at least) this is used before it's declared.  Also I think
you're missing a 'return' in that function.

*cough* https://www.kernel.org/pub/tools/crosstool/ *cough*

Yours Tony


pgpVkdKEDNLIV.pgp
Description: PGP signature


Re: [Lguest] lguest breaks i386 allmodconfig

2008-02-23 Thread Tony Breeds
On Sat, Feb 23, 2008 at 11:32:35PM -0500, Jeff Garzik wrote:
> The following
> 
>   make ARCH=i386 allmodconfig && \
>   make ARCH=i386 -sj5
> 
> on x86-64 produces the following build breakage at the post-build stage:
> 
> [...]
> Root device is (9, 0)
> Setup is 12504 bytes (padded to 12800 bytes).
> System is 1883 kB
> Kernel: arch/x86/boot/bzImage is ready  (#2)
> ERROR: "LGUEST_PAGES_guest_gdt_desc" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_host_gdt_desc" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_host_cr3" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_regs" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_host_idt_desc" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_guest_gdt" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_host_sp" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_regs_trapnum" [drivers/lguest/lg.ko] undefined!
> ERROR: "LGUEST_PAGES_guest_idt_desc" [drivers/lguest/lg.ko] undefined!
> [...]

I suspect that the various patches in this thread
(http://marc.info/?t=12033930202) will fix this problem.
It's a matter of which on Linus takes, and when.

Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Lguest] lguest breaks i386 allmodconfig

2008-02-23 Thread Tony Breeds
On Sat, Feb 23, 2008 at 11:32:35PM -0500, Jeff Garzik wrote:
 The following
 
   make ARCH=i386 allmodconfig  \
   make ARCH=i386 -sj5
 
 on x86-64 produces the following build breakage at the post-build stage:
 
 [...]
 Root device is (9, 0)
 Setup is 12504 bytes (padded to 12800 bytes).
 System is 1883 kB
 Kernel: arch/x86/boot/bzImage is ready  (#2)
 ERROR: LGUEST_PAGES_guest_gdt_desc [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_host_gdt_desc [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_host_cr3 [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_regs [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_host_idt_desc [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_guest_gdt [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_host_sp [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_regs_trapnum [drivers/lguest/lg.ko] undefined!
 ERROR: LGUEST_PAGES_guest_idt_desc [drivers/lguest/lg.ko] undefined!
 [...]

I suspect that the various patches in this thread
(http://marc.info/?t=12033930202) will fix this problem.
It's a matter of which on Linus takes, and when.

Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix building lguest as module.

2008-02-21 Thread Tony Breeds
On Wed, Feb 20, 2008 at 11:01:40AM +0100, Ingo Molnar wrote:
> 
> * Tony Breeds <[EMAIL PROTECTED]> wrote:
> 
> > I've attached the .config FWIW
> 
> indeed you are right...
> 
> I fixed this build failure too - could you check whether x86.git#test 
> (which has all these lguest build fixes) works fine for you:
> 
>http://people.redhat.com/mingo/x86.git/README
> 
> ? Thanks,

Sure that works.  I'm not conviniced that your patch is right as it
treats gust and host support as the same thing.  Having said that we're
only talkign about a few constants, so I don't think it's worth anymore
time.  If it's not right it can be fixed later by those that know
better.

Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix building lguest as module.

2008-02-21 Thread Tony Breeds
On Wed, Feb 20, 2008 at 11:01:40AM +0100, Ingo Molnar wrote:
 
 * Tony Breeds [EMAIL PROTECTED] wrote:
 
  I've attached the .config FWIW
 
 indeed you are right...
 
 I fixed this build failure too - could you check whether x86.git#test 
 (which has all these lguest build fixes) works fine for you:
 
http://people.redhat.com/mingo/x86.git/README
 
 ? Thanks,

Sure that works.  I'm not conviniced that your patch is right as it
treats gust and host support as the same thing.  Having said that we're
only talkign about a few constants, so I don't think it's worth anymore
time.  If it's not right it can be fixed later by those that know
better.

Yours Tony

  linux.conf.auhttp://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix building lguest as module.

2008-02-19 Thread Tony Breeds
On Tue, Feb 19, 2008 at 02:54:01PM +0100, Ingo Molnar wrote:
> 
> * Ingo Molnar <[EMAIL PROTECTED]> wrote:
> 
> > > +#endif
> > > +
> > > +#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
> > > + BLANK();
> > 
> > hm. Rusty's original fix is now upstream. I've done a delta to your 
> > patch, find the fix is below.

Thanks!.
> 
> the right one is below. There's no 'LGUEST_MODULE' anymore - 
> 'LGUEST_GUEST' is what should be used.

Hmm okay I'm confused now.  LGUEST_GUEST is only set when you have guest
support enabled, but if you're only building the host module[1] then that wont
work.

Appologies if I've missed soemthing.

-=-=-=-=-=-=-=-=-=-=-=-
[EMAIL PROTECTED]:~/projects/kernel/working$ git describe
v2.6.25-rc2-103-gf702c58
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep LGUEST 
/scratch/tmp/include/linux/autoconf.h
#define CONFIG_LGUEST_MODULE 1
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep 'defined.*CONFIG_LGUEST' 
arch/x86/kernel/asm-offsets_32.c 
#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST)
[EMAIL PROTECTED]:~/projects/kernel/working$ make O=/scratch/tmp -s
  GEN /scratch/tmp/Makefile
  Using /home/tony/projects/kernel/working as source for kernel
WARNING: modpost: Found 33 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  UPD include/linux/compile.h
  Building modules, stage 2.
ERROR: "LGUEST_PAGES_guest_gdt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_gdt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_cr3" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_regs" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_idt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_guest_gdt" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_sp" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_regs_trapnum" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_guest_idt_desc" [drivers/lguest/lg.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: *** Waiting for unfinished jobs
Root device is (3, 3)
Setup is 11320 bytes (padded to 11776 bytes).
System is 2663 kB
Kernel: arch/x86/boot/bzImage is ready  (#17)
make: *** [sub-make] Error 2
-=-=-=-=-=-=-=-=-=-=-=-
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep LGUEST 
/scratch/tmp/include/linux/autoconf.h
#define CONFIG_LGUEST_MODULE 1
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep 'defined.*CONFIG_LGUEST' 
arch/x86/kernel/asm-offsets_32.c 
#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
[EMAIL PROTECTED]:~/projects/kernel/working$ make O=/scratch/tmp -s
  GEN /scratch/tmp/Makefile
  Using /home/tony/projects/kernel/working as source for kernel
WARNING: modpost: Found 33 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  UPD include/linux/compile.h
  Building modules, stage 2.
Root device is (3, 3)
Setup is 11320 bytes (padded to 11776 bytes).
System is 2663 kB
Kernel: arch/x86/boot/bzImage is ready  (#18)

I've attached the .config FWIW

[1] Somewhat strange I agree but valid none the less.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.25-rc2
# Wed Feb 20 09:28:15 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
# CONFIG_GENERIC_LOCKBREAK is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_QUICKLIST=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_DMI=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME_VSYSCALL is not set
CONFIG_ARCH_HAS_CPU_RELAX=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_X86_SMP=y
CONFIG_X86_32_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_X86_TRAMPOLINE=y
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""

Re: [PATCH] Fix building lguest as module.

2008-02-19 Thread Tony Breeds
On Tue, Feb 19, 2008 at 02:54:01PM +0100, Ingo Molnar wrote:
 
 * Ingo Molnar [EMAIL PROTECTED] wrote:
 
   +#endif
   +
   +#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
   + BLANK();
  
  hm. Rusty's original fix is now upstream. I've done a delta to your 
  patch, find the fix is below.

Thanks!.
 
 the right one is below. There's no 'LGUEST_MODULE' anymore - 
 'LGUEST_GUEST' is what should be used.

Hmm okay I'm confused now.  LGUEST_GUEST is only set when you have guest
support enabled, but if you're only building the host module[1] then that wont
work.

Appologies if I've missed soemthing.

-=-=-=-=-=-=-=-=-=-=-=-
[EMAIL PROTECTED]:~/projects/kernel/working$ git describe
v2.6.25-rc2-103-gf702c58
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep LGUEST 
/scratch/tmp/include/linux/autoconf.h
#define CONFIG_LGUEST_MODULE 1
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep 'defined.*CONFIG_LGUEST' 
arch/x86/kernel/asm-offsets_32.c 
#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST)
[EMAIL PROTECTED]:~/projects/kernel/working$ make O=/scratch/tmp -s
  GEN /scratch/tmp/Makefile
  Using /home/tony/projects/kernel/working as source for kernel
WARNING: modpost: Found 33 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  UPD include/linux/compile.h
  Building modules, stage 2.
ERROR: LGUEST_PAGES_guest_gdt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_gdt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_cr3 [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_regs [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_idt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_guest_gdt [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_sp [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_regs_trapnum [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_guest_idt_desc [drivers/lguest/lg.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: *** Waiting for unfinished jobs
Root device is (3, 3)
Setup is 11320 bytes (padded to 11776 bytes).
System is 2663 kB
Kernel: arch/x86/boot/bzImage is ready  (#17)
make: *** [sub-make] Error 2
-=-=-=-=-=-=-=-=-=-=-=-
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep LGUEST 
/scratch/tmp/include/linux/autoconf.h
#define CONFIG_LGUEST_MODULE 1
[EMAIL PROTECTED]:~/projects/kernel/working$ egrep 'defined.*CONFIG_LGUEST' 
arch/x86/kernel/asm-offsets_32.c 
#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
[EMAIL PROTECTED]:~/projects/kernel/working$ make O=/scratch/tmp -s
  GEN /scratch/tmp/Makefile
  Using /home/tony/projects/kernel/working as source for kernel
WARNING: modpost: Found 33 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  UPD include/linux/compile.h
  Building modules, stage 2.
Root device is (3, 3)
Setup is 11320 bytes (padded to 11776 bytes).
System is 2663 kB
Kernel: arch/x86/boot/bzImage is ready  (#18)

I've attached the .config FWIW

[1] Somewhat strange I agree but valid none the less.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.25-rc2
# Wed Feb 20 09:28:15 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
# CONFIG_GENERIC_LOCKBREAK is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_QUICKLIST=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_DMI=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME_VSYSCALL is not set
CONFIG_ARCH_HAS_CPU_RELAX=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_X86_SMP=y
CONFIG_X86_32_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_X86_TRAMPOLINE=y
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y

[PATCH] Fix building lguest as module.

2008-02-18 Thread Tony Breeds
On Mon, Feb 04, 2008 at 07:11:10AM +1100, Rusty Russell wrote:
 
> Lguest guest support and host support are separate config options: they used
> to be tied together.  Sort out which parts of asm-offsets are needed for Guest
> and Host.

 With rusty's patch applied the errors still persist in some
configs.  Please try  the patch below.

Fixes the following errors from modpost when the lguest (host) support is
modular.

ERROR: "LGUEST_PAGES_guest_gdt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_gdt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_cr3" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_regs" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_idt_desc" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_guest_gdt" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_host_sp" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_regs_trapnum" [drivers/lguest/lg.ko] undefined!
ERROR: "LGUEST_PAGES_guest_idt_desc" [drivers/lguest/lg.ko] undefined!

Lguest guest support and host support are separate config options: they used
to be tied together.  Sort out which parts of asm-offsets are needed for Guest
and Host.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

Original patch from rusty (http://lkml.org/lkml/2008/2/3/168) didn't completely
fix the problem.  I think this matches the original intent.

Not sure of the right way to attribute this patch, clearlyt it's mostly
Rusty's work.

 arch/x86/kernel/asm-offsets_32.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index afd8446..ae9d289 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -20,10 +20,8 @@
 
 #include 
 
-#ifdef CONFIG_LGUEST_GUEST
 #include 
 #include "../../../drivers/lguest/lg.h"
-#endif
 
 #define DEFINE(sym, val) \
 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -134,6 +132,10 @@ void foo(void)
BLANK();
OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);
OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);
+#endif
+
+#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
+   BLANK();
OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);
OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);
OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3);
-- 
1.5.4.1




Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix building lguest as module.

2008-02-18 Thread Tony Breeds
On Mon, Feb 04, 2008 at 07:11:10AM +1100, Rusty Russell wrote:
 
 Lguest guest support and host support are separate config options: they used
 to be tied together.  Sort out which parts of asm-offsets are needed for Guest
 and Host.

snip With rusty's patch applied the errors still persist in some
configs.  Please try  the patch below.

Fixes the following errors from modpost when the lguest (host) support is
modular.

ERROR: LGUEST_PAGES_guest_gdt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_gdt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_cr3 [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_regs [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_idt_desc [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_guest_gdt [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_host_sp [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_regs_trapnum [drivers/lguest/lg.ko] undefined!
ERROR: LGUEST_PAGES_guest_idt_desc [drivers/lguest/lg.ko] undefined!

Lguest guest support and host support are separate config options: they used
to be tied together.  Sort out which parts of asm-offsets are needed for Guest
and Host.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---

Original patch from rusty (http://lkml.org/lkml/2008/2/3/168) didn't completely
fix the problem.  I think this matches the original intent.

Not sure of the right way to attribute this patch, clearlyt it's mostly
Rusty's work.

 arch/x86/kernel/asm-offsets_32.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index afd8446..ae9d289 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -20,10 +20,8 @@
 
 #include xen/interface/xen.h
 
-#ifdef CONFIG_LGUEST_GUEST
 #include linux/lguest.h
 #include ../../../drivers/lguest/lg.h
-#endif
 
 #define DEFINE(sym, val) \
 asm volatile(\n- #sym  %0  #val : : i (val))
@@ -134,6 +132,10 @@ void foo(void)
BLANK();
OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);
OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);
+#endif
+
+#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_MODULE)
+   BLANK();
OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);
OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);
OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3);
-- 
1.5.4.1




Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next build status

2008-02-14 Thread Tony Breeds
On Thu, Feb 14, 2008 at 08:24:27PM -0500, Chris Snook wrote:
> Stephen Rothwell wrote:
> >Hi all,
> >
> >Initial status can be seen here
> >http://kisskb.ellerman.id.au/kisskb/branch/9/ (I hope to make a better
> >URL soon).  Suggestions for more compiler/config combinations are
> >welcome, but we can't necessarily commit to fulfilling all you
> >wishes.  :-)
> >
> 
> i386 allmodconfig please.

Wont i386 allmodconfig be equivalent to x86_64 allmodconfig?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next build status

2008-02-14 Thread Tony Breeds
On Thu, Feb 14, 2008 at 08:24:27PM -0500, Chris Snook wrote:
 Stephen Rothwell wrote:
 Hi all,
 
 Initial status can be seen here
 http://kisskb.ellerman.id.au/kisskb/branch/9/ (I hope to make a better
 URL soon).  Suggestions for more compiler/config combinations are
 welcome, but we can't necessarily commit to fulfilling all you
 wishes.  :-)
 
 
 i386 allmodconfig please.

Wont i386 allmodconfig be equivalent to x86_64 allmodconfig?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: build #345 issue for v2.6.25-rc1 in tuner-core.c

2008-02-11 Thread Tony Breeds
On Mon, Feb 11, 2008 at 11:54:31AM +0100, Toralf Förster wrote:
> 
> Hello,
> 
> the build with the attached .config failed, make ending with:
> ...
>   MODPOST vmlinux.o
> WARNING: modpost: Found 12 section mismatch(es).
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
>   GEN .version
>   CHK include/linux/compile.h
>   UPD include/linux/compile.h
>   CC  init/version.o
>   LD  init/built-in.o
>   LD  .tmp_vmlinux1
> drivers/built-in.o: In function `set_type':
> tuner-core.c:(.text+0x8879d): undefined reference to `xc5000_attach'
> make: *** [.tmp_vmlinux1] Error 1


Fix Build error for xc5000 tuner when built as module.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
Not 100% certain this is correct but it works for me :) Michael?

 drivers/media/dvb/frontends/xc5000.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/xc5000.h 
b/drivers/media/dvb/frontends/xc5000.h
index e0e8456..32a5f1c 100644
--- a/drivers/media/dvb/frontends/xc5000.h
+++ b/drivers/media/dvb/frontends/xc5000.h
@@ -45,7 +45,8 @@ struct xc5000_config {
 /* xc5000 callback command */
 #define XC5000_TUNER_RESET 0
 
-#if defined(CONFIG_DVB_TUNER_XC5000) || defined(CONFIG_DVB_TUNER_XC5000_MODULE)
+#if defined(CONFIG_DVB_TUNER_XC5000) || \
+(defined(CONFIG_DVB_TUNER_XC5000_MODULE) && defined(MODULE))
 extern struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
  struct i2c_adapter *i2c,
  struct xc5000_config *cfg);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: build #345 issue for v2.6.25-rc1 in tuner-core.c

2008-02-11 Thread Tony Breeds
On Mon, Feb 11, 2008 at 11:54:31AM +0100, Toralf Förster wrote:
 
 Hello,
 
 the build with the attached .config failed, make ending with:
 ...
   MODPOST vmlinux.o
 WARNING: modpost: Found 12 section mismatch(es).
 To see full details build your kernel with:
 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
   GEN .version
   CHK include/linux/compile.h
   UPD include/linux/compile.h
   CC  init/version.o
   LD  init/built-in.o
   LD  .tmp_vmlinux1
 drivers/built-in.o: In function `set_type':
 tuner-core.c:(.text+0x8879d): undefined reference to `xc5000_attach'
 make: *** [.tmp_vmlinux1] Error 1

snip
Fix Build error for xc5000 tuner when built as module.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
Not 100% certain this is correct but it works for me :) Michael?

 drivers/media/dvb/frontends/xc5000.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/xc5000.h 
b/drivers/media/dvb/frontends/xc5000.h
index e0e8456..32a5f1c 100644
--- a/drivers/media/dvb/frontends/xc5000.h
+++ b/drivers/media/dvb/frontends/xc5000.h
@@ -45,7 +45,8 @@ struct xc5000_config {
 /* xc5000 callback command */
 #define XC5000_TUNER_RESET 0
 
-#if defined(CONFIG_DVB_TUNER_XC5000) || defined(CONFIG_DVB_TUNER_XC5000_MODULE)
+#if defined(CONFIG_DVB_TUNER_XC5000) || \
+(defined(CONFIG_DVB_TUNER_XC5000_MODULE)  defined(MODULE))
 extern struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
  struct i2c_adapter *i2c,
  struct xc5000_config *cfg);
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix powerpc vdso clock_getres().

2008-02-06 Thread Tony Breeds
Since implementing highres timers on powerpc the clock_getres syscall
has reported different resolutions due to the vdso using the a low res
value.  In the patch d7f71674ad7c3c4467e48f6ab9e85516dae2720 
([POWERPC] Use a sensible default for clock_getres() in the VDSO), the
powerpc vdso was updated to use the correct value.

This fix doesn't work on older compilers.  Below is a fix for powerpc,
that introduces a new (generic) #define MONOTONIC_RES_NSEC which is
equal to the 64 value stored in KTIME_MONOTONIC_RES.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

Thomas, If this is okay with you can it go through Paul's tree?

 arch/powerpc/kernel/asm-offsets.c |2 +-
 include/linux/hrtimer.h   |5 -
 include/linux/ktime.h |3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/asm-offsets.c 
b/arch/powerpc/kernel/asm-offsets.c
index e6e4928..4b749c4 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -313,7 +313,7 @@ int main(void)
DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
-   DEFINE(CLOCK_REALTIME_RES, (KTIME_MONOTONIC_RES).tv64);
+   DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
 
 #ifdef CONFIG_BUG
DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 7a9398e..8dba081 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -223,11 +223,14 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer 
*timer)
  * idea of the (in)accuracy of timers. Timer values are rounded up to
  * this resolution values.
  */
-# define KTIME_HIGH_RES(ktime_t) { .tv64 = 1 }
+# define HIGH_RES_NSEC 1
+# define KTIME_HIGH_RES(ktime_t) { .tv64 = HIGH_RES_NSEC }
+# define MONOTONIC_RES_NSECHIGH_RES_NSEC
 # define KTIME_MONOTONIC_RES   KTIME_HIGH_RES
 
 #else
 
+# define MONOTONIC_RES_NSECLOW_RES_NSEC
 # define KTIME_MONOTONIC_RES   KTIME_LOW_RES
 
 /*
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index a6ddec1..36c542b 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -316,7 +316,8 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const 
u64 usec)
  * idea of the (in)accuracy of timers. Timer values are rounded up to
  * this resolution values.
  */
-#define KTIME_LOW_RES  (ktime_t){ .tv64 = TICK_NSEC }
+#define LOW_RES_NSEC   TICK_NSEC
+#define KTIME_LOW_RES  (ktime_t){ .tv64 = LOW_RES_NSEC }
 
 /* Get the monotonic time in timespec format: */
 extern void ktime_get_ts(struct timespec *ts);


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [POWERPC] Use a sensible default for clock_getres() in the vdso.

2008-02-04 Thread Tony Breeds
On Sun, Jan 27, 2008 at 07:32:59PM +0530, Sripathi Kodi wrote:
> Hi Paul,
> 
> On PPC, I see a disparity between clock_getres implementations in the
> vdso and syscall. I am using a IBM Openpower hardware and 2.6.24 kernel
> with CONFIG_HIGH_RES_TIMERS=y. 
> 
> clock_getres call for CLOCK_REALTIME returns 1 millisecond. However,
> when I edit arch/powerpc/kernel/vdso*/gettimeofday.S to force it to use 
> sys_clock_getres, I get 1 nanosecond resolution. The code in vdso seems
> to be returning some pre-defined (incorrect) variables.
> 
> Could you please let me know the reason for this? Is it something that
> should be fixed in vdso?

Can you try the attached patch and see it if works for you?

From: Tony Breeds <[EMAIL PROTECTED]>
Subject: [PATCH] [POWERPC] Use a sensible default for clock_getres() in the 
vdso.

This ensures that the syscall and the (fast) vdso versions of clock_getres()
will return the same resolution.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/asm-offsets.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/asm-offsets.c 
b/arch/powerpc/kernel/asm-offsets.c
index ed083fe..e6e4928 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #ifdef CONFIG_PPC64
 #include 
 #include 
@@ -312,7 +313,7 @@ int main(void)
DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
-   DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
+   DEFINE(CLOCK_REALTIME_RES, (KTIME_MONOTONIC_RES).tv64);
 
 #ifdef CONFIG_BUG
DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
-- 
1.5.4


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [POWERPC] Use a sensible default for clock_getres() in the vdso.

2008-02-04 Thread Tony Breeds
On Sun, Jan 27, 2008 at 07:32:59PM +0530, Sripathi Kodi wrote:
 Hi Paul,
 
 On PPC, I see a disparity between clock_getres implementations in the
 vdso and syscall. I am using a IBM Openpower hardware and 2.6.24 kernel
 with CONFIG_HIGH_RES_TIMERS=y. 
 
 clock_getres call for CLOCK_REALTIME returns 1 millisecond. However,
 when I edit arch/powerpc/kernel/vdso*/gettimeofday.S to force it to use 
 sys_clock_getres, I get 1 nanosecond resolution. The code in vdso seems
 to be returning some pre-defined (incorrect) variables.
 
 Could you please let me know the reason for this? Is it something that
 should be fixed in vdso?

Can you try the attached patch and see it if works for you?

From: Tony Breeds [EMAIL PROTECTED]
Subject: [PATCH] [POWERPC] Use a sensible default for clock_getres() in the 
vdso.

This ensures that the syscall and the (fast) vdso versions of clock_getres()
will return the same resolution.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---
 arch/powerpc/kernel/asm-offsets.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/asm-offsets.c 
b/arch/powerpc/kernel/asm-offsets.c
index ed083fe..e6e4928 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -22,6 +22,7 @@
 #include linux/mman.h
 #include linux/mm.h
 #include linux/suspend.h
+#include linux/hrtimer.h
 #ifdef CONFIG_PPC64
 #include linux/time.h
 #include linux/hardirq.h
@@ -312,7 +313,7 @@ int main(void)
DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
-   DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
+   DEFINE(CLOCK_REALTIME_RES, (KTIME_MONOTONIC_RES).tv64);
 
 #ifdef CONFIG_BUG
DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
-- 
1.5.4


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ppc] Disparity between sys_clock_getres and vdso implementation

2008-02-03 Thread Tony Breeds
On Sun, Jan 27, 2008 at 07:32:59PM +0530, Sripathi Kodi wrote:
> Hi Paul,
> 
> On PPC, I see a disparity between clock_getres implementations in the
> vdso and syscall. I am using a IBM Openpower hardware and 2.6.24 kernel
> with CONFIG_HIGH_RES_TIMERS=y. 
> 
> clock_getres call for CLOCK_REALTIME returns 1 millisecond. However,
> when I edit arch/powerpc/kernel/vdso*/gettimeofday.S to force it to use 
> sys_clock_getres, I get 1 nanosecond resolution. The code in vdso seems
> to be returning some pre-defined (incorrect) variables.
> 
> Could you please let me know the reason for this? Is it something that
> should be fixed in vdso?

Almost certainly It's something I missed when I enabled highres timers
on powerpc.

I'll fix this tomorrow.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ppc] Disparity between sys_clock_getres and vdso implementation

2008-02-03 Thread Tony Breeds
On Sun, Jan 27, 2008 at 07:32:59PM +0530, Sripathi Kodi wrote:
 Hi Paul,
 
 On PPC, I see a disparity between clock_getres implementations in the
 vdso and syscall. I am using a IBM Openpower hardware and 2.6.24 kernel
 with CONFIG_HIGH_RES_TIMERS=y. 
 
 clock_getres call for CLOCK_REALTIME returns 1 millisecond. However,
 when I edit arch/powerpc/kernel/vdso*/gettimeofday.S to force it to use 
 sys_clock_getres, I get 1 nanosecond resolution. The code in vdso seems
 to be returning some pre-defined (incorrect) variables.
 
 Could you please let me know the reason for this? Is it something that
 should be fixed in vdso?

Almost certainly It's something I missed when I enabled highres timers
on powerpc.

I'll fix this tomorrow.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] Fix hardware IRQ time accounting problem.

2007-12-03 Thread Tony Breeds
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275 (sched: restore
deterministic CPU accounting on powerpc), unconditionally calls
update_process_tick() in system context.  In the deterministic accounting case
this is the correct thing to do.  However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as hardware irq
time being artificially elevated.

Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into one for neatness.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
The problem was seen and reported by Johannes Berg  and Frederik Himpe.
Paul, I think this is good for 2.6.24.

Changes since v1:
 - I noticed that the #define was explictly using "current" rather than
   the task passed in.  Using tsk is the right thing to do.
 - The whiteapce changes dirty-up the patch and are un-needed with the
   change above.

 arch/powerpc/kernel/process.c |2 +-
 include/asm-powerpc/time.h|8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
 
account_system_vtime(current);
-   account_process_tick(current, 0);
+   account_process_vtime(current);
calculate_steal_time();
 
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..a7281e0 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
 
 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
 
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING)
 extern void calculate_steal_time(void);
 extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(tsk, 0);
 #else
 #define calculate_steal_time() do { } while (0)
 #define snapshot_timebases()   do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
 #endif
 
 extern void secondary_cpu_time_init(void);
-- 
1.5.3.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix hardware IRQ time accounting problem.

2007-12-03 Thread Tony Breeds
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275, unconditionally calls
update_process_tick() in system context.  In the deterministic accounting case
this is the correct thing to do.  However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as
hardware irq time being artificially elevated.

Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into for neatness.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
The problem was seen and reported by Johannes Berg  and Frederik Himpe.
Paul, I think this is good for 2.6.24.


 arch/powerpc/kernel/process.c |2 +-
 include/asm-powerpc/time.h|   12 
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
 
account_system_vtime(current);
-   account_process_tick(current, 0);
+   account_process_vtime(current);
calculate_steal_time();
 
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..8a2c8db 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
 
 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
 
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING)
 extern void calculate_steal_time(void);
 extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(current, 0);
 #else
-#define calculate_steal_time() do { } while (0)
-#define snapshot_timebases()   do { } while (0)
+#define calculate_steal_time() do { } while (0)
+#define snapshot_timebases()   do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
 #endif
 
 extern void secondary_cpu_time_init(void);
-- 
1.5.3.6


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix hardware IRQ time accounting problem.

2007-12-03 Thread Tony Breeds
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275, unconditionally calls
update_process_tick() in system context.  In the deterministic accounting case
this is the correct thing to do.  However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as
hardware irq time being artificially elevated.

Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into for neatness.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---
The problem was seen and reported by Johannes Berg  and Frederik Himpe.
Paul, I think this is good for 2.6.24.


 arch/powerpc/kernel/process.c |2 +-
 include/asm-powerpc/time.h|   12 
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
 
account_system_vtime(current);
-   account_process_tick(current, 0);
+   account_process_vtime(current);
calculate_steal_time();
 
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..8a2c8db 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
 
 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
 
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING)
 extern void calculate_steal_time(void);
 extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(current, 0);
 #else
-#define calculate_steal_time() do { } while (0)
-#define snapshot_timebases()   do { } while (0)
+#define calculate_steal_time() do { } while (0)
+#define snapshot_timebases()   do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
 #endif
 
 extern void secondary_cpu_time_init(void);
-- 
1.5.3.6


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] Fix hardware IRQ time accounting problem.

2007-12-03 Thread Tony Breeds
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275 (sched: restore
deterministic CPU accounting on powerpc), unconditionally calls
update_process_tick() in system context.  In the deterministic accounting case
this is the correct thing to do.  However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as hardware irq
time being artificially elevated.

Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into one for neatness.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---
The problem was seen and reported by Johannes Berg  and Frederik Himpe.
Paul, I think this is good for 2.6.24.

Changes since v1:
 - I noticed that the #define was explictly using current rather than
   the task passed in.  Using tsk is the right thing to do.
 - The whiteapce changes dirty-up the patch and are un-needed with the
   change above.

 arch/powerpc/kernel/process.c |2 +-
 include/asm-powerpc/time.h|8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
 
account_system_vtime(current);
-   account_process_tick(current, 0);
+   account_process_vtime(current);
calculate_steal_time();
 
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..a7281e0 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
 
 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
 
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING)
 extern void calculate_steal_time(void);
 extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(tsk, 0);
 #else
 #define calculate_steal_time() do { } while (0)
 #define snapshot_timebases()   do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
 #endif
 
 extern void secondary_cpu_time_init(void);
-- 
1.5.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.24-rc3-git3: usb hardware interrupts using 25% of CPU time

2007-11-28 Thread Tony Breeds
On Wed, Nov 28, 2007 at 10:33:18PM +, Frederik Himpe wrote:

> I installed Linux 2.6.24-rc3-git3 on a PPC based Apple Powerbook G4 
> system. Now with top I see that over 20% of CPU time is used by hardware 
> interrupts. Looking at /proc/interrupts, the number in the row 
> ohci_hcd:usb1 is rising very quickly:

Hi Frederik,
Thanks for the report.  We suspect that this is an accounting
problem introduced when powerpc enabled NO_HZ and highres timers.
Fortunatley from the testing we've done it doens't actually look like
the time is being spent in hardware interupts, just accounted for there.
 
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.24-rc3-git3: usb hardware interrupts using 25% of CPU time

2007-11-28 Thread Tony Breeds
On Wed, Nov 28, 2007 at 10:33:18PM +, Frederik Himpe wrote:

 I installed Linux 2.6.24-rc3-git3 on a PPC based Apple Powerbook G4 
 system. Now with top I see that over 20% of CPU time is used by hardware 
 interrupts. Looking at /proc/interrupts, the number in the row 
 ohci_hcd:usb1 is rising very quickly:

Hi Frederik,
Thanks for the report.  We suspect that this is an accounting
problem introduced when powerpc enabled NO_HZ and highres timers.
Fortunatley from the testing we've done it doens't actually look like
the time is being spent in hardware interupts, just accounted for there.
 
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: time accounting problem (powerpc only?)

2007-11-26 Thread Tony Breeds
On Mon, Nov 26, 2007 at 05:23:13PM +0100, Johannes Berg wrote:
> Contrary to what I claimed later in the thread, my 64-bit powerpc box
> (quad-core G5) doesn't suffer from this problem.
> 
> Does anybody have any idea? I don't even know how to debug it further.

I'll see if I can grab an appropriate machine tomorrow and have a look at
it.  I think it's just an accounting bug, which is probably my fault :)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: mm snapshot broken-out-2007-11-20-01-45 Build Fail - net/wireless driver

2007-11-26 Thread Tony Breeds
On Tue, Nov 20, 2007 at 06:53:15PM +0530, Kamalesh Babulal wrote:
> Hi Andrew,
> 
> The kernel build fails, with following message
> 
>   LD  drivers/net/wireless/built-in.o
> drivers/net/wireless/rtl8187.o: In function `rtl8225z2_rf_init':
> (.opd+0x180): multiple definition of `rtl8225z2_rf_init'
> drivers/net/wireless/rtl8180.o:(.opd+0x1b0): first defined here
> drivers/net/wireless/rtl8187.o: In function `rtl8225z2_rf_init':
> /root/linux-2.6.24-rc3/drivers/net/wireless/rtl8187_rtl8225.c:571: multiple 
> definition of `.rtl8225z2_rf_init'
> drivers/net/wireless/rtl8180.o:/root/linux-2.6.24-rc3/drivers/net/wireless/rtl8180_rtl8225.c:561:
>  first defined here
> ld: Warning: size of symbol `.rtl8225z2_rf_init' changed from 3836 in 
> drivers/net/wireless/rtl8180.o to 3544 in drivers/net/wireless/rtl8187.o



The patch below is a little ugly but will allow allyesconfig to work.  I
don't know enough about the Realtek devices to make intellegent
suggestions on how to fix this particular problem.  Clearly the 2
drivers share a lot of common code so perhaps they can be merged?

I assumed that the RTL8180, is still somewhat WiP based on the commit
message for a2645795713c4374ff2efda960251cdc30b63430 (wireless-2.6.git).

Appologies for the uber long CC line, wasn't sure who can be pruned.

From: Tony Breeds <[EMAIL PROTECTED]>

Temporarily ensure that Realtek 8185 and 8187 aren't compiled together.

These two drivers share a number of common (global) functions.  While RTL8180
is still being worked on ensure that it's not built together with the RTL8187
(ie allyseconfig).

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 drivers/net/wireless/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 82e5de7..ab2eac0 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -555,6 +555,7 @@ config USB_ZD1201
 config RTL8180
tristate "Realtek 8185 PCI support"
depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL
+   depends on !RTL8187
select EEPROM_93CX6
 
 config RTL8187

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: mm snapshot broken-out-2007-11-20-01-45 Build Fail - net/wireless driver

2007-11-26 Thread Tony Breeds
On Tue, Nov 20, 2007 at 06:53:15PM +0530, Kamalesh Babulal wrote:
 Hi Andrew,
 
 The kernel build fails, with following message
 
   LD  drivers/net/wireless/built-in.o
 drivers/net/wireless/rtl8187.o: In function `rtl8225z2_rf_init':
 (.opd+0x180): multiple definition of `rtl8225z2_rf_init'
 drivers/net/wireless/rtl8180.o:(.opd+0x1b0): first defined here
 drivers/net/wireless/rtl8187.o: In function `rtl8225z2_rf_init':
 /root/linux-2.6.24-rc3/drivers/net/wireless/rtl8187_rtl8225.c:571: multiple 
 definition of `.rtl8225z2_rf_init'
 drivers/net/wireless/rtl8180.o:/root/linux-2.6.24-rc3/drivers/net/wireless/rtl8180_rtl8225.c:561:
  first defined here
 ld: Warning: size of symbol `.rtl8225z2_rf_init' changed from 3836 in 
 drivers/net/wireless/rtl8180.o to 3544 in drivers/net/wireless/rtl8187.o

snip

The patch below is a little ugly but will allow allyesconfig to work.  I
don't know enough about the Realtek devices to make intellegent
suggestions on how to fix this particular problem.  Clearly the 2
drivers share a lot of common code so perhaps they can be merged?

I assumed that the RTL8180, is still somewhat WiP based on the commit
message for a2645795713c4374ff2efda960251cdc30b63430 (wireless-2.6.git).

Appologies for the uber long CC line, wasn't sure who can be pruned.

From: Tony Breeds [EMAIL PROTECTED]

Temporarily ensure that Realtek 8185 and 8187 aren't compiled together.

These two drivers share a number of common (global) functions.  While RTL8180
is still being worked on ensure that it's not built together with the RTL8187
(ie allyseconfig).

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 drivers/net/wireless/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 82e5de7..ab2eac0 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -555,6 +555,7 @@ config USB_ZD1201
 config RTL8180
tristate Realtek 8185 PCI support
depends on MAC80211  PCI  WLAN_80211  EXPERIMENTAL
+   depends on !RTL8187
select EEPROM_93CX6
 
 config RTL8187

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: time accounting problem (powerpc only?)

2007-11-26 Thread Tony Breeds
On Mon, Nov 26, 2007 at 05:23:13PM +0100, Johannes Berg wrote:
 Contrary to what I claimed later in the thread, my 64-bit powerpc box
 (quad-core G5) doesn't suffer from this problem.
 
 Does anybody have any idea? I don't even know how to debug it further.

I'll see if I can grab an appropriate machine tomorrow and have a look at
it.  I think it's just an accounting bug, which is probably my fault :)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix build failure when CONFIG_INFINIBAND_IPOIB_CM is not defined.

2007-11-13 Thread Tony Breeds
Fixes:
  CC [M]  drivers/infiniband/ulp/ipoib/ipoib_main.o
drivers/infiniband/ulp/ipoib/ipoib_main.c: In function ‘ipoib_init_module’:
drivers/infiniband/ulp/ipoib/ipoib_main.c:1269: error: invalid lvalue in 
assignment

In the case where CONFIG_INFINIBAND_IPOIB_CM is not defined ipoib_max_conn_qp 
is #defined to 0.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 drivers/infiniband/ulp/ipoib/ipoib_main.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c 
b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 623458e..aeb5a01 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1265,8 +1265,9 @@ static int __init ipoib_init_module(void)
ipoib_sendq_size = roundup_pow_of_two(ipoib_sendq_size);
ipoib_sendq_size = min(ipoib_sendq_size, IPOIB_MAX_QUEUE_SIZE);
ipoib_sendq_size = max(ipoib_sendq_size, IPOIB_MIN_QUEUE_SIZE);
-
+#ifdef CONFIG_INFINIBAND_IPOIB_CM
ipoib_max_conn_qp = min(ipoib_max_conn_qp, IPOIB_CM_MAX_CONN_QP);
+#endif
 
ret = ipoib_register_debugfs();
if (ret)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix build failure when CONFIG_INFINIBAND_IPOIB_CM is not defined.

2007-11-13 Thread Tony Breeds
Fixes:
  CC [M]  drivers/infiniband/ulp/ipoib/ipoib_main.o
drivers/infiniband/ulp/ipoib/ipoib_main.c: In function ‘ipoib_init_module’:
drivers/infiniband/ulp/ipoib/ipoib_main.c:1269: error: invalid lvalue in 
assignment

In the case where CONFIG_INFINIBAND_IPOIB_CM is not defined ipoib_max_conn_qp 
is #defined to 0.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 drivers/infiniband/ulp/ipoib/ipoib_main.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c 
b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 623458e..aeb5a01 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1265,8 +1265,9 @@ static int __init ipoib_init_module(void)
ipoib_sendq_size = roundup_pow_of_two(ipoib_sendq_size);
ipoib_sendq_size = min(ipoib_sendq_size, IPOIB_MAX_QUEUE_SIZE);
ipoib_sendq_size = max(ipoib_sendq_size, IPOIB_MIN_QUEUE_SIZE);
-
+#ifdef CONFIG_INFINIBAND_IPOIB_CM
ipoib_max_conn_qp = min(ipoib_max_conn_qp, IPOIB_CM_MAX_CONN_QP);
+#endif
 
ret = ipoib_register_debugfs();
if (ret)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: mm snapshot broken-out-2007-11-06-02-32 build failure - !CONFIG_PPC_ISERIES

2007-11-07 Thread Tony Breeds
On Thu, Nov 08, 2007 at 02:27:07AM +0530, Kamalesh Babulal wrote:
> Hi Andrew,
> 
> The kernel build fails with randconfig, with following error
> 
>   CC  arch/powerpc/platforms/celleb/setup.o
> arch/powerpc/platforms/celleb/setup.c:151: error: ‘generic_calibrate_decr’ 
> undeclared here (not in a function)
> make[2]: *** [arch/powerpc/platforms/celleb/setup.o] Error 1
> make[1]: *** [arch/powerpc/platforms/celleb] Error 2
> make: *** [arch/powerpc/platforms] Error 2


I think you need this patch:
http://patchwork.ozlabs.org/linuxppc/patch?q=Tony%20Breeds=14462

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: mm snapshot broken-out-2007-11-06-02-32 build failure - !CONFIG_PPC_ISERIES

2007-11-07 Thread Tony Breeds
On Thu, Nov 08, 2007 at 02:27:07AM +0530, Kamalesh Babulal wrote:
 Hi Andrew,
 
 The kernel build fails with randconfig, with following error
 
   CC  arch/powerpc/platforms/celleb/setup.o
 arch/powerpc/platforms/celleb/setup.c:151: error: ‘generic_calibrate_decr’ 
 undeclared here (not in a function)
 make[2]: *** [arch/powerpc/platforms/celleb/setup.o] Error 1
 make[1]: *** [arch/powerpc/platforms/celleb] Error 2
 make: *** [arch/powerpc/platforms] Error 2


I think you need this patch:
http://patchwork.ozlabs.org/linuxppc/patch?q=Tony%20Breedsid=14462

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Update zfcp_sg_to_address() for new SG chanegs.

2007-10-29 Thread Tony Breeds
Commit 642f149031d70415d9318b919d50b71e4724adbd Added args to
zfcp_sg_to_address() but didn't update the defn. to know about them.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

Only compile tested.

 drivers/s390/scsi/zfcp_def.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 0754542..e70cd95 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @len: buffer length
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int len)
 {
-   sg_set_buf(list, address, 0);
+   sg_set_buf(list, address, len);
 }
 
 #define REQUEST_LIST_SIZE 128
-- 
1.5.3.4

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Update zfcp_sg_to_address() for new SG chanegs.

2007-10-29 Thread Tony Breeds
Commit 642f149031d70415d9318b919d50b71e4724adbd Added args to
zfcp_sg_to_address() but didn't update the defn. to know about them.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---

Only compile tested.

 drivers/s390/scsi/zfcp_def.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 0754542..e70cd95 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @len: buffer length
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int len)
 {
-   sg_set_buf(list, address, 0);
+   sg_set_buf(list, address, len);
 }
 
 #define REQUEST_LIST_SIZE 128
-- 
1.5.3.4

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc7-mm1 -- powerpc rtas panic

2007-10-02 Thread Tony Breeds
On Wed, Oct 03, 2007 at 10:30:16AM +1000, Michael Ellerman wrote:
 
> I realise it'll make the patch bigger, but this doesn't seem like a
> particularly good name for the variable anymore.

Sure, what about?

Clarify when RTAS logging is enabled.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
 arch/powerpc/platforms/pseries/rtasd.c |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/rtasd.c 
b/arch/powerpc/platforms/pseries/rtasd.c
index 30925d2..73401c8 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -54,8 +54,9 @@ static unsigned int rtas_event_scan_rate;
 static int full_rtas_msgs = 0;
 
 /* Stop logging to nvram after first fatal error */
-static int no_more_logging;
-
+static int logging_enabled; /* Until we initialize everything,
+ * make sure we don't try logging
+ * anything */
 static int error_log_cnt;
 
 /*
@@ -217,7 +218,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, 
int fatal)
}
 
/* Write error to NVRAM */
-   if (!no_more_logging && !(err_type & ERR_FLAG_BOOT))
+   if (logging_enabled && !(err_type & ERR_FLAG_BOOT))
nvram_write_error_log(buf, len, err_type, error_log_cnt);
 
/*
@@ -229,8 +230,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, 
int fatal)
printk_log_rtas(buf, len);
 
/* Check to see if we need to or have stopped logging */
-   if (fatal || no_more_logging) {
-   no_more_logging = 1;
+   if (fatal || !logging_enabled) {
+   logging_enabled = 0;
spin_unlock_irqrestore(_log_lock, s);
return;
}
@@ -302,7 +303,7 @@ static ssize_t rtas_log_read(struct file * file, char 
__user * buf,
 
spin_lock_irqsave(_log_lock, s);
/* if it's 0, then we know we got the last one (the one in NVRAM) */
-   if (rtas_log_size == 0 && !no_more_logging)
+   if (rtas_log_size == 0 && logging_enabled)
nvram_clear_error_log();
spin_unlock_irqrestore(_log_lock, s);
 
@@ -414,6 +415,8 @@ static int rtasd(void *unused)
memset(logdata, 0, rtas_error_log_max);
rc = nvram_read_error_log(logdata, rtas_error_log_max,
  _type, _log_cnt);
+   /* We can use rtas_log_buf now */
+   logging_enabled = 1;
 
if (!rc) {
if (err_type != ERR_FLAG_ALREADY_LOGGED) {

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc7-mm1 -- powerpc rtas panic

2007-10-02 Thread Tony Breeds
On Tue, Oct 02, 2007 at 06:28:19PM -0500, Linas Vepstas wrote:
> On Mon, Sep 24, 2007 at 01:35:31PM +0100, Andy Whitcroft wrote:
> > Seeing the following from an older power LPAR, pretty sure we had
> > this in the previous -mm also:
> 
> I haven't forgetten about this ... and am looking at it now.
> Seems that whenever I go to reserve the machine pSeries-102,
> someone else is using it :-)

This panic is caused by "[POWERPC] pseries: Fix jumbled no_logging flag."
(79c0108d1b9db4864ab77b2a95dfa04f2dcf264c), in the powerpc/for-2.6.24
branch.  It looks to me that we have logging enabled too early now.

I think the following is a reasonable fix?

---
Explicitly enable RTAS error logging, when it should be ready.


Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 arch/powerpc/platforms/pseries/rtasd.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/rtasd.c 
b/arch/powerpc/platforms/pseries/rtasd.c
index 30925d2..0df5d0d 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -54,7 +54,10 @@ static unsigned int rtas_event_scan_rate;
 static int full_rtas_msgs = 0;
 
 /* Stop logging to nvram after first fatal error */
-static int no_more_logging;
+static int no_more_logging = 1; /* Until we initialize everything,
+ * make sure we don't try logging
+ * anything */
+
 
 static int error_log_cnt;
 
@@ -414,6 +417,8 @@ static int rtasd(void *unused)
memset(logdata, 0, rtas_error_log_max);
rc = nvram_read_error_log(logdata, rtas_error_log_max,
  _type, _log_cnt);
+   /* We can use rtas_log_buf now */
+   no_more_logging = 0;
 
if (!rc) {
if (err_type != ERR_FLAG_ALREADY_LOGGED) {

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc7-mm1 -- powerpc rtas panic

2007-10-02 Thread Tony Breeds
On Tue, Oct 02, 2007 at 06:28:19PM -0500, Linas Vepstas wrote:
 On Mon, Sep 24, 2007 at 01:35:31PM +0100, Andy Whitcroft wrote:
  Seeing the following from an older power LPAR, pretty sure we had
  this in the previous -mm also:
 
 I haven't forgetten about this ... and am looking at it now.
 Seems that whenever I go to reserve the machine pSeries-102,
 someone else is using it :-)

This panic is caused by [POWERPC] pseries: Fix jumbled no_logging flag.
(79c0108d1b9db4864ab77b2a95dfa04f2dcf264c), in the powerpc/for-2.6.24
branch.  It looks to me that we have logging enabled too early now.

I think the following is a reasonable fix?

---
Explicitly enable RTAS error logging, when it should be ready.


Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 arch/powerpc/platforms/pseries/rtasd.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/rtasd.c 
b/arch/powerpc/platforms/pseries/rtasd.c
index 30925d2..0df5d0d 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -54,7 +54,10 @@ static unsigned int rtas_event_scan_rate;
 static int full_rtas_msgs = 0;
 
 /* Stop logging to nvram after first fatal error */
-static int no_more_logging;
+static int no_more_logging = 1; /* Until we initialize everything,
+ * make sure we don't try logging
+ * anything */
+
 
 static int error_log_cnt;
 
@@ -414,6 +417,8 @@ static int rtasd(void *unused)
memset(logdata, 0, rtas_error_log_max);
rc = nvram_read_error_log(logdata, rtas_error_log_max,
  err_type, error_log_cnt);
+   /* We can use rtas_log_buf now */
+   no_more_logging = 0;
 
if (!rc) {
if (err_type != ERR_FLAG_ALREADY_LOGGED) {

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc7-mm1 -- powerpc rtas panic

2007-10-02 Thread Tony Breeds
On Wed, Oct 03, 2007 at 10:30:16AM +1000, Michael Ellerman wrote:
 
 I realise it'll make the patch bigger, but this doesn't seem like a
 particularly good name for the variable anymore.

Sure, what about?

Clarify when RTAS logging is enabled.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
 arch/powerpc/platforms/pseries/rtasd.c |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/rtasd.c 
b/arch/powerpc/platforms/pseries/rtasd.c
index 30925d2..73401c8 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -54,8 +54,9 @@ static unsigned int rtas_event_scan_rate;
 static int full_rtas_msgs = 0;
 
 /* Stop logging to nvram after first fatal error */
-static int no_more_logging;
-
+static int logging_enabled; /* Until we initialize everything,
+ * make sure we don't try logging
+ * anything */
 static int error_log_cnt;
 
 /*
@@ -217,7 +218,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, 
int fatal)
}
 
/* Write error to NVRAM */
-   if (!no_more_logging  !(err_type  ERR_FLAG_BOOT))
+   if (logging_enabled  !(err_type  ERR_FLAG_BOOT))
nvram_write_error_log(buf, len, err_type, error_log_cnt);
 
/*
@@ -229,8 +230,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, 
int fatal)
printk_log_rtas(buf, len);
 
/* Check to see if we need to or have stopped logging */
-   if (fatal || no_more_logging) {
-   no_more_logging = 1;
+   if (fatal || !logging_enabled) {
+   logging_enabled = 0;
spin_unlock_irqrestore(rtasd_log_lock, s);
return;
}
@@ -302,7 +303,7 @@ static ssize_t rtas_log_read(struct file * file, char 
__user * buf,
 
spin_lock_irqsave(rtasd_log_lock, s);
/* if it's 0, then we know we got the last one (the one in NVRAM) */
-   if (rtas_log_size == 0  !no_more_logging)
+   if (rtas_log_size == 0  logging_enabled)
nvram_clear_error_log();
spin_unlock_irqrestore(rtasd_log_lock, s);
 
@@ -414,6 +415,8 @@ static int rtasd(void *unused)
memset(logdata, 0, rtas_error_log_max);
rc = nvram_read_error_log(logdata, rtas_error_log_max,
  err_type, error_log_cnt);
+   /* We can use rtas_log_buf now */
+   logging_enabled = 1;
 
if (!rc) {
if (err_type != ERR_FLAG_ALREADY_LOGGED) {

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: add new required termio functions

2007-09-11 Thread Tony Breeds
On Tue, Sep 11, 2007 at 07:17:42PM -0700, Linus Torvalds wrote:
 
> Really?
> 
> It shouldn't. The use of kernel_termios_to_user_termios_1() is conditional 
> on the architecture having a define for TCGETS2, and I think they match 
> up. I see:
> 
>   [EMAIL PROTECTED] linux]$ git grep -l kernel_termios_to_user_termios_1 
> include | wc -l
>   10
>   [EMAIL PROTECTED] linux]$ git grep -l TCGETS2 include | wc -l
>   10
> 
> and in neither case is ppc in that list of architecures.
> 
> So maybe you just read the patch without actually testing whether it 
> actually broke powerpc?
> 
> Or is something subtler going on?

As far as I can see TIOCSLCKTRMIOS and TIOCGLCKTRMIOS aren't protected
by TCGETS2 guards.  Do they need to be ...  Perhaps


From: Tony Breeds <[EMAIL PROTECTED]>

Add Guards around TIOCSLCKTRMIOS and TIOCGLCKTRMIOS.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 drivers/char/tty_ioctl.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 4a8969c..3ee73cf 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -795,6 +795,19 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * 
file,
if (L_ICANON(tty))
retval = inq_canon(tty);
return put_user(retval, (unsigned int __user *) arg);
+#ifndef TCGETS2
+   case TIOCGLCKTRMIOS:
+   if (kernel_termios_to_user_termios((struct termios 
__user *)arg, real_tty->termios_locked))
+   return -EFAULT;
+   return 0;
+
+   case TIOCSLCKTRMIOS:
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   if 
(user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios 
__user *) arg))
+   return -EFAULT;
+   return 0;
+#else
case TIOCGLCKTRMIOS:
if (kernel_termios_to_user_termios_1((struct termios 
__user *)arg, real_tty->termios_locked))
return -EFAULT;
@@ -806,6 +819,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
if 
(user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios 
__user *) arg))
return -EFAULT;
return 0;
+#endif
 
case TIOCPKT:
{

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fix "no_sync_cmos_clock" logic inversion in kernel/time/ntp.c

2007-09-11 Thread Tony Breeds

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

Seems to me that this timer will only get started on platforms that say
they don't want it?

 kernel/time/ntp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: working/kernel/time/ntp.c
===
--- working.orig/kernel/time/ntp.c  2007-09-11 17:34:44.0 +1000
+++ working/kernel/time/ntp.c   2007-09-11 17:34:55.0 +1000
@@ -226,7 +226,7 @@ static void sync_cmos_clock(unsigned lon
 
 static void notify_cmos_timer(void)
 {
-   if (no_sync_cmos_clock)
+   if (!no_sync_cmos_clock)
mod_timer(_cmos_timer, jiffies + 1);
 }
 

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fix no_sync_cmos_clock logic inversion in kernel/time/ntp.c

2007-09-11 Thread Tony Breeds

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

Seems to me that this timer will only get started on platforms that say
they don't want it?

 kernel/time/ntp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: working/kernel/time/ntp.c
===
--- working.orig/kernel/time/ntp.c  2007-09-11 17:34:44.0 +1000
+++ working/kernel/time/ntp.c   2007-09-11 17:34:55.0 +1000
@@ -226,7 +226,7 @@ static void sync_cmos_clock(unsigned lon
 
 static void notify_cmos_timer(void)
 {
-   if (no_sync_cmos_clock)
+   if (!no_sync_cmos_clock)
mod_timer(sync_cmos_timer, jiffies + 1);
 }
 

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: add new required termio functions

2007-09-11 Thread Tony Breeds
On Tue, Sep 11, 2007 at 07:17:42PM -0700, Linus Torvalds wrote:
 
 Really?
 
 It shouldn't. The use of kernel_termios_to_user_termios_1() is conditional 
 on the architecture having a define for TCGETS2, and I think they match 
 up. I see:
 
   [EMAIL PROTECTED] linux]$ git grep -l kernel_termios_to_user_termios_1 
 include | wc -l
   10
   [EMAIL PROTECTED] linux]$ git grep -l TCGETS2 include | wc -l
   10
 
 and in neither case is ppc in that list of architecures.
 
 So maybe you just read the patch without actually testing whether it 
 actually broke powerpc?
 
 Or is something subtler going on?

As far as I can see TIOCSLCKTRMIOS and TIOCGLCKTRMIOS aren't protected
by TCGETS2 guards.  Do they need to be ...  Perhaps


From: Tony Breeds [EMAIL PROTECTED]

Add Guards around TIOCSLCKTRMIOS and TIOCGLCKTRMIOS.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 drivers/char/tty_ioctl.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 4a8969c..3ee73cf 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -795,6 +795,19 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * 
file,
if (L_ICANON(tty))
retval = inq_canon(tty);
return put_user(retval, (unsigned int __user *) arg);
+#ifndef TCGETS2
+   case TIOCGLCKTRMIOS:
+   if (kernel_termios_to_user_termios((struct termios 
__user *)arg, real_tty-termios_locked))
+   return -EFAULT;
+   return 0;
+
+   case TIOCSLCKTRMIOS:
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   if 
(user_termios_to_kernel_termios(real_tty-termios_locked, (struct termios 
__user *) arg))
+   return -EFAULT;
+   return 0;
+#else
case TIOCGLCKTRMIOS:
if (kernel_termios_to_user_termios_1((struct termios 
__user *)arg, real_tty-termios_locked))
return -EFAULT;
@@ -806,6 +819,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
if 
(user_termios_to_kernel_termios_1(real_tty-termios_locked, (struct termios 
__user *) arg))
return -EFAULT;
return 0;
+#endif
 
case TIOCPKT:
{

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-2.6.23-rc4 ppc build failure

2007-08-30 Thread Tony Breeds
On Thu, Aug 30, 2007 at 02:56:50PM -0700, Bret Towe wrote:
> On 8/29/07, Bret Towe <[EMAIL PROTECTED]> wrote:
> > while trying to build a fresh kernel for my mini after upgrading from gutsy
> > (and forgetting to save my .config) I hit the below build error
> > 2.6.23-rc3 I did work under feisty but that is with a different .config
> > so not sure if that makes any difference or not
> > I've not bisected cause it takes so long on this computer...
> > attached is the config I'm working off now

So how did you generate the new .config?  Did you start with a defconfig
of some sort and then alter to personal taste?

I ask because if we have other users our there that have working system
with BLK_DEV_IDE=m it'd be nice to have make oldconfig fix them.  If
it's just a matter of not letting people get into that state then
something like the patch below will probably help.

Ensure that BLK_DEV_IDE is built-in befoer allowing BLK_DEV_IDE_PMAC to
be selected.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 drivers/ide/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e049f65..e55be26 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -780,7 +780,7 @@ endif
 
 config BLK_DEV_IDE_PMAC
bool "Builtin PowerMac IDE support"
-   depends on PPC_PMAC && IDE=y
+   depends on PPC_PMAC && IDE=y && BLK_DEV_IDE=y
help
  This driver provides support for the built-in IDE controller on
  most of the recent Apple Power Macintoshes and PowerBooks.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix discrepancy between VDSO based gettimeofday() and sys_gettimeofday().

2007-08-30 Thread Tony Breeds
On platforms that copy sys_tz into the vdso (currently only x86_64, soon
to include powerpc), it is possible for the vdso to get out of sync if a
user calls (admittedly unusual) settimeofday(NULL, ptr).

This patch adds a hook for architectures that set CONFIG_GENERIC_TIME_VSYSCALL
to ensure when sys_tz is updated they can also updater their copy in the vdso.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Cc: Tony Luck <[EMAIL PROTECTED]>
Cc: John Stultz <[EMAIL PROTECTED]>
---

Only compile tested for IA64
Testcase at: http://bakeyournoodle.com/~tony/settimeofday-0.0/
I guess this is aimed at 2.6.24

 arch/ia64/kernel/time.c   |5 +
 arch/x86_64/kernel/vsyscall.c |   11 ++-
 include/linux/clocksource.h   |5 +
 kernel/time.c |2 ++
 4 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 98cfc90..2bb8421 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -371,6 +371,11 @@ ia64_setup_printk_clock(void)
ia64_printk_clock = ia64_itc_printk_clock;
 }
 
+/* IA64 doesn't cache the timezone */
+void update_vsyscall_tz(void)
+{
+}
+
 void update_vsyscall(struct timespec *wall, struct clocksource *c)
 {
 unsigned long flags;
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 06c3494..4ff78b0 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -66,6 +66,16 @@ struct vsyscall_gtod_data __vsyscall_gtod_data 
__section_vsyscall_gtod_data =
.sysctl_enabled = 1,
 };
 
+void update_vsyscall_tz(void)
+{
+   unsigned long flags;
+
+   write_seqlock_irqsave(_gtod_data.lock, flags);
+   /* sys_tz has changed */
+   vsyscall_gtod_data.sys_tz = sys_tz;
+   write_sequnlock_irqrestore(_gtod_data.lock, flags);
+}
+
 void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
 {
unsigned long flags;
@@ -79,7 +89,6 @@ void update_vsyscall(struct timespec *wall_time, struct 
clocksource *clock)
vsyscall_gtod_data.clock.shift = clock->shift;
vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
-   vsyscall_gtod_data.sys_tz = sys_tz;
vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
write_sequnlock_irqrestore(_gtod_data.lock, flags);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 16ea337..107787a 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -221,10 +221,15 @@ extern void clocksource_resume(void);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
+extern void update_vsyscall_tz(void);
 #else
 static inline void update_vsyscall(struct timespec *ts, struct clocksource *c)
 {
 }
+
+static inline void update_vsyscall_tz(void)
+{
+}
 #endif
 
 #endif /* _LINUX_CLOCKSOURCE_H */
diff --git a/kernel/time.c b/kernel/time.c
index 2289a8d..9a4873e 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -163,6 +164,7 @@ int do_sys_settimeofday(struct timespec *tv, struct 
timezone *tz)
if (tz) {
/* SMP safe, global irq locking makes it work. */
sys_tz = *tz;
+   update_vsyscall_tz();
if (firsttime) {
firsttime = 0;
if (!tv)
-- 
1.5.2.5

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix discrepancy between VDSO based gettimeofday() and sys_gettimeofday().

2007-08-30 Thread Tony Breeds
On platforms that copy sys_tz into the vdso (currently only x86_64, soon
to include powerpc), it is possible for the vdso to get out of sync if a
user calls (admittedly unusual) settimeofday(NULL, ptr).

This patch adds a hook for architectures that set CONFIG_GENERIC_TIME_VSYSCALL
to ensure when sys_tz is updated they can also updater their copy in the vdso.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Cc: Tony Luck [EMAIL PROTECTED]
Cc: John Stultz [EMAIL PROTECTED]
---

Only compile tested for IA64
Testcase at: http://bakeyournoodle.com/~tony/settimeofday-0.0/
I guess this is aimed at 2.6.24

 arch/ia64/kernel/time.c   |5 +
 arch/x86_64/kernel/vsyscall.c |   11 ++-
 include/linux/clocksource.h   |5 +
 kernel/time.c |2 ++
 4 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 98cfc90..2bb8421 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -371,6 +371,11 @@ ia64_setup_printk_clock(void)
ia64_printk_clock = ia64_itc_printk_clock;
 }
 
+/* IA64 doesn't cache the timezone */
+void update_vsyscall_tz(void)
+{
+}
+
 void update_vsyscall(struct timespec *wall, struct clocksource *c)
 {
 unsigned long flags;
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 06c3494..4ff78b0 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -66,6 +66,16 @@ struct vsyscall_gtod_data __vsyscall_gtod_data 
__section_vsyscall_gtod_data =
.sysctl_enabled = 1,
 };
 
+void update_vsyscall_tz(void)
+{
+   unsigned long flags;
+
+   write_seqlock_irqsave(vsyscall_gtod_data.lock, flags);
+   /* sys_tz has changed */
+   vsyscall_gtod_data.sys_tz = sys_tz;
+   write_sequnlock_irqrestore(vsyscall_gtod_data.lock, flags);
+}
+
 void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
 {
unsigned long flags;
@@ -79,7 +89,6 @@ void update_vsyscall(struct timespec *wall_time, struct 
clocksource *clock)
vsyscall_gtod_data.clock.shift = clock-shift;
vsyscall_gtod_data.wall_time_sec = wall_time-tv_sec;
vsyscall_gtod_data.wall_time_nsec = wall_time-tv_nsec;
-   vsyscall_gtod_data.sys_tz = sys_tz;
vsyscall_gtod_data.wall_time_nsec = wall_time-tv_nsec;
vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
write_sequnlock_irqrestore(vsyscall_gtod_data.lock, flags);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 16ea337..107787a 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -221,10 +221,15 @@ extern void clocksource_resume(void);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
+extern void update_vsyscall_tz(void);
 #else
 static inline void update_vsyscall(struct timespec *ts, struct clocksource *c)
 {
 }
+
+static inline void update_vsyscall_tz(void)
+{
+}
 #endif
 
 #endif /* _LINUX_CLOCKSOURCE_H */
diff --git a/kernel/time.c b/kernel/time.c
index 2289a8d..9a4873e 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -30,6 +30,7 @@
 #include linux/module.h
 #include linux/timex.h
 #include linux/capability.h
+#include linux/clocksource.h
 #include linux/errno.h
 #include linux/syscalls.h
 #include linux/security.h
@@ -163,6 +164,7 @@ int do_sys_settimeofday(struct timespec *tv, struct 
timezone *tz)
if (tz) {
/* SMP safe, global irq locking makes it work. */
sys_tz = *tz;
+   update_vsyscall_tz();
if (firsttime) {
firsttime = 0;
if (!tv)
-- 
1.5.2.5

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-2.6.23-rc4 ppc build failure

2007-08-30 Thread Tony Breeds
On Thu, Aug 30, 2007 at 02:56:50PM -0700, Bret Towe wrote:
 On 8/29/07, Bret Towe [EMAIL PROTECTED] wrote:
  while trying to build a fresh kernel for my mini after upgrading from gutsy
  (and forgetting to save my .config) I hit the below build error
  2.6.23-rc3 I did work under feisty but that is with a different .config
  so not sure if that makes any difference or not
  I've not bisected cause it takes so long on this computer...
  attached is the config I'm working off now

So how did you generate the new .config?  Did you start with a defconfig
of some sort and then alter to personal taste?

I ask because if we have other users our there that have working system
with BLK_DEV_IDE=m it'd be nice to have make oldconfig fix them.  If
it's just a matter of not letting people get into that state then
something like the patch below will probably help.

Ensure that BLK_DEV_IDE is built-in befoer allowing BLK_DEV_IDE_PMAC to
be selected.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 drivers/ide/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e049f65..e55be26 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -780,7 +780,7 @@ endif
 
 config BLK_DEV_IDE_PMAC
bool Builtin PowerMac IDE support
-   depends on PPC_PMAC  IDE=y
+   depends on PPC_PMAC  IDE=y  BLK_DEV_IDE=y
help
  This driver provides support for the built-in IDE controller on
  most of the recent Apple Power Macintoshes and PowerBooks.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Re: 2.6.22-git ppc build failure

2007-07-18 Thread Tony Breeds
On Tue, Jul 17, 2007 at 07:27:51PM -0700, Linus Torvalds wrote:
 
> Ok, thanks. Maybe it's the merge, and maybe it's one of the sides. You 
> might want to double-check that both parents are ok before you look too 
> closely at the merge itself.

Turns out the boot failure wasn't related to the merge after all.  With
my orginal compile (and the revert below) PCI works and the kernel
boots.

Please apply both.

From: Tony Breeds <[EMAIL PROTECTED]>
Subject: [PATCH] Revert "[POWERPC] Do firmware feature fixups after features 
are initialised"

This reverts commit 5a26f6bbb767d7ad23311a1e81cfdd2bebefb855.

The original patch causes boot failures when built with ppc64_defconfig.  The
quickest fix is to revert it while alterates are investigated.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/setup_64.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index bc43bba..6018178 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -350,11 +350,13 @@ void __init setup_system(void)
 {
DBG(" -> setup_system()\n");
 
-   /* Apply CPUs-specific fixups to kernel text (nop out sections
-* not relevant to this CPU)
+   /* Apply the CPUs-specific and firmware specific fixups to kernel
+* text (nop out sections not relevant to this CPU or this firmware)
 */
do_feature_fixups(cur_cpu_spec->cpu_features,
  &__start___ftr_fixup, &__stop___ftr_fixup);
+   do_feature_fixups(powerpc_firmware_features,
+ &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
 
/*
 * Unflatten the device-tree passed by prom_init or kexec
@@ -392,12 +394,6 @@ void __init setup_system(void)
if (ppc_md.init_early)
ppc_md.init_early();
 
-   /* Apply firmware specific fixups to kernel text (nop out
-* sections not relevant to this firmware)
-*/
-   do_feature_fixups(powerpc_firmware_features,
- &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
-
/*
 * We can discover serial ports now since the above did setup the
 * hash table management for us, thus ioremap works. We do that early
-- 
1.5.2.3


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Re: 2.6.22-git ppc build failure

2007-07-18 Thread Tony Breeds
On Tue, Jul 17, 2007 at 07:27:51PM -0700, Linus Torvalds wrote:
 
 Ok, thanks. Maybe it's the merge, and maybe it's one of the sides. You 
 might want to double-check that both parents are ok before you look too 
 closely at the merge itself.

Turns out the boot failure wasn't related to the merge after all.  With
my orginal compile (and the revert below) PCI works and the kernel
boots.

Please apply both.

From: Tony Breeds [EMAIL PROTECTED]
Subject: [PATCH] Revert [POWERPC] Do firmware feature fixups after features 
are initialised

This reverts commit 5a26f6bbb767d7ad23311a1e81cfdd2bebefb855.

The original patch causes boot failures when built with ppc64_defconfig.  The
quickest fix is to revert it while alterates are investigated.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---
 arch/powerpc/kernel/setup_64.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index bc43bba..6018178 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -350,11 +350,13 @@ void __init setup_system(void)
 {
DBG( - setup_system()\n);
 
-   /* Apply CPUs-specific fixups to kernel text (nop out sections
-* not relevant to this CPU)
+   /* Apply the CPUs-specific and firmware specific fixups to kernel
+* text (nop out sections not relevant to this CPU or this firmware)
 */
do_feature_fixups(cur_cpu_spec-cpu_features,
  __start___ftr_fixup, __stop___ftr_fixup);
+   do_feature_fixups(powerpc_firmware_features,
+ __start___fw_ftr_fixup, __stop___fw_ftr_fixup);
 
/*
 * Unflatten the device-tree passed by prom_init or kexec
@@ -392,12 +394,6 @@ void __init setup_system(void)
if (ppc_md.init_early)
ppc_md.init_early();
 
-   /* Apply firmware specific fixups to kernel text (nop out
-* sections not relevant to this firmware)
-*/
-   do_feature_fixups(powerpc_firmware_features,
- __start___fw_ftr_fixup, __stop___fw_ftr_fixup);
-
/*
 * We can discover serial ports now since the above did setup the
 * hash table management for us, thus ioremap works. We do that early
-- 
1.5.2.3


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Re: 2.6.22-git ppc build failure

2007-07-17 Thread Tony Breeds
On Tue, Jul 17, 2007 at 06:44:26PM -0700, Linus Torvalds wrote:

> Thanks. I assume this has been boot-tested too, and everything else from 
> the PCI merge was ok?

*cough* umm the boot test fails.  I'll look harder at the merge, and
provide a better patch.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Re: 2.6.22-git ppc build failure

2007-07-17 Thread Tony Breeds
On Tue, Jul 17, 2007 at 11:04:57AM -0700, Bret Towe wrote:
> this is off my g4 mac mini
> latest git as of when this email was sent
> config file attached

Hi Bret,
the patch below will fix it.

From: Tony Breeds <[EMAIL PROTECTED]>

Fix compile failure in arch/powerpc/kernel/pci-common.c

 CC  arch/powerpc/kernel/pci-common.o
arch/powerpc/kernel/pci-common.c:160: error: conflicting types for 
'pcibios_add_platform_entries'
include/linux/pci.h:889: error: previous declaration of 
'pcibios_add_platform_entries' was here

Fallout from the powerpc merge (489de30259e667d7bc47da9da44a0270b050cd97).

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
 arch/powerpc/kernel/pci-common.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: working/arch/powerpc/kernel/pci-common.c
===
--- working.orig/arch/powerpc/kernel/pci-common.c   2007-07-18 
10:34:55.0 +1000
+++ working/arch/powerpc/kernel/pci-common.c2007-07-18 10:39:19.0 
+1000
@@ -156,11 +156,14 @@ static DEVICE_ATTR(devspec, S_IRUGO, pci
 #endif /* CONFIG_PPC_OF */
 
 /* Add sysfs properties */
-void pcibios_add_platform_entries(struct pci_dev *pdev)
+int pcibios_add_platform_entries(struct pci_dev *pdev)
 {
 #ifdef CONFIG_PPC_OF
-   device_create_file(>dev, _attr_devspec);
+   return device_create_file(>dev, _attr_devspec);
+#else
+   return 0;
 #endif /* CONFIG_PPC_OF */
+
 }
 
 char __init *pcibios_setup(char *str)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Re: 2.6.22-git ppc build failure

2007-07-17 Thread Tony Breeds
On Tue, Jul 17, 2007 at 11:04:57AM -0700, Bret Towe wrote:
 this is off my g4 mac mini
 latest git as of when this email was sent
 config file attached

Hi Bret,
the patch below will fix it.

From: Tony Breeds [EMAIL PROTECTED]

Fix compile failure in arch/powerpc/kernel/pci-common.c

 CC  arch/powerpc/kernel/pci-common.o
arch/powerpc/kernel/pci-common.c:160: error: conflicting types for 
'pcibios_add_platform_entries'
include/linux/pci.h:889: error: previous declaration of 
'pcibios_add_platform_entries' was here

Fallout from the powerpc merge (489de30259e667d7bc47da9da44a0270b050cd97).

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
 arch/powerpc/kernel/pci-common.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: working/arch/powerpc/kernel/pci-common.c
===
--- working.orig/arch/powerpc/kernel/pci-common.c   2007-07-18 
10:34:55.0 +1000
+++ working/arch/powerpc/kernel/pci-common.c2007-07-18 10:39:19.0 
+1000
@@ -156,11 +156,14 @@ static DEVICE_ATTR(devspec, S_IRUGO, pci
 #endif /* CONFIG_PPC_OF */
 
 /* Add sysfs properties */
-void pcibios_add_platform_entries(struct pci_dev *pdev)
+int pcibios_add_platform_entries(struct pci_dev *pdev)
 {
 #ifdef CONFIG_PPC_OF
-   device_create_file(pdev-dev, dev_attr_devspec);
+   return device_create_file(pdev-dev, dev_attr_devspec);
+#else
+   return 0;
 #endif /* CONFIG_PPC_OF */
+
 }
 
 char __init *pcibios_setup(char *str)

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Re: 2.6.22-git ppc build failure

2007-07-17 Thread Tony Breeds
On Tue, Jul 17, 2007 at 06:44:26PM -0700, Linus Torvalds wrote:

 Thanks. I assume this has been boot-tested too, and everything else from 
 the PCI merge was ok?

*cough* umm the boot test fails.  I'll look harder at the merge, and
provide a better patch.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mkmakefile: include ARCH on O= builds

2007-07-11 Thread Tony Breeds
On Thu, Jul 12, 2007 at 03:40:04AM +0200, Bodo Eggert wrote:
> If you build using O=builddir ARCH=bar, you'll currently need to supply
> ARCH= on builds from the builddir, too. With this patch, the generated
> Makefile will do that instead.



> diff -X dontdiff -pruN linux-2.6.22/scripts/mkmakefile 
> linux-2.6.22.changed/scripts/mkmakefile
> --- linux-2.6.22/scripts/mkmakefile   2006-11-29 22:57:37.0 +0100
> +++ linux-2.6.22.changed/scripts/mkmakefile   2007-07-12 03:03:49.0 
> +0200
> @@ -8,6 +8,7 @@
>  # $2 - Output directory
>  # $3 - version
>  # $4 - patchlevel
> +# $5 - patchlevel

Really?  I suspect you wanted
  +# $5 - architecture

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mkmakefile: include ARCH on O= builds

2007-07-11 Thread Tony Breeds
On Thu, Jul 12, 2007 at 03:40:04AM +0200, Bodo Eggert wrote:
 If you build using O=builddir ARCH=bar, you'll currently need to supply
 ARCH= on builds from the builddir, too. With this patch, the generated
 Makefile will do that instead.

snip

 diff -X dontdiff -pruN linux-2.6.22/scripts/mkmakefile 
 linux-2.6.22.changed/scripts/mkmakefile
 --- linux-2.6.22/scripts/mkmakefile   2006-11-29 22:57:37.0 +0100
 +++ linux-2.6.22.changed/scripts/mkmakefile   2007-07-12 03:03:49.0 
 +0200
 @@ -8,6 +8,7 @@
  # $2 - Output directory
  # $3 - version
  # $4 - patchlevel
 +# $5 - patchlevel

Really?  I suspect you wanted
  +# $5 - architecture

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 02:06:01PM -0700, john stultz wrote:

Hi John.

> Hey Tony,
>   Thanks for sending this out! I really appreciate this work, as its been
> on my todo forever, and I've just not been able to focus on it.
> Currently it seems a bit minimal of a conversion (ideally there should
> be very little time code left), but It looks like a great start!

Thanks.

> I might be missing a subtlety in the ppc code, but I'm still not sure if
> I see the need for the clocksource settimeofday hook.
> 
> update_vsyscall() is intended to provide a hook that allows the generic
> time code to provide all the needed timekeeping state to the arch
> specific vsyscall implementation. It is called any time the base
> timekeeping variables are changed.

Well as I just said the Daniel, I was under the impression I needed a
hook that was only called from settimeofday().  The comments I've
recieved from everyone has given me good cause to re-evaluate.

I think I can make it work without the hook, that started this
discussion.  Thomas, I think it's probably best to axe it now.  If I
/really/ need it then I'll start the discussion again :)  Thanks.
 
> I think it would be enlightening to flatten this out a bit. Putting both
> the timer_recalc_offset and clocksource_settime code in the same
> function. It might illustrate where some optimizations could be done and
> where it might make more sense to split things up.
> 
> Also I'd leave timer_check_rtc() in the timer_interrupt for now (later
> moving it to tglx's generic rtc update).

Yes you're rigth I don't need to move the timer_check_rtc() call.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 07:57:19AM -0700, Daniel Walker wrote:

Hi Daniel.

> As I said in our private thread, I do think you should be using
> update_vsyscall() .. update_vsyscall() is just called when the time is
> set, usually that happens in the timer interrupt and sometimes that
> happens in settimeofday() ..

Well I've taken another look at the code and I think I can probably
restructure my code to use update_vsyscall().  I thought I needed a
hook that was called /only/ from settimeofday() (which as you say
doesn't match update_vsyscall()'s usage).

I'll try again and see what problems I hit.
 
> At least some of your code is duplications over what is already being
> worked on inside the powerpc community.. For instance, I know there is
> already a timebase clocksource,
> 
> http://people.redhat.com/~mingo/realtime-preempt/patch-2.6.21.5-rt17

Thanks. The one in -rt doesn't seem to support the VDSO.  however I see
that there is duplication of effort there.
 
> Hmm .. This doesn't look like it's taking into account that the time has
> changed .. Your time has effectively incremented by one jiffie .. The
> vdso_data doesn't appear to be updated ..

Unless I miss your meaning, the vdso is updated in
timer_recalc_offset()/update_gtod() when needed.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 08:53:47PM +0400, Sergei Shtylyov wrote:

Hi Sergei,
Thanks for taking the time to look over my patch.

>I guess it's been based on the prior work by John Stultz (and me too :-)?

At some level I guess so.  John did send me a patch a while ago.
 
>If you mean the init. part, this has been already done by me -- I've 
> implemented read_persistent_clock() and got rid of xtime setting. What's 
> left is to implemet update_persistent_clock() and get rid of 
> timer_check_rtc()...

Actually I think that comment is redundant.  and should be removed
sorry.

>Perhaps we even need to raise the rating to 300 or 400 -- according to 
> what  says?

Sure.
 
> >+.flags= CLOCK_SOURCE_IS_CONTINUOUS,
> >+.mask = CLOCKSOURCE_MASK(64),
> >+.shift= 22,
> 
>PPC64 has issues with the fixed shift value, see:
> 
> http://patchwork.ozlabs.org/linuxppc/patch?id=11125

Thanks!
 
> >+.mult = 0,  /* To be filled in */
> >+.read = NULL,   /* To be filled in */
> >+.settimeofday = NULL,   /* To be filled in */
> 
>I don't quite understand why not just init them right away?  The values 
> are fixed anyways.

Well at least mult needs to be calculated at runtime, and I prefer to
have the structure near the top of the file at which stage the
read/settimeofday functions aren't defined.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 08:53:47PM +0400, Sergei Shtylyov wrote:

Hi Sergei,
Thanks for taking the time to look over my patch.

I guess it's been based on the prior work by John Stultz (and me too :-)?

At some level I guess so.  John did send me a patch a while ago.
 
If you mean the init. part, this has been already done by me -- I've 
 implemented read_persistent_clock() and got rid of xtime setting. What's 
 left is to implemet update_persistent_clock() and get rid of 
 timer_check_rtc()...

Actually I think that comment is redundant.  and should be removed
sorry.

Perhaps we even need to raise the rating to 300 or 400 -- according to 
 what linux/clocksource.h says?

Sure.
 
 +.flags= CLOCK_SOURCE_IS_CONTINUOUS,
 +.mask = CLOCKSOURCE_MASK(64),
 +.shift= 22,
 
PPC64 has issues with the fixed shift value, see:
 
 http://patchwork.ozlabs.org/linuxppc/patch?id=11125

Thanks!
 
 +.mult = 0,  /* To be filled in */
 +.read = NULL,   /* To be filled in */
 +.settimeofday = NULL,   /* To be filled in */
 
I don't quite understand why not just init them right away?  The values 
 are fixed anyways.

Well at least mult needs to be calculated at runtime, and I prefer to
have the structure near the top of the file at which stage the
read/settimeofday functions aren't defined.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 07:57:19AM -0700, Daniel Walker wrote:

Hi Daniel.

 As I said in our private thread, I do think you should be using
 update_vsyscall() .. update_vsyscall() is just called when the time is
 set, usually that happens in the timer interrupt and sometimes that
 happens in settimeofday() ..

Well I've taken another look at the code and I think I can probably
restructure my code to use update_vsyscall().  I thought I needed a
hook that was called /only/ from settimeofday() (which as you say
doesn't match update_vsyscall()'s usage).

I'll try again and see what problems I hit.
 
 At least some of your code is duplications over what is already being
 worked on inside the powerpc community.. For instance, I know there is
 already a timebase clocksource,
 
 http://people.redhat.com/~mingo/realtime-preempt/patch-2.6.21.5-rt17

Thanks. The one in -rt doesn't seem to support the VDSO.  however I see
that there is duplication of effort there.
 
 Hmm .. This doesn't look like it's taking into account that the time has
 changed .. Your time has effectively incremented by one jiffie .. The
 vdso_data doesn't appear to be updated ..

Unless I miss your meaning, the vdso is updated in
timer_recalc_offset()/update_gtod() when needed.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] clocksouce implementation for powerpc

2007-06-22 Thread Tony Breeds
On Wed, Jun 20, 2007 at 02:06:01PM -0700, john stultz wrote:

Hi John.

 Hey Tony,
   Thanks for sending this out! I really appreciate this work, as its been
 on my todo forever, and I've just not been able to focus on it.
 Currently it seems a bit minimal of a conversion (ideally there should
 be very little time code left), but It looks like a great start!

Thanks.

 I might be missing a subtlety in the ppc code, but I'm still not sure if
 I see the need for the clocksource settimeofday hook.
 
 update_vsyscall() is intended to provide a hook that allows the generic
 time code to provide all the needed timekeeping state to the arch
 specific vsyscall implementation. It is called any time the base
 timekeeping variables are changed.

Well as I just said the Daniel, I was under the impression I needed a
hook that was only called from settimeofday().  The comments I've
recieved from everyone has given me good cause to re-evaluate.

I think I can make it work without the hook, that started this
discussion.  Thomas, I think it's probably best to axe it now.  If I
/really/ need it then I'll start the discussion again :)  Thanks.
 
 I think it would be enlightening to flatten this out a bit. Putting both
 the timer_recalc_offset and clocksource_settime code in the same
 function. It might illustrate where some optimizations could be done and
 where it might make more sense to split things up.
 
 Also I'd leave timer_check_rtc() in the timer_interrupt for now (later
 moving it to tglx's generic rtc update).

Yes you're rigth I don't need to move the timer_check_rtc() call.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC] clocksouce implementation for powerpc

2007-06-20 Thread Tony Breeds
On Sat, Jun 16, 2007 at 08:51:23AM -0700, Daniel Walker wrote:
> On Sat, 2007-06-16 at 10:36 +, Thomas Gleixner wrote:
> > plain text document attachment
> > (clocksource-add-settimeofday-hook.patch)
> > From: Tony Breeds <[EMAIL PROTECTED] >
> > 
> > I'm working on a clocksource implementation for all powerpc platforms.
> > some of these platforms needs to do a little work as part of the
> > settimeofday() syscall and I can't see a way to do that without adding
> > this hook to clocksource.
> > 
> 
> 
> I'd like to see how this is used? If the code that uses this API change
> isn't ready yet, then this patch should really wait..

This is my current patch to rework arch/powerpc/kernel/time.c to create
a clocksource.  It's not ready for inclusion.

powerpc needs to keep the vdso in sync whenener settimeodfay() is
called.  Adding the hook the to the clocksource structure was my way of
allowing this to happen.  There are other approaches, but this seemed to
best allow for runtime.  Initially I considered using update_vsyscall()
but this is called from do_timer(), and I don't need this code run then
:(

This has been booted on pSeries and iSeries (I'm using glibc 2.5, which
uses the vdso gettimeoday())

All comments appreiated.

Index: working/arch/powerpc/Kconfig
===
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -31,6 +31,12 @@ config MMU
bool
default y
 
+config GENERIC_TIME
+   def_bool y
+
+config GENERIC_TIME_VSYSCALL
+   def_bool y
+
 config GENERIC_HARDIRQS
bool
default y
Index: working/arch/powerpc/kernel/time.c
===
--- working.orig/arch/powerpc/kernel/time.c
+++ working/arch/powerpc/kernel/time.c
@@ -74,6 +74,30 @@
 #endif
 #include 
 
+/* powerpc clocksource/clockevent code */
+
+/* TODO:
+ *  o Code style
+ ** Variable names ... be consistent.
+ *
+ * TODO: Clocksource
+ *  o Need a _USE_RTC() clocksource impelementation
+ *  o xtime:  Either time.c manages it, or clocksource does, not both
+ */
+
+#include 
+
+static struct clocksource clocksource_timebase = {
+   .name = "timebase",
+   .rating   = 200,
+   .flags= CLOCK_SOURCE_IS_CONTINUOUS,
+   .mask = CLOCKSOURCE_MASK(64),
+   .shift= 22,
+   .mult = 0,  /* To be filled in */
+   .read = NULL,   /* To be filled in */
+   .settimeofday = NULL,   /* To be filled in */
+};
+
 /* keep track of when we need to update the rtc */
 time_t last_rtc_update;
 #ifdef CONFIG_PPC_ISERIES
@@ -376,65 +400,6 @@ static __inline__ void timer_check_rtc(v
 }
 }
 
-/*
- * This version of gettimeofday has microsecond resolution.
- */
-static inline void __do_gettimeofday(struct timeval *tv)
-{
-   unsigned long sec, usec;
-   u64 tb_ticks, xsec;
-   struct gettimeofday_vars *temp_varp;
-   u64 temp_tb_to_xs, temp_stamp_xsec;
-
-   /*
-* These calculations are faster (gets rid of divides)
-* if done in units of 1/2^20 rather than microseconds.
-* The conversion to microseconds at the end is done
-* without a divide (and in fact, without a multiply)
-*/
-   temp_varp = do_gtod.varp;
-
-   /* Sampling the time base must be done after loading
-* do_gtod.varp in order to avoid racing with update_gtod.
-*/
-   data_barrier(temp_varp);
-   tb_ticks = get_tb() - temp_varp->tb_orig_stamp;
-   temp_tb_to_xs = temp_varp->tb_to_xs;
-   temp_stamp_xsec = temp_varp->stamp_xsec;
-   xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
-   sec = xsec / XSEC_PER_SEC;
-   usec = (unsigned long)xsec & (XSEC_PER_SEC - 1);
-   usec = SCALE_XSEC(usec, 100);
-
-   tv->tv_sec = sec;
-   tv->tv_usec = usec;
-}
-
-void do_gettimeofday(struct timeval *tv)
-{
-   if (__USE_RTC()) {
-   /* do this the old way */
-   unsigned long flags, seq;
-   unsigned int sec, nsec, usec;
-
-   do {
-   seq = read_seqbegin_irqsave(_lock, flags);
-   sec = xtime.tv_sec;
-   nsec = xtime.tv_nsec + tb_ticks_since(tb_last_jiffy);
-   } while (read_seqretry_irqrestore(_lock, seq, flags));
-   usec = nsec / 1000;
-   while (usec >= 100) {
-   usec -= 100;
-   ++sec;
-   }
-   tv->tv_sec = sec;
-   tv->tv_usec = usec;
-   return;
-   }
-   __do_gettimeofday(tv);
-}
-
-EXPORT_SYMBOL(do_gettimeofday);
 
 /*
  * There are two copies of tb_to_xs and stamp_xsec so that no
@@ -666,8 +631,8 @@ void timer_interrupt(struct pt_regs * re
 

[RFC] clocksouce implementation for powerpc

2007-06-20 Thread Tony Breeds
On Sat, Jun 16, 2007 at 08:51:23AM -0700, Daniel Walker wrote:
 On Sat, 2007-06-16 at 10:36 +, Thomas Gleixner wrote:
  plain text document attachment
  (clocksource-add-settimeofday-hook.patch)
  From: Tony Breeds [EMAIL PROTECTED] 
  
  I'm working on a clocksource implementation for all powerpc platforms.
  some of these platforms needs to do a little work as part of the
  settimeofday() syscall and I can't see a way to do that without adding
  this hook to clocksource.
  
 
 
 I'd like to see how this is used? If the code that uses this API change
 isn't ready yet, then this patch should really wait..

This is my current patch to rework arch/powerpc/kernel/time.c to create
a clocksource.  It's not ready for inclusion.

powerpc needs to keep the vdso in sync whenener settimeodfay() is
called.  Adding the hook the to the clocksource structure was my way of
allowing this to happen.  There are other approaches, but this seemed to
best allow for runtime.  Initially I considered using update_vsyscall()
but this is called from do_timer(), and I don't need this code run then
:(

This has been booted on pSeries and iSeries (I'm using glibc 2.5, which
uses the vdso gettimeoday())

All comments appreiated.

Index: working/arch/powerpc/Kconfig
===
--- working.orig/arch/powerpc/Kconfig
+++ working/arch/powerpc/Kconfig
@@ -31,6 +31,12 @@ config MMU
bool
default y
 
+config GENERIC_TIME
+   def_bool y
+
+config GENERIC_TIME_VSYSCALL
+   def_bool y
+
 config GENERIC_HARDIRQS
bool
default y
Index: working/arch/powerpc/kernel/time.c
===
--- working.orig/arch/powerpc/kernel/time.c
+++ working/arch/powerpc/kernel/time.c
@@ -74,6 +74,30 @@
 #endif
 #include asm/smp.h
 
+/* powerpc clocksource/clockevent code */
+
+/* TODO:
+ *  o Code style
+ ** Variable names ... be consistent.
+ *
+ * TODO: Clocksource
+ *  o Need a _USE_RTC() clocksource impelementation
+ *  o xtime:  Either time.c manages it, or clocksource does, not both
+ */
+
+#include linux/clocksource.h
+
+static struct clocksource clocksource_timebase = {
+   .name = timebase,
+   .rating   = 200,
+   .flags= CLOCK_SOURCE_IS_CONTINUOUS,
+   .mask = CLOCKSOURCE_MASK(64),
+   .shift= 22,
+   .mult = 0,  /* To be filled in */
+   .read = NULL,   /* To be filled in */
+   .settimeofday = NULL,   /* To be filled in */
+};
+
 /* keep track of when we need to update the rtc */
 time_t last_rtc_update;
 #ifdef CONFIG_PPC_ISERIES
@@ -376,65 +400,6 @@ static __inline__ void timer_check_rtc(v
 }
 }
 
-/*
- * This version of gettimeofday has microsecond resolution.
- */
-static inline void __do_gettimeofday(struct timeval *tv)
-{
-   unsigned long sec, usec;
-   u64 tb_ticks, xsec;
-   struct gettimeofday_vars *temp_varp;
-   u64 temp_tb_to_xs, temp_stamp_xsec;
-
-   /*
-* These calculations are faster (gets rid of divides)
-* if done in units of 1/2^20 rather than microseconds.
-* The conversion to microseconds at the end is done
-* without a divide (and in fact, without a multiply)
-*/
-   temp_varp = do_gtod.varp;
-
-   /* Sampling the time base must be done after loading
-* do_gtod.varp in order to avoid racing with update_gtod.
-*/
-   data_barrier(temp_varp);
-   tb_ticks = get_tb() - temp_varp-tb_orig_stamp;
-   temp_tb_to_xs = temp_varp-tb_to_xs;
-   temp_stamp_xsec = temp_varp-stamp_xsec;
-   xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
-   sec = xsec / XSEC_PER_SEC;
-   usec = (unsigned long)xsec  (XSEC_PER_SEC - 1);
-   usec = SCALE_XSEC(usec, 100);
-
-   tv-tv_sec = sec;
-   tv-tv_usec = usec;
-}
-
-void do_gettimeofday(struct timeval *tv)
-{
-   if (__USE_RTC()) {
-   /* do this the old way */
-   unsigned long flags, seq;
-   unsigned int sec, nsec, usec;
-
-   do {
-   seq = read_seqbegin_irqsave(xtime_lock, flags);
-   sec = xtime.tv_sec;
-   nsec = xtime.tv_nsec + tb_ticks_since(tb_last_jiffy);
-   } while (read_seqretry_irqrestore(xtime_lock, seq, flags));
-   usec = nsec / 1000;
-   while (usec = 100) {
-   usec -= 100;
-   ++sec;
-   }
-   tv-tv_sec = sec;
-   tv-tv_usec = usec;
-   return;
-   }
-   __do_gettimeofday(tv);
-}
-
-EXPORT_SYMBOL(do_gettimeofday);
 
 /*
  * There are two copies of tb_to_xs and stamp_xsec so that no
@@ -666,8 +631,8 @@ void timer_interrupt(struct pt_regs * re
if (per_cpu(last_jiffy, cpu) = tb_next_jiffy) {
tb_last_jiffy

Include hrtimer.h in tick.h.

2007-06-13 Thread Tony Breeds
From: Tony Breeds <[EMAIL PROTECTED]>

struct tick_shed in tick.h uses struct hrtimer, explictly include the
hrtimer header file to make sure this is defined.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 include/linux/tick.h |1 +
 1 file changed, 1 insertion(+)

Index: working/include/linux/tick.h
===
--- working.orig/include/linux/tick.h
+++ working/include/linux/tick.h
@@ -7,6 +7,7 @@
 #define _LINUX_TICK_H
 
 #include 
+#include 
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Add per clocksource hook to settimeofday().

2007-06-13 Thread Tony Breeds
I'm working on a clocksource implementation for all powerpc platforms.
some of these platforms needs to do a little work as part of the
settimeofday() syscall and I can't see a way to do that without adding
this hook to clocksource.

From: Tony Breeds <[EMAIL PROTECTED]>

Add per clocksource hook to settimeofday().

Some clocksources need to do extra work as part of the settimeofday call, this
hook make it easy to do so.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---

 include/linux/clocksource.h |3 +++
 kernel/time/timekeeping.c   |3 +++
 2 files changed, 6 insertions(+)

Index: working/include/linux/clocksource.h
===
--- working.orig/include/linux/clocksource.h
+++ working/include/linux/clocksource.h
@@ -50,6 +50,7 @@ struct clocksource;
  * @flags: flags describing special properties
  * @vread: vsyscall based read
  * @resume:resume function for the clocksource, if necessary
+ * @settimeofday:  [Optional] Do arch specific work during do_settimeofday
  * @cycle_interval:Used internally by timekeeping core, please ignore.
  * @xtime_interval:Used internally by timekeeping core, please ignore.
  */
@@ -68,6 +69,8 @@ struct clocksource {
cycle_t (*vread)(void);
void (*resume)(void);
 
+   void (*settimeofday)(struct clocksource *cs, struct timespec *ts);
+
/* timekeeping specific data, ignore */
cycle_t cycle_interval;
u64 xtime_interval;
Index: working/kernel/time/timekeeping.c
===
--- working.orig/kernel/time/timekeeping.c
+++ working/kernel/time/timekeeping.c
@@ -151,6 +151,9 @@ int do_settimeofday(struct timespec *tv)
clock->error = 0;
ntp_clear();
 
+   if (clock->settimeofday)
+   clock->settimeofday(clock, tv);
+
update_vsyscall(, clock);
 
write_sequnlock_irqrestore(_lock, flags);

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Add per clocksource hook to settimeofday().

2007-06-13 Thread Tony Breeds
I'm working on a clocksource implementation for all powerpc platforms.
some of these platforms needs to do a little work as part of the
settimeofday() syscall and I can't see a way to do that without adding
this hook to clocksource.

From: Tony Breeds [EMAIL PROTECTED]

Add per clocksource hook to settimeofday().

Some clocksources need to do extra work as part of the settimeofday call, this
hook make it easy to do so.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 include/linux/clocksource.h |3 +++
 kernel/time/timekeeping.c   |3 +++
 2 files changed, 6 insertions(+)

Index: working/include/linux/clocksource.h
===
--- working.orig/include/linux/clocksource.h
+++ working/include/linux/clocksource.h
@@ -50,6 +50,7 @@ struct clocksource;
  * @flags: flags describing special properties
  * @vread: vsyscall based read
  * @resume:resume function for the clocksource, if necessary
+ * @settimeofday:  [Optional] Do arch specific work during do_settimeofday
  * @cycle_interval:Used internally by timekeeping core, please ignore.
  * @xtime_interval:Used internally by timekeeping core, please ignore.
  */
@@ -68,6 +69,8 @@ struct clocksource {
cycle_t (*vread)(void);
void (*resume)(void);
 
+   void (*settimeofday)(struct clocksource *cs, struct timespec *ts);
+
/* timekeeping specific data, ignore */
cycle_t cycle_interval;
u64 xtime_interval;
Index: working/kernel/time/timekeeping.c
===
--- working.orig/kernel/time/timekeeping.c
+++ working/kernel/time/timekeeping.c
@@ -151,6 +151,9 @@ int do_settimeofday(struct timespec *tv)
clock-error = 0;
ntp_clear();
 
+   if (clock-settimeofday)
+   clock-settimeofday(clock, tv);
+
update_vsyscall(xtime, clock);
 
write_sequnlock_irqrestore(xtime_lock, flags);

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Include hrtimer.h in tick.h.

2007-06-13 Thread Tony Breeds
From: Tony Breeds [EMAIL PROTECTED]

struct tick_shed in tick.h uses struct hrtimer, explictly include the
hrtimer header file to make sure this is defined.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---

 include/linux/tick.h |1 +
 1 file changed, 1 insertion(+)

Index: working/include/linux/tick.h
===
--- working.orig/include/linux/tick.h
+++ working/include/linux/tick.h
@@ -7,6 +7,7 @@
 #define _LINUX_TICK_H
 
 #include linux/clockchips.h
+#include linux/hrtimer.h
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH/RFC] Fix build failure for drivers/ata/pata_scc.c

2007-05-11 Thread Tony Breeds
The commit d4b2bab4f26345ea1803feb23ea92fbe3f6b77bc added deadline support to
prereset and reset methods to libbata the pata_scc driver wasn't converted.
This patch is a naive attempt to bring this driver up to scratch.

Build failures are:
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:870: error: too few arguments to function 
'ata_std_prereset'
drivers/ata/pata_scc.c: In function 'scc_error_handler':
drivers/ata/pata_scc.c:916: warning: passing argument 2 of 'ata_bmdma_drive_eh' 
from incompatible pointer type
drivers/ata/pata_scc.c:916: warning: passing argument 3 of 'ata_bmdma_drive_eh' 
from incompatible pointer type
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:871: warning: control reaches end of non-void function

On a releated note scc_bus_post_reset() is (AFACT) identical to
ata_bus_post_reset(), would a patch to make ata_bus_post_reset() assesable to
drivers be accepted?


Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
CC: Tejun Heo <[EMAIL PROTECTED]>
CC: Akira Iguchi <[EMAIL PROTECTED]>
CC: Jeff Garzik <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
---

 drivers/ata/pata_scc.c |   48 -
 1 file changed, 29 insertions(+), 19 deletions(-)

Index: working/drivers/ata/pata_scc.c
===
--- working.orig/drivers/ata/pata_scc.c
+++ working/drivers/ata/pata_scc.c
@@ -489,23 +489,26 @@ static unsigned int scc_devchk (struct a
  * Note: Original code is ata_bus_post_reset().
  */
 
-static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
+static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
+  unsigned long deadline)
 {
struct ata_ioports *ioaddr = >ioaddr;
unsigned int dev0 = devmask & (1 << 0);
unsigned int dev1 = devmask & (1 << 1);
-   unsigned long timeout;
+   int rc;
 
/* if device 0 was found in ata_devchk, wait for its
 * BSY bit to clear
 */
-   if (dev0)
-   ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
+   if (dev0) {
+   rc = ata_wait_ready(ap, deadline);
+   if (rc && rc != -ENODEV)
+   return rc;
+   }
 
/* if device 1 was found in ata_devchk, wait for
 * register access, then wait for BSY to clear
 */
-   timeout = jiffies + ATA_TMOUT_BOOT;
while (dev1) {
u8 nsect, lbal;
 
@@ -514,14 +517,15 @@ static void scc_bus_post_reset (struct a
lbal = in_be32(ioaddr->lbal_addr);
if ((nsect == 1) && (lbal == 1))
break;
-   if (time_after(jiffies, timeout)) {
-   dev1 = 0;
-   break;
-   }
+   if (time_after(jiffies, deadline))
+   return -EBUSY;
msleep(50); /* give drive a breather */
}
-   if (dev1)
-   ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
+   if (dev1) {
+   rc = ata_wait_ready(ap, deadline);
+   if (rc && rc != -ENODEV)
+   return rc;
+   }
 
/* is all this really necessary? */
ap->ops->dev_select(ap, 0);
@@ -529,6 +533,8 @@ static void scc_bus_post_reset (struct a
ap->ops->dev_select(ap, 1);
if (dev0)
ap->ops->dev_select(ap, 0);
+
+   return 0;
 }
 
 /**
@@ -537,8 +543,8 @@ static void scc_bus_post_reset (struct a
  * Note: Original code is ata_bus_softreset().
  */
 
-static unsigned int scc_bus_softreset (struct ata_port *ap,
-  unsigned int devmask)
+static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int 
devmask,
+  unsigned long deadline)
 {
struct ata_ioports *ioaddr = >ioaddr;
 
@@ -570,7 +576,7 @@ static unsigned int scc_bus_softreset (s
if (scc_check_status(ap) == 0xFF)
return 0;
 
-   scc_bus_post_reset(ap, devmask);
+   scc_bus_post_reset(ap, devmask, deadline);
 
return 0;
 }
@@ -579,11 +585,13 @@ static unsigned int scc_bus_softreset (s
  * scc_std_softreset - reset host port via ATA SRST
  * @ap: port to reset
  * @classes: resulting classes of attached devices
+ * @deadline: deadline jiffies for the operation
  *
  * Note: Original code is ata_std_softreset().
  */
 
-static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)
+static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
+  unsigned long deadline)
 {
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 

[PATCH] Fix warning when building fs/afs/super.c

2007-05-11 Thread Tony Breeds

Fix build waning in fs/afs/super.c

fs/afs/super.c: In function 'afs_parse_options':
fs/afs/super.c:153: warning: passing argument 2 of 'match_token' discards 
qualifiers from pointer target type

AFS declares it's match_table as const, which is discrded in lib/parser.c.
match_token() doesn't modify the table so making it const should be safe.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
 include/linux/parser.h |2 +-
 lib/parser.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: working/include/linux/parser.h
===
--- working.orig/include/linux/parser.h
+++ working/include/linux/parser.h
@@ -25,7 +25,7 @@ typedef struct {
char *to;
 } substring_t;
 
-int match_token(char *, match_table_t table, substring_t args[]);
+int match_token(char *, const match_table_t table, substring_t args[]);
 int match_int(substring_t *, int *result);
 int match_octal(substring_t *, int *result);
 int match_hex(substring_t *, int *result);
Index: working/lib/parser.c
===
--- working.orig/lib/parser.c
+++ working/lib/parser.c
@@ -100,7 +100,7 @@ static int match_one(char *s, const char
  * format identifiers which will be taken into account when matching the
  * tokens, and whose locations will be returned in the @args array.
  */
-int match_token(char *s, match_table_t table, substring_t args[])
+int match_token(char *s, const match_table_t table, substring_t args[])
 {
const struct match_token *p;
 
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/ata/pata_hpt37x.c Remove unused static variable.

2007-05-11 Thread Tony Breeds

Remove unused static variable.

drivers/ata/pata_hpt37x.c: In function 'hpt37x_init_one':
drivers/ata/pata_hpt37x.c:935: warning: unused variable 'info_hpt372_50'

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
CC: Jeff Garzik <[EMAIL PROTECTED]>
CC: Alan Cox <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
---

 drivers/ata/pata_hpt37x.c |9 -
 1 file changed, 9 deletions(-)

Index: working/drivers/ata/pata_hpt37x.c
===
--- working.orig/drivers/ata/pata_hpt37x.c
+++ working/drivers/ata/pata_hpt37x.c
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_de
.udma_mask = 0x7f,
.port_ops = _port_ops
};
-   /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
-   static struct ata_port_info info_hpt372_50 = {
-   .sht = _sht,
-   .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
-   .pio_mask = 0x1f,
-   .mwdma_mask = 0x07,
-   .udma_mask = 0x3f,
-   .port_ops = _port_ops
-   };
/* HPT374 - UDMA133 */
static struct ata_port_info info_hpt374 = {
.sht = _sht,
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/ata/pata_hpt37x.c Remove unused static variable.

2007-05-11 Thread Tony Breeds

Remove unused static variable.

drivers/ata/pata_hpt37x.c: In function 'hpt37x_init_one':
drivers/ata/pata_hpt37x.c:935: warning: unused variable 'info_hpt372_50'

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
CC: Jeff Garzik [EMAIL PROTECTED]
CC: Alan Cox [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
---

 drivers/ata/pata_hpt37x.c |9 -
 1 file changed, 9 deletions(-)

Index: working/drivers/ata/pata_hpt37x.c
===
--- working.orig/drivers/ata/pata_hpt37x.c
+++ working/drivers/ata/pata_hpt37x.c
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_de
.udma_mask = 0x7f,
.port_ops = hpt372_port_ops
};
-   /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
-   static struct ata_port_info info_hpt372_50 = {
-   .sht = hpt37x_sht,
-   .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
-   .pio_mask = 0x1f,
-   .mwdma_mask = 0x07,
-   .udma_mask = 0x3f,
-   .port_ops = hpt372_port_ops
-   };
/* HPT374 - UDMA133 */
static struct ata_port_info info_hpt374 = {
.sht = hpt37x_sht,
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix warning when building fs/afs/super.c

2007-05-11 Thread Tony Breeds

Fix build waning in fs/afs/super.c

fs/afs/super.c: In function 'afs_parse_options':
fs/afs/super.c:153: warning: passing argument 2 of 'match_token' discards 
qualifiers from pointer target type

AFS declares it's match_table as const, which is discrded in lib/parser.c.
match_token() doesn't modify the table so making it const should be safe.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
---
 include/linux/parser.h |2 +-
 lib/parser.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: working/include/linux/parser.h
===
--- working.orig/include/linux/parser.h
+++ working/include/linux/parser.h
@@ -25,7 +25,7 @@ typedef struct {
char *to;
 } substring_t;
 
-int match_token(char *, match_table_t table, substring_t args[]);
+int match_token(char *, const match_table_t table, substring_t args[]);
 int match_int(substring_t *, int *result);
 int match_octal(substring_t *, int *result);
 int match_hex(substring_t *, int *result);
Index: working/lib/parser.c
===
--- working.orig/lib/parser.c
+++ working/lib/parser.c
@@ -100,7 +100,7 @@ static int match_one(char *s, const char
  * format identifiers which will be taken into account when matching the
  * tokens, and whose locations will be returned in the @args array.
  */
-int match_token(char *s, match_table_t table, substring_t args[])
+int match_token(char *s, const match_table_t table, substring_t args[])
 {
const struct match_token *p;
 
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH/RFC] Fix build failure for drivers/ata/pata_scc.c

2007-05-11 Thread Tony Breeds
The commit d4b2bab4f26345ea1803feb23ea92fbe3f6b77bc added deadline support to
prereset and reset methods to libbata the pata_scc driver wasn't converted.
This patch is a naive attempt to bring this driver up to scratch.

Build failures are:
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:870: error: too few arguments to function 
'ata_std_prereset'
drivers/ata/pata_scc.c: In function 'scc_error_handler':
drivers/ata/pata_scc.c:916: warning: passing argument 2 of 'ata_bmdma_drive_eh' 
from incompatible pointer type
drivers/ata/pata_scc.c:916: warning: passing argument 3 of 'ata_bmdma_drive_eh' 
from incompatible pointer type
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:871: warning: control reaches end of non-void function

On a releated note scc_bus_post_reset() is (AFACT) identical to
ata_bus_post_reset(), would a patch to make ata_bus_post_reset() assesable to
drivers be accepted?


Signed-off-by: Tony Breeds [EMAIL PROTECTED]
CC: Tejun Heo [EMAIL PROTECTED]
CC: Akira Iguchi [EMAIL PROTECTED]
CC: Jeff Garzik [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
---

 drivers/ata/pata_scc.c |   48 -
 1 file changed, 29 insertions(+), 19 deletions(-)

Index: working/drivers/ata/pata_scc.c
===
--- working.orig/drivers/ata/pata_scc.c
+++ working/drivers/ata/pata_scc.c
@@ -489,23 +489,26 @@ static unsigned int scc_devchk (struct a
  * Note: Original code is ata_bus_post_reset().
  */
 
-static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
+static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
+  unsigned long deadline)
 {
struct ata_ioports *ioaddr = ap-ioaddr;
unsigned int dev0 = devmask  (1  0);
unsigned int dev1 = devmask  (1  1);
-   unsigned long timeout;
+   int rc;
 
/* if device 0 was found in ata_devchk, wait for its
 * BSY bit to clear
 */
-   if (dev0)
-   ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
+   if (dev0) {
+   rc = ata_wait_ready(ap, deadline);
+   if (rc  rc != -ENODEV)
+   return rc;
+   }
 
/* if device 1 was found in ata_devchk, wait for
 * register access, then wait for BSY to clear
 */
-   timeout = jiffies + ATA_TMOUT_BOOT;
while (dev1) {
u8 nsect, lbal;
 
@@ -514,14 +517,15 @@ static void scc_bus_post_reset (struct a
lbal = in_be32(ioaddr-lbal_addr);
if ((nsect == 1)  (lbal == 1))
break;
-   if (time_after(jiffies, timeout)) {
-   dev1 = 0;
-   break;
-   }
+   if (time_after(jiffies, deadline))
+   return -EBUSY;
msleep(50); /* give drive a breather */
}
-   if (dev1)
-   ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
+   if (dev1) {
+   rc = ata_wait_ready(ap, deadline);
+   if (rc  rc != -ENODEV)
+   return rc;
+   }
 
/* is all this really necessary? */
ap-ops-dev_select(ap, 0);
@@ -529,6 +533,8 @@ static void scc_bus_post_reset (struct a
ap-ops-dev_select(ap, 1);
if (dev0)
ap-ops-dev_select(ap, 0);
+
+   return 0;
 }
 
 /**
@@ -537,8 +543,8 @@ static void scc_bus_post_reset (struct a
  * Note: Original code is ata_bus_softreset().
  */
 
-static unsigned int scc_bus_softreset (struct ata_port *ap,
-  unsigned int devmask)
+static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int 
devmask,
+  unsigned long deadline)
 {
struct ata_ioports *ioaddr = ap-ioaddr;
 
@@ -570,7 +576,7 @@ static unsigned int scc_bus_softreset (s
if (scc_check_status(ap) == 0xFF)
return 0;
 
-   scc_bus_post_reset(ap, devmask);
+   scc_bus_post_reset(ap, devmask, deadline);
 
return 0;
 }
@@ -579,11 +585,13 @@ static unsigned int scc_bus_softreset (s
  * scc_std_softreset - reset host port via ATA SRST
  * @ap: port to reset
  * @classes: resulting classes of attached devices
+ * @deadline: deadline jiffies for the operation
  *
  * Note: Original code is ata_std_softreset().
  */
 
-static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)
+static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
+  unsigned long deadline)
 {
unsigned int slave_possible = ap-flags  ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 0, err_mask;
@@ -607,7 +615,7 @@ static int scc_std_softreset (struct ata
 
/* issue bus reset */
DPRINTK(about to softreset

[LGUEST] Look in object dir for .config

2007-05-02 Thread Tony Breeds
From: Tony Breeds <[EMAIL PROTECTED]>

[LGUEST] Look in object dir for .config

If you build with make O= then .config isn't in ../../, this patch
goes partway to making sure that you don't dirty the source tree.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
 Documentation/lguest/Makefile |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

--- Documentation/lguest/Makefile.orig  2007-05-03 14:23:07.0 +1000
+++ Documentation/lguest/Makefile   2007-05-03 14:25:27.0 +1000
@@ -1,8 +1,15 @@
 # This creates the demonstration utility "lguest" which runs a Linux guest.
 
+# For those people that have a separate object dir, look there for .config
+KBUILD_OUTPUT := ../..
+ifdef O
+  ifeq ("$(origin O)", "command line")
+KBUILD_OUTPUT := $(O)
+  endif
+endif
 # We rely on CONFIG_PAGE_OFFSET to know the highest address we can put
 # the lguest binary.
-include ../../.config
+include $(KBUILD_OUTPUT)/.config
 LGUEST_GUEST_TOP := ($(CONFIG_PAGE_OFFSET) - 0x0800)
 
 CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 \

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[LGUEST] Look in object dir for .config

2007-05-02 Thread Tony Breeds
From: Tony Breeds [EMAIL PROTECTED]

[LGUEST] Look in object dir for .config

If you build with make O= then .config isn't in ../../, this patch
goes partway to making sure that you don't dirty the source tree.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
 Documentation/lguest/Makefile |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

--- Documentation/lguest/Makefile.orig  2007-05-03 14:23:07.0 +1000
+++ Documentation/lguest/Makefile   2007-05-03 14:25:27.0 +1000
@@ -1,8 +1,15 @@
 # This creates the demonstration utility lguest which runs a Linux guest.
 
+# For those people that have a separate object dir, look there for .config
+KBUILD_OUTPUT := ../..
+ifdef O
+  ifeq ($(origin O), command line)
+KBUILD_OUTPUT := $(O)
+  endif
+endif
 # We rely on CONFIG_PAGE_OFFSET to know the highest address we can put
 # the lguest binary.
-include ../../.config
+include $(KBUILD_OUTPUT)/.config
 LGUEST_GUEST_TOP := ($(CONFIG_PAGE_OFFSET) - 0x0800)
 
 CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 \

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-04 Thread Tony Breeds
On Mon, Apr 02, 2007 at 11:51:09PM -0400, Rob Landley wrote:
 
> So "make oldconfig ARCH=powerpc" will accept a config that doesn't have a 
> platform selected?

It seems so.

I think the patch below will fix that by forcing at least one platform
to be selected.  Can you try it and see if it helps with your current
problem?

> Hmmm...  So CONFIG_PPC_MULTIPLATFORM doesn't cover it?  ("There is no help 
> available for this kernel option"...  Maybe a website somewhere?)

CONFIG_PPC_MULTIPLATFORM Allows you to select from the options, but
isn't a valid platform in itself.
 
> Er, never.  I was largely guessing at what I needed via menuconfig.  (I'm 
> trying to get something I can boot to a shell prompt under QEMU.)

Ahh.
 
> I'll try this CHRP thing...

Perhaps starting with make chrp32_defconfig would be a reasonable
starting point?

---
 arch/powerpc/Kconfig |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d6abe49..f3f0628 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -360,6 +360,14 @@ endmenu
 
 source "init/Kconfig"
 
+config PPC_PLATFORM_CHOSEN
+   def_bool n
+
+config PPC_DEFAULT_PLATFORM
+   def_bool PPC_MULTIPLATFORM && !PPC_PLATFORM_CHOSEN
+   select PPC_CHRPif PPC32
+   select PPC_PSERIES if PPC64
+
 menu "Platform support"
depends on PPC64 || CLASSIC32
 
@@ -406,12 +414,15 @@ config PPC_PSERIES
select RTAS_ERROR_LOGGING
select PPC_UDBG_16550
select PPC_NATIVE
+# No need to "select PPC_PLATFORM_CHOSEN" for pSeries, as it is the default
+# platform for PPC64, see PPC_DEFAULT_PLATFORM
default y
 
 config PPC_ISERIES
bool "IBM Legacy iSeries"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_INDIRECT_IO
+   select PPC_PLATFORM_CHOSEN
 
 config PPC_CHRP
bool "Common Hardware Reference Platform (CHRP) based machines"
@@ -423,6 +434,8 @@ config PPC_CHRP
select PPC_MPC106
select PPC_UDBG_16550
select PPC_NATIVE
+# No need to "select PPC_PLATFORM_CHOSEN" here, as it is the default platform 
+# for PPC32, see PPC_DEFAULT_PLATFORM
default y
 
 config PPC_MPC52xx
@@ -436,6 +449,7 @@ config PPC_EFIKA
select RTAS_PROC
select PPC_MPC52xx
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default n
 
 config PPC_LITE5200
@@ -451,6 +465,7 @@ config PPC_PMAC
select PPC_INDIRECT_PCI if PPC32
select PPC_MPC106 if PPC32
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default y
 
 config PPC_PMAC64
@@ -461,6 +476,7 @@ config PPC_PMAC64
select MPIC_BROKEN_U3
select GENERIC_TBSYNC
select PPC_970_NAP
+   select PPC_PLATFORM_CHOSEN
default y
 
 config PPC_PREP
@@ -471,6 +487,7 @@ config PPC_PREP
select PPC_INDIRECT_PCI
select PPC_UDBG_16550
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default n
 
 config PPC_MAPLE
@@ -485,6 +502,7 @@ config PPC_MAPLE
select PPC_NATIVE
select PPC_RTAS
select ATA_NONSTANDARD if ATA
+   select PPC_PLATFORM_CHOSEN
default n
help
   This option enables support for the Maple 970FX Evaluation Board.
@@ -498,6 +516,7 @@ config PPC_PASEMI
select PPC_UDBG_16550
select GENERIC_TBSYNC
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
help
  This option enables support for PA Semi's PWRficient line
  of SoC processors, including PA6T-1682M
@@ -524,11 +543,13 @@ config PPC_IBM_CELL_BLADE
select MMIO_NVRAM
select PPC_UDBG_16550
select UDBG_RTAS_CONSOLE
+   select PPC_PLATFORM_CHOSEN
 
 config PPC_PS3
bool "Sony PS3 (incomplete)"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL
+   select PPC_PLATFORM_CHOSEN
help
  This option enables support for the Sony PS3 game console
  and other platforms using the PS3 hypervisor.
-- 
1.5.0.6


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-04 Thread Tony Breeds
On Mon, Apr 02, 2007 at 11:51:09PM -0400, Rob Landley wrote:
 
 So make oldconfig ARCH=powerpc will accept a config that doesn't have a 
 platform selected?

It seems so.

I think the patch below will fix that by forcing at least one platform
to be selected.  Can you try it and see if it helps with your current
problem?

 Hmmm...  So CONFIG_PPC_MULTIPLATFORM doesn't cover it?  (There is no help 
 available for this kernel option...  Maybe a website somewhere?)

CONFIG_PPC_MULTIPLATFORM Allows you to select from the options, but
isn't a valid platform in itself.
 
 Er, never.  I was largely guessing at what I needed via menuconfig.  (I'm 
 trying to get something I can boot to a shell prompt under QEMU.)

Ahh.
 
 I'll try this CHRP thing...

Perhaps starting with make chrp32_defconfig would be a reasonable
starting point?

---
 arch/powerpc/Kconfig |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d6abe49..f3f0628 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -360,6 +360,14 @@ endmenu
 
 source init/Kconfig
 
+config PPC_PLATFORM_CHOSEN
+   def_bool n
+
+config PPC_DEFAULT_PLATFORM
+   def_bool PPC_MULTIPLATFORM  !PPC_PLATFORM_CHOSEN
+   select PPC_CHRPif PPC32
+   select PPC_PSERIES if PPC64
+
 menu Platform support
depends on PPC64 || CLASSIC32
 
@@ -406,12 +414,15 @@ config PPC_PSERIES
select RTAS_ERROR_LOGGING
select PPC_UDBG_16550
select PPC_NATIVE
+# No need to select PPC_PLATFORM_CHOSEN for pSeries, as it is the default
+# platform for PPC64, see PPC_DEFAULT_PLATFORM
default y
 
 config PPC_ISERIES
bool IBM Legacy iSeries
depends on PPC_MULTIPLATFORM  PPC64
select PPC_INDIRECT_IO
+   select PPC_PLATFORM_CHOSEN
 
 config PPC_CHRP
bool Common Hardware Reference Platform (CHRP) based machines
@@ -423,6 +434,8 @@ config PPC_CHRP
select PPC_MPC106
select PPC_UDBG_16550
select PPC_NATIVE
+# No need to select PPC_PLATFORM_CHOSEN here, as it is the default platform 
+# for PPC32, see PPC_DEFAULT_PLATFORM
default y
 
 config PPC_MPC52xx
@@ -436,6 +449,7 @@ config PPC_EFIKA
select RTAS_PROC
select PPC_MPC52xx
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default n
 
 config PPC_LITE5200
@@ -451,6 +465,7 @@ config PPC_PMAC
select PPC_INDIRECT_PCI if PPC32
select PPC_MPC106 if PPC32
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default y
 
 config PPC_PMAC64
@@ -461,6 +476,7 @@ config PPC_PMAC64
select MPIC_BROKEN_U3
select GENERIC_TBSYNC
select PPC_970_NAP
+   select PPC_PLATFORM_CHOSEN
default y
 
 config PPC_PREP
@@ -471,6 +487,7 @@ config PPC_PREP
select PPC_INDIRECT_PCI
select PPC_UDBG_16550
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
default n
 
 config PPC_MAPLE
@@ -485,6 +502,7 @@ config PPC_MAPLE
select PPC_NATIVE
select PPC_RTAS
select ATA_NONSTANDARD if ATA
+   select PPC_PLATFORM_CHOSEN
default n
help
   This option enables support for the Maple 970FX Evaluation Board.
@@ -498,6 +516,7 @@ config PPC_PASEMI
select PPC_UDBG_16550
select GENERIC_TBSYNC
select PPC_NATIVE
+   select PPC_PLATFORM_CHOSEN
help
  This option enables support for PA Semi's PWRficient line
  of SoC processors, including PA6T-1682M
@@ -524,11 +543,13 @@ config PPC_IBM_CELL_BLADE
select MMIO_NVRAM
select PPC_UDBG_16550
select UDBG_RTAS_CONSOLE
+   select PPC_PLATFORM_CHOSEN
 
 config PPC_PS3
bool Sony PS3 (incomplete)
depends on PPC_MULTIPLATFORM  PPC64
select PPC_CELL
+   select PPC_PLATFORM_CHOSEN
help
  This option enables support for the Sony PS3 game console
  and other platforms using the PS3 hypervisor.
-- 
1.5.0.6


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-02 Thread Tony Breeds
On Mon, Apr 02, 2007 at 03:14:14PM -0400, Rob Landley wrote:
 
> Sure, quite easily the source of the trouble.  Attached in both full .config 
> and mini.config formats.

Okay, I have no idea how it happend but you seem to have an invalid
config.  It looks to me like you need to select a platform.

One of the following:
CONFIG_PPC_PSERIES
CONFIG_PPC_MAPLE
CONFIG_PPC_IBM_CELL_BLADE
CONFIG_PPC_PS3
CONFIG_PPC_CHRP
CONFIG_PPC_EFIKA
CONFIG_PPC_PMAC

When did this config last build a zImage?  I'm guessing either CHRP or
PMAC?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-02 Thread Tony Breeds
On Mon, Apr 02, 2007 at 03:14:14PM -0400, Rob Landley wrote:
 
 Sure, quite easily the source of the trouble.  Attached in both full .config 
 and mini.config formats.

Okay, I have no idea how it happend but you seem to have an invalid
config.  It looks to me like you need to select a platform.

One of the following:
CONFIG_PPC_PSERIES
CONFIG_PPC_MAPLE
CONFIG_PPC_IBM_CELL_BLADE
CONFIG_PPC_PS3
CONFIG_PPC_CHRP
CONFIG_PPC_EFIKA
CONFIG_PPC_PMAC

When did this config last build a zImage?  I'm guessing either CHRP or
PMAC?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-01 Thread Tony Breeds
On Fri, Mar 30, 2007 at 05:53:26PM -0400, Rob Landley wrote:
> So doing:
> 
>   make ARCH=powerpc CROSS=powerpc-
> 
> Chugs along fine for a while, but then it ends with:
> 
> MODPOST vmlinux

There should be a lot of activity between this step and the error below.

>   ln: accessing `arch/powerpc/boot/zImage': No such file or directory
>   make[1]: *** [arch/powerpc/boot/zImage] Error 1
>   make: *** [zImage] Error 2
> 
> I.E. it builds vmlinux, then dies because there's no zImage, which it never 
> tried to build...

zImage is built later, AFAICT
 
> Is there no working default "make" target for powerpc, or did I do something 
> wrong?  Could this be a .config issue?

Possibly, can we see your .config?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Powerpc build unhappy in 2.6.20.4?

2007-04-01 Thread Tony Breeds
On Fri, Mar 30, 2007 at 05:53:26PM -0400, Rob Landley wrote:
 So doing:
 
   make ARCH=powerpc CROSS=powerpc-
 
 Chugs along fine for a while, but then it ends with:
 
 MODPOST vmlinux

There should be a lot of activity between this step and the error below.

   ln: accessing `arch/powerpc/boot/zImage': No such file or directory
   make[1]: *** [arch/powerpc/boot/zImage] Error 1
   make: *** [zImage] Error 2
 
 I.E. it builds vmlinux, then dies because there's no zImage, which it never 
 tried to build...

zImage is built later, AFAICT
 
 Is there no working default make target for powerpc, or did I do something 
 wrong?  Could this be a .config issue?

Possibly, can we see your .config?

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.21-rc2-mm2: drivers/net/wireless/libertas/debugfs.c addr bogosity

2007-03-11 Thread Tony Breeds
On Fri, Mar 09, 2007 at 09:14:29AM -0800, Randy Dunlap wrote:
 
> Good to use FIELD_SIZEOF(),

Thanks.

> but in general, we prefer to use it
> directly, not in yet another wrapper.

I left the item_{size,addr} in place as it seemed to make the item[]
more compact.

I'm not certain using the FIELD_SIZEOF() macro directly is a win.

From: Tony Breeds <[EMAIL PROTECTED]>

Cleanup drivers/net/wireless/libertas/debugfs.c to use standard kernel macros 
and functions.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
only compile tested on x86

 drivers/net/wireless/libertas/debugfs.c |   56 +++
 1 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/libertas/debugfs.c 
b/drivers/net/wireless/libertas/debugfs.c
index 3ad1e03..8b0e3ec 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1771,58 +1771,26 @@ void libertas_debugfs_remove_one(wlan_private *priv)
 }
 
 /* debug entry */
-
-#define item_size(n) (sizeof ((wlan_adapter *)0)->n)
-#define item_addr(n) ((u32) &((wlan_adapter *)0)->n)
-
 struct debug_data {
char name[32];
u32 size;
u32 addr;
 };
 
-/* To debug any member of wlan_adapter, simply add one line here.
- */
+/* To debug any member of wlan_adapter, simply add a record here. */
 static struct debug_data items[] = {
-   {"intcounter", item_size(intcounter), item_addr(intcounter)},
-   {"psmode", item_size(psmode), item_addr(psmode)},
-   {"psstate", item_size(psstate), item_addr(psstate)},
+   { .name = "intcounter",
+ .size = FIELD_SIZEOF(wlan_adapter, intcounter),
+ .addr = offsetof(wlan_adapter, intcounter) },
+   { .name = "psmode",
+ .size = FIELD_SIZEOF(wlan_adapter, psmode),
+ .addr = offsetof(wlan_adapter, psmode) },
+   { .name = "psstate",
+ .size = FIELD_SIZEOF(wlan_adapter, psstate),
+ .addr = offsetof(wlan_adapter, psstate) },
 };
 
-static int num_of_items = sizeof(items) / sizeof(items[0]);
-
-/**
- *  @brief convert string to number
- *
- *  @param s  pointer to numbered string
- *  @return   converted number from string s
- */
-static int string_to_number(char *s)
-{
-   int r = 0;
-   int base = 0;
-
-   if ((strncmp(s, "0x", 2) == 0) || (strncmp(s, "0X", 2) == 0))
-   base = 16;
-   else
-   base = 10;
-
-   if (base == 16)
-   s += 2;
-
-   for (s = s; *s != 0; s++) {
-   if ((*s >= 48) && (*s <= 57))
-   r = (r * base) + (*s - 48);
-   else if ((*s >= 65) && (*s <= 70))
-   r = (r * base) + (*s - 55);
-   else if ((*s >= 97) && (*s <= 102))
-   r = (r * base) + (*s - 87);
-   else
-   break;
-   }
-
-   return r;
-}
+static int num_of_items = ARRAY_SIZE(items);
 
 /**
  *  @brief proc read function
@@ -1912,7 +1880,7 @@ static int wlan_debugfs_write(struct file *f, const char 
__user *buf,
if (!p2)
break;
p2++;
-   r = string_to_number(p2);
+   r = simple_strtoul(p2, NULL, 0);
if (d[i].size == 1)
*((u8 *) d[i].addr) = (u8) r;
else if (d[i].size == 2)


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.21-rc2-mm2: drivers/net/wireless/libertas/debugfs.c addr bogosity

2007-03-11 Thread Tony Breeds
On Fri, Mar 09, 2007 at 09:14:29AM -0800, Randy Dunlap wrote:
 
 Good to use FIELD_SIZEOF(),

Thanks.

 but in general, we prefer to use it
 directly, not in yet another wrapper.

I left the item_{size,addr} in place as it seemed to make the item[]
more compact.

I'm not certain using the FIELD_SIZEOF() macro directly is a win.

From: Tony Breeds [EMAIL PROTECTED]

Cleanup drivers/net/wireless/libertas/debugfs.c to use standard kernel macros 
and functions.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
only compile tested on x86

 drivers/net/wireless/libertas/debugfs.c |   56 +++
 1 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/libertas/debugfs.c 
b/drivers/net/wireless/libertas/debugfs.c
index 3ad1e03..8b0e3ec 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1771,58 +1771,26 @@ void libertas_debugfs_remove_one(wlan_private *priv)
 }
 
 /* debug entry */
-
-#define item_size(n) (sizeof ((wlan_adapter *)0)-n)
-#define item_addr(n) ((u32) ((wlan_adapter *)0)-n)
-
 struct debug_data {
char name[32];
u32 size;
u32 addr;
 };
 
-/* To debug any member of wlan_adapter, simply add one line here.
- */
+/* To debug any member of wlan_adapter, simply add a record here. */
 static struct debug_data items[] = {
-   {intcounter, item_size(intcounter), item_addr(intcounter)},
-   {psmode, item_size(psmode), item_addr(psmode)},
-   {psstate, item_size(psstate), item_addr(psstate)},
+   { .name = intcounter,
+ .size = FIELD_SIZEOF(wlan_adapter, intcounter),
+ .addr = offsetof(wlan_adapter, intcounter) },
+   { .name = psmode,
+ .size = FIELD_SIZEOF(wlan_adapter, psmode),
+ .addr = offsetof(wlan_adapter, psmode) },
+   { .name = psstate,
+ .size = FIELD_SIZEOF(wlan_adapter, psstate),
+ .addr = offsetof(wlan_adapter, psstate) },
 };
 
-static int num_of_items = sizeof(items) / sizeof(items[0]);
-
-/**
- *  @brief convert string to number
- *
- *  @param s  pointer to numbered string
- *  @return   converted number from string s
- */
-static int string_to_number(char *s)
-{
-   int r = 0;
-   int base = 0;
-
-   if ((strncmp(s, 0x, 2) == 0) || (strncmp(s, 0X, 2) == 0))
-   base = 16;
-   else
-   base = 10;
-
-   if (base == 16)
-   s += 2;
-
-   for (s = s; *s != 0; s++) {
-   if ((*s = 48)  (*s = 57))
-   r = (r * base) + (*s - 48);
-   else if ((*s = 65)  (*s = 70))
-   r = (r * base) + (*s - 55);
-   else if ((*s = 97)  (*s = 102))
-   r = (r * base) + (*s - 87);
-   else
-   break;
-   }
-
-   return r;
-}
+static int num_of_items = ARRAY_SIZE(items);
 
 /**
  *  @brief proc read function
@@ -1912,7 +1880,7 @@ static int wlan_debugfs_write(struct file *f, const char 
__user *buf,
if (!p2)
break;
p2++;
-   r = string_to_number(p2);
+   r = simple_strtoul(p2, NULL, 0);
if (d[i].size == 1)
*((u8 *) d[i].addr) = (u8) r;
else if (d[i].size == 2)


Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.21-rc2-mm2: drivers/net/wireless/libertas/debugfs.c addr bogosity

2007-03-08 Thread Tony Breeds
On Wed, Mar 07, 2007 at 03:00:57PM -0800, Andrew Morton wrote:
> On Wed, 7 Mar 2007 23:41:16 +0100
> Adrian Bunk <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, Mar 06, 2007 at 12:44:08AM -0800, Andrew Morton wrote:
> > >...
> > > Changes since 2.6.20-rc2-mm1:
> > >...
> > >  git-netdev-all.patch
> > >...
> > >  git trees
> > >...
> > 
> > drivers/net/wireless/libertas/debugfs.c contains:
> >   #define item_addr(n) ((u32) &((wlan_adapter *)0)->n)
> > 
> > This is wrong on 64bit architectures.
> 
> Is OK - it is simply yet another reimplementation of offsetof().  Hint.

Perhaps something like?

Against 2.6.21-rc3-mm2

From: Tony Breeds <[EMAIL PROTECTED]>

Cleanup drivers/net/wireless/libertas/debugfs.c to use standard kernel macros 
and functions.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>

---
only compile tested on x86

 debugfs.c |   41 -
 1 file changed, 4 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/libertas/debugfs.c 
b/drivers/net/wireless/libertas/debugfs.c
index 3ad1e03..51dfd20 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1772,8 +1772,8 @@ void libertas_debugfs_remove_one(wlan_private *priv)
 
 /* debug entry */
 
-#define item_size(n) (sizeof ((wlan_adapter *)0)->n)
-#define item_addr(n) ((u32) &((wlan_adapter *)0)->n)
+#define item_size(n)   (FIELD_SIZEOF(wlan_adapter, n))
+#define item_addr(n)   (offsetof(wlan_adapter, n))
 
 struct debug_data {
char name[32];
@@ -1789,40 +1789,7 @@ static struct debug_data items[] = {
{"psstate", item_size(psstate), item_addr(psstate)},
 };
 
-static int num_of_items = sizeof(items) / sizeof(items[0]);
-
-/**
- *  @brief convert string to number
- *
- *  @param s  pointer to numbered string
- *  @return   converted number from string s
- */
-static int string_to_number(char *s)
-{
-   int r = 0;
-   int base = 0;
-
-   if ((strncmp(s, "0x", 2) == 0) || (strncmp(s, "0X", 2) == 0))
-   base = 16;
-   else
-   base = 10;
-
-   if (base == 16)
-   s += 2;
-
-   for (s = s; *s != 0; s++) {
-   if ((*s >= 48) && (*s <= 57))
-   r = (r * base) + (*s - 48);
-   else if ((*s >= 65) && (*s <= 70))
-   r = (r * base) + (*s - 55);
-   else if ((*s >= 97) && (*s <= 102))
-   r = (r * base) + (*s - 87);
-   else
-   break;
-   }
-
-   return r;
-}
+static int num_of_items = ARRAY_SIZE(items);
 
 /**
  *  @brief proc read function
@@ -1912,7 +1879,7 @@ static int wlan_debugfs_write(struct file *f, const char 
__user *buf,
if (!p2)
break;
p2++;
-   r = string_to_number(p2);
+   r = simple_strtoul(p2, NULL, 0);
if (d[i].size == 1)
*((u8 *) d[i].addr) = (u8) r;
else if (d[i].size == 2)
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.21-rc2-mm2: drivers/net/wireless/libertas/debugfs.c addr bogosity

2007-03-08 Thread Tony Breeds
On Wed, Mar 07, 2007 at 03:00:57PM -0800, Andrew Morton wrote:
 On Wed, 7 Mar 2007 23:41:16 +0100
 Adrian Bunk [EMAIL PROTECTED] wrote:
 
  On Tue, Mar 06, 2007 at 12:44:08AM -0800, Andrew Morton wrote:
  ...
   Changes since 2.6.20-rc2-mm1:
  ...
git-netdev-all.patch
  ...
git trees
  ...
  
  drivers/net/wireless/libertas/debugfs.c contains:
#define item_addr(n) ((u32) ((wlan_adapter *)0)-n)
  
  This is wrong on 64bit architectures.
 
 Is OK - it is simply yet another reimplementation of offsetof().  Hint.

Perhaps something like?

Against 2.6.21-rc3-mm2

From: Tony Breeds [EMAIL PROTECTED]

Cleanup drivers/net/wireless/libertas/debugfs.c to use standard kernel macros 
and functions.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]

---
only compile tested on x86

 debugfs.c |   41 -
 1 file changed, 4 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/libertas/debugfs.c 
b/drivers/net/wireless/libertas/debugfs.c
index 3ad1e03..51dfd20 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -1772,8 +1772,8 @@ void libertas_debugfs_remove_one(wlan_private *priv)
 
 /* debug entry */
 
-#define item_size(n) (sizeof ((wlan_adapter *)0)-n)
-#define item_addr(n) ((u32) ((wlan_adapter *)0)-n)
+#define item_size(n)   (FIELD_SIZEOF(wlan_adapter, n))
+#define item_addr(n)   (offsetof(wlan_adapter, n))
 
 struct debug_data {
char name[32];
@@ -1789,40 +1789,7 @@ static struct debug_data items[] = {
{psstate, item_size(psstate), item_addr(psstate)},
 };
 
-static int num_of_items = sizeof(items) / sizeof(items[0]);
-
-/**
- *  @brief convert string to number
- *
- *  @param s  pointer to numbered string
- *  @return   converted number from string s
- */
-static int string_to_number(char *s)
-{
-   int r = 0;
-   int base = 0;
-
-   if ((strncmp(s, 0x, 2) == 0) || (strncmp(s, 0X, 2) == 0))
-   base = 16;
-   else
-   base = 10;
-
-   if (base == 16)
-   s += 2;
-
-   for (s = s; *s != 0; s++) {
-   if ((*s = 48)  (*s = 57))
-   r = (r * base) + (*s - 48);
-   else if ((*s = 65)  (*s = 70))
-   r = (r * base) + (*s - 55);
-   else if ((*s = 97)  (*s = 102))
-   r = (r * base) + (*s - 87);
-   else
-   break;
-   }
-
-   return r;
-}
+static int num_of_items = ARRAY_SIZE(items);
 
 /**
  *  @brief proc read function
@@ -1912,7 +1879,7 @@ static int wlan_debugfs_write(struct file *f, const char 
__user *buf,
if (!p2)
break;
p2++;
-   r = string_to_number(p2);
+   r = simple_strtoul(p2, NULL, 0);
if (d[i].size == 1)
*((u8 *) d[i].addr) = (u8) r;
else if (d[i].size == 2)
Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix soft lockup with iSeries viocd driver

2007-02-28 Thread Tony Breeds
From: Tony Breeds <[EMAIL PROTECTED]>

Fix soft lockup with iSeries viocd driver, caused by eventually calling
end_that_request_first() with nr_bytes 0.

The lockup is triggered by hald, interrogating the device.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>

---
 viocd.c |   27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

Index: linux-2.6.20-rc5/drivers/cdrom/viocd.c
===
--- linux-2.6.20-rc5.orig/drivers/cdrom/viocd.c
+++ linux-2.6.20-rc5/drivers/cdrom/viocd.c
@@ -376,6 +376,25 @@ static int send_request(struct request *
return 0;
 }
 
+static void viocd_end_request(struct request *req, int uptodate)
+{
+   int nsectors = req->hard_nr_sectors;
+
+   /*
+* Make sure it's fully ended, and ensure that we process
+* at least one sector.
+*/
+   if (blk_pc_request(req))
+   nsectors = (req->data_len + 511) >> 9;
+   if (!nsectors)
+   nsectors = 1;
+
+   if (end_that_request_first(req, uptodate, nsectors))
+   BUG();
+   add_disk_randomness(req->rq_disk);
+   blkdev_dequeue_request(req);
+   end_that_request_last(req, uptodate);
+}
 
 static int rwreq;
 
@@ -385,11 +404,11 @@ static void do_viocd_request(request_que
 
while ((rwreq == 0) && ((req = elv_next_request(q)) != NULL)) {
if (!blk_fs_request(req))
-   end_request(req, 0);
+   viocd_end_request(req, 0);
else if (send_request(req) < 0) {
printk(VIOCD_KERN_WARNING
"unable to send message to OS/400!");
-   end_request(req, 0);
+   viocd_end_request(req, 0);
} else
rwreq++;
}
@@ -601,9 +620,9 @@ return_complete:
"with rc %d:0x%04X: %s\n",
req, event->xRc,
bevent->sub_result, err->msg);
-   end_request(req, 0);
+   viocd_end_request(req, 0);
} else
-   end_request(req, 1);
+   viocd_end_request(req, 1);
 
/* restart handling of incoming requests */
spin_unlock_irqrestore(_reqlock, flags);





Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!



Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >