blob: 894289b22b155ac271ba3fd17414ac284b3dd204 [file] [log] [blame]
Mauro Carvalho Chehabdca22a62016-09-21 08:51:05 -03001.. _submitchecklist:
2
Jesper Juhl8b7ecb12007-07-15 23:40:51 -07003Linux Kernel patch submission checklist
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03004~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Randy Dunlap915a56d2006-06-23 02:05:49 -07005
Andrew Mortone54695a2006-07-10 04:45:42 -07006Here are some basic things that developers should do if they want to see their
7kernel patch submissions accepted more quickly.
Randy Dunlap915a56d2006-06-23 02:05:49 -07008
Andrew Mortone54695a2006-07-10 04:45:42 -07009These are all above and beyond the documentation that is provided in
Mauro Carvalho Chehabdca22a62016-09-21 08:51:05 -030010:ref:`Documentation/SubmittingPatches <submittingpatches>`
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030011and elsewhere regarding submitting Linux kernel patches.
Randy Dunlap915a56d2006-06-23 02:05:49 -070012
13
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300141) If you use a facility then #include the file that defines/declares
Randy Dunlapb5247c82010-03-10 15:21:59 -080015 that facility. Don't depend on other header files pulling in ones
16 that you use.
17
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300182) Builds cleanly:
Randy Dunlap915a56d2006-06-23 02:05:49 -070019
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030020 a) with applicable or modified ``CONFIG`` options ``=y``, ``=m``, and
21 ``=n``. No ``gcc`` warnings/errors, no linker warnings/errors.
Randy Dunlap915a56d2006-06-23 02:05:49 -070022
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030023 b) Passes ``allnoconfig``, ``allmodconfig``
Randy Dunlap85f96422010-05-23 17:02:30 -070024
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030025 c) Builds successfully when using ``O=builddir``
26
273) Builds on multiple CPU architectures by using local cross-compile tools
Randy Dunlap7de33692009-12-15 16:46:59 -080028 or some other build farm.
Randy Dunlap915a56d2006-06-23 02:05:49 -070029
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300304) ppc64 is a good architecture for cross-compilation checking because it
31 tends to use ``unsigned long`` for 64-bit quantities.
Randy Dunlap915a56d2006-06-23 02:05:49 -070032
Mauro Carvalho Chehabdca22a62016-09-21 08:51:05 -0300335) Check your patch for general style as detailed in
34 :ref:`Documentation/CodingStyle <codingstyle>`.
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030035 Check for trivial violations with the patch style checker prior to
36 submission (``scripts/checkpatch.pl``).
J. Bruce Fieldsdf24d9a2008-02-13 15:03:20 -080037 You should be able to justify all violations that remain in
38 your patch.
Randy Dunlap915a56d2006-06-23 02:05:49 -070039
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300406) Any new or modified ``CONFIG`` options don't muck up the config menu.
Randy Dunlap915a56d2006-06-23 02:05:49 -070041
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300427) All new ``Kconfig`` options have help text.
Randy Dunlap915a56d2006-06-23 02:05:49 -070043
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300448) Has been carefully reviewed with respect to relevant ``Kconfig``
Andrew Mortone54695a2006-07-10 04:45:42 -070045 combinations. This is very hard to get right with testing -- brainpower
46 pays off here.
Randy Dunlap915a56d2006-06-23 02:05:49 -070047
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300489) Check cleanly with sparse.
Randy Dunlap915a56d2006-06-23 02:05:49 -070049
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03005010) Use ``make checkstack`` and ``make namespacecheck`` and fix any problems
51 that they find.
52
53 .. note::
54
55 ``checkstack`` does not point out problems explicitly,
56 but any one function that uses more than 512 bytes on the stack is a
57 candidate for change.
Randy Dunlap915a56d2006-06-23 02:05:49 -070058
Mauro Carvalho Chehabdca22a62016-09-21 08:51:05 -03005911) Include :ref:`kernel-doc <kernel_doc>` to document global kernel APIs.
Mauro Carvalho Chehab0cef67a2016-09-19 08:08:00 -030060 (Not required for static functions, but OK there also.) Use
61 ``make htmldocs`` or ``make pdfdocs`` to check the
62 :ref:`kernel-doc <kernel_doc>` and fix any issues.
Randy Dunlap915a56d2006-06-23 02:05:49 -070063
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03006412) Has been tested with ``CONFIG_PREEMPT``, ``CONFIG_DEBUG_PREEMPT``,
65 ``CONFIG_DEBUG_SLAB``, ``CONFIG_DEBUG_PAGEALLOC``, ``CONFIG_DEBUG_MUTEXES``,
66 ``CONFIG_DEBUG_SPINLOCK``, ``CONFIG_DEBUG_ATOMIC_SLEEP``,
67 ``CONFIG_PROVE_RCU`` and ``CONFIG_DEBUG_OBJECTS_RCU_HEAD`` all
68 simultaneously enabled.
Randy Dunlap915a56d2006-06-23 02:05:49 -070069
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007013) Has been build- and runtime tested with and without ``CONFIG_SMP`` and
71 ``CONFIG_PREEMPT.``
Randy Dunlap915a56d2006-06-23 02:05:49 -070072
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007314) If the patch affects IO/Disk, etc: has been tested with and without
74 ``CONFIG_LBDAF.``
Randy Dunlap915a56d2006-06-23 02:05:49 -070075
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007615) All codepaths have been exercised with all lockdep features enabled.
Randy Dunlap915a56d2006-06-23 02:05:49 -070077
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007816) All new ``/proc`` entries are documented under ``Documentation/``
Andrew Mortone54695a2006-07-10 04:45:42 -070079
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008017) All new kernel boot parameters are documented in
81 ``Documentation/kernel-parameters.txt``.
Andrew Mortone54695a2006-07-10 04:45:42 -070082
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008318) All new module parameters are documented with ``MODULE_PARM_DESC()``
Randy Dunlap1a036cdd2006-09-29 02:01:26 -070084
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008519) All new userspace interfaces are documented in ``Documentation/ABI/``.
86 See ``Documentation/ABI/README`` for more information.
Michael Kerrisk1d992ce2008-10-03 15:23:44 -070087 Patches that change userspace interfaces should be CCed to
88 linux-api@vger.kernel.org.
Andrew Mortonce584f92006-09-30 23:27:39 -070089
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03009020) Check that it all passes ``make headers_check``.
Andrew Morton0dd4e5b2006-12-10 02:18:56 -080091
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03009221) Has been checked with injection of at least slab and page-allocation
93 failures. See ``Documentation/fault-injection/``.
Andrew Morton0dd4e5b2006-12-10 02:18:56 -080094
95 If the new code is substantial, addition of subsystem-specific fault
96 injection might be appropriate.
Andrew Mortona517b9f2007-01-22 20:40:36 -080097
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03009822) Newly-added code has been compiled with ``gcc -W`` (use
99 ``make EXTRA_CFLAGS=-W``). This will generate lots of noise, but is good
100 for finding bugs like "warning: comparison between signed and unsigned".
Randy Dunlap244474b2007-02-28 20:12:35 -0800101
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030010223) Tested after it has been merged into the -mm patchset to make sure
Randy Dunlap244474b2007-02-28 20:12:35 -0800103 that it still works with all of the other queued patches and various
104 changes in the VM, VFS, and other subsystems.
Randy Dunlap8033fe62008-10-15 22:01:59 -0700105
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030010624) All memory barriers {e.g., ``barrier()``, ``rmb()``, ``wmb()``} need a
107 comment in the source code that explains the logic of what they are doing
108 and why.
Randy Dunlap7de33692009-12-15 16:46:59 -0800109
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030011025) If any ioctl's are added by the patch, then also update
111 ``Documentation/ioctl/ioctl-number.txt``.
Randy Dunlap85f96422010-05-23 17:02:30 -0700112
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030011326) If your modified source code depends on or uses any of the kernel
114 APIs or features that are related to the following ``Kconfig`` symbols,
115 then test multiple builds with the related ``Kconfig`` symbols disabled
116 and/or ``=m`` (if that option is available) [not all of these at the
Randy Dunlap85f96422010-05-23 17:02:30 -0700117 same time, just various/random combinations of them]:
118
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300119 ``CONFIG_SMP``, ``CONFIG_SYSFS``, ``CONFIG_PROC_FS``, ``CONFIG_INPUT``, ``CONFIG_PCI``, ``CONFIG_BLOCK``, ``CONFIG_PM``, ``CONFIG_MAGIC_SYSRQ``,
120 ``CONFIG_NET``, ``CONFIG_INET=n`` (but latter with ``CONFIG_NET=y``).