netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] NET: phy_device, fix lock imbalance
@ 2009-07-13 21:23 Jiri Slaby
  2009-07-13 21:23 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave Jiri Slaby
  2009-07-14 19:27 ` [PATCH 1/2] NET: phy_device, fix lock imbalance David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-07-13 21:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Jiri Slaby

Don't forget to unlock a mutex in phy_scan_fixups on a fail path.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/net/phy/phy_device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index eba937c..b10fedd 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev)
 
 			err = fixup->run(phydev);
 
-			if (err < 0)
+			if (err < 0) {
+				mutex_unlock(&phy_fixup_lock);
 				return err;
+			}
 		}
 	}
 	mutex_unlock(&phy_fixup_lock);
-- 
1.6.3.2


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

* [PATCH 2/2] NET: sungem, use spin_trylock_irqsave
  2009-07-13 21:23 [PATCH 1/2] NET: phy_device, fix lock imbalance Jiri Slaby
@ 2009-07-13 21:23 ` Jiri Slaby
  2009-07-14  2:12   ` David Miller
  2009-07-14 21:10   ` David Miller
  2009-07-14 19:27 ` [PATCH 1/2] NET: phy_device, fix lock imbalance David Miller
  1 sibling, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-07-13 21:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Jiri Slaby

Use spin_trylock_irqsave instead of open-coded
local_irq_save+spin_trylock.

Impact: cleanup

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/net/sungem.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index d2dfe0a..22474a8 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1032,10 +1032,8 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
 			(csum_stuff_off << 21));
 	}
 
-	local_irq_save(flags);
-	if (!spin_trylock(&gp->tx_lock)) {
+	if (!spin_trylock_irqsave(&gp->tx_lock)) {
 		/* Tell upper layer to requeue */
-		local_irq_restore(flags);
 		return NETDEV_TX_LOCKED;
 	}
 	/* We raced with gem_do_stop() */
-- 
1.6.3.2

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

* Re: [PATCH 2/2] NET: sungem, use spin_trylock_irqsave
  2009-07-13 21:23 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave Jiri Slaby
@ 2009-07-14  2:12   ` David Miller
  2009-07-14 21:10   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2009-07-14  2:12 UTC (permalink / raw)
  To: jirislaby; +Cc: netdev, linux-kernel


Please DO NOT combine cleanups with real bug fixes into
a patch series.

Bug fixes go to one tree, the rest go to another tree, and that is
especially the case this late in the RC series.

A series of patches are a group of changes that are supposed to be
related and are expected to be applied all to the same tree.  That is
not true of the patches you have posted here.

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

* Re: [PATCH 1/2] NET: phy_device, fix lock imbalance
  2009-07-13 21:23 [PATCH 1/2] NET: phy_device, fix lock imbalance Jiri Slaby
  2009-07-13 21:23 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave Jiri Slaby
@ 2009-07-14 19:27 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2009-07-14 19:27 UTC (permalink / raw)
  To: jirislaby; +Cc: netdev, linux-kernel

From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 13 Jul 2009 23:23:39 +0200

> Don't forget to unlock a mutex in phy_scan_fixups on a fail path.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

Applied.

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

* Re: [PATCH 2/2] NET: sungem, use spin_trylock_irqsave
  2009-07-13 21:23 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave Jiri Slaby
  2009-07-14  2:12   ` David Miller
@ 2009-07-14 21:10   ` David Miller
  2009-07-14 21:18     ` Jiri Slaby
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2009-07-14 21:10 UTC (permalink / raw)
  To: jirislaby; +Cc: netdev, linux-kernel

From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 13 Jul 2009 23:23:40 +0200

> -	if (!spin_trylock(&gp->tx_lock)) {
> +	if (!spin_trylock_irqsave(&gp->tx_lock)) {

I'm about to give you a royal flaming.

Any idea why?

(hint: type 'make' before you send patches!!!!)


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

* Re: [PATCH 2/2] NET: sungem, use spin_trylock_irqsave
  2009-07-14 21:10   ` David Miller
@ 2009-07-14 21:18     ` Jiri Slaby
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-07-14 21:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel

On 07/14/2009 11:10 PM, David Miller wrote:
>> -	if (!spin_trylock(&gp->tx_lock)) {
>> +	if (!spin_trylock_irqsave(&gp->tx_lock)) {
> 
> (hint: type 'make' before you send patches!!!!)

Grr, I did but my bash_history shows that I built wrong subtree. My
apologies.

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

end of thread, other threads:[~2009-07-14 21:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 21:23 [PATCH 1/2] NET: phy_device, fix lock imbalance Jiri Slaby
2009-07-13 21:23 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave Jiri Slaby
2009-07-14  2:12   ` David Miller
2009-07-14 21:10   ` David Miller
2009-07-14 21:18     ` Jiri Slaby
2009-07-14 19:27 ` [PATCH 1/2] NET: phy_device, fix lock imbalance 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).