2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* Platform dependent support for SGI SN
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
2006-02-02 05:15:51 -05:00
|
|
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/irq.h>
|
2005-07-06 17:59:44 -04:00
|
|
|
#include <linux/spinlock.h>
|
2006-02-02 05:15:51 -05:00
|
|
|
#include <linux/init.h>
|
2005-04-16 18:20:36 -04:00
|
|
|
#include <asm/sn/addrs.h>
|
|
|
|
#include <asm/sn/arch.h>
|
2005-07-06 18:26:51 -04:00
|
|
|
#include <asm/sn/intr.h>
|
|
|
|
#include <asm/sn/pcibr_provider.h>
|
2005-04-25 14:32:16 -04:00
|
|
|
#include <asm/sn/pcibus_provider_defs.h>
|
|
|
|
#include <asm/sn/pcidev.h>
|
2005-04-16 18:20:36 -04:00
|
|
|
#include <asm/sn/shub_mmr.h>
|
|
|
|
#include <asm/sn/sn_sal.h>
|
|
|
|
|
|
|
|
static void force_interrupt(int irq);
|
|
|
|
static void register_intr_pda(struct sn_irq_info *sn_irq_info);
|
|
|
|
static void unregister_intr_pda(struct sn_irq_info *sn_irq_info);
|
|
|
|
|
2005-08-25 12:41:22 -04:00
|
|
|
int sn_force_interrupt_flag = 1;
|
2005-04-16 18:20:36 -04:00
|
|
|
extern int sn_ioif_inited;
|
2005-07-06 17:59:44 -04:00
|
|
|
static struct list_head **sn_irq_lh;
|
|
|
|
static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-01-16 22:54:40 -05:00
|
|
|
static inline u64 sn_intr_alloc(nasid_t local_nasid, int local_widget,
|
2005-04-16 18:20:36 -04:00
|
|
|
u64 sn_irq_info,
|
|
|
|
int req_irq, nasid_t req_nasid,
|
|
|
|
int req_slice)
|
|
|
|
{
|
|
|
|
struct ia64_sal_retval ret_stuff;
|
|
|
|
ret_stuff.status = 0;
|
|
|
|
ret_stuff.v0 = 0;
|
|
|
|
|
|
|
|
SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT,
|
|
|
|
(u64) SAL_INTR_ALLOC, (u64) local_nasid,
|
|
|
|
(u64) local_widget, (u64) sn_irq_info, (u64) req_irq,
|
|
|
|
(u64) req_nasid, (u64) req_slice);
|
|
|
|
return ret_stuff.status;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sn_intr_free(nasid_t local_nasid, int local_widget,
|
|
|
|
struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
|
|
|
struct ia64_sal_retval ret_stuff;
|
|
|
|
ret_stuff.status = 0;
|
|
|
|
ret_stuff.v0 = 0;
|
|
|
|
|
|
|
|
SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT,
|
|
|
|
(u64) SAL_INTR_FREE, (u64) local_nasid,
|
|
|
|
(u64) local_widget, (u64) sn_irq_info->irq_irq,
|
|
|
|
(u64) sn_irq_info->irq_cookie, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned int sn_startup_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sn_shutdown_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sn_disable_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sn_enable_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sn_ack_irq(unsigned int irq)
|
|
|
|
{
|
2006-02-02 05:15:51 -05:00
|
|
|
u64 event_occurred, mask;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
irq = irq & 0xff;
|
2006-02-02 05:15:51 -05:00
|
|
|
event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED));
|
2005-04-25 16:06:28 -04:00
|
|
|
mask = event_occurred & SH_ALL_INT_MASK;
|
2006-02-02 05:15:51 -05:00
|
|
|
HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS), mask);
|
2005-04-16 18:20:36 -04:00
|
|
|
__set_bit(irq, (volatile void *)pda->sn_in_service_ivecs);
|
|
|
|
|
2006-01-27 12:55:34 -05:00
|
|
|
move_native_irq(irq);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sn_end_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
int ivec;
|
2005-08-11 13:26:00 -04:00
|
|
|
u64 event_occurred;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
ivec = irq & 0xff;
|
|
|
|
if (ivec == SGI_UART_VECTOR) {
|
2005-08-11 13:26:00 -04:00
|
|
|
event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR (SH_EVENT_OCCURRED));
|
2005-07-06 17:59:44 -04:00
|
|
|
/* If the UART bit is set here, we may have received an
|
2005-04-16 18:20:36 -04:00
|
|
|
* interrupt from the UART that the driver missed. To
|
|
|
|
* make sure, we IPI ourselves to force us to look again.
|
|
|
|
*/
|
|
|
|
if (event_occurred & SH_EVENT_OCCURRED_UART_INT_MASK) {
|
|
|
|
platform_send_ipi(smp_processor_id(), SGI_UART_VECTOR,
|
|
|
|
IA64_IPI_DM_INT, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__clear_bit(ivec, (volatile void *)pda->sn_in_service_ivecs);
|
|
|
|
if (sn_force_interrupt_flag)
|
|
|
|
force_interrupt(irq);
|
|
|
|
}
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
static void sn_irq_info_free(struct rcu_head *head);
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
|
|
|
|
{
|
2005-07-06 17:59:44 -04:00
|
|
|
struct sn_irq_info *sn_irq_info, *sn_irq_info_safe;
|
2005-04-16 18:20:36 -04:00
|
|
|
int cpuid, cpuphys;
|
|
|
|
|
|
|
|
cpuid = first_cpu(mask);
|
|
|
|
cpuphys = cpu_physical_id(cpuid);
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe,
|
|
|
|
sn_irq_lh[irq], list) {
|
2006-01-16 22:54:40 -05:00
|
|
|
u64 bridge;
|
2005-07-06 17:59:44 -04:00
|
|
|
int local_widget, status;
|
|
|
|
nasid_t local_nasid;
|
|
|
|
struct sn_irq_info *new_irq_info;
|
2005-08-25 14:45:00 -04:00
|
|
|
struct sn_pcibus_provider *pci_provider;
|
2005-07-06 17:59:44 -04:00
|
|
|
|
|
|
|
new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
|
|
|
|
if (new_irq_info == NULL)
|
|
|
|
break;
|
|
|
|
memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
|
|
|
|
|
2006-01-16 22:54:40 -05:00
|
|
|
bridge = (u64) new_irq_info->irq_bridge;
|
2005-07-06 17:59:44 -04:00
|
|
|
if (!bridge) {
|
|
|
|
kfree(new_irq_info);
|
|
|
|
break; /* irq is not a device interrupt */
|
|
|
|
}
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
local_nasid = NASID_GET(bridge);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
if (local_nasid & 1)
|
|
|
|
local_widget = TIO_SWIN_WIDGETNUM(bridge);
|
|
|
|
else
|
|
|
|
local_widget = SWIN_WIDGETNUM(bridge);
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
/* Free the old PROM new_irq_info structure */
|
|
|
|
sn_intr_free(local_nasid, local_widget, new_irq_info);
|
|
|
|
/* Update kernels new_irq_info with new target info */
|
|
|
|
unregister_intr_pda(new_irq_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
/* allocate a new PROM new_irq_info struct */
|
2005-04-16 18:20:36 -04:00
|
|
|
status = sn_intr_alloc(local_nasid, local_widget,
|
2005-07-06 17:59:44 -04:00
|
|
|
__pa(new_irq_info), irq,
|
|
|
|
cpuid_to_nasid(cpuid),
|
|
|
|
cpuid_to_slice(cpuid));
|
|
|
|
|
|
|
|
/* SAL call failed */
|
|
|
|
if (status) {
|
|
|
|
kfree(new_irq_info);
|
|
|
|
break;
|
|
|
|
}
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
new_irq_info->irq_cpuid = cpuid;
|
|
|
|
register_intr_pda(new_irq_info);
|
|
|
|
|
2005-08-25 14:45:00 -04:00
|
|
|
pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type];
|
|
|
|
if (pci_provider && pci_provider->target_interrupt)
|
|
|
|
(pci_provider->target_interrupt)(new_irq_info);
|
2005-07-06 17:59:44 -04:00
|
|
|
|
|
|
|
spin_lock(&sn_irq_info_lock);
|
|
|
|
list_replace_rcu(&sn_irq_info->list, &new_irq_info->list);
|
|
|
|
spin_unlock(&sn_irq_info_lock);
|
|
|
|
call_rcu(&sn_irq_info->rcu, sn_irq_info_free);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
2005-07-06 17:59:44 -04:00
|
|
|
set_irq_affinity_info((irq & 0xff), cpuphys, 0);
|
2005-04-16 18:20:36 -04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct hw_interrupt_type irq_type_sn = {
|
2005-07-06 17:59:44 -04:00
|
|
|
.typename = "SN hub",
|
|
|
|
.startup = sn_startup_irq,
|
|
|
|
.shutdown = sn_shutdown_irq,
|
|
|
|
.enable = sn_enable_irq,
|
|
|
|
.disable = sn_disable_irq,
|
|
|
|
.ack = sn_ack_irq,
|
|
|
|
.end = sn_end_irq,
|
|
|
|
.set_affinity = sn_set_affinity_irq
|
2005-04-16 18:20:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int sn_local_vector_to_irq(u8 vector)
|
|
|
|
{
|
|
|
|
return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector));
|
|
|
|
}
|
|
|
|
|
|
|
|
void sn_irq_init(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
irq_desc_t *base_desc = irq_desc;
|
|
|
|
|
|
|
|
for (i = 0; i < NR_IRQS; i++) {
|
|
|
|
if (base_desc[i].handler == &no_irq_type) {
|
|
|
|
base_desc[i].handler = &irq_type_sn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void register_intr_pda(struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
|
|
|
int irq = sn_irq_info->irq_irq;
|
|
|
|
int cpu = sn_irq_info->irq_cpuid;
|
|
|
|
|
|
|
|
if (pdacpu(cpu)->sn_last_irq < irq) {
|
|
|
|
pdacpu(cpu)->sn_last_irq = irq;
|
|
|
|
}
|
|
|
|
|
2006-02-02 05:15:51 -05:00
|
|
|
if (pdacpu(cpu)->sn_first_irq == 0 || pdacpu(cpu)->sn_first_irq > irq)
|
2005-04-16 18:20:36 -04:00
|
|
|
pdacpu(cpu)->sn_first_irq = irq;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void unregister_intr_pda(struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
|
|
|
int irq = sn_irq_info->irq_irq;
|
|
|
|
int cpu = sn_irq_info->irq_cpuid;
|
|
|
|
struct sn_irq_info *tmp_irq_info;
|
|
|
|
int i, foundmatch;
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
rcu_read_lock();
|
2005-04-16 18:20:36 -04:00
|
|
|
if (pdacpu(cpu)->sn_last_irq == irq) {
|
|
|
|
foundmatch = 0;
|
2005-07-06 17:59:44 -04:00
|
|
|
for (i = pdacpu(cpu)->sn_last_irq - 1;
|
|
|
|
i && !foundmatch; i--) {
|
|
|
|
list_for_each_entry_rcu(tmp_irq_info,
|
|
|
|
sn_irq_lh[i],
|
|
|
|
list) {
|
2005-04-16 18:20:36 -04:00
|
|
|
if (tmp_irq_info->irq_cpuid == cpu) {
|
2005-07-06 17:59:44 -04:00
|
|
|
foundmatch = 1;
|
2005-04-16 18:20:36 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pdacpu(cpu)->sn_last_irq = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pdacpu(cpu)->sn_first_irq == irq) {
|
|
|
|
foundmatch = 0;
|
2005-07-06 17:59:44 -04:00
|
|
|
for (i = pdacpu(cpu)->sn_first_irq + 1;
|
|
|
|
i < NR_IRQS && !foundmatch; i++) {
|
|
|
|
list_for_each_entry_rcu(tmp_irq_info,
|
|
|
|
sn_irq_lh[i],
|
|
|
|
list) {
|
2005-04-16 18:20:36 -04:00
|
|
|
if (tmp_irq_info->irq_cpuid == cpu) {
|
2005-07-06 17:59:44 -04:00
|
|
|
foundmatch = 1;
|
2005-04-16 18:20:36 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pdacpu(cpu)->sn_first_irq = ((i == NR_IRQS) ? 0 : i);
|
|
|
|
}
|
2005-07-06 17:59:44 -04:00
|
|
|
rcu_read_unlock();
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
static void sn_irq_info_free(struct rcu_head *head)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
|
|
|
struct sn_irq_info *sn_irq_info;
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
sn_irq_info = container_of(head, struct sn_irq_info, rcu);
|
2005-04-16 18:20:36 -04:00
|
|
|
kfree(sn_irq_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
|
|
|
nasid_t nasid = sn_irq_info->irq_nasid;
|
|
|
|
int slice = sn_irq_info->irq_slice;
|
|
|
|
int cpu = nasid_slice_to_cpuid(nasid, slice);
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
pci_dev_get(pci_dev);
|
2005-04-16 18:20:36 -04:00
|
|
|
sn_irq_info->irq_cpuid = cpu;
|
|
|
|
sn_irq_info->irq_pciioinfo = SN_PCIDEV_INFO(pci_dev);
|
|
|
|
|
|
|
|
/* link it into the sn_irq[irq] list */
|
2005-07-06 17:59:44 -04:00
|
|
|
spin_lock(&sn_irq_info_lock);
|
|
|
|
list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]);
|
|
|
|
spin_unlock(&sn_irq_info_lock);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-02-02 05:15:51 -05:00
|
|
|
register_intr_pda(sn_irq_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
void sn_irq_unfixup(struct pci_dev *pci_dev)
|
|
|
|
{
|
|
|
|
struct sn_irq_info *sn_irq_info;
|
|
|
|
|
|
|
|
/* Only cleanup IRQ stuff if this device has a host bus context */
|
|
|
|
if (!SN_PCIDEV_BUSSOFT(pci_dev))
|
|
|
|
return;
|
|
|
|
|
|
|
|
sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info;
|
2006-02-09 17:12:24 -05:00
|
|
|
if (!sn_irq_info)
|
|
|
|
return;
|
|
|
|
if (!sn_irq_info->irq_irq) {
|
2005-07-06 18:29:53 -04:00
|
|
|
kfree(sn_irq_info);
|
2005-07-06 17:59:44 -04:00
|
|
|
return;
|
2005-07-06 18:29:53 -04:00
|
|
|
}
|
2005-07-06 17:59:44 -04:00
|
|
|
|
|
|
|
unregister_intr_pda(sn_irq_info);
|
|
|
|
spin_lock(&sn_irq_info_lock);
|
|
|
|
list_del_rcu(&sn_irq_info->list);
|
|
|
|
spin_unlock(&sn_irq_info_lock);
|
|
|
|
call_rcu(&sn_irq_info->rcu, sn_irq_info_free);
|
|
|
|
pci_dev_put(pci_dev);
|
|
|
|
}
|
|
|
|
|
2005-08-03 17:06:00 -04:00
|
|
|
static inline void
|
|
|
|
sn_call_force_intr_provider(struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
|
|
|
struct sn_pcibus_provider *pci_provider;
|
|
|
|
|
|
|
|
pci_provider = sn_pci_provider[sn_irq_info->irq_bridge_type];
|
|
|
|
if (pci_provider && pci_provider->force_interrupt)
|
|
|
|
(*pci_provider->force_interrupt)(sn_irq_info);
|
|
|
|
}
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
static void force_interrupt(int irq)
|
|
|
|
{
|
|
|
|
struct sn_irq_info *sn_irq_info;
|
|
|
|
|
|
|
|
if (!sn_ioif_inited)
|
|
|
|
return;
|
2005-07-06 17:59:44 -04:00
|
|
|
|
|
|
|
rcu_read_lock();
|
2005-08-03 17:06:00 -04:00
|
|
|
list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list)
|
|
|
|
sn_call_force_intr_provider(sn_irq_info);
|
|
|
|
|
2005-07-06 17:59:44 -04:00
|
|
|
rcu_read_unlock();
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check for lost interrupts. If the PIC int_status reg. says that
|
|
|
|
* an interrupt has been sent, but not handled, and the interrupt
|
|
|
|
* is not pending in either the cpu irr regs or in the soft irr regs,
|
|
|
|
* and the interrupt is not in service, then the interrupt may have
|
|
|
|
* been lost. Force an interrupt on that pin. It is possible that
|
|
|
|
* the interrupt is in flight, so we may generate a spurious interrupt,
|
|
|
|
* but we should never miss a real lost interrupt.
|
|
|
|
*/
|
|
|
|
static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
|
|
|
|
{
|
2006-01-16 22:54:40 -05:00
|
|
|
u64 regval;
|
2005-04-16 18:20:36 -04:00
|
|
|
struct pcidev_info *pcidev_info;
|
|
|
|
struct pcibus_info *pcibus_info;
|
|
|
|
|
2005-08-03 17:06:00 -04:00
|
|
|
/*
|
|
|
|
* Bridge types attached to TIO (anything but PIC) do not need this WAR
|
|
|
|
* since they do not target Shub II interrupt registers. If that
|
|
|
|
* ever changes, this check needs to accomodate.
|
|
|
|
*/
|
|
|
|
if (sn_irq_info->irq_bridge_type != PCIIO_ASIC_TYPE_PIC)
|
|
|
|
return;
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
|
|
|
|
if (!pcidev_info)
|
|
|
|
return;
|
|
|
|
|
|
|
|
pcibus_info =
|
|
|
|
(struct pcibus_info *)pcidev_info->pdi_host_pcidev_info->
|
|
|
|
pdi_pcibus_info;
|
|
|
|
regval = pcireg_intr_status_get(pcibus_info);
|
|
|
|
|
2006-03-21 12:44:07 -05:00
|
|
|
if (!ia64_get_irr(irq_to_vector(irq))) {
|
2005-08-03 17:06:00 -04:00
|
|
|
if (!test_bit(irq, pda->sn_in_service_ivecs)) {
|
|
|
|
regval &= 0xff;
|
|
|
|
if (sn_irq_info->irq_int_bit & regval &
|
|
|
|
sn_irq_info->irq_last_intr) {
|
|
|
|
regval &= ~(sn_irq_info->irq_int_bit & regval);
|
|
|
|
sn_call_force_intr_provider(sn_irq_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sn_irq_info->irq_last_intr = regval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sn_lb_int_war_check(void)
|
|
|
|
{
|
2005-07-06 17:59:44 -04:00
|
|
|
struct sn_irq_info *sn_irq_info;
|
2005-04-16 18:20:36 -04:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!sn_ioif_inited || pda->sn_first_irq == 0)
|
|
|
|
return;
|
2005-07-06 17:59:44 -04:00
|
|
|
|
|
|
|
rcu_read_lock();
|
2005-04-16 18:20:36 -04:00
|
|
|
for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) {
|
2005-07-06 17:59:44 -04:00
|
|
|
list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[i], list) {
|
2005-08-03 17:06:00 -04:00
|
|
|
sn_check_intr(i, sn_irq_info);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
}
|
2005-07-06 17:59:44 -04:00
|
|
|
rcu_read_unlock();
|
|
|
|
}
|
|
|
|
|
2006-02-02 05:15:51 -05:00
|
|
|
void __init sn_irq_lh_init(void)
|
2005-07-06 17:59:44 -04:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
sn_irq_lh = kmalloc(sizeof(struct list_head *) * NR_IRQS, GFP_KERNEL);
|
|
|
|
if (!sn_irq_lh)
|
|
|
|
panic("SN PCI INIT: Failed to allocate memory for PCI init\n");
|
|
|
|
|
|
|
|
for (i = 0; i < NR_IRQS; i++) {
|
|
|
|
sn_irq_lh[i] = kmalloc(sizeof(struct list_head), GFP_KERNEL);
|
|
|
|
if (!sn_irq_lh[i])
|
|
|
|
panic("SN PCI INIT: Failed IRQ memory allocation\n");
|
|
|
|
|
|
|
|
INIT_LIST_HEAD(sn_irq_lh[i]);
|
|
|
|
}
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|