commit | 2cf61c95546e0f5a5a066192b082207d8aaf0db5 | [log] [tgz] |
---|---|---|
author | Todd Kjos <[email protected]> | Mon Jan 27 20:53:47 2025 +0000 |
committer | Todd Kjos <[email protected]> | Tue Jan 28 12:33:51 2025 -0800 |
tree | 032b9ddb86e78792bf4fa5c3b9f0e31211bd7923 | |
parent | 9b355fa5261b2d252bedc818a84a1da1619494c6 [diff] |
ANDROID: KABI macros to release excess KABI fields for use with backports With KMI freeze, we reserve padding in structs to be exclusively used for LTS updates that would otherwise break the KMI. These fields are reserved via the ANDROID_KABI_RESERVE() macro that adds a u64 field to the struct. The ANDROID_KABI_USE() macro is used when the field is needed for an LTS patch backport. Since these fields must be reserved at KMI freeze time, we have make our best guess at what might be needed - and sometimes reserve too many fields. An example of this is the 8 ANDROID_KABI_RESERVE() fields in `struct net_device` for android13-5.15. We are now 3 years into the 6 year lifetime for android13-5.15 and none of those 8 padding fields have been used. At this point it is reasonable to allow 1 or 2 of those fields to be used for non-LTS backports. We won't relax the rule that ANDROID_KABI_RESERVE() is exclusively for LTS backports, Instead we'll introduce a new macro, ANDROID_KABI_BACKPORT_OK() to release some KABI fields for general use as the branches age and the use of padding for LTS becomes unlikely. We release the field for use by replacing the ANDROID_KABI_RESERVE() with the new ANDROID_KABI_BACKPORT_OK() macro, which has the exact same implementation, but allows others to use it for backporting features from upstream. When an ANDROID_KABI_BACKPORT_OK() field is going to be used, the ANDROID_KABI_BACKPORT_USE() macro is used to indicate that the field was used for a feature backport, not an LTS patch. This patch adds the two new macros: ANDROID_KABI_BACKPORT_OK() : exactly the same as ANDROID_KABI_RESERVE() ANDROID_KABI_BACKPORT_USE() ; exacly the same as ANDROID_KABI_USE() Patches that change an ANDROID_KABI_RESERVE() to ANDROID_KABI_BACKPORT_OK() must be reviewed and get a CR+1 from gregkh@, joneslee@ or tkjos@ to make sure it really is acceptable to reduce the padding for LTS merges. Bug: 392673958 Signed-off-by: Todd Kjos <[email protected]> Change-Id: I19b9dfc16d891fb6fe48ec4379c6fa3dcb6adf24 (cherry picked from commit f1954b6e6cba2533beb6dff539b9d0b079ceb665)
BEST: Make all of your changes to upstream Linux. If appropriate, backport to the stable releases. These patches will be merged automatically in the corresponding common kernels. If the patch is already in upstream Linux, post a backport of the patch that conforms to the patch requirements below.
EXPORT_SYMBOL_GPL()
require an in-tree modular driver that uses the symbol -- so include the new driver or changes to an existing driver in the same patchset as the export.LESS GOOD: Develop your patches out-of-tree (from an upstream Linux point-of-view). Unless these are fixing an Android-specific bug, these are very unlikely to be accepted unless they have been coordinated with [email protected]. If you want to proceed, post a patch that conforms to the patch requirements below.
scripts/checkpatch.pl
UPSTREAM:
, BACKPORT:
, FROMGIT:
, FROMLIST:
, or ANDROID:
.Change-Id:
tag (see https://gerrit-review.googlesource.com/Documentation/user-changeid.html)Bug:
tag.Signed-off-by:
tag by the author and the submitterAdditional requirements are listed below based on patch type
UPSTREAM:
, BACKPORT:
UPSTREAM:
.(cherry picked from commit ...)
lineimportant patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]>
- then Joe Smith would upload the patch for the common kernel as
UPSTREAM: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]> Bug: 135791357 Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1) Signed-off-by: Joe Smith <[email protected]>
BACKPORT:
instead of UPSTREAM:
.UPSTREAM:
(cherry picked from commit ...)
lineBACKPORT: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]> Bug: 135791357 Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1) [joe: Resolved minor conflict in drivers/foo/bar.c ] Signed-off-by: Joe Smith <[email protected]>
FROMGIT:
, FROMLIST:
,FROMGIT:
(cherry picked from commit <sha1> <repo> <branch>)
. This must be a stable maintainer branch (not rebased, so don't use linux-next
for example).BACKPORT: FROMGIT:
important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]>
- then Joe Smith would upload the patch for the common kernel as
FROMGIT: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]> Bug: 135791357 (cherry picked from commit 878a2fd9de10b03d11d2f622250285c7e63deace https://git.kernel.org/pub/scm/linux/kernel/git/foo/bar.git test-branch) Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <[email protected]>
FROMLIST:
Link:
tag with a link to the submittal on lore.kernel.orgBug:
tag with the Android bug (required for patches not accepted into a maintainer tree)BACKPORT: FROMLIST:
FROMLIST: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <[email protected]> Bug: 135791357 Link: https://lore.kernel.org/lkml/[email protected]/ Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <[email protected]>
ANDROID:
ANDROID:
Fixes:
tag that cites the patch with the bugANDROID: fix android-specific bug in foobar.c This is the detailed description of the important fix Fixes: 1234abcd2468 ("foobar: add cool feature") Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <[email protected]>
ANDROID:
Bug:
tag with the Android bug (required for android-specific features)