]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
started up next 2.6.22 queue
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 21 Aug 2007 21:16:56 +0000 (14:16 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 21 Aug 2007 21:16:56 +0000 (14:16 -0700)
queue-2.6.22/net-share-correct-feature-code-between-bridging-and-bonding.patch [new file with mode: 0644]
queue-2.6.22/ocfs2-fix-bad-source-start-calculation-during-kernel-writes.patch [new file with mode: 0644]
queue-2.6.22/series [new file with mode: 0644]
queue-2.6.22/sky2-don-t-clear-phy-power-bits.patch [new file with mode: 0644]

diff --git a/queue-2.6.22/net-share-correct-feature-code-between-bridging-and-bonding.patch b/queue-2.6.22/net-share-correct-feature-code-between-bridging-and-bonding.patch
new file mode 100644 (file)
index 0000000..d8a8a6a
--- /dev/null
@@ -0,0 +1,208 @@
+From herbert@gondor.apana.org.au  Tue Aug 21 14:12:37 2007
+From: Herbert Xu <herbert@gondor.apana.org.au>
+Date: Tue, 21 Aug 2007 14:22:55 +0800
+Subject: NET: Share correct feature code between bridging and bonding
+To: David Miller <davem@davemloft.net>
+Cc: netdev@vger.kernel.org, stable@kernel.org
+Message-ID: <20070821062255.GA21799@gondor.apana.org.au>
+Content-Disposition: inline
+
+[NET]: Share correct feature code between bridging and bonding
+
+http://bugzilla.kernel.org/show_bug.cgi?id=8797 shows that the
+bonding driver may produce bogus combinations of the checksum
+flags and SG/TSO.
+
+For example, if you bond devices with NETIF_F_HW_CSUM and
+NETIF_F_IP_CSUM you'll end up with a bonding device that
+has neither flag set.  If both have TSO then this produces
+an illegal combination.
+
+The bridge device on the other hand has the correct code to
+deal with this.
+
+In fact, the same code can be used for both.  So this patch
+moves that logic into net/core/dev.c and uses it for both
+bonding and bridging.
+
+In the process I've made small adjustments such as only
+setting GSO_ROBUST if at least one constituent device
+supports it.
+
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Acked-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/bonding/bond_main.c |   30 +++++++++---------------------
+ include/linux/netdevice.h       |    2 ++
+ net/bridge/br_device.c          |    3 ++-
+ net/bridge/br_if.c              |   28 ++++------------------------
+ net/core/dev.c                  |   38 ++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 55 insertions(+), 46 deletions(-)
+
+--- a/drivers/net/bonding/bond_main.c
++++ b/drivers/net/bonding/bond_main.c
+@@ -1233,43 +1233,31 @@ int bond_sethwaddr(struct net_device *bo
+       return 0;
+ }
+-#define BOND_INTERSECT_FEATURES \
+-      (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO)
++#define BOND_VLAN_FEATURES \
++      (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \
++       NETIF_F_HW_VLAN_FILTER)
+ /* 
+  * Compute the common dev->feature set available to all slaves.  Some
+- * feature bits are managed elsewhere, so preserve feature bits set on
+- * master device that are not part of the examined set.
++ * feature bits are managed elsewhere, so preserve those feature bits
++ * on the master device.
+  */
+ static int bond_compute_features(struct bonding *bond)
+ {
+-      unsigned long features = BOND_INTERSECT_FEATURES;
+       struct slave *slave;
+       struct net_device *bond_dev = bond->dev;
++      unsigned long features = bond_dev->features & ~BOND_VLAN_FEATURES;
+       unsigned short max_hard_header_len = ETH_HLEN;
+       int i;
+       bond_for_each_slave(bond, slave, i) {
+-              features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
++              features = netdev_compute_features(features,
++                                                 slave->dev->features);
+               if (slave->dev->hard_header_len > max_hard_header_len)
+                       max_hard_header_len = slave->dev->hard_header_len;
+       }
+-      if ((features & NETIF_F_SG) && 
+-          !(features & NETIF_F_ALL_CSUM))
+-              features &= ~NETIF_F_SG;
+-
+-      /* 
+-       * features will include NETIF_F_TSO (NETIF_F_UFO) iff all 
+-       * slave devices support NETIF_F_TSO (NETIF_F_UFO), which 
+-       * implies that all slaves also support scatter-gather 
+-       * (NETIF_F_SG), which implies that features also includes 
+-       * NETIF_F_SG. So no need to check whether we have an  
+-       * illegal combination of NETIF_F_{TSO,UFO} and 
+-       * !NETIF_F_SG 
+-       */
+-
+-      features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
++      features |= (bond_dev->features & BOND_VLAN_FEATURES);
+       bond_dev->features = features;
+       bond_dev->hard_header_len = max_hard_header_len;
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
+@@ -1032,6 +1032,8 @@ extern void dev_seq_stop(struct seq_file
+ extern void linkwatch_run_queue(void);
++extern int netdev_compute_features(unsigned long all, unsigned long one);
++
+ static inline int net_gso_ok(int features, int gso_type)
+ {
+       int feature = gso_type << NETIF_F_GSO_SHIFT;
+--- a/net/bridge/br_device.c
++++ b/net/bridge/br_device.c
+@@ -179,5 +179,6 @@ void br_dev_setup(struct net_device *dev
+       dev->priv_flags = IFF_EBRIDGE;
+       dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+-                      NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
++                      NETIF_F_GSO_SOFTWARE | NETIF_F_NO_CSUM |
++                      NETIF_F_GSO_ROBUST | NETIF_F_LLTX;
+ }
+--- a/net/bridge/br_if.c
++++ b/net/bridge/br_if.c
+@@ -360,35 +360,15 @@ int br_min_mtu(const struct net_bridge *
+ void br_features_recompute(struct net_bridge *br)
+ {
+       struct net_bridge_port *p;
+-      unsigned long features, checksum;
++      unsigned long features;
+-      checksum = br->feature_mask & NETIF_F_ALL_CSUM ? NETIF_F_NO_CSUM : 0;
+-      features = br->feature_mask & ~NETIF_F_ALL_CSUM;
++      features = br->feature_mask;
+       list_for_each_entry(p, &br->port_list, list) {
+-              unsigned long feature = p->dev->features;
+-
+-              if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM))
+-                      checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
+-              if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM))
+-                      checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM;
+-              if (!(feature & NETIF_F_IP_CSUM))
+-                      checksum = 0;
+-
+-              if (feature & NETIF_F_GSO)
+-                      feature |= NETIF_F_GSO_SOFTWARE;
+-              feature |= NETIF_F_GSO;
+-
+-              features &= feature;
++              features = netdev_compute_features(features, p->dev->features);
+       }
+-      if (!(checksum & NETIF_F_ALL_CSUM))
+-              features &= ~NETIF_F_SG;
+-      if (!(features & NETIF_F_SG))
+-              features &= ~NETIF_F_GSO_MASK;
+-
+-      br->dev->features = features | checksum | NETIF_F_LLTX |
+-                          NETIF_F_GSO_ROBUST;
++      br->dev->features = features;
+ }
+ /* called with RTNL */
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -3635,6 +3635,44 @@ static int __init netdev_dma_register(vo
+ static int __init netdev_dma_register(void) { return -ENODEV; }
+ #endif /* CONFIG_NET_DMA */
++/**
++ *    netdev_compute_feature - compute conjunction of two feature sets
++ *    @all: first feature set
++ *    @one: second feature set
++ *
++ *    Computes a new feature set after adding a device with feature set
++ *    @one to the master device with current feature set @all.  Returns
++ *    the new feature set.
++ */
++int netdev_compute_features(unsigned long all, unsigned long one)
++{
++      /* if device needs checksumming, downgrade to hw checksumming */
++      if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
++              all ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
++
++      /* if device can't do all checksum, downgrade to ipv4 */
++      if (all & NETIF_F_HW_CSUM && !(one & NETIF_F_HW_CSUM))
++              all ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM;
++
++      if (one & NETIF_F_GSO)
++              one |= NETIF_F_GSO_SOFTWARE;
++      one |= NETIF_F_GSO;
++
++      /* If even one device supports robust GSO, enable it for all. */
++      if (one & NETIF_F_GSO_ROBUST)
++              all |= NETIF_F_GSO_ROBUST;
++
++      all &= one | NETIF_F_LLTX;
++
++      if (!(all & NETIF_F_ALL_CSUM))
++              all &= ~NETIF_F_SG;
++      if (!(all & NETIF_F_SG))
++              all &= ~NETIF_F_GSO_MASK;
++
++      return all;
++}
++EXPORT_SYMBOL(netdev_compute_features);
++
+ /*
+  *    Initialize the DEV module. At boot time this walks the device list and
+  *    unhooks any devices that fail to initialise (normally hardware not
diff --git a/queue-2.6.22/ocfs2-fix-bad-source-start-calculation-during-kernel-writes.patch b/queue-2.6.22/ocfs2-fix-bad-source-start-calculation-during-kernel-writes.patch
new file mode 100644 (file)
index 0000000..042baa4
--- /dev/null
@@ -0,0 +1,37 @@
+From mark.fasheh@oracle.com  Tue Aug 21 14:11:52 2007
+From: Mark Fasheh <mark.fasheh@oracle.com>
+Date: Thu, 16 Aug 2007 17:16:04 -0700
+Subject: ocfs2: Fix bad source start calculation during kernel writes
+To: stable@kernel.org
+Message-ID: <20070817001604.GI5260@ca-server1.us.oracle.com>
+Content-Disposition: inline
+
+
+From: Mark Fasheh <mark.fasheh@oracle.com>
+
+[PATCH] ocfs2: Fix bad source start calculation during kernel writes
+
+For in-kernel writes ocfs2_get_write_source() should be starting the buffer
+at a page boundary as the math in ocfs2_map_and_write_user_data() will pad
+it back out to the correct write offset. Instead, we were passing the raw
+offset, which caused ocfs2_map_and_write_user_data() start too far into the
+buffer, resulting in corruptions from nfs client writes.
+
+Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ocfs2/file.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ocfs2/file.c
++++ b/fs/ocfs2/file.c
+@@ -1353,7 +1353,7 @@ static struct page * ocfs2_get_write_sou
+               else
+                       src_page = ERR_PTR(-EFAULT);
+       } else {
+-              bp->b_src_buf = buf;
++              bp->b_src_buf = (char *)((unsigned long)buf & PAGE_CACHE_MASK);
+       }
+       return src_page;
diff --git a/queue-2.6.22/series b/queue-2.6.22/series
new file mode 100644 (file)
index 0000000..2a7c93b
--- /dev/null
@@ -0,0 +1,3 @@
+ocfs2-fix-bad-source-start-calculation-during-kernel-writes.patch
+net-share-correct-feature-code-between-bridging-and-bonding.patch
+sky2-don-t-clear-phy-power-bits.patch
diff --git a/queue-2.6.22/sky2-don-t-clear-phy-power-bits.patch b/queue-2.6.22/sky2-don-t-clear-phy-power-bits.patch
new file mode 100644 (file)
index 0000000..e4740e2
--- /dev/null
@@ -0,0 +1,34 @@
+From shemminger@linux-foundation.org  Tue Aug 21 14:13:24 2007
+From: Stephen Hemminger <shemminger@linux-foundation.org>
+Date: Tue, 21 Aug 2007 11:10:22 -0700
+Subject: sky2: don't clear phy power bits
+To: Greg KH <gregkh@suse.de>
+Cc: stable@vger.kernel.org, stable@kernel.org, Justin Forbes <jmforbes@linuxtx.org>, Zwane Mwaikambo <zwane@arm.linux.org.uk>, "Theodore  Ts'o" <tytso@mit.edu>, Randy Dunlap <rdunlap@xenotime.net>, Dave Jones <davej@redhat.com>, Chuck Wolber <chuckw@quantumlinux.com>, Chris Wedgwood <reviews@ml.cw.f00f.org>, Michael Krufky <mkrufky@linuxtv.org>, Chuck Ebbert <cebbert@redhat.com>, Domenico Andreoli <cavokz@gmail.com>, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, netdev@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <20070821111022.046eec14@freepuppy.rosehill.hemminger.net>
+
+
+There are special PHY settings available on Yukon EC-U chip that
+should not get cleared. This should solve mysterious errors on some
+motherboards (like Gigabyte DS-3).
+
+Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/net/sky2.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/sky2.c
++++ b/drivers/net/sky2.c
+@@ -657,8 +657,8 @@ static void sky2_mac_init(struct sky2_hw
+       int i;
+       const u8 *addr = hw->dev[port]->dev_addr;
+-      sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
+-      sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
++      sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
++      sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
+       sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);