Skip to content
Joel Stanley edited this page Dec 6, 2021 · 12 revisions

This is a list of tests and checks to perform before submitting patches.

Read the upstream documentation

https://kernelnewbies.org/UpstreamMerge https://kernelnewbies.org/FirstKernelPatch

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Use the git tools

Git has tools for formatting patches, and talking to your SMTP server to email them out. Here's how to create a patch from the most recent commit in your tree:

$ git format-patch --subject-prefix="PATCH linux dev-5.15" \
  --to="Joel Stanley <[email protected]>" [email protected] -1

And sending it out is a simple as:

$ git send-email 0001-arm-aspeed-fix-the-whizbang.patch

This version of the patch should contain [PATCH linux <branch>] in the subject, where <branch> is the name of the current OpenBMC development tree.

Review your patch

Take a look at both your patch and the commit message.

Ensure it makes sense for someone else reading it.

Make sure any comments are relevant to the final version of the code.

Fix build warnings

Ensure you have tested the version of the code you're sending upstream. Just before running git format-patch, run make clean && make, and watch the build output for any warnings in your code.

Checkpatch

In the kernel source tree there is a script called checkpatch.pl. Run your patches through this tool and fix the issues it reports.

./scripts/checkpatch.pl 0000-drivers-msic-support-for-flux-capacitor.patch

Boot in Qemu

The OpenBMC team has created an accurate Qemu model of the Palmetto (ast2400) and Romulus (ast2500). Please test your kernel+device tree changes in both of these machines. You can read how to in TipsAndTricks.