diff options
| author | Joerg Roedel <joerg.roedel@amd.com> | 2009-06-09 10:50:57 +0200 |
|---|---|---|
| committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-06-09 10:50:57 +0200 |
| commit | d2dd01de9924ae24afeba5aa5bc2e08287701df6 (patch) | |
| tree | 3021bf496579a48984666355b59df5e44b42dd32 /kernel/async.c | |
| parent | 367d04c4ec02dad34d80452e32e3370db7fb6fee (diff) | |
| parent | 62a6f465f6572e1f28765c583c12753bb3e23715 (diff) | |
Merge commit 'tip/core/iommu' into amd-iommu/fixes
Diffstat (limited to 'kernel/async.c')
| -rw-r--r-- | kernel/async.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/async.c b/kernel/async.c index 968ef9457d4..50540301ed0 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -92,19 +92,23 @@ extern int initcall_debug; static async_cookie_t __lowest_in_progress(struct list_head *running) { struct async_entry *entry; + async_cookie_t ret = next_cookie; /* begin with "infinity" value */ + if (!list_empty(running)) { entry = list_first_entry(running, struct async_entry, list); - return entry->cookie; - } else if (!list_empty(&async_pending)) { - entry = list_first_entry(&async_pending, - struct async_entry, list); - return entry->cookie; - } else { - /* nothing in progress... next_cookie is "infinity" */ - return next_cookie; + ret = entry->cookie; } + if (!list_empty(&async_pending)) { + list_for_each_entry(entry, &async_pending, list) + if (entry->running == running) { + ret = entry->cookie; + break; + } + } + + return ret; } static async_cookie_t lowest_in_progress(struct list_head *running) |
