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

login
register
mail settings
Submitter Lino Sanfilippo
Date March 30, 2012, 5:36 p.m.
Message ID <20120330173616.GC2703@Neptun>
Download mbox | patch
Permalink /patch/149703/
State Accepted
Delegated to: David Miller
Headers show

Comments

Lino Sanfilippo - March 30, 2012, 5:36 p.m.
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(-)
David Miller - April 1, 2012, 8:11 p.m.
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Date: Fri, 30 Mar 2012 19:36:16 +0200

> 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>

Stephen, ping?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - April 3, 2012, 6:55 p.m.
On Fri, 30 Mar 2012 19:36:16 +0200
Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:

> 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>

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.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lino Sanfilippo - April 3, 2012, 8:09 p.m.
On Tue, Apr 03, 2012 at 11:55:47AM -0700, Stephen Hemminger wrote:
> 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. 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 3, 2012, 8:30 p.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 3 Apr 2012 11:55:47 -0700

> On Fri, 30 Mar 2012 19:36:16 +0200
> Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
> 
>> 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>
> 
> 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?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - April 3, 2012, 8:59 p.m.
On Tue, 03 Apr 2012 16:30:08 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Tue, 3 Apr 2012 11:55:47 -0700
> 
> > On Fri, 30 Mar 2012 19:36:16 +0200
> > Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
> > 
> >> 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>
> > 
> > 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 3, 2012, 9:08 p.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 3 Apr 2012 13:59:54 -0700

> On Tue, 03 Apr 2012 16:30:08 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Tue, 3 Apr 2012 11:55:47 -0700
>> 
>> > On Fri, 30 Mar 2012 19:36:16 +0200
>> > Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
>> > 
>> >> 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>
>> > 
>> > 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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);