[IA64] assign_irq_vector() should not panic

Current assign_irq_vector() will panic if interrupt vectors is running
out. But I think how to handle the case of lack of interrupt vectors
should be handled by the caller of this function. For example, some
PCI devices can raise the interrupt signal via both MSI and I/O
APIC. So even if the driver for these device fails to allocate a
vector for MSI, the driver still has a chance to use I/O APIC based
interrupt. But currently there is no chance for these driver to use
I/O APIC based interrupt because kernel will panic when
assign_irq_vector() fails to allocate interrupt vector.

The following patch changes assign_irq_vector() for ia64 to return
-ENOSPC on error instead of panic (as i386 and x86_64 versions do).

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Kenji Kaneshige
2005-07-10 21:49:00 -07:00
committed by Tony Luck
parent 699139279d
commit 3b5cc09033
5 changed files with 20 additions and 22 deletions

View File

@ -191,7 +191,7 @@ simeth_probe1(void)
unsigned char mac_addr[ETH_ALEN];
struct simeth_local *local;
struct net_device *dev;
int fd, i, err;
int fd, i, err, rc;
/*
* XXX Fix me
@ -228,7 +228,9 @@ simeth_probe1(void)
return err;
}
dev->irq = assign_irq_vector(AUTO_ASSIGN);
if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);
dev->irq = rc;
/*
* attach the interrupt in the simulator, this does enable interrupts

View File

@ -982,7 +982,7 @@ static struct tty_operations hp_ops = {
static int __init
simrs_init (void)
{
int i;
int i, rc;
struct serial_state *state;
if (!ia64_platform_is("hpsim"))
@ -1017,7 +1017,10 @@ simrs_init (void)
if (state->type == PORT_UNKNOWN) continue;
if (!state->irq) {
state->irq = assign_irq_vector(AUTO_ASSIGN);
if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n",
__FUNCTION__);
state->irq = rc;
ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
}