blob: 22a370ff34e5f21be867d30f114b7a78db7177dc [file] [log] [blame]
Jesper Juhl8b7ecb12007-07-15 23:40:51 -07001Linux Kernel patch submission checklist
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03002~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Randy Dunlap915a56d2006-06-23 02:05:49 -07003
Andrew Mortone54695a2006-07-10 04:45:42 -07004Here are some basic things that developers should do if they want to see their
5kernel patch submissions accepted more quickly.
Randy Dunlap915a56d2006-06-23 02:05:49 -07006
Andrew Mortone54695a2006-07-10 04:45:42 -07007These are all above and beyond the documentation that is provided in
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008Documentation/SubmittingPatches
9and elsewhere regarding submitting Linux kernel patches.
Randy Dunlap915a56d2006-06-23 02:05:49 -070010
11
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300121) If you use a facility then #include the file that defines/declares
Randy Dunlapb5247c82010-03-10 15:21:59 -080013 that facility. Don't depend on other header files pulling in ones
14 that you use.
15
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300162) Builds cleanly:
Randy Dunlap915a56d2006-06-23 02:05:49 -070017
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030018 a) with applicable or modified ``CONFIG`` options ``=y``, ``=m``, and
19 ``=n``. No ``gcc`` warnings/errors, no linker warnings/errors.
Randy Dunlap915a56d2006-06-23 02:05:49 -070020
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030021 b) Passes ``allnoconfig``, ``allmodconfig``
Randy Dunlap85f96422010-05-23 17:02:30 -070022
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030023 c) Builds successfully when using ``O=builddir``
24
253) Builds on multiple CPU architectures by using local cross-compile tools
Randy Dunlap7de33692009-12-15 16:46:59 -080026 or some other build farm.
Randy Dunlap915a56d2006-06-23 02:05:49 -070027
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300284) ppc64 is a good architecture for cross-compilation checking because it
29 tends to use ``unsigned long`` for 64-bit quantities.
Randy Dunlap915a56d2006-06-23 02:05:49 -070030
J. Bruce Fieldsdf24d9a2008-02-13 15:03:20 -0800315: Check your patch for general style as detailed in
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030032 Documentation/CodingStyle.
33 Check for trivial violations with the patch style checker prior to
34 submission (``scripts/checkpatch.pl``).
J. Bruce Fieldsdf24d9a2008-02-13 15:03:20 -080035 You should be able to justify all violations that remain in
36 your patch.
Randy Dunlap915a56d2006-06-23 02:05:49 -070037
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300386) Any new or modified ``CONFIG`` options don't muck up the config menu.
Randy Dunlap915a56d2006-06-23 02:05:49 -070039
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300407) All new ``Kconfig`` options have help text.
Randy Dunlap915a56d2006-06-23 02:05:49 -070041
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300428) Has been carefully reviewed with respect to relevant ``Kconfig``
Andrew Mortone54695a2006-07-10 04:45:42 -070043 combinations. This is very hard to get right with testing -- brainpower
44 pays off here.
Randy Dunlap915a56d2006-06-23 02:05:49 -070045
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300469) Check cleanly with sparse.
Randy Dunlap915a56d2006-06-23 02:05:49 -070047
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03004810) Use ``make checkstack`` and ``make namespacecheck`` and fix any problems
49 that they find.
50
51 .. note::
52
53 ``checkstack`` does not point out problems explicitly,
54 but any one function that uses more than 512 bytes on the stack is a
55 candidate for change.
Randy Dunlap915a56d2006-06-23 02:05:49 -070056
Mauro Carvalho Chehab0cef67a2016-09-19 08:08:00 -03005711: Include :ref:`kernel-doc <kernel_doc>` to document global kernel APIs.
58 (Not required for static functions, but OK there also.) Use
59 ``make htmldocs`` or ``make pdfdocs`` to check the
60 :ref:`kernel-doc <kernel_doc>` and fix any issues.
Randy Dunlap915a56d2006-06-23 02:05:49 -070061
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03006212) Has been tested with ``CONFIG_PREEMPT``, ``CONFIG_DEBUG_PREEMPT``,
63 ``CONFIG_DEBUG_SLAB``, ``CONFIG_DEBUG_PAGEALLOC``, ``CONFIG_DEBUG_MUTEXES``,
64 ``CONFIG_DEBUG_SPINLOCK``, ``CONFIG_DEBUG_ATOMIC_SLEEP``,
65 ``CONFIG_PROVE_RCU`` and ``CONFIG_DEBUG_OBJECTS_RCU_HEAD`` all
66 simultaneously enabled.
Randy Dunlap915a56d2006-06-23 02:05:49 -070067
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03006813) Has been build- and runtime tested with and without ``CONFIG_SMP`` and
69 ``CONFIG_PREEMPT.``
Randy Dunlap915a56d2006-06-23 02:05:49 -070070
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007114) If the patch affects IO/Disk, etc: has been tested with and without
72 ``CONFIG_LBDAF.``
Randy Dunlap915a56d2006-06-23 02:05:49 -070073
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007415) All codepaths have been exercised with all lockdep features enabled.
Randy Dunlap915a56d2006-06-23 02:05:49 -070075
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007616) All new ``/proc`` entries are documented under ``Documentation/``
Andrew Mortone54695a2006-07-10 04:45:42 -070077
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03007817) All new kernel boot parameters are documented in
79 ``Documentation/kernel-parameters.txt``.
Andrew Mortone54695a2006-07-10 04:45:42 -070080
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008118) All new module parameters are documented with ``MODULE_PARM_DESC()``
Randy Dunlap1a036cdd2006-09-29 02:01:26 -070082
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008319) All new userspace interfaces are documented in ``Documentation/ABI/``.
84 See ``Documentation/ABI/README`` for more information.
Michael Kerrisk1d992ce2008-10-03 15:23:44 -070085 Patches that change userspace interfaces should be CCed to
86 linux-api@vger.kernel.org.
Andrew Mortonce584f92006-09-30 23:27:39 -070087
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03008820) Check that it all passes ``make headers_check``.
Andrew Morton0dd4e5b2006-12-10 02:18:56 -080089
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03009021) Has been checked with injection of at least slab and page-allocation
91 failures. See ``Documentation/fault-injection/``.
Andrew Morton0dd4e5b2006-12-10 02:18:56 -080092
93 If the new code is substantial, addition of subsystem-specific fault
94 injection might be appropriate.
Andrew Mortona517b9f2007-01-22 20:40:36 -080095
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -03009622) Newly-added code has been compiled with ``gcc -W`` (use
97 ``make EXTRA_CFLAGS=-W``). This will generate lots of noise, but is good
98 for finding bugs like "warning: comparison between signed and unsigned".
Randy Dunlap244474b2007-02-28 20:12:35 -080099
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030010023) Tested after it has been merged into the -mm patchset to make sure
Randy Dunlap244474b2007-02-28 20:12:35 -0800101 that it still works with all of the other queued patches and various
102 changes in the VM, VFS, and other subsystems.
Randy Dunlap8033fe62008-10-15 22:01:59 -0700103
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030010424) All memory barriers {e.g., ``barrier()``, ``rmb()``, ``wmb()``} need a
105 comment in the source code that explains the logic of what they are doing
106 and why.
Randy Dunlap7de33692009-12-15 16:46:59 -0800107
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030010825) If any ioctl's are added by the patch, then also update
109 ``Documentation/ioctl/ioctl-number.txt``.
Randy Dunlap85f96422010-05-23 17:02:30 -0700110
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -030011126) If your modified source code depends on or uses any of the kernel
112 APIs or features that are related to the following ``Kconfig`` symbols,
113 then test multiple builds with the related ``Kconfig`` symbols disabled
114 and/or ``=m`` (if that option is available) [not all of these at the
Randy Dunlap85f96422010-05-23 17:02:30 -0700115 same time, just various/random combinations of them]:
116
Mauro Carvalho Chehab7a71a802016-09-19 08:08:01 -0300117 ``CONFIG_SMP``, ``CONFIG_SYSFS``, ``CONFIG_PROC_FS``, ``CONFIG_INPUT``, ``CONFIG_PCI``, ``CONFIG_BLOCK``, ``CONFIG_PM``, ``CONFIG_MAGIC_SYSRQ``,
118 ``CONFIG_NET``, ``CONFIG_INET=n`` (but latter with ``CONFIG_NET=y``).