Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83333
b: refs/heads/master
c: 2cae367
h: refs/heads/master
i:
  83331: f76c504
v: v3
  • Loading branch information
Matthew Wilcox committed Dec 4, 2007
1 parent 6cb777b commit 6235ac7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e87aa773747fb5e4217d716ea22a573c03b6693a
refs/heads/master: 2cae367e4854ff055c4f5e8aacd56b0eeec9f6cb
9 changes: 5 additions & 4 deletions trunk/mm/dmapool.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
size_t offset;
void *retval;

restart:
spin_lock_irqsave(&pool->lock, flags);
restart:
list_for_each_entry(page, &pool->page_list, page_list) {
int i;
/* only cachable accesses here ... */
Expand All @@ -299,12 +299,13 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
DECLARE_WAITQUEUE(wait, current);

__set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&pool->waitq, &wait);
__add_wait_queue(&pool->waitq, &wait);
spin_unlock_irqrestore(&pool->lock, flags);

schedule_timeout(POOL_TIMEOUT_JIFFIES);

remove_wait_queue(&pool->waitq, &wait);
spin_lock_irqsave(&pool->lock, flags);
__remove_wait_queue(&pool->waitq, &wait);
goto restart;
}
retval = NULL;
Expand Down Expand Up @@ -406,7 +407,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
page->in_use--;
set_bit(block, &page->bitmap[map]);
if (waitqueue_active(&pool->waitq))
wake_up(&pool->waitq);
wake_up_locked(&pool->waitq);
/*
* Resist a temptation to do
* if (!is_page_busy(bpp, page->bitmap)) pool_free_page(pool, page);
Expand Down

0 comments on commit 6235ac7

Please sign in to comment.