-
Notifications
You must be signed in to change notification settings - Fork 102
[Deepin-Kernel-SIG] [linux 6.6-y] [Deepin] fwnode: Fix kabi breakage due to reference count interface #1284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Deepin-Kernel-SIG] [linux 6.6-y] [Deepin] fwnode: Fix kabi breakage due to reference count interface #1284
Conversation
deepin inclusion category: bugfix commit b229baa ("kernel.h: split out COUNT_ARGS() and CONCATENATE() to args.h") move COUNT_ARGS to linux/args.h, it lead to make some headers not include it. lead to strange build failed when use KABI_USE. It can be reproduced in original rh_kabi.h(use centos 10) + upstream 6.6 in fwnode.h, and commit 1dc05a2 ("device property: Replace custom implementation of COUNT_ARGS()") include args.h, so it cannot be reproduced after v6.7 upstream. Log: In file included from ./include/linux/property.h:15, from drivers/base/firmware_loader/fallback_platform.c:4: ./include/linux/fwnode.h:178:8: error: macro "_RH_KABI_REPLACE" requires 2 arguments, but only 1 given 178 | RH_KABI_USE(1, int b) | ^ ~~~~~~~~~~~~~~~~~~~~~ In file included from ./include/linux/fwnode.h:130: ./include/linux/rh_kabi.h:441: note: macro "_RH_KABI_REPLACE" defined here 441 | # define _RH_KABI_REPLACE(_orig, _new) \ | ./include/linux/rh_kabi.h:490:33: error: expected specifier-qualifier-list before ‘_RH_KABI_REPLACE’ 490 | #define _RH_KABI_USE(...) _RH_KABI_REPLACE(__VA_ARGS__) | ^~~~~~~~~~~~~~~~ ./include/linux/rh_kabi.h:491:33: note: in expansion of macro ‘_RH_KABI_USE’ 491 | #define RH_KABI_USE(n, ...) _RH_KABI_USE(__PASTE(_RH_KABI_USE, COUNT_ARGS(__VA_ARGS__))(n, __VA_ARGS__)); | ^~~~~~~~~~~~ ./include/linux/fwnode.h:178:9: note: in expansion of macro ‘RH_KABI_USE’ 178 | RH_KABI_USE(1, int b) Fixes: 5083950 ("kABI: Introduce generic kABI macros to use for kABI workarounds") Signed-off-by: Wentao Guan <[email protected]>
deepin inclusion category: kabi Fixes: 12cd73c ("Add a property reference count interface for ACPI.") Signed-off-by: Wentao Guan <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis patch restores kABI compatibility by refactoring the fwnode reference-count callback to use the DEEPIN_KABI_USE macro and adds the missing COUNT_ARGS definition via an args.h include in deepin_kabi.h. Class diagram for updated fwnode_operations structureclassDiagram
class fwnode_operations {
+void __iomem *iomap(struct fwnode_handle *fwnode, int index)
+int irq_get(const struct fwnode_handle *fwnode, unsigned int index)
+int add_links(struct fwnode_handle *fwnode)
+DEEPIN_KABI_USE(1, int (*property_count_reference_with_args)(const struct fwnode_handle *fwnode, const char *list_name, const char *cells_name))
+DEEPIN_KABI_RESERVE(2)
+DEEPIN_KABI_RESERVE(3)
+DEEPIN_KABI_RESERVE(4)
}
Class diagram for deepin_kabi.h include changesclassDiagram
class deepin_kabi_h {
+#include <linux/args.h>
+#include <linux/kconfig.h>
+#include <linux/compiler.h>
+#include <linux/stringify.h>
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来帮你分析这个 git diff 的修改内容:
潜在问题:
改进建议:
#ifndef _LINUX_DEEPIN_KABI_H
#define _LINUX_DEEPIN_KABI_H
// 建议添加注释说明新增头文件的用途
#include <linux/args.h> /* 用于参数处理相关宏定义 */
#include <linux/kconfig.h>
#include <linux/compiler.h>
#include <linux/stringify.h>
struct fwnode_operations {
// ... 其他成员 ...
// 建议添加注释说明这个变更的目的
/*
* 使用 KABI 机制管理 property_count_reference_with_args 函数指针,
* 确保接口向后兼容性
*/
DEEPIN_KABI_USE(1, int (*property_count_reference_with_args)(
const struct fwnode_handle *fwnode, const char *list_name,
const char *cells_name))
// 建议为每个保留位添加注释说明未来可能的用途
DEEPIN_KABI_RESERVE(2) /* 保留用于未来扩展 */
DEEPIN_KABI_RESERVE(3) /* 保留用于未来扩展 */
DEEPIN_KABI_RESERVE(4) /* 保留用于未来扩展 */
这些修改主要是为了更好地管理内核接口的兼容性,整体设计是合理的。只要确保宏定义的正确实现和适当的文档说明,这些变更是可以接受的。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shy129 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fwnode: Fix kabi breakage due to reference count interface
deepin inclusion
category: kabi
Fixes: 12cd73c ("Add a property reference count interface for ACPI.")
Signed-off-by: Wentao Guan [email protected]
kABI: Fix kABI macros use COUNT_ARGS
deepin inclusion
category: bugfix
commit b229baa ("kernel.h: split out COUNT_ARGS() and CONCATENATE() to args.h")
move COUNT_ARGS to linux/args.h, it lead to make some headers not include it.
lead to strange build failed when use KABI_USE.
It can be reproduced in original rh_kabi.h(use centos 10) + upstream 6.6 in fwnode.h,
and commit 1dc05a2 ("device property: Replace custom implementation of COUNT_ARGS()")
include args.h, so it cannot be reproduced after v6.7 upstream.
Log:
In file included from ./include/linux/property.h:15,
from drivers/base/firmware_loader/fallback_platform.c:4:
./include/linux/fwnode.h:178:8: error: macro "_RH_KABI_REPLACE" requires 2 arguments, but only 1 given
178 | RH_KABI_USE(1, int b)
| ^ ~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/fwnode.h:130:
./include/linux/rh_kabi.h:441: note: macro "_RH_KABI_REPLACE" defined here
441 | # define _RH_KABI_REPLACE(_orig, _new)
|
./include/linux/rh_kabi.h:490:33: error: expected specifier-qualifier-list before ‘_RH_KABI_REPLACE’
490 | #define _RH_KABI_USE(...) _RH_KABI_REPLACE(VA_ARGS)
| ^~~~~~~~~~~~~~~~
./include/linux/rh_kabi.h:491:33: note: in expansion of macro ‘_RH_KABI_USE’
491 | #define RH_KABI_USE(n, ...) _RH_KABI_USE(__PASTE(_RH_KABI_USE, COUNT_ARGS(VA_ARGS))(n, VA_ARGS));
| ^~~~~~~~~~~~
./include/linux/fwnode.h:178:9: note: in expansion of macro ‘RH_KABI_USE’
178 | RH_KABI_USE(1, int b)
Fixes: 5083950 ("kABI: Introduce generic kABI macros to use for kABI workarounds")
Signed-off-by: Wentao Guan [email protected]
Summary by Sourcery
Fix build failures in the fwnode reference count interface by ensuring kABI macros have the required COUNT_ARGS definition and properly exposing the new operation slot.
Bug Fixes: