Skip to contentSkip to conversation

Adding a new platform

DISCUSSION David VomLehn 11 participants 15 messages Aug 19, 2008 – Aug 22, 2008

lore
Share & tools
lore
#0 lore raw

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform? --
David VomLehn

#1 lore raw
Quoted 3 lines · David VomLehn

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform?

Basically a patchset that adds support for the base platform and all necessary drivers. Send that to the respective mailing lists and maintainers (see MAINTAINERS file) and wait for the feedback. Expect to polish your patchset a few times until everybody is happy. That's the basic receipe. See also Documentation/SubmittingPatches, Documentation/SubmittingDrivers and Documentation/SubmitChecklist.

Ralf

#2 lore raw
In reply to David VomLehn
Quoted 3 lines · David VomLehn

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform?

Based on the phrase "educate our management" -- I would strongly suggest you have a look at Jonathan Corbet's document that describes the process and the eventual value-add of having things in-kernel -- with an audience of non-kernel hackers in mind. I think this will really assist you in your efforts, and I'm glad that
Jonathan put the time into this that he did.

His original post can be viewed here:

http://lkml.org/lkml/2008/7/29/363

or here:

http://lwn.net/Articles/291967/

Paul.

Quoted 8 lines

--
David VomLehn

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 12 lines · Paul Gortmaker
Quoted 3 lines · David VomLehn

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform?

Based on the phrase "educate our management" -- I would strongly suggest you have a look at Jonathan Corbet's document that describes the process and the eventual value-add of having things in-kernel -- with an audience of non-kernel hackers in mind. I think this will really assist you in your efforts, and I'm glad that
Jonathan put the time into this that he did.

Quoted 8 lines

His original post can be viewed here:

http://lkml.org/lkml/2008/7/29/363

or here:

http://lwn.net/Articles/291967/

This indeed is a very interesting document. I can hardly agree with the below point, however:

+- While kernel developers strive to maintain a stable interface to user
+  space, the internal kernel API is in constant flux.  The lack of a stable
+  internal interface is a deliberate design decision; it allows fundamental
+  improvements to be made at any time and results in higher-quality code.
+  But one result of that policy is that any out-of-tree code requires
+  constant upkeep if it is to work with new kernels.  Maintaining
+  out-of-tree code requires significant amounts of work just to keep that
+  code working.

so, say a developer submits a proprietary driver and it gets accepted. Then some internal kernel interface gets changed. Who now has to modify and retest the driver? Is it the person who introduces the change (how can he even do this, as he does not have the proprietary hardware available)? Or is this the original submitter - then where is the benefit of saving on upkeep?

This constant change of the kernel innards is hardly a good selling point, would you agree?

cheers,
/vb

#4 lore raw
Quoted 35 lines · vb
Quoted 12 lines · Paul Gortmaker
Quoted 3 lines · David VomLehn

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform?

Based on the phrase "educate our management" -- I would strongly suggest you have a look at Jonathan Corbet's document that describes the process and the eventual value-add of having things in-kernel -- with an audience of non-kernel hackers in mind. I think this will really assist you in your efforts, and I'm glad that
Jonathan put the time into this that he did.

Quoted 8 lines

His original post can be viewed here:

http://lkml.org/lkml/2008/7/29/363

or here:

http://lwn.net/Articles/291967/

This indeed is a very interesting document. I can hardly agree with the below point, however:

+- While kernel developers strive to maintain a stable interface to user

(quoted diff) +7 -0
+  space, the internal kernel API is in constant flux.  The lack of a stable
+  internal interface is a deliberate design decision; it allows fundamental
+  improvements to be made at any time and results in higher-quality code.
+  But one result of that policy is that any out-of-tree code requires
+  constant upkeep if it is to work with new kernels.  Maintaining
+  out-of-tree code requires significant amounts of work just to keep that
+  code working.
Quoted 1 line

so, say a developer submits a proprietary driver and it gets accepted.

Doesn't happen. By design. If the driver is proprietary then it is presumably not meant for open distribution, and hence not compatible with GPL and widespread distribution into 100,000 public git repositories. So it won't get submitted and it won't get accepted.

Quoted 5 lines

Then some internal kernel interface gets changed. Who now has to modify and retest the driver? Is it the person who introduces the change (how can he even do this, as he does not have the proprietary hardware available)? Or is this the original submitter - then where is the benefit of saving on upkeep?

I'd suggest you feed google "stable API nonsense" and continue reading from there if you are interested in the topic.

Paul.

Quoted 7 lines

This constant change of the kernel innards is hardly a good selling point, would you agree?

cheers,
/vb

#5 lore raw
Quoted 9 lines · Paul Gortmaker
Quoted 2 lines · vb

so, say a developer submits a proprietary driver and it gets accepted.

Doesn't happen. By design. If the driver is proprietary then it is presumably not meant for open distribution, and hence not compatible with GPL and widespread distribution into 100,000 public git repositories. So it won't get submitted and it won't get accepted.

I guess 'proprietary' is not the right term then, how do you call a driver which is not a secret and not a problem to release, but controls some hardware present in only in certain devices of a certain company.

Would such a driver be accepted? Wouldn't such a driver get stale after a few kernel releases?

#6 lore raw
Quoted 2 lines · vb

Would such a driver be accepted? Wouldn't such a driver get stale after a few kernel releases?

Yes, the kernel contains tons of such platform-specific drivers. No, it won't get stale as long as someone who has access to the hardware is willing to test a -rc kernel every once in a while.

You can't really expect to get away with no maintenance at all, but in my experience, it takes much less effort to maintain a driver in-tree than out-of-tree. It's also much easier to get help if it's in-tree.

Haavard

#7 lore raw
Quoted 4 lines · Haavard Skinnemoen
Quoted 2 lines · vb

Would such a driver be accepted? Wouldn't such a driver get stale after a few kernel releases?

Quoted 8 lines

Yes, the kernel contains tons of such platform-specific drivers. No, it won't get stale as long as someone who has access to the hardware is willing to test a -rc kernel every once in a while.

You can't really expect to get away with no maintenance at all, but in my experience, it takes much less effort to maintain a driver in-tree than out-of-tree. It's also much easier to get help if it's in-tree.

fair enough, maybe this paragraph should be added to the original document.

cheers,
/v

Quoted 2 lines

Haavard

#8 lore raw
In reply to vb
Quoted 11 lines · On Wednesday 20 August 2008 17:15:01 vb wrote:

On Tue, Aug 19, 2008 at 9:29 PM, Paul Gortmaker

Quoted 7 lines · <[email protected]> wrote:
Quoted 1 line · vb

so, say a developer submits a proprietary driver and it gets accepted.

Doesn't happen. By design. If the driver is proprietary then it is presumably not meant for open distribution, and hence not compatible with GPL and widespread distribution into 100,000 public git repositories. So it won't get submitted and it won't get accepted.

Quoted 7 lines

I guess 'proprietary' is not the right term then, how do you call a driver which is not a secret and not a problem to release, but controls some hardware present in only in certain devices of a certain company.

Would such a driver be accepted? Wouldn't such a driver get stale after a few kernel releases?

In-tree is no silver bullet.

When people modify internal APIs they will likely fix anything that breaks compilation. However many things are more subtle than that and it is very easy to end up with a driver or other code that compiles but does not work properly.

Luckily APIs for drivers (the most common stuff that people work on) don't change that much, and the interfaces are reasonably clear. If you want some hell then try working on file systems :-).

#9 lore raw
Quoted 11 lines · Charles Manning

In-tree is no silver bullet.

When people modify internal APIs they will likely fix anything that breaks compilation. However many things are more subtle than that and it is very easy to end up with a driver or other code that compiles but does not work properly.

Luckily APIs for drivers (the most common stuff that people work on) don't change that much, and the interfaces are reasonably clear. If you want some hell then try working on file systems :-).

File systems show an excellent example of why you're wrong, in fact. The API for file systems changes quite a lot, and the people who make those changes do tend to fix up all the in-tree file systems simultaneously, -- and since they're doing it with a full understanding of the implications of the change they're making, they usually manage to get the change _right_.

I find it's more common to introduce subtle errors when the person modifying the core API _hasn't_ also modified the driver/fs code which uses that API. Which is what happens when you have out-of-tree code.

I'd rather remove my gonads with a rusty spoon than maintain an out-of-tree file system.

Signature · 1 line
dwmw2
#10 lore raw
In reply to Charles Manning
Quoted 20 lines · Charles Manning
Quoted 11 lines · On Wednesday 20 August 2008 17:15:01 vb wrote:

On Tue, Aug 19, 2008 at 9:29 PM, Paul Gortmaker

Quoted 7 lines · <[email protected]> wrote:
Quoted 1 line · vb

so, say a developer submits a proprietary driver and it gets accepted.

Doesn't happen. By design. If the driver is proprietary then it is presumably not meant for open distribution, and hence not compatible with GPL and widespread distribution into 100,000 public git repositories. So it won't get submitted and it won't get accepted.

Quoted 7 lines

I guess 'proprietary' is not the right term then, how do you call a driver which is not a secret and not a problem to release, but controls some hardware present in only in certain devices of a certain company.

Would such a driver be accepted? Wouldn't such a driver get stale after a few kernel releases?

Quoted 6 lines

In-tree is no silver bullet.

When people modify internal APIs they will likely fix anything that breaks compilation. However many things are more subtle than that and it is very easy to end up with a driver or other code that compiles but does not work properly.

My experience with Linux/m68k tells me that +95% of the breakage is visible by compiler warnings and errors. If it still compiles, it still works ;-)

Quoted 3 lines

Luckily APIs for drivers (the most common stuff that people work on) don't change that much, and the interfaces are reasonably clear. If you want some hell then try working on file systems :-).

Really? So how come so few changes are needed to keep squashfs working?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   [email protected]
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

#11 lore raw
Quoted 2 lines · Geert Uytterhoeven

Really? So how come so few changes are needed to keep squashfs working?

It's read-only.

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#12 lore raw
In reply to Geert Uytterhoeven
Quoted 6 lines · Geert Uytterhoeven
Quoted 1 line · Charles Manning

Luckily APIs for drivers (the most common stuff that people work on) don't change that much, and the interfaces are reasonably clear. If you want some hell then try working on file systems :-).

Really? So how come so few changes are needed to keep squashfs working?

It only uses a relatively small subset of the VFS, and goes nowhere near the MTD subsystem. Recently dusting off an MTD patch I wrote for Squashfs a couple of years ago, I found it had to be completely rewritten for modern kernels.

Having said that the bit of the VFS Squashfs is interested in has changed in each of 2.6.23, 2.6.24, 2.6.25, 2.6.26 and now 2.6.27, and so I wouldn't say it was immune anyway.

Phillip

#13 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Phillip" == Phillip Lougher <[email protected]> writes:

Hi,

Phillip> It only uses a relatively small subset of the VFS, and goes Phillip> nowhere near the MTD subsystem. Recently dusting off an MTD Phillip> patch I wrote for Squashfs a couple of years ago, I found it Phillip> had to be completely rewritten for modern kernels.

Can I see it? I've recently pondered patching squashfs to talk directly to MTD instead of through mtdblock as squashfs often is the only thing using the block layer on embedded systems.

Compiling with CONFIG_BLOCK=n seems to save around 125kb here.

Phillip> Having said that the bit of the VFS Squashfs is interested Phillip> in has changed in each of 2.6.23, 2.6.24, 2.6.25, 2.6.26 and Phillip> now 2.6.27, and so I wouldn't say it was immune anyway.

Yeah, but it has always been pretty easy to fixup.

Signature · 1 line
Bye, Peter Korsgaard
#14 lore raw
In reply to vb
Quoted 35 lines · vb
Quoted 12 lines · Paul Gortmaker
Quoted 3 lines · David VomLehn

I'm working to educate our management on the need to get our platform in the kernel mainline. I expect I will be asked to tell them how much work this is. What do we need to do to add a new MIPS platform?

Based on the phrase "educate our management" -- I would strongly suggest you have a look at Jonathan Corbet's document that describes the process and the eventual value-add of having things in-kernel -- with an audience of non-kernel hackers in mind. I think this will really assist you in your efforts, and I'm glad that
Jonathan put the time into this that he did.

Quoted 8 lines

His original post can be viewed here:

http://lkml.org/lkml/2008/7/29/363

or here:

http://lwn.net/Articles/291967/

This indeed is a very interesting document. I can hardly agree with the below point, however:

+- While kernel developers strive to maintain a stable interface to user

(quoted diff) +7 -0
+  space, the internal kernel API is in constant flux.  The lack of a stable
+  internal interface is a deliberate design decision; it allows fundamental
+  improvements to be made at any time and results in higher-quality code.
+  But one result of that policy is that any out-of-tree code requires
+  constant upkeep if it is to work with new kernels.  Maintaining
+  out-of-tree code requires significant amounts of work just to keep that
+  code working.
Quoted 1 line

so, say a developer submits a proprietary driver and it gets accepted.

This doesn't make any sense to begin with. It's not possible to merge a proprietary driver in to the kernel. If you're talking about a GPLed driver, then the word proprietary here is meaningless (ie, whether hardware is widely available or not is not a concern as long as someone is actively looking after the code). On the other hand, if you are talking about an out-of-tree driver, then the maintenance burden is purely on whoever is maintaining that.

Quoted 6 lines

Then some internal kernel interface gets changed. Who now has to modify and retest the driver? Is it the person who introduces the change (how can he even do this, as he does not have the proprietary hardware available)? Or is this the original submitter - then where is the benefit of saving on upkeep?

In the general case, interface changes are done carefully, and in-tree users are converted over as to minimize breakage. Obviously whoever is making the change is not going to be able to test each driver, so it usually comes down to common sense. If there's something that's potentially problematic for a given driver, then testing is solicited from those that have a vested interest in the continued functionality of said driver. Likewise, if the change goes in and breaks things, that's a regression, and is usually reverted or quickly fixed once it's been identified. People that habitually cause regressions will suddenly find it much more difficult to get anything applied to the kernel, it's fairly self-regulating.

People don't inherently go out of their way to break others code, but it certainly does happen. The main thing is that we have a pretty good process in place to handle those sorts of problems as they come up, so there's generally no reason _not_ to keep things changing.

On the embedded side there is obviously the issue that some people will only test things once or twice a year, but at that level of active involvement, they may as well just do all of their things out-of-tree instead.

Quoted 3 lines

This constant change of the kernel innards is hardly a good selling point, would you agree?

No, but there are others that might. Have you considered BSD?