public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gianfar: Revive VLAN support
@ 2009-01-26 20:50 Anton Vorontsov
  2009-01-26 21:07 ` Andy Fleming
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Vorontsov @ 2009-01-26 20:50 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: David Miller, Andy Fleming, Dai Haruki, netdev, linuxppc-dev

commit 77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba ("gianfar: Fix VLAN
HW feature related frame/buffer size calculation") wrongly removed
priv->vlgrp assignment, and now priv->vlgrp is always NULL.

This patch fixes the issue, plus fixes following sparse warning
introduced by the same commit:
gianfar.c:1406:13: warning: context imbalance in 'gfar_vlan_rx_register' - wrong count at exit

gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries
to return w/o dropping the lock.

According to net/8021q/vlan.c VLAN core issues rx_register() callback:
1. In register_vlan_dev() only on a newly created group;
2. In unregister_vlan_dev() only if the group becomes empty.

Thus the check in the gianfar driver isn't needed.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/net/gianfar.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 228b88f..6d406f9 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1408,15 +1408,11 @@ static void gfar_vlan_rx_register(struct net_device *dev,
 {
 	struct gfar_private *priv = netdev_priv(dev);
 	unsigned long flags;
-	struct vlan_group *old_grp;
 	u32 tempval;
 
 	spin_lock_irqsave(&priv->rxlock, flags);
 
-	old_grp = priv->vlgrp;
-
-	if (old_grp == grp)
-		return;
+	priv->vlgrp = grp;
 
 	if (grp) {
 		/* Enable VLAN tag insertion */
-- 
1.5.6.5

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

* Re: [PATCH] gianfar: Revive VLAN support
  2009-01-26 20:50 [PATCH] gianfar: Revive VLAN support Anton Vorontsov
@ 2009-01-26 21:07 ` Andy Fleming
  2009-01-26 22:33   ` David Miller
  2009-01-26 23:39   ` Haruki Dai
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Fleming @ 2009-01-26 21:07 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Jeff Garzik, David Miller, Dai Haruki, netdev, linuxppc-dev


On Jan 26, 2009, at 2:50 PM, Anton Vorontsov wrote:

> commit 77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba ("gianfar: Fix VLAN
> HW feature related frame/buffer size calculation") wrongly removed
> priv->vlgrp assignment, and now priv->vlgrp is always NULL.
>
> This patch fixes the issue, plus fixes following sparse warning
> introduced by the same commit:
> gianfar.c:1406:13: warning: context imbalance in  
> 'gfar_vlan_rx_register' - wrong count at exit
>
> gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries
> to return w/o dropping the lock.
>
> According to net/8021q/vlan.c VLAN core issues rx_register() callback:
> 1. In register_vlan_dev() only on a newly created group;
> 2. In unregister_vlan_dev() only if the group becomes empty.
>
> Thus the check in the gianfar driver isn't needed.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: Andy Fleming <afleming@freescale.com>

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

* Re: [PATCH] gianfar: Revive VLAN support
  2009-01-26 21:07 ` Andy Fleming
@ 2009-01-26 22:33   ` David Miller
  2009-01-26 23:39   ` Haruki Dai
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-01-26 22:33 UTC (permalink / raw)
  To: afleming; +Cc: avorontsov, jgarzik, dai.haruki, netdev, linuxppc-dev

From: Andy Fleming <afleming@freescale.com>
Date: Mon, 26 Jan 2009 15:07:37 -0600

> 
> On Jan 26, 2009, at 2:50 PM, Anton Vorontsov wrote:
> 
> > commit 77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba ("gianfar: Fix VLAN
> > HW feature related frame/buffer size calculation") wrongly removed
> > priv->vlgrp assignment, and now priv->vlgrp is always NULL.
 ...
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> 
> Acked-by: Andy Fleming <afleming@freescale.com>

Applied, thanks guys.

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

* RE: [PATCH] gianfar: Revive VLAN support
  2009-01-26 21:07 ` Andy Fleming
  2009-01-26 22:33   ` David Miller
@ 2009-01-26 23:39   ` Haruki Dai
  1 sibling, 0 replies; 4+ messages in thread
From: Haruki Dai @ 2009-01-26 23:39 UTC (permalink / raw)
  To: Fleming Andy-AFLEMING, Anton Vorontsov
  Cc: Jeff Garzik, David Miller, netdev, linuxppc-dev

> -----Original Message-----
> From: Fleming Andy-AFLEMING
> Sent: Monday, January 26, 2009 3:08 PM
> To: Anton Vorontsov
> Cc: Jeff Garzik; David Miller; Haruki Dai-R35557;
netdev@vger.kernel.org;
> linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] gianfar: Revive VLAN support
> 
> 
> On Jan 26, 2009, at 2:50 PM, Anton Vorontsov wrote:
> 
> > commit 77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba ("gianfar: Fix VLAN
> > HW feature related frame/buffer size calculation") wrongly removed
> > priv->vlgrp assignment, and now priv->vlgrp is always NULL.
> >
> > This patch fixes the issue, plus fixes following sparse warning
> > introduced by the same commit:
> > gianfar.c:1406:13: warning: context imbalance in
> > 'gfar_vlan_rx_register' - wrong count at exit
> >
> > gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries
> > to return w/o dropping the lock.
> >
> > According to net/8021q/vlan.c VLAN core issues rx_register()
callback:
> > 1. In register_vlan_dev() only on a newly created group;
> > 2. In unregister_vlan_dev() only if the group becomes empty.
> >
> > Thus the check in the gianfar driver isn't needed.
> >
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> 
> Acked-by: Andy Fleming <afleming@freescale.com>

Acked-by: Dai Haruki <dai.haruki@freescale.com>


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

end of thread, other threads:[~2009-01-26 23:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 20:50 [PATCH] gianfar: Revive VLAN support Anton Vorontsov
2009-01-26 21:07 ` Andy Fleming
2009-01-26 22:33   ` David Miller
2009-01-26 23:39   ` Haruki Dai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox