diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2005-07-11 00:49:00 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-07-11 13:30:07 -0400 |
commit | 3b5cc09033f49d004006acf44e5b05036bd46a85 (patch) | |
tree | dcae13f5768234fe59736e877885ee6d8b4fc0fc /arch/ia64/hp/sim/simserial.c | |
parent | 699139279d29e36e39d353b0536b510dab2e5ffa (diff) |
[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>
Diffstat (limited to 'arch/ia64/hp/sim/simserial.c')
-rw-r--r-- | arch/ia64/hp/sim/simserial.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 7a8ae0f4b387..7dcb8582ae0d 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c | |||
@@ -982,7 +982,7 @@ static struct tty_operations hp_ops = { | |||
982 | static int __init | 982 | static int __init |
983 | simrs_init (void) | 983 | simrs_init (void) |
984 | { | 984 | { |
985 | int i; | 985 | int i, rc; |
986 | struct serial_state *state; | 986 | struct serial_state *state; |
987 | 987 | ||
988 | if (!ia64_platform_is("hpsim")) | 988 | if (!ia64_platform_is("hpsim")) |
@@ -1017,7 +1017,10 @@ simrs_init (void) | |||
1017 | if (state->type == PORT_UNKNOWN) continue; | 1017 | if (state->type == PORT_UNKNOWN) continue; |
1018 | 1018 | ||
1019 | if (!state->irq) { | 1019 | if (!state->irq) { |
1020 | state->irq = assign_irq_vector(AUTO_ASSIGN); | 1020 | if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0) |
1021 | panic("%s: out of interrupt vectors!\n", | ||
1022 | __FUNCTION__); | ||
1023 | state->irq = rc; | ||
1021 | ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq); | 1024 | ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq); |
1022 | } | 1025 | } |
1023 | 1026 | ||