<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>kernel patch upstream on GPUers</title><link>https://en.gpuers.cn/tags/kernel-patch-upstream/</link><description>Recent content in kernel patch upstream on GPUers</description><image><title>GPUers</title><url>https://en.gpuers.cn/img/og-cover-en.png</url><link>https://en.gpuers.cn/img/og-cover-en.png</link></image><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 25 Nov 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://en.gpuers.cn/tags/kernel-patch-upstream/index.xml" rel="self" type="application/rss+xml"/><item><title>A Complete Guide to Submitting Linux Kernel Patches (Upstreaming)</title><link>https://en.gpuers.cn/notes/9000-001/</link><pubDate>Wed, 25 Nov 2026 00:00:00 +0800</pubDate><guid>https://en.gpuers.cn/notes/9000-001/</guid><description>This document is a hands-on guide to kernel patch submission for Linux driver developers.</description><content:encoded><![CDATA[<p>This document is a hands-on guide to kernel patch submission for Linux driver developers. It covers the entire process, from environment preparation to sending patches and following up on review. It applies to the scenario of submitting a patch series to the Linux community through mailing lists.</p>
<hr>
<h2 id="table-of-contents">Table of Contents</h2>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#stage-1-environment-preparation">Stage 1: Environment Preparation</a></li>
<li><a href="#stage-2-code-preparation">Stage 2: Code Preparation</a></li>
<li><a href="#stage-3-commit-message-conventions">Stage 3: Commit Message Conventions</a></li>
<li><a href="#stage-4-quality-checks">Stage 4: Quality Checks</a></li>
<li><a href="#stage-5-generating-the-patch-series">Stage 5: Generating the Patch Series</a></li>
<li><a href="#stage-6-sending-patches">Stage 6: Sending Patches</a></li>
<li><a href="#stage-7-review-and-iteration">Stage 7: Review and Iteration</a></li>
<li><a href="#appendix">Appendix</a></li>
</ul>
<hr>
<h2 id="overview">Overview</h2>
<p>The Linux kernel uses a mailing-list + patch collaboration model. Developers format their code changes as patches and send them to the corresponding mailing list with <code>git send-email</code>. Maintainers and community members review the patches, and after several rounds of revision the maintainer merges them.</p>
<p>A typical merge path for an AMD GPU driver patch:</p>
<pre tabindex="0"><code>developer patch
  → amd-gfx mailing list review
    → amd-staging-drm-next branch
      → drm-next
        → linux-next
          → Linus mainline
</code></pre><hr>
<h2 id="stage-1-environment-preparation">Stage 1: Environment Preparation</h2>
<h3 id="11-install-git-send-email">1.1 Install git send-email</h3>
<p><code>git send-email</code> is the standard tool for sending patches. Most distributions require a separate installation:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Debian / Ubuntu</span>
</span></span><span class="line"><span class="cl">sudo apt install git-email
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Fedora / RHEL</span>
</span></span><span class="line"><span class="cl">sudo dnf install git-email
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Arch Linux</span>
</span></span><span class="line"><span class="cl">sudo pacman -S git
</span></span></code></pre></div><p>Verify the installation:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git send-email --help
</span></span></code></pre></div><h3 id="12-configure-smtp">1.2 Configure SMTP</h3>
<p>Add the SMTP configuration to <code>~/.gitconfig</code>. The following are examples for common mail services:</p>
<p><strong>Office365 / Outlook (common in enterprises)</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ini" data-lang="ini"><span class="line"><span class="cl"><span class="k">[sendemail]</span>
</span></span><span class="line"><span class="cl">    <span class="na">smtpserver</span> <span class="o">=</span> <span class="s">smtp.office365.com
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpserverport = 587
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpencryption = tls
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpuser = your.name@company.com
</span></span></span><span class="line"><span class="cl"><span class="s">    from = Your Name &lt;your.name@company.com&gt;</span>
</span></span></code></pre></div><p><strong>Gmail</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ini" data-lang="ini"><span class="line"><span class="cl"><span class="k">[sendemail]</span>
</span></span><span class="line"><span class="cl">    <span class="na">smtpserver</span> <span class="o">=</span> <span class="s">smtp.gmail.com
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpserverport = 587
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpencryption = tls
</span></span></span><span class="line"><span class="cl"><span class="s">    smtpuser = yourname@gmail.com
</span></span></span><span class="line"><span class="cl"><span class="s">    from = Your Name &lt;yourname@gmail.com&gt;</span>
</span></span></code></pre></div><blockquote>
<p><strong>Note:</strong></p>
<ul>
<li>Gmail requires an &ldquo;App Password&rdquo;; a regular password cannot be used.</li>
<li>Some corporate mailboxes require the IT department to enable SMTP access or provide an App Password.</li>
<li>On the first send, git will prompt for a password, which can be cached through <code>git credential</code>.</li>
</ul>
</blockquote>
<h3 id="13-configure-git-user-information">1.3 Configure git user information</h3>
<p>Make sure the git user information matches the information you registered with the mailing list:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git config --global user.name <span class="s2">&#34;Your Name&#34;</span>
</span></span><span class="line"><span class="cl">git config --global user.email <span class="s2">&#34;your.name@company.com&#34;</span>
</span></span></code></pre></div><h3 id="14-subscribe-to-the-relevant-mailing-lists">1.4 Subscribe to the relevant mailing lists</h3>
<p>Before sending a patch, be sure to subscribe to the target mailing list first. Otherwise your email may be held in the moderation queue, and you will not receive review replies.</p>
<p>Common DRM / AMD GPU related lists:</p>
<table>
	<thead>
			<tr>
					<th>Mailing list</th>
					<th>Subscription address</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><strong>amd-gfx</strong></td>
					<td><a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></td>
			</tr>
			<tr>
					<td><strong>dri-devel</strong></td>
					<td><a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a></td>
			</tr>
			<tr>
					<td><strong>linux-kernel (LKML)</strong></td>
					<td><a href="http://vger.kernel.org/vger-lists.html#linux-kernel">http://vger.kernel.org/vger-lists.html#linux-kernel</a></td>
			</tr>
	</tbody>
</table>
<blockquote>
<p><strong>Tip:</strong> LKML has an extremely high volume of mail. It is recommended not to subscribe, or to configure mail filtering rules. Usually a Cc is enough; there is no need to actively read every message on LKML.</p>
</blockquote>
<hr>
<h2 id="stage-2-code-preparation">Stage 2: Code Preparation</h2>
<h3 id="21-choose-the-correct-base-branch">2.1 Choose the correct base branch</h3>
<p>Your patch must be based on the correct upstream branch. Choosing the wrong base will cause the patch to fail to apply.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Add the upstream remote (if not already present)</span>
</span></span><span class="line"><span class="cl">git remote add drm-misc https://gitlab.freedesktop.org/drm/misc/kernel.git
</span></span><span class="line"><span class="cl">git remote add upstream https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Fetch the latest code</span>
</span></span><span class="line"><span class="cl">git fetch drm-misc
</span></span><span class="line"><span class="cl">git fetch upstream
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Create a working branch based on drm-next</span>
</span></span><span class="line"><span class="cl">git checkout -b my-feature drm-misc/drm-next
</span></span></code></pre></div><p>Base branch selection for different subsystems:</p>
<table>
	<thead>
			<tr>
					<th>Subsystem</th>
					<th>Recommended base</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>AMD GPU (amdgpu)</td>
					<td><code>amd-staging-drm-next</code> or <code>drm-next</code></td>
			</tr>
			<tr>
					<td>DRM core</td>
					<td><code>drm-misc-next</code></td>
			</tr>
			<tr>
					<td>Memory management (mm)</td>
					<td><code>mm-unstable</code> or <code>linux-next</code></td>
			</tr>
			<tr>
					<td>General kernel</td>
					<td><code>torvalds/master</code></td>
			</tr>
	</tbody>
</table>
<h3 id="22-rebase-onto-the-latest-base">2.2 Rebase onto the latest base</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git rebase drm-misc/drm-next
</span></span></code></pre></div><p>After resolving all conflicts, make sure the code compiles.</p>
<h3 id="23-clean-up-the-commit-history">2.3 Clean up the commit history</h3>
<p>Each commit should be a <strong>logically complete, independently buildable</strong> unit of change. Use an interactive rebase to clean it up:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git rebase -i &lt;base-commit&gt;
</span></span></code></pre></div><p>Cleanup principles:</p>
<ul>
<li><strong>One commit does one thing</strong> — do not mix feature additions and bug fixes in a single commit</li>
<li><strong>Every commit builds</strong> — bisect-friendly</li>
<li><strong>A reasonable commit order</strong> — infrastructure first, then the feature implementation, and finally the wire-up</li>
<li><strong>No fixup commits</strong> — they should be squashed into the corresponding commit</li>
</ul>
<hr>
<h2 id="stage-3-commit-message-conventions">Stage 3: Commit Message Conventions</h2>
<h3 id="31-format-requirements">3.1 Format requirements</h3>
<pre tabindex="0"><code>subsystem: short description (no more than 72 characters)

A detailed description that explains what (what was done) and why (why it
was done), rather than how (how it was done, since the code itself shows
that).

Separate multiple paragraphs with blank lines.

Lists are allowed:
  - First point
  - Second point

Signed-off-by: Your Name &lt;your.name@company.com&gt;
</code></pre><h3 id="32-subject-line-rules">3.2 Subject line rules</h3>
<ul>
<li>Format: <code>subsystem prefix: short description</code></li>
<li>No more than <strong>72 characters</strong></li>
<li>First letter lowercase (the first word after the prefix)</li>
<li>No trailing period</li>
<li>Use the imperative mood (&ldquo;add support&rdquo; rather than &ldquo;added support&rdquo;)</li>
</ul>
<p>Common prefix examples for AMD GPU drivers:</p>
<pre tabindex="0"><code>drm/amdgpu:              # amdgpu driver, general
drm/amdgpu/vcn:          # VCN submodule
drm/amdkfd:              # KFD submodule
drm/amd/pm:              # power management
drm/amd/display:         # display
</code></pre><h3 id="33-description-body">3.3 Description body</h3>
<ul>
<li>Explain <strong>why</strong> the change is needed (motivation, problem background)</li>
<li>Describe <strong>what</strong> was done (high-level design idea)</li>
<li>For a bug fix, describe the root cause of the problem and the fix</li>
<li>Reference relevant discussion links (if any)</li>
<li>No more than <strong>75 characters</strong> per line</li>
</ul>
<h3 id="34-signed-off-by-sob">3.4 Signed-off-by (SOB)</h3>
<p>Every commit <strong>must</strong> have a <code>Signed-off-by</code> tag, indicating that you agree to the Developer Certificate of Origin (DCO):</p>
<pre tabindex="0"><code>Signed-off-by: Your Name &lt;your.name@company.com&gt;
</code></pre><blockquote>
<p>⚠️ <strong>Warning: the SOB email must match the Author email.</strong> If <code>git config user.email</code> is <code>Your.Name@company.com</code>, the SOB must be the same address, with the same case.</p>
<p>Use <code>git commit -s</code> to add the SOB automatically.</p>
</blockquote>
<h3 id="35-other-common-tags">3.5 Other common tags</h3>
<pre tabindex="0"><code># This patch fixes a bug introduced by a certain commit
Fixes: &lt;12-char hash&gt; (&#34;original commit title&#34;)

# Reviewed and approved by someone
Reviewed-by: Reviewer Name &lt;reviewer@email.com&gt;

# Tested and verified by someone
Tested-by: Tester Name &lt;tester@email.com&gt;

# Acknowledgment, e.g. someone provided the idea or early code
Suggested-by: Someone &lt;someone@email.com&gt;

# Carbon copy, to Cc the patch email to specific people
Cc: Someone &lt;someone@email.com&gt;
</code></pre><hr>
<h2 id="stage-4-quality-checks">Stage 4: Quality Checks</h2>
<h3 id="41-run-checkpatchpl">4.1 Run checkpatch.pl</h3>
<p>This is a <strong>mandatory</strong> step. checkpatch verifies code style, commit message format, and more:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Check the most recent N commits</span>
</span></span><span class="line"><span class="cl">git format-patch -N -o /tmp/patches/
</span></span><span class="line"><span class="cl">scripts/checkpatch.pl /tmp/patches/*.patch
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Or check the git commits directly</span>
</span></span><span class="line"><span class="cl">scripts/checkpatch.pl --git HEAD~N..HEAD
</span></span></code></pre></div><p>Fix all <strong>ERROR</strong>s. For <strong>WARNING</strong>s, most should also be fixed; if one truly cannot be avoided, explain the reason in the cover letter.</p>
<p>Common checkpatch issues:</p>
<ul>
<li>Line exceeds 80/100 characters</li>
<li>Missing blank line</li>
<li>Incorrect comment format</li>
<li>Commit message subject exceeds 72 characters</li>
<li>Trailing whitespace</li>
</ul>
<h3 id="42-build-check">4.2 Build check</h3>
<p>Make sure each commit builds independently:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Basic build</span>
</span></span><span class="line"><span class="cl">make <span class="nv">M</span><span class="o">=</span>drivers/gpu/drm/amd/amdgpu
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Enable sparse static analysis</span>
</span></span><span class="line"><span class="cl">make <span class="nv">C</span><span class="o">=</span><span class="m">1</span> <span class="nv">M</span><span class="o">=</span>drivers/gpu/drm/amd/amdgpu
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Full kernel build (if the change touches header files)</span>
</span></span><span class="line"><span class="cl">make -j<span class="k">$(</span>nproc<span class="k">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Enable more warnings</span>
</span></span><span class="line"><span class="cl">make <span class="nv">W</span><span class="o">=</span><span class="m">1</span> <span class="nv">M</span><span class="o">=</span>drivers/gpu/drm/amd/amdgpu
</span></span></code></pre></div><h3 id="43-run-tests">4.3 Run tests</h3>
<p>Run the relevant tests for your change:</p>
<ul>
<li><strong>IGT GPU Tools</strong>: the <code>igt_runner</code> test suite</li>
<li><strong>KFD tests</strong>: <code>kfdtest</code></li>
<li><strong>Kernel selftests</strong>: <code>make kselftest</code></li>
</ul>
<p>Describe your test method and results in the cover letter.</p>
<h3 id="44-check-documentation">4.4 Check documentation</h3>
<p>If your change touches the UAPI (user-space interface), new sysfs/debugfs nodes, or a new ioctl, update the documentation accordingly:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Build the documentation to check</span>
</span></span><span class="line"><span class="cl">make htmldocs
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Check for documentation warnings</span>
</span></span><span class="line"><span class="cl">make htmldocs 2&gt;<span class="p">&amp;</span><span class="m">1</span> <span class="p">|</span> grep -i warning
</span></span></code></pre></div><hr>
<h2 id="stage-5-generating-the-patch-series">Stage 5: Generating the Patch Series</h2>
<h3 id="51-use-git-format-patch">5.1 Use git format-patch</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Generate the patch series with a cover letter</span>
</span></span><span class="line"><span class="cl">git format-patch -N --cover-letter -o /tmp/patches/
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Parameter explanation:</span>
</span></span><span class="line"><span class="cl"><span class="c1">#   -N             the most recent N commits</span>
</span></span><span class="line"><span class="cl"><span class="c1">#   --cover-letter generate a cover letter (0000-cover-letter.patch)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#   -o DIR         output directory</span>
</span></span><span class="line"><span class="cl"><span class="c1">#   --base=auto    record base information automatically (recommended)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Full example</span>
</span></span><span class="line"><span class="cl">git format-patch -5 --cover-letter --base<span class="o">=</span>auto -o /tmp/patches/ <span class="se">\
</span></span></span><span class="line"><span class="cl">    --subject-prefix<span class="o">=</span><span class="s2">&#34;PATCH&#34;</span>
</span></span></code></pre></div><h3 id="52-subject-prefix-conventions">5.2 Subject prefix conventions</h3>
<table>
	<thead>
			<tr>
					<th>Prefix</th>
					<th>Meaning</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>[PATCH]</code></td>
					<td>First submission</td>
			</tr>
			<tr>
					<td><code>[PATCH v2]</code></td>
					<td>Second version (after revisions in response to review)</td>
			</tr>
			<tr>
					<td><code>[PATCH RFC]</code></td>
					<td>Request for comments, not expected to be merged directly</td>
			</tr>
			<tr>
					<td><code>[PATCH RESEND]</code></td>
					<td>Resend (no changes)</td>
			</tr>
			<tr>
					<td><code>[PATCH 0/N]</code></td>
					<td>Cover letter (a series of N patches)</td>
			</tr>
	</tbody>
</table>
<p>Specify it with <code>--subject-prefix</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># RFC patch</span>
</span></span><span class="line"><span class="cl">git format-patch --subject-prefix<span class="o">=</span><span class="s2">&#34;RFC PATCH&#34;</span> ...
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Second version</span>
</span></span><span class="line"><span class="cl">git format-patch --subject-prefix<span class="o">=</span><span class="s2">&#34;PATCH v2&#34;</span> ...
</span></span></code></pre></div><h3 id="53-write-the-cover-letter">5.3 Write the cover letter</h3>
<p>The cover letter is the overview of the entire patch series and is the first thing a reviewer reads. Edit the generated <code>0000-cover-letter.patch</code>:</p>
<pre tabindex="0"><code>Subject: [PATCH 0/N] subsystem: short description of the entire series

This patch series implements the XXX feature.

=== Background and motivation ===
Describe why this set of changes is needed and what problem it solves.

=== Design overview ===
Describe the overall design at a high level.

=== Dependencies ===
If it depends on other patch series not yet merged, state so here:
- Depends on: [PATCH vN] &#34;series title&#34; by Author
  https://lore.kernel.org/link

=== Testing ===
Describe the test method:
- Hardware platform: GPU model
- Test cases: IGT / kfdtest / custom tests
- Test results

=== Change history (required from v2 onward) ===
v2:
  - Fixed the XXX issue (Reviewer&#39;s suggestion)
  - Refactored the YYY function
v1:
  - https://lore.kernel.org/initial-submission-link

Your Name (N):
  subsystem: patch 1 title
  subsystem: patch 2 title
  ...

 file1.c | 100 ++++++++++++
 file2.h |  20 ++
 N files changed, X insertions(+), Y deletions(-)
</code></pre><h3 id="54-confirm-the-recipients">5.4 Confirm the recipients</h3>
<p>Use <code>get_maintainer.pl</code> to determine the recipients automatically:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/get_maintainer.pl /tmp/patches/*.patch
</span></span></code></pre></div><p>The output lists all relevant maintainers and mailing lists. General rules:</p>
<ul>
<li><strong>To:</strong> Subsystem maintainer(s) + the main mailing list</li>
<li><strong>Cc:</strong> Higher-level maintainers + broader mailing lists + relevant developers</li>
</ul>
<blockquote>
<p><strong>Tip:</strong> The output of <code>get_maintainer.pl</code> can be used directly as arguments to <code>git send-email</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/get_maintainer.pl --separator<span class="o">=</span>, /tmp/patches/*.patch
</span></span></code></pre></div></blockquote>
<hr>
<h2 id="stage-6-sending-patches">Stage 6: Sending Patches</h2>
<h3 id="61-send-a-test-email-first">6.1 Send a test email first</h3>
<p>It is <strong>strongly recommended</strong> to send to yourself first for testing:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git send-email --to<span class="o">=</span>yourself@email.com /tmp/patches/*.patch
</span></span></code></pre></div><p>Check the received email:</p>
<ul>
<li><input disabled="" type="checkbox"> Is the format correct (plain text, not HTML)?</li>
<li><input disabled="" type="checkbox"> Can the patch be applied with <code>git am</code>?</li>
<li><input disabled="" type="checkbox"> Is the encoding free of garbled characters?</li>
<li><input disabled="" type="checkbox"> Is the threading correct (the cover letter is the parent, each patch a reply)?</li>
</ul>
<h3 id="62-send-for-real">6.2 Send for real</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git send-email <span class="se">\
</span></span></span><span class="line"><span class="cl">    --to<span class="o">=</span><span class="s2">&#34;Maintainer1 &lt;maintainer1@email.com&gt;&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">    --to<span class="o">=</span><span class="s2">&#34;Maintainer2 &lt;maintainer2@email.com&gt;&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">    --to<span class="o">=</span><span class="s2">&#34;subsystem-list@lists.freedesktop.org&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">    --cc<span class="o">=</span><span class="s2">&#34;dri-devel@lists.freedesktop.org&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">    --cc<span class="o">=</span><span class="s2">&#34;linux-kernel@vger.kernel.org&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">    /tmp/patches/*.patch
</span></span></code></pre></div><p><code>git send-email</code> sends them one by one and prompts for confirmation.</p>
<h3 id="63-verify-the-send-succeeded">6.3 Verify the send succeeded</h3>
<p>After sending, verify that your patch has appeared on the following platforms:</p>
<ul>
<li><strong>lore.kernel.org</strong>: <a href="https://lore.kernel.org/">https://lore.kernel.org/</a> (search for your patch title)</li>
<li><strong>Patchwork</strong>: <a href="https://patchwork.freedesktop.org/project/amd-gfx/">https://patchwork.freedesktop.org/project/amd-gfx/</a> (if the target is the amd-gfx list)</li>
</ul>
<hr>
<h2 id="stage-7-review-and-iteration">Stage 7: Review and Iteration</h2>
<h3 id="71-respond-to-review-comments">7.1 Respond to review comments</h3>
<ul>
<li><strong>Reply promptly</strong> — respond as soon as you receive a review, even if just to say &ldquo;thanks, I&rsquo;ll fix this in v2&rdquo;</li>
<li><strong>Respond point by point</strong> — give a reply to each review comment</li>
<li><strong>Stay polite</strong> — even if you disagree, explain your reasoning; do not ignore comments</li>
<li><strong>Bottom-post</strong> — the Linux community uses bottom-posting; do not top-post</li>
</ul>
<p>Reply example:</p>
<pre tabindex="0"><code>&gt; Review comment about your code
&gt;
&gt; Suggestion to change XXX

Good point. I&#39;ll fix this in v2. The new approach will be ...
</code></pre><h3 id="72-submit-v2-the-revised-version">7.2 Submit v2 (the revised version)</h3>
<p>After revising the code according to the review:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Modify the commits (rebase -i, amend, etc.)</span>
</span></span><span class="line"><span class="cl">git rebase -i &lt;base&gt;
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Generate the v2 patch</span>
</span></span><span class="line"><span class="cl">git format-patch -N --cover-letter --base<span class="o">=</span>auto <span class="se">\
</span></span></span><span class="line"><span class="cl">    --subject-prefix<span class="o">=</span><span class="s2">&#34;PATCH v2&#34;</span> -o /tmp/patches-v2/
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Add the change history in the cover letter</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Send</span>
</span></span><span class="line"><span class="cl">git send-email ... /tmp/patches-v2/*.patch
</span></span></code></pre></div><blockquote>
<p><strong>Note:</strong> When sending v2, keep the recipient list the same as v1, and add the people who gave review comments on v1.</p>
</blockquote>
<h3 id="73-add-reviewed-by--acked-by">7.3 Add Reviewed-by / Acked-by</h3>
<p>If a reviewer gives a <code>Reviewed-by</code> or <code>Acked-by</code> tag, add it to the SOB area of the corresponding commit in v2:</p>
<pre tabindex="0"><code>Signed-off-by: Your Name &lt;your@email.com&gt;
Reviewed-by: Reviewer Name &lt;reviewer@email.com&gt;
</code></pre><h3 id="74-waiting-and-pinging">7.4 Waiting and pinging</h3>
<ul>
<li><strong>Normal wait</strong> — 1-2 weeks is a normal review cycle</li>
<li><strong>Ping</strong> — if there is no reply after more than 2 weeks, you can reply to your own patch email to ping</li>
<li><strong>RESEND</strong> — if you suspect the email was lost, you can resend with <code>[PATCH RESEND]</code></li>
<li><strong>Merge confirmation</strong> — once the patch is accepted, the maintainer will reply or mark the status in patchwork</li>
</ul>
<hr>
<h2 id="appendix">Appendix</h2>
<h3 id="a-quick-command-reference">A. Quick command reference</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Generate patches</span>
</span></span><span class="line"><span class="cl">git format-patch -N --cover-letter --base<span class="o">=</span>auto -o /tmp/patches/
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Check code style</span>
</span></span><span class="line"><span class="cl">scripts/checkpatch.pl /tmp/patches/*.patch
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Find maintainers</span>
</span></span><span class="line"><span class="cl">scripts/get_maintainer.pl /tmp/patches/*.patch
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Send patches</span>
</span></span><span class="line"><span class="cl">git send-email --to<span class="o">=</span>... --cc<span class="o">=</span>... /tmp/patches/*.patch
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Apply a received patch (for reviewer testing)</span>
</span></span><span class="line"><span class="cl">git am /path/to/patch.mbox
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Check commit messages</span>
</span></span><span class="line"><span class="cl">git log --oneline -N
</span></span></code></pre></div><h3 id="b-important-reference-documents">B. Important reference documents</h3>
<table>
	<thead>
			<tr>
					<th>Document</th>
					<th>Link</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Official kernel patch submission guide</td>
					<td><a href="https://www.kernel.org/doc/html/latest/process/submitting-patches.html">https://www.kernel.org/doc/html/latest/process/submitting-patches.html</a></td>
			</tr>
			<tr>
					<td>Kernel coding style</td>
					<td><a href="https://www.kernel.org/doc/html/latest/process/coding-style.html">https://www.kernel.org/doc/html/latest/process/coding-style.html</a></td>
			</tr>
			<tr>
					<td>Email client configuration guide</td>
					<td><a href="https://www.kernel.org/doc/html/latest/process/email-clients.html">https://www.kernel.org/doc/html/latest/process/email-clients.html</a></td>
			</tr>
			<tr>
					<td>Kernel mailing list archive and search</td>
					<td><a href="https://lore.kernel.org/">https://lore.kernel.org/</a></td>
			</tr>
			<tr>
					<td>DRM subsystem patch tracking</td>
					<td><a href="https://patchwork.freedesktop.org/">https://patchwork.freedesktop.org/</a></td>
			</tr>
	</tbody>
</table>
<h3 id="c-checklist-pre-submission-checklist">C. Checklist (pre-submission checklist)</h3>
<h4 id="environment-preparation">Environment preparation</h4>
<ul>
<li><input disabled="" type="checkbox"> <code>git send-email</code> is installed</li>
<li><input disabled="" type="checkbox"> SMTP is configured and tested</li>
<li><input disabled="" type="checkbox"> Subscribed to the target mailing list</li>
</ul>
<h4 id="code-quality">Code quality</h4>
<ul>
<li><input disabled="" type="checkbox"> Based on the correct upstream branch (<code>drm-next</code> / <code>amd-staging-drm-next</code>)</li>
<li><input disabled="" type="checkbox"> Each commit is logically independent and buildable</li>
<li><input disabled="" type="checkbox"> <code>checkpatch.pl</code> reports no ERROR</li>
<li><input disabled="" type="checkbox"> Builds successfully (including the sparse check)</li>
<li><input disabled="" type="checkbox"> Relevant tests pass</li>
</ul>
<h4 id="commit-message">Commit message</h4>
<ul>
<li><input disabled="" type="checkbox"> Subject ≤72 characters, correct format</li>
<li><input disabled="" type="checkbox"> Body describes what and why</li>
<li><input disabled="" type="checkbox"> <code>Signed-off-by</code> email matches the Author</li>
<li><input disabled="" type="checkbox"> Has a <code>Fixes</code> tag (if it is a bug fix)</li>
</ul>
<h4 id="submission-material">Submission material</h4>
<ul>
<li><input disabled="" type="checkbox"> Cover letter written (background, design, testing, change history)</li>
<li><input disabled="" type="checkbox"> Recipients confirmed with <code>get_maintainer.pl</code></li>
<li><input disabled="" type="checkbox"> Test email sent successfully</li>
<li><input disabled="" type="checkbox"> Final patches sent</li>
<li><input disabled="" type="checkbox"> Searchable on lore.kernel.org</li>
</ul>
<hr>
<p>The following guide covers the concrete tooling in practice: <a href="https://gpuers.blog.csdn.net/article/details/160594950">A complete guide to replying on the Linux kernel mailing list (neomutt + b4)</a>.</p>
]]></content:encoded></item></channel></rss>