Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362837
b: refs/heads/master
c: ffa9095
h: refs/heads/master
i:
  362835: f751f3a
v: v3
  • Loading branch information
Hanjun Guo authored and Tony Luck committed Mar 19, 2013
1 parent 91144d1 commit da96c7e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 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: c74edea33c57ae98121a1fdfa5512fbcd9c74875
refs/heads/master: ffa9095532d758cab6ecd6f161b08e338e7f64cb
32 changes: 31 additions & 1 deletion trunk/arch/ia64/kernel/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,26 @@ iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)
return 0;
}

static int
iosapic_delete_rte(unsigned int irq, unsigned int gsi)
{
struct iosapic_rte_info *rte, *temp;

list_for_each_entry_safe(rte, temp, &iosapic_intr_info[irq].rtes,
rte_list) {
if (rte->iosapic->gsi_base + rte->rte_index == gsi) {
if (rte->refcnt)
return -EBUSY;

list_del(&rte->rte_list);
kfree(rte);
return 0;
}
}

return -EINVAL;
}

int iosapic_init(unsigned long phys_addr, unsigned int gsi_base)
{
int num_rte, err, index;
Expand Down Expand Up @@ -1069,7 +1089,7 @@ int iosapic_init(unsigned long phys_addr, unsigned int gsi_base)

int iosapic_remove(unsigned int gsi_base)
{
int index, err = 0;
int i, irq, index, err = 0;
unsigned long flags;

spin_lock_irqsave(&iosapic_lock, flags);
Expand All @@ -1087,6 +1107,16 @@ int iosapic_remove(unsigned int gsi_base)
goto out;
}

for (i = gsi_base; i < gsi_base + iosapic_lists[index].num_rte; i++) {
irq = __gsi_to_irq(i);
if (irq < 0)
continue;

err = iosapic_delete_rte(irq, i);
if (err)
goto out;
}

iounmap(iosapic_lists[index].addr);
iosapic_free(index);
out:
Expand Down

0 comments on commit da96c7e

Please sign in to comment.