gianfar: Revive VLAN support
Subsystems (2)
PATCH 1/1 gianfar: Revive VLAN support
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.
--- drivers/net/gianfar.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/net/gianfar.c +1 -5
@@ -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 */
Signature · 1 line
1.5.6.5
Quoted 11 lines · Anton Vorontsov
commit
77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba("gianfar: Fix VLAN HW feature related frame/buffer size calculation") wrongly removedpriv->vlgrpassignment, and nowpriv->vlgrpis 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.
Quoted 7 lines
According to
net/8021q/vlan.cVLAN core issuesrx_register()callback:
1. Inregister_vlan_dev()only on a newly created group;
2. Inunregister_vlan_dev()only if the group becomes empty.Thus the check in the gianfar driver isn't needed.
Signed-off-by Anton Vorontsov <[email protected]>
From: Andy Fleming <[email protected]>
Date: Mon, 26 Jan 2009 15:07:37 -0600
Quoted 6 lines · Anton Vorontsov
Quoted 4 lines
commit
77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba("gianfar: Fix VLAN HW feature related frame/buffer size calculation") wrongly removedpriv->vlgrpassignment, and nowpriv->vlgrpis always NULL.
...
Quoted 3 lines
Quoted 1 line
Signed-off-by Anton Vorontsov <[email protected]>Acked-by Andy Fleming <[email protected]>
Applied, thanks guys.
Haruki Dai
Acked-byQuoted 5 lines
-----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;
Quoted 16 lines
[email protected]
Subject: Re: [PATCH] gianfar: Revive VLAN support =20
=20
On Jan 26, 2009, at 2:50 PM, Anton Vorontsov wrote:
=20Quoted 10 lines
commit
77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba("gianfar: Fix VLAN HW feature related frame/buffer size calculation") wrongly removedpriv->vlgrpassignment, and nowpriv->vlgrpis 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=3D=3D grp)" and =
tries
Quoted 3 lines
Quoted 3 lines
to return w/o dropping the lock.
According to
net/8021q/vlan.cVLAN core issuesrx_register()
callback:
Quoted 8 lines
Quoted 6 lines
1. In
register_vlan_dev()only on a newly created group;
2. Inunregister_vlan_dev()only if the group becomes empty.Thus the check in the gianfar driver isn't needed.
Signed-off-by Anton Vorontsov <[email protected]>=20
Acked-by Andy Fleming <[email protected]>