Skip to content

Commit

Permalink
gianfar: Revive VLAN support
Browse files Browse the repository at this point in the history
commit 77ecaf2 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Anton Vorontsov authored and David S. Miller committed Jan 26, 2009
1 parent 116cb42 commit cd1f55a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,15 +1423,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 */
Expand Down

0 comments on commit cd1f55a

Please sign in to comment.