Skip to contentSkip to conversation

sky2: fix missing register reset on error path in sky2_test_msi()

PATCH In review Lino Sanfilippo 3 participants 7 messages Mar 30, 2012 – Apr 3, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sky2: fix missing register reset on error path in sky2_test_msi()

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

---
This applies against 3.3

 drivers/net/ethernet/marvell/sky2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/sky2.c +2 -2
index 760c2b1..0e23ce4 100644
@@ -4795,14 +4795,14 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
 
 	init_waitqueue_head(&hw->msi_wait);
 
-	sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
-
 	err = request_irq(pdev->irq, sky2_test_intr, 0, DRV_NAME, hw);
 	if (err) {
 		dev_err(&pdev->dev, "cannot assign irq %d\n", pdev->irq);
 		return err;
 	}
 
+	sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
+
 	sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ);
 	sky2_read8(hw, B0_CTST);
 
Signature · 1 line
1.5.6.5
maintainer
#1 lore raw

From: Lino Sanfilippo <[email protected]>
Date: Fri, 30 Mar 2012 19:36:16 +0200

Quoted 5 lines

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

Stephen, ping?

#2 lore raw
In reply to Lino Sanfilippo
Quoted 5 lines · On Fri, 30 Mar 2012 19:36:16 +0200 Lino Sanfilippo <[email protected]>…

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

Ok, but this is a non-serious error case. If request_irq() fails here, the driver is going to fail to load and on the failure path of sky2_probe will reset the chip on the way out.

#3 lore raw
Quoted 4 lines · Stephen Hemminger

Ok, but this is a non-serious error case. If request_irq() fails here, the driver is going to fail to load and on the failure path of sky2_probe will reset the chip on the way out.

Youre right, this is more a cosmetic change than a fix for a real bug.

maintainer
#4 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Tue, 3 Apr 2012 11:55:47 -0700

Quoted 7 lines
Quoted 4 lines · On Fri, 30 Mar 2012 19:36:16 +0200 Lino Sanfilippo <[email protected]>…

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

Quoted 5 lines
Quoted 1 line

Ok, but this is a non-serious error case. If request_irq() fails here, the driver is going to fail to load and on the failure path of sky2_probe will reset the chip on the way out.

So, ACK for net-next? Toss it? What?

#5 lore raw
Quoted 10 lines · On Tue, 03 Apr 2012 16:30:08 -0400 (EDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Tue, 3 Apr 2012 11:55:47 -0700

Quoted 7 lines
Quoted 4 lines · On Fri, 30 Mar 2012 19:36:16 +0200 Lino Sanfilippo <[email protected]>…

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Ok, but this is a non-serious error case. If request_irq() fails here, the driver is going to fail to load and on the failure path of sky2_probe will reset the chip on the way out.

So, ACK for net-next? Toss it? What?

Put it in net-next, no need for net or stable.

maintainer
#6 lore raw

From: Stephen Hemminger <[email protected]>
Date: Tue, 3 Apr 2012 13:59:54 -0700

Quoted 15 lines
Quoted 12 lines · On Tue, 03 Apr 2012 16:30:08 -0400 (EDT) David Miller <[email protected]>…

From: Stephen Hemminger <[email protected]>
Date: Tue, 3 Apr 2012 11:55:47 -0700

Quoted 9 lines
Quoted 5 lines · On Fri, 30 Mar 2012 19:36:16 +0200 Lino Sanfilippo <[email protected]>…

In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case that request_irq() fails.
With this patch we only set the interrupt mask if request_irq() was successful.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Ok, but this is a non-serious error case. If request_irq() fails here, the driver is going to fail to load and on the failure path of sky2_probe will reset the chip on the way out.

So, ACK for net-next? Toss it? What?

Put it in net-next, no need for net or stable.

Done, thanks.