netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: fix missing register reset on error path in sky2_test_msi()
@ 2012-03-30 17:36 Lino Sanfilippo
  2012-04-01 20:11 ` David Miller
  2012-04-03 18:55 ` Stephen Hemminger
  0 siblings, 2 replies; 7+ messages in thread
From: Lino Sanfilippo @ 2012-03-30 17:36 UTC (permalink / raw)
  To: shemminger; +Cc: linux-kernel, netdev

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.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
---
 This applies against 3.3

 drivers/net/ethernet/marvell/sky2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 760c2b1..0e23ce4 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -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);
 
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-03 21:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 17:36 [PATCH] sky2: fix missing register reset on error path in sky2_test_msi() Lino Sanfilippo
2012-04-01 20:11 ` David Miller
2012-04-03 18:55 ` Stephen Hemminger
2012-04-03 20:09   ` Lino Sanfilippo
2012-04-03 20:30   ` David Miller
2012-04-03 20:59     ` Stephen Hemminger
2012-04-03 21:08       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).