backport-include/sysfs.h: guard fallback sysfs visibility macros#300
Open
knayana-gse wants to merge 7 commits intointel-gpu:oot-backport/mainfrom
Open
backport-include/sysfs.h: guard fallback sysfs visibility macros#300knayana-gse wants to merge 7 commits intointel-gpu:oot-backport/mainfrom
knayana-gse wants to merge 7 commits intointel-gpu:oot-backport/mainfrom
Conversation
Define fallback sysfs visibility helper macros only when missing to avoid redefinition warnings with RHEL 10.1 headers. This keeps compatibility with kernel 6.6 and 6.12. Warning: --------------------------------------------------------------------- "DEFINE_SIMPLE_SYSFS_BIN_GROUP_VISIBLE" redefined --------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
RHEL 10.1 headers require string-literal namespaces in MODULE_IMPORT_NS. Use BPM_MODULE_IMPORT_TO_STRING_LITERAL_PRESENT to select unquoted vs quoted namespace form in dma-buf and intel_vsec backport headers. Error: ------------------------------------------------------------------------------- Fixes compile error: expected ',' or ';' before 'DMA_BUF'. Fixes compile error: expected ',' or ';' before 'INTEL_VSEC'. ------------------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
RHEL 10.1 headers already define secs_to_jiffies, which triggers a macro redefinition warning in backport builds. Guard the fallback with #ifndef secs_to_jiffies so it is only defined when missing. Also update the configure probe to check secs_to_jiffies via the jiffies API header, avoiding false “not present” detection. Warning: --------------------------------------------------------------------- "secs_to_jiffies" redefined --------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
The configure probe used the wrong return type for drmm_cgroup_register_region (struct drm_cgroup_state *), while newer headers (including RHEL 10.1) expose struct dmem_cgroup_region *. With -Werror, this mismatch can fail the probe, incorrectly define BPM_DRMM_CGROUP_REGISTER_REGION_NOT_PRESENT, and trigger a conflicting backport static declaration. Use struct dmem_cgroup_region * in the probe to detect API availability correctly and avoid the static/non-static declaration conflict. Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
RHEL 10.1 kernels expose drm_dev_wedged_event with two arguments, while mainline kernels use three arguments. Add separate configure probes for API presence and third-argument support. This allows selecting the correct compatibility path and avoids conflicting drm_dev_wedged_event declarations during build. Error: ------------------------------------------------------------------------------- conflicting types for ‘drm_dev_wedged_event’; have ‘int(struct drm_device *, long unsigned int, struct drm_wedge_task_info *)’ ------------------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
AC_DRV_DATE_NOT_PRESENT had inverted probe handling and could leave BPM_DRV_DATE_NOT_PRESENT unset when .date is not available in struct drm_driver as seen with RHEL 10.1 headers. Move the AC_DEFINE(BPM_DRV_DATE_NOT_PRESENT, 1, ...) action to the compile-failure branch so .date = DRIVER_DATE is correctly disabled when the field is absent. Error: ------------------------------------------------------------------------------- initializer element is not computable at load time 9 | #define DRIVER_DATE "20201103" ------------------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
The AC_CONST_STRUCT_BIN_ATTRIBUTE_IS_NOT_PRESENT check defined a helper function inside the compile body, which can cause probe failures unrelated to the actual bin_attribute::mmap callback type. Move test_mmap() to the compile section so the probe accurately detects whether mmap expects const struct bin_attribute *. This fixes incorrect configure detection seen with RHEL 10.1 headers. Error: ------------------------------------------------------------------------------- assignment to ‘int (*)(struct file *, struct kobject *, const struct bin_attribute *, struct vm_area_struct *)’ from incompatible pointer type ‘int (*)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *)’ ------------------------------------------------------------------------------- Signed-off-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
smuqthya
requested changes
Mar 26, 2026
|
|
||
| #ifdef BPM_SECS_TO_JIFFIES_NOT_PRESENT | ||
|
|
||
| #ifndef secs_to_jiffies |
Contributor
There was a problem hiding this comment.
Why do we need M4 if we are using conditional check
| ],[ | ||
| struct drm_device *dev = NULL; | ||
| struct drm_cgroup_state *cg; | ||
| struct dmem_cgroup_region *cg; |
Contributor
There was a problem hiding this comment.
is it wrong m4 previously. did we verify all the variants true or false
| #include <drm/drm_drv.h> | ||
| ],[ | ||
| struct drm_device drm; | ||
| drm_dev_wedged_event(&drm, 0, NULL); |
Contributor
There was a problem hiding this comment.
Why different trails hear? can we move it to conditional M4. looks we may have both ways
| unsigned long method, | ||
| struct drm_wedge_task_info *info) | ||
| { | ||
| (void)info; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Define fallback sysfs visibility helper macros only when
missing to avoid redefinition warnings with RHEL 10.1 headers.
This keeps compatibility with kernel 6.6 and 6.12.
Warning:
"DEFINE_SIMPLE_SYSFS_BIN_GROUP_VISIBLE" redefined
Signed-off-by: Kanaka Raju Nayana kanaka.raju.nayana@intel.com