Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:ARM:Factory:Contrib:Mali
mali-midgard-kmp
mali-fix-kernel-5.5.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mali-fix-kernel-5.5.diff of Package mali-midgard-kmp
--- diff --git a/driver/product/kernel/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c b/driver/product/kernel/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c index c25045b..3354367 100644 --- a/driver/product/kernel/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c +++ b/driver/product/kernel/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c @@ -1,6 +1,6 @@ /* * - * (C) COPYRIGHT 2010-2019 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2010-2020 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -2925,6 +2925,20 @@ } KBASE_EXPORT_TEST_API(kbase_vunmap); +static void kbasep_add_mm_counter(struct mm_struct *mm, int member, long value) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) + /* To avoid the build breakage due to an unexported kernel symbol + * 'mm_trace_rss_stat' from later kernels, i.e. from V5.5.0 onwards, + * we inline here the equivalent of 'add_mm_counter()' from linux + * kernel V5.4.0~8. + */ + atomic_long_add(value, &mm->rss_stat.count[member]); +#else + add_mm_counter(mm, member, value); +#endif +} + void kbasep_os_process_page_usage_update(struct kbase_context *kctx, int pages) { struct mm_struct *mm; @@ -2934,10 +2948,10 @@ if (mm) { atomic_add(pages, &kctx->nonmapped_pages); #ifdef SPLIT_RSS_COUNTING - add_mm_counter(mm, MM_FILEPAGES, pages); + kbasep_add_mm_counter(mm, MM_FILEPAGES, pages); #else spin_lock(&mm->page_table_lock); - add_mm_counter(mm, MM_FILEPAGES, pages); + kbasep_add_mm_counter(mm, MM_FILEPAGES, pages); spin_unlock(&mm->page_table_lock); #endif } @@ -2962,10 +2976,10 @@ pages = atomic_xchg(&kctx->nonmapped_pages, 0); #ifdef SPLIT_RSS_COUNTING - add_mm_counter(mm, MM_FILEPAGES, -pages); + kbasep_add_mm_counter(mm, MM_FILEPAGES, -pages); #else spin_lock(&mm->page_table_lock); - add_mm_counter(mm, MM_FILEPAGES, -pages); + kbasep_add_mm_counter(mm, MM_FILEPAGES, -pages); spin_unlock(&mm->page_table_lock); #endif } diff --git a/driver/product/kernel/drivers/gpu/arm/midgard/tests/kutf/kutf_suite.c b/driver/product/kernel/drivers/gpu/arm/midgard/tests/kutf/kutf_suite.c index ea5696f..517d92d 100644 --- a/driver/product/kernel/drivers/gpu/arm/midgard/tests/kutf/kutf_suite.c +++ b/driver/product/kernel/drivers/gpu/arm/midgard/tests/kutf/kutf_suite.c @@ -1,6 +1,6 @@ /* * - * (C) COPYRIGHT 2014, 2017-2019 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017-2020 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -627,6 +627,17 @@ kfree(test_fix); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) +/* Adapting to the upstream debugfs_create_x32() change */ +static int ktufp_u32_get(void *data, u64 *val) +{ + *val = *(u32 *)data; + return 0; +} + +DEFINE_DEBUGFS_ATTRIBUTE(kutfp_fops_x32_ro, ktufp_u32_get, NULL, "0x%08llx\n"); +#endif + void kutf_add_test_with_filters_and_data( struct kutf_suite *suite, unsigned int id, @@ -661,8 +672,13 @@ } test_func->filters = filters; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0) + tmp = debugfs_create_file_unsafe("filters", S_IROTH, test_func->dir, + &test_func->filters, &kutfp_fops_x32_ro); +#else tmp = debugfs_create_x32("filters", S_IROTH, test_func->dir, &test_func->filters); +#endif if (!tmp) { pr_err("Failed to create debugfs file \"filters\" when adding test %s\n", name); goto fail_file;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor