Skip to contentSkip to conversation

bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int

PATCH New Benjamin Li 1 participant 1 message Sep 17, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int

Quoted 1 line

From c455b36005a9b1b6a2b0036b7947d3f4bebb9f2d Mon Sep 17 00:00:00 2001

From: Benjamin Li <[email protected]>
Date: Tue, 16 Sep 2008 17:20:11 -0700
Subject: [PATCH] bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int

The bnx2 driver stores/uses the irq value from the pci_dev internally. But when it stores the irq value, it has been performing an integer demotion. Because of the recent changes made to arch/x86/kernel/io_apic.c, the new method in creating the irq value (using build_irq_for_pci_dev()) has exposed this bug on x86 systems.

Because of this demotion when calling request_irq() from bnx2_request_irq(), the driver would get a return code of -EINVAL. This is because the kernel could not find the requested irq descriptor. By storing the irq value properly, the kernel can find the correct irq descriptor and the bnx2 driver can operate normally.

---
 drivers/net/bnx2.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bnx2.h +1 -1
index c3c579f..dfacd31 100644
@@ -6597,7 +6597,7 @@ struct flash_spec {
 
 struct bnx2_irq {
 	irq_handler_t	handler;
-	u16		vector;
+	unsigned int	vector;
 	u8		requested;
 	char		name[16];
 };
Signature · 1 line
1.5.5.1