Skip to content

Commit af5529a

Browse files
KamopplKamil Gierszewski
authored andcommitted
Fix involuntary preemption check
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
1 parent 114b250 commit af5529a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

modules/cas_cache/main.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,15 @@ ocf_ctx_t cas_ctx;
4444
struct cas_module cas_module;
4545

4646
static inline uint32_t involuntary_preemption_enabled(void)
47-
{
48-
bool config_dynamic = IS_ENABLED(CONFIG_PREEMPT_DYNAMIC);
47+
{
4948
bool config_rt = IS_ENABLED(CONFIG_PREEMPT_RT);
5049
bool config_preempt = IS_ENABLED(CONFIG_PREEMPT);
5150
bool config_lazy = IS_ENABLED(CONFIG_PREEMPT_LAZY);
52-
bool config_none = IS_ENABLED(CONFIG_PREEMPT_NONE);
53-
54-
if (!config_dynamic && !config_rt && !config_preempt && !config_lazy)
55-
return false;
5651

57-
if (config_none)
58-
return false;
59-
60-
if (config_rt || config_preempt || config_lazy) {
52+
if (config_rt) {
6153
printk(KERN_ERR OCF_PREFIX_SHORT
62-
"The kernel has been built with involuntary preemption "
63-
"enabled.\nFailed to load Open CAS kernel module.\n");
54+
"The kernel has been compiled with real-time preemption enabled (PREEMPT_RT).\n"
55+
"Failed to load Open CAS kernel module");
6456
return true;
6557
}
6658

@@ -78,11 +70,19 @@ static inline uint32_t involuntary_preemption_enabled(void)
7870
"preemption enabled.\nFailed to load Open CAS kernel "
7971
"module.\n");
8072
return true;
81-
} else {
82-
return false;
8373
}
74+
return false;
75+
8476
#endif
8577

78+
if (config_preempt || config_lazy) {
79+
printk(KERN_ERR OCF_PREFIX_SHORT
80+
"The kernel has been built with involuntary preemption "
81+
"enabled.\nFailed to load Open CAS kernel module.\n");
82+
return true;
83+
}
84+
85+
8686
return false;
8787
}
8888

0 commit comments

Comments
 (0)