On Mon, 2009-02-16 at 01:48 -0800, Luis R. Rodriguez wrote: > > Are you sure the mutex order reg_mutex --> cfg80211_mutex is a good > > idea? Is there a need for two locks at all? > > I think so. So reg_mutex would prevent any new requests to be added > into the queue, that's the only thing that mutex protects. Once you > are sure you have no one adding requests to the queue you then need to > ensure no one is processing a regulatory request and hence the > cfg80211_mutex. > > We need to protect the queue from additions to the queue from having > the workqueue process it. Maybe just use a spinlock for the list, and do the loop manually like in mac80211/key.c then? spin_lock(&todo_lock); while (!list_empty(&todo_list)) { key = list_first_entry(&todo_list, struct ieee80211_key, todo); list_del_init(&key->todo); spin_unlock(&todo_lock); ........ spin_lock(&todo_lock); } spin_unlock(&todo_lock); johannes
Attachment:
signature.asc
Description: This is a digitally signed message part