* [patch] fix intr-remap with dyn_array/nr_irqs changes
@ 2008-08-19 18:54 Suresh Siddha
2008-08-19 19:40 ` Yinghai Lu
0 siblings, 1 reply; 2+ messages in thread
From: Suresh Siddha @ 2008-08-19 18:54 UTC (permalink / raw)
To: yhlu.kernel, mingo; +Cc: linux-kernel, ebiederm, x86
I didn't find time to closely review the dyn_array/nr_irqs changes. But
the appended patch is needed to fix the broken intr-remapping support on
x86/tip
And also, I don't see any locks used in to_irq_desc_with_new(). How are
we handling the concurrent usage scenarios. And also, this code can use
some cleanups (like the names, to_irq_desc_with_new()?) etc.
thanks,
suresh
---
In irq_2_iommu_with_new() and set_irte_irq(), irq_desc or
irq_2_iommu pointers may not be allocated. So use the routines which
will allocate them if they are not already allocated.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 3593f0f..fbd82ff 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -76,7 +76,10 @@ static struct irq_2_iommu *irq_2_iommu_with_new(unsigned int irq)
struct irq_desc *desc;
struct irq_2_iommu *irq_iommu;
- desc = to_irq_desc(irq);
+ /*
+ * alloc irq desc if not allocated already.
+ */
+ desc = to_irq_desc_with_new(irq);
BUG_ON(!desc);
@@ -255,11 +258,7 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
struct irq_2_iommu *irq_iommu;
spin_lock(&irq_2_ir_lock);
- irq_iommu = valid_irq_2_iommu(irq);
- if (!irq_iommu) {
- spin_unlock(&irq_2_ir_lock);
- return -1;
- }
+ irq_iommu = irq_2_iommu_with_new(irq);
irq_iommu->iommu = iommu;
irq_iommu->irte_index = index;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [patch] fix intr-remap with dyn_array/nr_irqs changes
2008-08-19 18:54 [patch] fix intr-remap with dyn_array/nr_irqs changes Suresh Siddha
@ 2008-08-19 19:40 ` Yinghai Lu
0 siblings, 0 replies; 2+ messages in thread
From: Yinghai Lu @ 2008-08-19 19:40 UTC (permalink / raw)
To: Suresh Siddha; +Cc: mingo, linux-kernel, ebiederm, x86
On Tue, Aug 19, 2008 at 11:54 AM, Suresh Siddha
<suresh.b.siddha@intel.com> wrote:
> I didn't find time to closely review the dyn_array/nr_irqs changes. But
> the appended patch is needed to fix the broken intr-remapping support on
> x86/tip
>
> And also, I don't see any locks used in to_irq_desc_with_new(). How are
> we handling the concurrent usage scenarios. And also, this code can use
> some cleanups (like the names, to_irq_desc_with_new()?) etc.
>
> thanks,
> suresh
> ---
>
> In irq_2_iommu_with_new() and set_irte_irq(), irq_desc or
> irq_2_iommu pointers may not be allocated. So use the routines which
> will allocate them if they are not already allocated.
>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
i'm trying to rebase sparseirq to tip/x86/core.
will address your concern about lock after that.
Thanks
YH
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-19 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 18:54 [patch] fix intr-remap with dyn_array/nr_irqs changes Suresh Siddha
2008-08-19 19:40 ` Yinghai Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox