Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | U-Boot Development Process |
| 4 | ========================== |
| 5 | |
| 6 | Management Summary |
| 7 | ------------------ |
| 8 | |
| 9 | * Development happens in Release Cycles of 3 months. |
| 10 | |
Tom Rini | bab5e4d | 2022-07-12 17:34:15 -0400 | [diff] [blame] | 11 | * The first 3 weeks of the cycle are referred to as the Merge Window, which is |
| 12 | followed by a Stabilization Period. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 13 | |
| 14 | * Patches with new code get only accepted while the Merge Window is open. |
| 15 | |
| 16 | * A patch that is generally in good shape and that was submitted while the |
| 17 | Merge Window was open is eligible to go into the upcoming release, even if |
| 18 | changes and resubmits are needed. |
| 19 | |
| 20 | * During the Stabilization Period, only patches that contain bug fixes get |
| 21 | applied. |
| 22 | |
| 23 | Phases of the Development Process |
| 24 | --------------------------------- |
| 25 | |
| 26 | U-Boot development takes place in `Release Cycles |
| 27 | <https://www.denx.de/wiki/U-Boot/ReleaseCycle>`_. A Release Cycle lasts |
| 28 | normally for three months. |
| 29 | |
Tom Rini | bab5e4d | 2022-07-12 17:34:15 -0400 | [diff] [blame] | 30 | The first three weeks of each Release Cycle are called *Merge Window*. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 31 | |
| 32 | It is followed by a *Stabilization Period*. |
| 33 | |
| 34 | The end of a Release Cycle is marked by the release of a new U-Boot version. |
| 35 | |
| 36 | Merge Window |
| 37 | ------------ |
| 38 | |
Tom Rini | bab5e4d | 2022-07-12 17:34:15 -0400 | [diff] [blame] | 39 | The Merge Window is the period when new patches get submitted (and hopefully |
| 40 | accepted) for inclusion into U-Boot mainline. This period lasts for 21 days (3 |
| 41 | weeks) and ends with the release of ``"-rc1"``. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 42 | |
| 43 | This is the only time when new code (like support for new processors or new |
| 44 | boards, or other new features or reorganization of code) is accepted. |
| 45 | |
| 46 | Twilight Time |
| 47 | ------------- |
| 48 | |
| 49 | Usually patches do not get accepted as they are - the peer review that takes |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 50 | place will usually require changes and resubmissions of the patches before they |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 51 | are considered to be ripe for inclusion into mainline. |
| 52 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 53 | Also the review often happens not immediately after a patch was submitted, |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 54 | but only when somebody (usually the responsible custodian) finds time to do |
| 55 | this. |
| 56 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 57 | The result is that the final version of such patches gets submitted after the |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 58 | merge window has been closed. |
| 59 | |
| 60 | It is current practice in U-Boot that such patches are eligible to go into the |
| 61 | upcoming release. |
| 62 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 63 | The result is that the release of the ``"-rc1"`` version and formal closing of |
| 64 | the Merge Window does not preclude patches that were already posted from being |
| 65 | merged for the upcoming release. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 66 | |
| 67 | Stabilization Period |
| 68 | -------------------- |
| 69 | |
| 70 | During the Stabilization Period only patches containing bug fixes get |
| 71 | applied. |
| 72 | |
| 73 | Corner Cases |
| 74 | ------------ |
| 75 | |
| 76 | Sometimes it is not clear if a patch contains a bug fix or not. |
| 77 | For example, changes that remove dead code, unused macros etc. or |
| 78 | that contain Coding Style fixes are not strict bug fixes. |
| 79 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 80 | In such situations it is up to the responsible custodian to decide if they |
| 81 | apply such patches even when the Merge Window is closed. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 82 | |
| 83 | Exception: at the end of the Stabilization Period only strict bug |
| 84 | fixes my be applied. |
| 85 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 86 | Sometimes patches miss the Merge Window slightly - say by a few |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 87 | hours or even a day. Patch acceptance is not as critical as a |
| 88 | financial transaction, or such. So if there is such a slight delay, |
| 89 | the custodian is free to turn a blind eye and accept it anyway. The |
| 90 | idea of the development process is to make it foreseeable, |
| 91 | but not to slow down development. |
| 92 | |
| 93 | It makes more sense if an engineer spends another day on testing and |
| 94 | cleanup and submits the patch a couple of hours late, instead of |
| 95 | submitting a green patch which will waste efforts from several people |
| 96 | during several rounds of review and reposts. |
| 97 | |
| 98 | Differences to the Linux Development Process |
| 99 | -------------------------------------------- |
| 100 | |
| 101 | * In Linux, top-level maintainers will collect patches in their trees and send |
| 102 | pull requests to Linus as soon as the merge window opens. |
| 103 | So far, most U-Boot custodians do not work like that; they send pull requests |
| 104 | only at (or even after) the end of the merge window. |
| 105 | |
| 106 | * In Linux, the closing of the merge window is marked by the release of the |
| 107 | next ``"-rc1"`` |
| 108 | In U-Boot, ``"-rc1"`` will only be released after all (or at least most of |
| 109 | the) patches that were submitted during the merge window have been applied. |
| 110 | |
| 111 | Custodians |
| 112 | ---------- |
| 113 | |
| 114 | The Custodians take responsibility for some area of the U-Boot code. The |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 115 | in-tree ``MAINTAINERS`` files list who is responsible for which areas. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 116 | |
| 117 | It is their responsibility to pick up patches from the mailing list |
| 118 | that fall into their responsibility, and to process these. |
| 119 | |
| 120 | A very important responsibility of each custodian is to provide |
| 121 | feedback to the submitter of a patch about what is going on: if the |
| 122 | patch was accepted, or if it was rejected (which exact list of |
| 123 | reasons), if it needs to be reworked (with respective review |
| 124 | comments). Even a "I have no time now, will look into it later" |
| 125 | message is better than nothing. Also, if there are remarks to a |
| 126 | patch, these should leave no doubt if they were just comments and the |
| 127 | patch will be accepted anyway, or if the patch should be |
| 128 | reworked/resubmitted, or if it was rejected. |
| 129 | |
| 130 | Work flow of a Custodian |
| 131 | ------------------------ |
| 132 | |
| 133 | The normal flow of work in the U-Boot development process will look |
| 134 | like this: |
| 135 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 136 | #. A developer submits a patch via e-mail to the u-boot mailing list. In |
| 137 | U-Boot, we make use of the `Developer Certificate of Origin |
| 138 | <https://developercertificate.org/>`_ that is common in other projects such |
| 139 | as the Linux kernel. Following this and adding a ``Signed-off-by:`` line |
| 140 | that contains the developer's name and email address is required. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 141 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 142 | #. Everybody who can is invited to review and test the changes. Typically, we |
| 143 | follow the same guidelines as the Linux kernel for `Acked-by |
| 144 | <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by>`_ |
| 145 | as well as `Reviewed-by |
| 146 | <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>`_ |
| 147 | and similar additional tags. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 148 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 149 | #. The responsible custodian inspects this patch, especially for: |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 150 | |
| 151 | #. :doc:`codingstyle` |
| 152 | |
| 153 | #. Basic logic: |
| 154 | |
| 155 | * The patch fixes a real problem. |
| 156 | |
| 157 | * The patch does not introduce new problems, especially it does not break |
| 158 | other boards or architectures |
| 159 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 160 | #. U-Boot Philosophy, as documented in :doc:`designprinciples`. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 161 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 162 | #. Applies cleanly to the source tree. The custodian is expected to put in |
| 163 | a "best effort" if a patch does not apply cleanly, but can be made to apply |
| 164 | still. It is up to the custodian to decide how recent of a commit the |
| 165 | patch must be against. It is acceptable to request patches against the |
| 166 | last officially released version of U-Boot or newer. Of course a |
| 167 | custodian can also accept patches against older code. It can be |
| 168 | difficult to find the correct balance between putting too much work on |
| 169 | the custodian or too much work on an individual submitting a patch when |
| 170 | something does not apply cleanly. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 171 | |
Tom Rini | 4eed72a | 2022-07-14 08:07:45 -0400 | [diff] [blame] | 172 | #. Passes :doc:`ci_testing` as this checks for new warnings and other issues. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 173 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 174 | #. Note that in some cases more than one custodian may feel responsible for a |
| 175 | particular change. To avoid duplicated efforts, the custodian who starts |
| 176 | processing the patch should follow up to the email saying they intend to |
| 177 | pick it up. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 178 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 179 | #. Commits must show original author in the ``author`` field and include all of |
| 180 | the ``Signed-off-by``, ``Reviewed-by``, etc, tags that have been submitted. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 181 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 182 | #. The final decision to accept or reject a patch comes down to the custodian |
| 183 | in question. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 184 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 185 | #. If accepted, the custodian adds the patch to their public git repository. |
| 186 | Ideally, they will also follow up on the mailing list with some notification |
| 187 | that it has been applied. This is not always easy given different custodian |
| 188 | workflows and environments however. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 189 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 190 | #. Although a custodian is supposed to perform their own tests it is a |
| 191 | well-known and accepted fact that they needs help from other developers who |
| 192 | - for example - have access to the required hardware or other relevant |
| 193 | environments. Custodians are expected to ask for assistance with testing |
| 194 | when required. |
Tom Rini | 4476965 | 2022-07-14 08:07:43 -0400 | [diff] [blame] | 195 | |
Tom Rini | 1974a56 | 2022-07-14 08:07:46 -0400 | [diff] [blame] | 196 | #. Custodians are expected to submit a timely pull request of their git |
| 197 | repository to the main repository. It is strongly encouraged that a CI run |
| 198 | has been completed prior to submission, but not required. |