Submitting a patch to the Linux kernel is not simply a matter of attaching a diff to an email. The community has developed specific conventions for patch format, commit messages, sign-off lines, and sending method. Following them correctly significantly increases the chances that your work will be reviewed and accepted.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DeelerDev/linux/llms.txt
Use this file to discover all available pages before exploring further.
Before you start
Patches must be prepared against a specific version of the kernel. Use the mainline tree as your base:MAINTAINERS file for the correct base tree, or ask the maintainer directly.
Before creating your first patch, make sure you have read
Documentation/process/coding-style.rst and that scripts/checkpatch.pl reports no errors. Reviewers will request style fixes before reading the code.Writing a good commit message
Each patch must have a clear, self-contained commit message. It should explain the problem, describe the solution, and give reviewers enough context to understand why the change is needed — even months or years later. The subject line format is:The Developer’s Certificate of Origin
Every patch must include aSigned-off-by: line. This certifies that you have the right to submit the code under the open-source license indicated in the file, in accordance with the Developer’s Certificate of Origin (DCO):
git commit -s to add the sign-off automatically. For reverts, git revert -s adds it as well.
Additional tags that may appear after the sign-off:
| Tag | Meaning |
|---|---|
Acked-by: | A developer (often a maintainer) has reviewed and is satisfied with the patch |
Reviewed-by: | A technical review was carried out and the patch is found acceptable |
Tested-by: | The named person has tested the patch in some environment |
Reported-by: | Credits the person who discovered and reported the bug |
Co-developed-by: | The patch was created jointly; must be followed immediately by a Signed-off-by: |
Step-by-step submission workflow
Find the right maintainer
Run Cross-check with the
scripts/get_maintainer.pl against your patch file to identify the correct subsystem maintainer and mailing list:MAINTAINERS file. The M: field lists the maintainer email, L: lists the mailing list, and T: lists the subsystem tree.Separate your changes into logical patches
Each patch should make one logical change. Bug fixes and feature additions for the same driver belong in separate patches. API changes and the new code that uses the API belong in separate patches. Every patch in the series must leave the kernel in a buildable, working state so that
git bisect can function correctly.Run checkpatch and fix style issues
ERROR and WARNING messages. Be prepared to justify any remaining CHECK messages.Format patches with git format-patch
For a single patch:For a series of patches with a cover letter:The
--base=auto flag embeds the base commit information, which helps automated CI tools and reviewers apply your series cleanly.Write the cover letter (for patch series)
For anything more than a trivial single patch, write a cover letter (
0000-cover-letter.patch) that explains the overall goal of the series, any testing done, and context that applies to all patches. The cover letter does not appear in the git log — make sure individual patch commit messages are also complete.Send with git send-email
git send-email handles this correctly. See the interactive tutorial at git-send-email.io if you are setting it up for the first time.Patch format details
The canonical patch subject line for a series looks like:v2, v3) and add a changelog after the --- separator in each patch:
--- is stripped when the patch is applied and does not appear in the commit log.
Responding to review
Your patch will almost certainly receive review comments. You must respond to them — ignoring reviewers is the fastest way to ensure your patch is never merged.How to handle review comments
How to handle review comments
Reply inline to the reviewer’s email. Explain what changes you made and thank them for their time. If you disagree with a comment, explain your reasoning politely. Add commenters to the Cc: list of your next revision so they see the updated version.
How long to wait
How long to wait
Expect 2–3 weeks for initial feedback. If you hear nothing, wait at least a week before resending. You can resend with
RESEND in the subject only if the patch is unchanged:Stable tree backports
Stable tree backports
If your patch fixes a significant bug in released kernels, add this to the sign-off area of the patch (not as a mail recipient):The stable team will see it once your patch merges into the mainline.
Security bugs
Security bugs
Send patches fixing exploitable security bugs to
security@kernel.org rather than public mailing lists. A short embargo may be arranged for severe issues to allow distributions time to prepare.Common mistakes
Sending patches as attachments
Sending patches as attachments
Never attach patches as MIME attachments. Many email clients mangle them. Send plain text inline using
git send-email.Sending to the wrong list
Sending to the wrong list
Sending a networking patch to
linux-kernel instead of netdev will result in a redirect and delay. Always use scripts/get_maintainer.pl and the MAINTAINERS file.Top-posting in replies
Top-posting in replies
Top-posting is strongly discouraged in kernel discussions. Use interleaved (inline) replies. Quote only the portions of the previous message you are responding to.
Missing or wrong base tree
Missing or wrong base tree
Basing a patch on the wrong tree means it may not apply cleanly. Check the T: field in
MAINTAINERS and use git format-patch --base=auto to include base commit information.