Project

General

Profile

Bug #4020

Make ldi_ev_remove_callbacks safe to use in LDI callbacks

Added by Robert Mustacchi over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Category:
kernel
Start date:
2013-08-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

LDI allows various events to be propagated from a device driver up to consumers of those devices. The functions ldi_invoke_finalize and ldi_invoke_notify will walk the list of subscriptions and call back into the function pointer to deliver the event.

Unfortunately, the notify phase of LDI event delivery can require the consumer to synchronously free resources and close their LDI handle before returning from the callback. Consumers are also required to invoke ldi_ev_remove_callbacks on all registered callbacks when doing so.

Even more unfortunately, you may have more than one callback registered for a particular LDI handle and the walk of the list is not removal safe. So, we must enlist the cooperation of ldi_ev_remove_callbacks to shift our walker along the list if we are unregistering the element at our current walk position.

History

#1

Updated by Robert Mustacchi over 6 years ago

  • Status changed from New to Resolved

Resolved in 20aa1b4d581d4b759a9db7f61e4ab39b88dcb9c4.

Also available in: Atom PDF