All valid patches submitted via email to [[mailto:linux-media@vger.kernel.org]] are automatically stored at [[http://patchwork.kernel.org/project/linux-media/list/]]. A patch, to be valid, should be in diff unified format. If you're using a -git tree, the simplest way to generate unified diff patches is to run:

+

All valid patches submitted via email to [[mailto:linux-media@vger.kernel.org Linux Media ML]] are automatically stored at [[http://patchwork.kernel.org/project/linux-media/list/ Kernel Patchwork]]. A patch, to be valid, should be in diff unified format. If you're using a -git tree, the simplest way to generate unified diff patches is to run:

KERNEL DEVELOPMENT PROCEDURES AT THE KERNEL UPSTREAM

It is important that people understand how upstream development works.

Kernel development has 2 phases:

1) a merge window typically with 2 weeks (although Linus is gave some indications that he may reduce it on 2.6.34), starting with the release of a new kernel version;

2) the -rc period, where the Kernel is tested and receive fixes.

The length of the -rc period depends on the number and relevance of the fixes. Considering the recent history, it ranges from -rc6 to -rc8, where each -rc takes one week.

Those are the latest -rc kernels since 2.6.12:

kernel

latest -rc version

2.6.12

rc6

2.6.13

rc7

2.6.14

rc5

2.6.15

rc7

2.6.16

rc6

2.6.17

rc6

2.6.18

rc7

2.6.19

rc6

2.6.20

rc7

2.6.21

rc7

2.6.22

rc7

2.6.23

rc9

2.6.24

rc8

2.6.25

rc9

2.6.26

rc9

2.6.27

rc9

2.6.28

rc9

2.6.29

rc8

2.6.30

rc8

2.6.31

rc9

2.6.32

rc8

In general, the announcement of a new -rc kernel gives some hints when that -rc kernel may be the last one.

Subsystem procedures for merging patches upstream

The required procedure on subsystem trees is that:

a) During -rc period (e.g. latest main kernel available is 2.6.x, the latest -rc kernel is 2.6.[x+1]-rc<y>):

fix patches for the -rc kernel (2.6.[x+1]) should be sent upstream, being a good idea to send them for some time at linux-next tree, allowing other people to test it, and check for potential conflicts with the other arch's;

patches for 2.6.[x+2] should be sent to linux-next.

b) the release of 2.6.[x+1] kernel:

closes the -rc period and starts the merge window.

c) During the merge window:

the patch that were added on linux-next during the -rc period for 2.6.[x+2] should be sent upstream;

new non-fix patches should be hold until the next -rc period starts, so, they'll be added on 2.6.[x+3];

fix patches for 2.6.[x+2] should go to linux-next, wait for a few days and then send upstream.

d) the release of 2.6.[x+2]-rc1 kernel:

the merge window has closed. No new features are allowed.

the patches with new features that arrived during the merge window will be moved to linux-next

A practical example

Considering that, at the time this document were written, the last main release is 2.6.32, and the latest -rc release is 2.6.33-rc5, this means that:

Stable patches, after adding upstream, are being received for 2.6.32 kernel series;

Bug fixes are being received for kernel 2.6.33;

New feature patches are being received for kernel 2.6.34.

After the release of kernel 2.6.33, starts the period for receiving patches for 2.6.35.

In other words, the features being developed are always meant to be included on the next 2 kernels.

In the specific case of new drivers that don't touch on existing features, it could be possible to send it during the -rc period, but it is safer to assume that those drivers should follow the above procedure, as a later submission may be nacked.

Patches for stable

Sometimes, a fix patch corrects a problem that happens also on stable kernels (e. g. on kernel 2.6.x or even 2.6.y, where y < x). In this case, the patch should be sent to stable@kernel.org, in order to be added on stable kernels.

In the case of git-submitted patches with fixes, that also need to be send to stable, all the developer needs to do is to add, a the patch description:

CC: stable.kernel.org

At the moment the patch reaches upstream, a copy of the patch will be automatically be sent to the stable maintainer and will be considered for inclusion on the next stable kernel (2.6.x.y).

KERNEL DEVELOPMENT PROCEDURES FOR V4L/DVB

The upsteam procedures should be followed by every kernel subsystem. The subsystems have their own specific procedures detailing how the development patches are handled before arriving upstream. In the case of v4l/dvb, those are the used procedures.

Fixes and linux-next patches

One of the big problems of our model used in the past by the subsystem, based on one Mercurial tree, is that there were just one tree/branch for everything. This makes hard to send some fix patches for 2.6.[x+1], as they may have conflicts with the patches for 2.6.[x+2]. So, when the conflict is simple to solve, the patch is sent as fixes. Otherwise, the patch generally needed to hold to the next cycle.
The fix patches used to get a special tag, added by the developer ("Priority: high", in the body of the description), to give a hint to the subsystem maintainer that the patch should be sent upstream.

Unfortunately, sometimes people mark the driver with the wrong tag. For example, a patch got merged on Jan, 22 2010 that marked with "high". However, that patch didn't apply at the fixes tree, because it fix a regression introduced by a driver that weren't merged upstream yet.

How to solve those issues?

Well, basically, the subsystem should work with more than one tree (or branch), on upstream submission:

While the patches via -hg, due to the merge conflicts its mentioned, the better is that, even those developers that prefer to develop patches use the old way, to send the fix patches via -git. This way, if is there a conflict, he is the one that can better solve it. Also, it avoids the risk of a patch being wrongly tagged.

Also, after having a patch added on one of the above trees, it can't simply remove it, as others will be cloning that tree. So, the only option would be to send a revert patch, causing the patch history to be dirty and could be resulting on some troubles when submitting upstream. I've seen some nacks on receiving patches upstream from dirty git trees. So, we should really avoid this.

how to submit a -git pull request

As the same git tree may have more than one branch, and we'll have 2 -git trees for upstream, it is required that people specify what should be done. The internal maintainer's workflow is based on different mail queues for each type of requesting received.

There are some scripts to automate the process, so it is important that everyone that sends -git pull do it at the same way.

The from line may later be used by the git mailbomb script to send you a copy when the patch were committed, so it should be your real email.

The indication between [] on the subject will be handled by the mailer scripts to put the request at the right queue. So, if tagged wrong, it may not be committed.

Don't send a copy of the pull to the maintainer addresses. The pull will be filtering based on the subject and on the mailing list. If you send a c/c to the maintainer, it will be simply discarded.

NEVER send a copy of any pull request to a subscribers-only mailing list. Everyone is free to answer to the email, reviewing your patches. Don't penalty people that wants to contribute with you with SPAM bouncing emails, produced by subscribers only lists.

When a patch touches on other subsystem codes, please copy the other subsystem maintainers. This is important for patches that touches on arch files, and also for -alsa non-trivial patches.

The email should be generated with the usage of git request-pull:

git request-pull $ORIGIN $URL

where $ORIGIN is the commit hash of the tree before your patches, and $URL is the URL for your repository.

For example, for the patches merged directly from -hg at the -git trees on Jan, 22 2010, the above commands produced:

This helps to identify what's expected to be found at the -git tree and to double check if the merge happened fine.

Tags that a patch receive after its submission

This is probably the most complex issue to solve.

Signed-off-by/Acked-by/Tested-by/Nacked-by tags may be received after a patch or a -git submission. This can happen even while the patch is being tested at linux-next, from people reporting problems on the existing patches, or reporting that a patch worked fine.

Also, the driver maintainer and the subsystem maintainer that is committing those patches should sign each one, to indicate that he reviewed and has accepted the patch.

Currently, if a new tag is added to a committed patch, its hash will change. There were some discussions at Linux Kernel Mailing List about allowing adding new tags on -git without changing the hash, but I think this weren't implemented (yet?).

The same problem occurs with -hg, but, as -hg doesn't support multiple branches (well, it has a "branch" command, but the concept of branch there is different), it was opted that the -hg trees won't have all the needed SOBs. Instead, those would be added only at the submission tree.

With -git, a better procedure can be used:

The developer may have two separate branches on his tree. For example, let's assume that the developer has the following branches on his tree:

media-master (associated with "linuxtv" remote)

fixes

devel

His development happens on devel branch. When the patches are ready to submission will be copied into a new for_submission branch:
git branch for_submission devel

And a pull request from the branch "for_submission" will be sent.

Eventually, he'll write new patches on his devel branch.

After merged, the developer updates the linuxtv remote and drops the for_submission branch. This way, "media-master" will contain his patches that got a new hash, due to the maintainer's SOB. However, he has some new patches on his devel, that applies over the old hashes.

Fortunately, git has a special command to automatically remove the old objects: git rebase.

All the developer needs to do is to run the commands bellow:

git command

notes

git remote update

to update his remotes, including "linuxtv"

git checkout devel

move to devel branch

git pull . media-master

to make a recursive merge from v4l/dvb upstream

git rebase media-master

to remove the legacy hashes

After this, his development branch will contain only upstream patches + the new ones he added after sending the patches for upstream submission.

Patches submitted via email

All valid patches submitted via email to [Linux Media ML] are automatically stored at [Kernel Patchwork]. A patch, to be valid, should be in diff unified format. If you're using a -git tree, the simplest way to generate unified diff patches is to run:

git diff

If you're writing several patches, the better is to create a tag or a branch for the changes you're working. After that, you can use