RE: RE[PATCH]2.6.4-rc3 MSI Support for IA64

From: Nakajima, Jun
Date: Fri Mar 12 2004 - 20:49:09 EST


Long,

I agree with David and Zwane. The other thing is those CONFIG_IA64
below. We should move those to the arch-specific directory, by defining
interface/macro.

Jun

>-#define MSI_AUTO -1
>+#ifndef CONFIG_IA64
>+#include <asm/desc.h>
>+#ifndef CONFIG_X86_64
>+#include <mach_apic.h>
>+#endif
>
>-#ifndef CONFIG_X86_IO_APIC
>-static inline int get_ioapic_vector(struct pci_dev *dev) { return -1;}
>-static inline void restore_ioapic_irq_handler(int irq) {}
>+static inline int vector_resources(void)
>+{
>+ int res;
>+#ifndef CONFIG_IA64
>+ int i, repeat;
>+ for (i = NR_REPEATS; i > 0; i--) {
>+ if ((FIRST_DEVICE_VECTOR + i * 8) > FIRST_SYSTEM_VECTOR)
>+ continue;
>+ break;
>+ }
>+ i++;
>+ repeat = (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR)/i;
>+ res = i * repeat - NR_RESERVED_VECTORS + 1;
> #else
>-extern void restore_ioapic_irq_handler(int irq);
>+ res = LAST_DEVICE_VECTOR - FIRST_DEVICE_VECTOR - 1;
> #endif
>+
>+ return res;
>+}
>
>+#ifdef CONFIG_IA64
>+#define MSI_DEST_MODE MSI_PHYSICAL_MODE
>+#define MSI_TARGET_CPU ((ia64_getreg(_IA64_REG_CR_LID) >> 16) &
0xffff)
>+#define MSI_TARGET_CPU_SHIFT 4
>+#else
>+#define MSI_DEST_MODE MSI_LOGICAL_MODE
>+#define MSI_TARGET_CPU_SHIFT 12
> #ifdef CONFIG_SMP
> #define MSI_TARGET_CPU
logical_smp_processor_id()
> #else
> #define MSI_TARGET_CPU TARGET_CPUS
> #endif
>+#endif

>-----Original Message-----
>From: Nguyen, Tom L
>Sent: Friday, March 12, 2004 4:22 PM
>To: davidm@xxxxxxxxxx; Zwane Mwaikambo
>Cc: long; linux-ia64@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
>grep@xxxxxxxxx; jgarzik@xxxxxxxxx; Nakajima, Jun; Luck, Tony
>Subject: RE: RE[PATCH]2.6.4-rc3 MSI Support for IA64
>
>On Fri, 12 Mar 2004, David Mosberger wrote:
>
>>>>>> On Fri, 12 Mar 2004 18:26:39 -0500 (EST), Zwane Mwaikambo
><zwane@xxxxxxxxxxxxx> said:
>
>> Zwane> I wonder if we could consolidate these vector allocators as
>> Zwane> assign_irq_vector(AUTO_ASSIGN) has the same semantics as
>> Zwane> ia64_alloc_vector() and the one for i386 is also almost the
>> Zwane> same as its MSI ilk.
>
>> Agreed. I don't see any reason why ia64_alloc_vector() and
>> assign_irq_vector() couldn't or shouldn't be one and the same thing
>> (and assign_irq_vector() is a fine name).
>
>Agree. Thanks!
>
>> Tom, if you want to send me a patch that converts the existing uses
of
>> ia64_alloc_vector() to assign_irq_vector(), I'd be happy to apply
>> (assuming it's clean etc., as usual).
>
>Thanks! We'll do. I will work with Tony and Jun to consolidate
i386/IA64
>vector
>allocators to ensure it is clean.
>
>Thanks,
>Long
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/