aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/hp/sim/simeth.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2005-07-11 00:49:00 -0400
committerTony Luck <tony.luck@intel.com>2005-07-11 13:30:07 -0400
commit3b5cc09033f49d004006acf44e5b05036bd46a85 (patch)
treedcae13f5768234fe59736e877885ee6d8b4fc0fc /arch/ia64/hp/sim/simeth.c
parent699139279d29e36e39d353b0536b510dab2e5ffa (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/simeth.c')
-rw-r--r--arch/ia64/hp/sim/simeth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index ae84a1018a89..0639ec0ed015 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -191,7 +191,7 @@ simeth_probe1(void)
191 unsigned char mac_addr[ETH_ALEN]; 191 unsigned char mac_addr[ETH_ALEN];
192 struct simeth_local *local; 192 struct simeth_local *local;
193 struct net_device *dev; 193 struct net_device *dev;
194 int fd, i, err; 194 int fd, i, err, rc;
195 195
196 /* 196 /*
197 * XXX Fix me 197 * XXX Fix me
@@ -228,7 +228,9 @@ simeth_probe1(void)
228 return err; 228 return err;
229 } 229 }
230 230
231 dev->irq = assign_irq_vector(AUTO_ASSIGN); 231 if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
232 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
233 dev->irq = rc;
232 234
233 /* 235 /*
234 * attach the interrupt in the simulator, this does enable interrupts 236 * attach the interrupt in the simulator, this does enable interrupts