2009-09-03 21:25:46

by Robin Getz

[permalink] [raw]
Subject: asm-generic update candidates?

Arnd:

I was reviewing some files in ./arch/blackfin/include for missing copyrights,
and while tracking things down I noticed there were still some likely
candidates for inclusion in asm-generic...

All seem to be the same file:

md5sum:
5b6b31d728ed2ed0df73c56676fdc68f blackfin/include/asm/fb.h
5b6b31d728ed2ed0df73c56676fdc68f cris/include/asm/fb.h
5b6b31d728ed2ed0df73c56676fdc68f frv/include/asm/fb.h
5b6b31d728ed2ed0df73c56676fdc68f h8300/include/asm/fb.h
5b6b31d728ed2ed0df73c56676fdc68f s390/include/asm/fb.h
5b6b31d728ed2ed0df73c56676fdc68f xtensa/include/asm/fb.h

e31d052cbba4f417ba2158a41b0d8709 arm/include/asm/fb.h
e31d052cbba4f417ba2158a41b0d8709 m32r/include/asm/fb.h
e31d052cbba4f417ba2158a41b0d8709 sh/include/asm/fb.h

Mostly the same:
mn10300/include/asm/shmparam.h
frv/include/asm/shmparam.h
m68k/include/asm/shmparam.h
h8300/include/asm/shmparam.h
alpha/include/asm/shmparam.h
x86/include/asm/shmparam.h
m32r/include/asm/shmparam.h
avr32/include/asm/shmparam.h
powerpc/include/asm/shmparam.h
blackfin/include/asm/shmparam.h


All the same:
frv/include/asm/ucontext.h
h8300/include/asm/ucontext.h
avr32/include/asm/ucontext.h
m32r/include/asm/ucontext.h
cris/include/asm/ucontext.h
alpha/include/asm/ucontext.h
mips/include/asm/ucontext.h
microblaze/include/asm/ucontext.h
mn10300/include/asm/ucontext.h
blackfin/include/asm/ucontext.h

There seems to be lots of similarities in
*/include/asm/types.h
*/include/asm/kmap_types.h
*/include/asm/termios.h
*/include/asm/socket.h
*/include/asm/param.h
*/include/asm/signal.h (but not all)
*/include/asm/posix_types.h
*/include/asm/termbits.h
*/include/asm/segment.h
*/include/asm/auxvec.h
*/include/asm/shmbuf.h
*/include/asm/spinlock_types.h

Do you keep a list somewhere?

Thanks



2009-09-04 13:33:53

by Arnd Bergmann

[permalink] [raw]
Subject: Re: asm-generic update candidates?

On Thursday 03 September 2009, Robin Getz wrote:
> Arnd:
>
> I was reviewing some files in ./arch/blackfin/include for missing copyrights,
> and while tracking things down I noticed there were still some likely
> candidates for inclusion in asm-generic...

Ah, thanks. I basically started out with the list of files that exist in
almost all architectures. I never looked at files that are identical in
some architectures but nonexistent in more than a few others.

Also, my plan is to do one architecture at a time, not one file at a time
across all architectures, because that will reduce the need for coordination
between multiple maintainers.

> All seem to be the same file:
>
> md5sum:
> 5b6b31d728ed2ed0df73c56676fdc68f blackfin/include/asm/fb.h
> 5b6b31d728ed2ed0df73c56676fdc68f cris/include/asm/fb.h
> 5b6b31d728ed2ed0df73c56676fdc68f frv/include/asm/fb.h
> 5b6b31d728ed2ed0df73c56676fdc68f h8300/include/asm/fb.h
> 5b6b31d728ed2ed0df73c56676fdc68f s390/include/asm/fb.h
> 5b6b31d728ed2ed0df73c56676fdc68f xtensa/include/asm/fb.h

Look at the latest version. Some architectures have already started
using the generic version, e.g. blackfin.

> e31d052cbba4f417ba2158a41b0d8709 arm/include/asm/fb.h
> e31d052cbba4f417ba2158a41b0d8709 m32r/include/asm/fb.h
> e31d052cbba4f417ba2158a41b0d8709 sh/include/asm/fb.h

Interesting one. The only difference between these and the
above is the use of pgprot_writecombine, which is defined as
pgprot_noncached on the other architectures.

> Mostly the same:
> mn10300/include/asm/shmparam.h
> frv/include/asm/shmparam.h
> m68k/include/asm/shmparam.h
> h8300/include/asm/shmparam.h
> alpha/include/asm/shmparam.h
> x86/include/asm/shmparam.h
> m32r/include/asm/shmparam.h
> avr32/include/asm/shmparam.h
> powerpc/include/asm/shmparam.h
> blackfin/include/asm/shmparam.h
>
> All the same:
> frv/include/asm/ucontext.h
> h8300/include/asm/ucontext.h
> avr32/include/asm/ucontext.h
> m32r/include/asm/ucontext.h
> cris/include/asm/ucontext.h
> alpha/include/asm/ucontext.h
> mips/include/asm/ucontext.h
> microblaze/include/asm/ucontext.h
> mn10300/include/asm/ucontext.h
> blackfin/include/asm/ucontext.h

Yes, these should come naturally when the architectures
get changed to use the generic headers.

> There seems to be lots of similarities in
> */include/asm/types.h
> */include/asm/kmap_types.h
> */include/asm/termios.h
> */include/asm/socket.h
> */include/asm/param.h
> */include/asm/signal.h (but not all)
> */include/asm/posix_types.h
> */include/asm/termbits.h
> */include/asm/segment.h
> */include/asm/auxvec.h
> */include/asm/shmbuf.h
> */include/asm/spinlock_types.h
>
> Do you keep a list somewhere?

Well, this is how I started out writing doing the common files
in the first place. I looked at the most similar files, and then
used vimdiff on up to four files at a time, changing them to
be exactly identical by editing out all the bitrot.

In general, if a file exists in asm-generic, it should be usable
by some of the architectures, if it does not exist then either it
is too hard to make a generic version or I have not looked at it
yet.

If you want to help convert an architecture, try doing

for i in include/asm-generic/*.h ; do
vimdiff ${i} arch/${ARCH}/include/asm/${i##*/}
done

If the files are identical, replace the contents of the arch
specific one with a simple #include <asm-generic/${i}>. If they
are almost identical, add overrides like in
arch/microblaze/include/asm/posix_types.h, possibly adding the
option for overriding to the generic file. For files that
are rather different, just leave them alone.

Arnd <><

2009-09-04 19:36:10

by Robin Getz

[permalink] [raw]
Subject: Re: asm-generic update candidates?

On Fri 4 Sep 2009 09:32, Arnd Bergmann pondered:
> On Thursday 03 September 2009, Robin Getz wrote:
> > Arnd:
> >
> > I was reviewing some files in ./arch/blackfin/include for missing
copyrights,
> > and while tracking things down I noticed there were still some likely
> > candidates for inclusion in asm-generic...
>
> Ah, thanks. I basically started out with the list of files that exist in
> almost all architectures. I never looked at files that are identical in
> some architectures but nonexistent in more than a few others.
>
> Also, my plan is to do one architecture at a time,

Which arch are you starting with?

> not one file at a time
> across all architectures, because that will reduce the need for coordination
> between multiple maintainers.

Makes sense. I guess I saw your earlier commits changing all archs, and
thought you were doing it the other way around.

> > All seem to be the same file:
> >
> > md5sum:
> > 5b6b31d728ed2ed0df73c56676fdc68f blackfin/include/asm/fb.h
> > 5b6b31d728ed2ed0df73c56676fdc68f cris/include/asm/fb.h
> > 5b6b31d728ed2ed0df73c56676fdc68f frv/include/asm/fb.h
> > 5b6b31d728ed2ed0df73c56676fdc68f h8300/include/asm/fb.h
> > 5b6b31d728ed2ed0df73c56676fdc68f s390/include/asm/fb.h
> > 5b6b31d728ed2ed0df73c56676fdc68f xtensa/include/asm/fb.h
>
> Look at the latest version. Some architectures have already started
> using the generic version, e.g. blackfin.

Yeah, sorry - I was looking at our release tree - not Linus's.

> > e31d052cbba4f417ba2158a41b0d8709 arm/include/asm/fb.h
> > e31d052cbba4f417ba2158a41b0d8709 m32r/include/asm/fb.h
> > e31d052cbba4f417ba2158a41b0d8709 sh/include/asm/fb.h
>
> Interesting one. The only difference between these and the
> above is the use of pgprot_writecombine, which is defined as
> pgprot_noncached on the other architectures.
>
[snip]
>
> > There seems to be lots of similarities in
[snip]

Hmm - all I listed are already in Linus's tree...

Sorry about the noise.

> > Do you keep a list somewhere?
>
> Well, this is how I started out writing doing the common files
> in the first place. I looked at the most similar files, and then
> used vimdiff on up to four files at a time, changing them to
> be exactly identical by editing out all the bitrot.
>
> In general, if a file exists in asm-generic, it should be usable
> by some of the architectures, if it does not exist then either it
> is too hard to make a generic version or I have not looked at it
> yet.

OK -- here are some identical ones:

8253pit.h (alpha and power)
fbio.h (m68k and sparc)
md.h (h8300, alpha and m68k)

I also noticed in Linus's latest (last commit
37d0892c5a94e208cf863e3b7bac014edee4346d):

cat arch/microblaze/include/asm/ipc.h
#include <asm-generic/ipc.h>

but: ls include/asm-generic/ipc.h
ls: cannot access include/asm-generic/ipc.h: No such file or directory

?

> If you want to help convert an architecture, try doing
>
> for i in include/asm-generic/*.h ; do
> vimdiff ${i} arch/${ARCH}/include/asm/${i##*/}
> done
>
> If the files are identical, replace the contents of the arch
> specific one with a simple #include <asm-generic/${i}>. If they
> are almost identical, add overrides like in
> arch/microblaze/include/asm/posix_types.h, possibly adding the
> option for overriding to the generic file. For files that
> are rather different, just leave them alone.

Will do.

Thanks.
-Robin

2009-09-08 12:55:49

by Arnd Bergmann

[permalink] [raw]
Subject: Re: asm-generic update candidates?

On Friday 04 September 2009, Robin Getz wrote:
> On Fri 4 Sep 2009 09:32, Arnd Bergmann pondered:
> > On Thursday 03 September 2009, Robin Getz wrote:
> > Also, my plan is to do one architecture at a time,
>
> Which arch are you starting with?

I've done patches for microblaze, powerpc and x86, and some arch
maintainers have done more. I'd probably do s390 next and see who
else is submitting patches for their architectures in 2.6.32,
then work on those remaining. Feel free to grab any one whose
maintainer you can get hold of.

> > > Do you keep a list somewhere?
> >
> > Well, this is how I started out writing doing the common files
> > in the first place. I looked at the most similar files, and then
> > used vimdiff on up to four files at a time, changing them to
> > be exactly identical by editing out all the bitrot.
> >
> > In general, if a file exists in asm-generic, it should be usable
> > by some of the architectures, if it does not exist then either it
> > is too hard to make a generic version or I have not looked at it
> > yet.
>
> OK -- here are some identical ones:
>
> 8253pit.h (alpha and power)

PIT is interesting, there is also 8253.h in some architectures.
This could use a larger rework, I've started on bits of it
and should probably look which patches are still needed.

> fbio.h (m68k and sparc)

It seems that m68k FB_SUN3 support was removed a long time ago,
so this one is really just sparc specific.

> md.h (h8300, alpha and m68k)

This file does not appear to be used at all, we should probably
remove it.

> I also noticed in Linus's latest (last commit
> 37d0892c5a94e208cf863e3b7bac014edee4346d):
>
> cat arch/microblaze/include/asm/ipc.h
> #include <asm-generic/ipc.h>
>
> but: ls include/asm-generic/ipc.h
> ls: cannot access include/asm-generic/ipc.h: No such file or directory

Adrian Bunk killed that file in asm/ back in 2007, he probably crossed
patches with the microblaze architecture.

Arnd <><

2009-09-08 16:54:40

by Robin Getz

[permalink] [raw]
Subject: Re: asm-generic update candidates?

On Tue 8 Sep 2009 08:55, Arnd Bergmann pondered:
> On Friday 04 September 2009, Robin Getz wrote:
> > I also noticed in Linus's latest (last commit
> > 37d0892c5a94e208cf863e3b7bac014edee4346d):
> >
> > cat arch/microblaze/include/asm/ipc.h
> > #include <asm-generic/ipc.h>
> >
> > but: ls include/asm-generic/ipc.h
> > ls: cannot access include/asm-generic/ipc.h: No such file or directory
>
> Adrian Bunk killed that file in asm/ back in 2007, he probably crossed
> patches with the microblaze architecture.

Ok - that got me doing a quick look:

asm-generic/compat_signal.h doesn't exist?
arch/parisc/include/asm/compat_signal.h:#include <asm-generic/compat_signal.h>

asm-generic/cpumask.h doesn't exist?
arch/frv/include/asm/cpumask.h:#include <asm-generic/cpumask.h>
arch/xtensa/include/asm/cpumask.h:#include <asm-generic/cpumask.h>

asm-generic/ipc.h doesn't exist?
arch/microblaze/include/asm/ipc.h:#include <asm-generic/ipc.h>
arch/mn10300/include/asm/ipc.h:#include <asm-generic/ipc.h>

asm-generic/rmap.h doesn't exist?
arch/xtensa/include/asm/rmap.h:#include <asm-generic/rmap.h>


Maybe checkpatch (or something else?) needs something to make sure all
referenced files are actually in the tree or in the patch?

2009-09-09 09:19:18

by Michal Simek

[permalink] [raw]
Subject: Re: asm-generic update candidates?

Robin Getz wrote:
> On Tue 8 Sep 2009 08:55, Arnd Bergmann pondered:
>
>> On Friday 04 September 2009, Robin Getz wrote:
>>
>>> I also noticed in Linus's latest (last commit
>>> 37d0892c5a94e208cf863e3b7bac014edee4346d):
>>>
>>> cat arch/microblaze/include/asm/ipc.h
>>> #include <asm-generic/ipc.h>
>>>
>>> but: ls include/asm-generic/ipc.h
>>> ls: cannot access include/asm-generic/ipc.h: No such file or directory
>>>
>> Adrian Bunk killed that file in asm/ back in 2007, he probably crossed
>> patches with the microblaze architecture.
>>
>
> Ok - that got me doing a quick look:
>
> asm-generic/compat_signal.h doesn't exist?
> arch/parisc/include/asm/compat_signal.h:#include <asm-generic/compat_signal.h>
>
> asm-generic/cpumask.h doesn't exist?
> arch/frv/include/asm/cpumask.h:#include <asm-generic/cpumask.h>
> arch/xtensa/include/asm/cpumask.h:#include <asm-generic/cpumask.h>
>
> asm-generic/ipc.h doesn't exist?
> arch/microblaze/include/asm/ipc.h:#include <asm-generic/ipc.h>
>
Thanks for pointing. You can remove it from include/asm/ipc.h or I can
do it instead of you - just let me know.

Regards,
Michal

> arch/mn10300/include/asm/ipc.h:#include <asm-generic/ipc.h>
>
> asm-generic/rmap.h doesn't exist?
> arch/xtensa/include/asm/rmap.h:#include <asm-generic/rmap.h>
>
>
> Maybe checkpatch (or something else?) needs something to make sure all
> referenced files are actually in the tree or in the patch?
> --
> 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/
>


--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: http://www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663