@@ -265,19 +265,19 @@ dpusm_provider_register(dpusm_t *dpusm, struct module *module, const dpusm_pf_t
265
265
return - EINVAL ;
266
266
}
267
267
268
- mutex_lock ( & dpusm -> lock ); ;
268
+ while ( mutex_lock_interruptible ( & dpusm -> lock )) ;
269
269
270
270
dpusm_ph_t * * found = find_provider (dpusm , module_name (module ));
271
271
if (found ) {
272
272
printk ("%s: DPUSM Provider with the name \"%s\" (%p) already exists. %zu providers registered.\n" ,
273
273
__func__ , module_name (module ), * found , dpusm -> count );
274
- mutex_unlock (& dpusm -> lock );;
274
+ mutex_unlock (& dpusm -> lock );
275
275
return - EEXIST ;
276
276
}
277
277
278
278
dpusm_ph_t * provider = dpusmph_init (module , funcs );
279
279
if (!provider ) {
280
- mutex_unlock (& dpusm -> lock );;
280
+ mutex_unlock (& dpusm -> lock );
281
281
return - ECANCELED ;
282
282
}
283
283
@@ -286,7 +286,7 @@ dpusm_provider_register(dpusm_t *dpusm, struct module *module, const dpusm_pf_t
286
286
printk ("%s: DPUSM Provider \"%s\" (%p) added. Now %zu providers registered.\n" ,
287
287
__func__ , module_name (module ), provider , dpusm -> count );
288
288
289
- mutex_unlock (& dpusm -> lock );;
289
+ mutex_unlock (& dpusm -> lock );
290
290
291
291
return 0 ;
292
292
}
@@ -320,20 +320,20 @@ dpusm_provider_unregister_handle(dpusm_t *dpusm, dpusm_ph_t **provider) {
320
320
321
321
int
322
322
dpusm_provider_unregister (dpusm_t * dpusm , struct module * module ) {
323
- mutex_lock ( & dpusm -> lock ); ;
323
+ while ( mutex_lock_interruptible ( & dpusm -> lock )) ;
324
324
325
325
dpusm_ph_t * * provider = find_provider (dpusm , module_name (module ));
326
326
if (!provider ) {
327
327
printk ("%s: Could not find provider with name \"%s\"\n" , __func__ , module_name (module ));
328
- mutex_unlock (& dpusm -> lock );;
328
+ mutex_unlock (& dpusm -> lock );
329
329
return DPUSM_ERROR ;
330
330
}
331
331
332
332
void * addr = * provider ;
333
333
const int rc = dpusm_provider_unregister_handle (dpusm , provider );
334
334
printk ("%s: Unregistered \"%s\" (%p): %d\n" , __func__ , module_name (module ), addr , rc );
335
335
336
- mutex_unlock (& dpusm -> lock );;
336
+ mutex_unlock (& dpusm -> lock );
337
337
return rc ;
338
338
}
339
339
@@ -345,7 +345,7 @@ dpusm_provider_unregister(dpusm_t *dpusm, struct module *module) {
345
345
/* get a provider by name */
346
346
dpusm_ph_t * *
347
347
dpusm_provider_get (dpusm_t * dpusm , const char * name ) {
348
- mutex_lock ( & dpusm -> lock );
348
+ while ( mutex_lock_interruptible ( & dpusm -> lock ) );
349
349
dpusm_ph_t * * provider = find_provider (dpusm , name );
350
350
if (provider ) {
351
351
struct module * module = (* provider )-> module ;
@@ -405,7 +405,7 @@ dpusm_provider_put(dpusm_t *dpusm, void *handle) {
405
405
}
406
406
407
407
void dpusm_provider_invalidate (dpusm_t * dpusm , const char * name ) {
408
- mutex_lock ( & dpusm -> lock ); ;
408
+ while ( mutex_lock_interruptible ( & dpusm -> lock )) ;
409
409
dpusm_ph_t * * provider = find_provider (dpusm , name );
410
410
if (provider && * provider ) {
411
411
(* provider )-> funcs = NULL ;
@@ -418,5 +418,5 @@ void dpusm_provider_invalidate(dpusm_t *dpusm, const char *name) {
418
418
printk ("%s: Error: Did not find provider \"%s\"\n" ,
419
419
__func__ , name );
420
420
}
421
- mutex_unlock (& dpusm -> lock );;
421
+ mutex_unlock (& dpusm -> lock );
422
422
}
0 commit comments