Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28768
b: refs/heads/master
c: 4312dc7
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and Paul Mackerras committed Jun 15, 2006
1 parent 8d63569 commit be4c6f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 368a6ba5d188552aea2a668301a259164c9f355e
refs/heads/master: 4312dc76a88146c4f1d693fc4643d1df12aaf755
14 changes: 14 additions & 0 deletions trunk/arch/powerpc/platforms/powermac/pfunc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,17 @@ int pmf_register_irq_client(struct device_node *target,
spin_unlock_irqrestore(&pmf_lock, flags);
if (func == NULL)
return -ENODEV;

/* guard against manipulations of list */
mutex_lock(&pmf_irq_mutex);
if (list_empty(&func->irq_clients))
func->dev->handlers->irq_enable(func);

/* guard against pmf_do_irq while changing list */
spin_lock_irqsave(&pmf_lock, flags);
list_add(&client->link, &func->irq_clients);
spin_unlock_irqrestore(&pmf_lock, flags);

client->func = func;
mutex_unlock(&pmf_irq_mutex);

Expand All @@ -885,12 +892,19 @@ EXPORT_SYMBOL_GPL(pmf_register_irq_client);
void pmf_unregister_irq_client(struct pmf_irq_client *client)
{
struct pmf_function *func = client->func;
unsigned long flags;

BUG_ON(func == NULL);

/* guard against manipulations of list */
mutex_lock(&pmf_irq_mutex);
client->func = NULL;

/* guard against pmf_do_irq while changing list */
spin_lock_irqsave(&pmf_lock, flags);
list_del(&client->link);
spin_unlock_irqrestore(&pmf_lock, flags);

if (list_empty(&func->irq_clients))
func->dev->handlers->irq_disable(func);
mutex_unlock(&pmf_irq_mutex);
Expand Down

0 comments on commit be4c6f8

Please sign in to comment.