We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff7b915 commit 832ef87Copy full SHA for 832ef87
drivers/crypto/ccp/hygon/psp-dev.c
@@ -75,14 +75,21 @@ int psp_mutex_trylock(struct psp_mutex *mutex)
75
int psp_mutex_lock_timeout(struct psp_mutex *mutex, uint64_t ms)
76
{
77
int ret = 0;
78
- unsigned long je;
+ unsigned long je, last_je;
79
80
+ last_je = jiffies;
81
je = jiffies + msecs_to_jiffies(ms);
82
do {
83
if (psp_mutex_trylock(mutex)) {
84
ret = 1;
85
break;
86
}
87
+
88
+ // avoid triggering soft lockup warning
89
+ if (time_after(jiffies, last_je + msecs_to_jiffies(100))) {
90
+ schedule();
91
92
+ }
93
} while ((ms == 0) || time_before(jiffies, je));
94
95
return ret;
0 commit comments