From eb7ac07bc4d99160a9fd08c22e8873f571a8fabe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 4 Apr 2012 09:51:42 -0700 Subject: [PATCH] 3.2-stable patches added patches: fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch net-usb-cdc_eem-fix-mtu.patch rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch sky2-dont-overwrite-settings-for-phy-quick-link.patch tg3-fix-5717-serdes-powerdown-problem.patch x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch --- ...e-undid-bug-fix-in-a-previous-commit.patch | 46 +++++++++++++++++++ queue-3.2/net-usb-cdc_eem-fix-mtu.patch | 36 +++++++++++++++ ...x-memcpy-bug-in-rose_set_mac_address.patch | 39 ++++++++++++++++ queue-3.2/series | 6 +++ ...verwrite-settings-for-phy-quick-link.patch | 40 ++++++++++++++++ ...g3-fix-5717-serdes-powerdown-problem.patch | 35 ++++++++++++++ ...-the-16-bit-immediate-operand-of-and.patch | 33 +++++++++++++ 7 files changed, 235 insertions(+) create mode 100644 queue-3.2/fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch create mode 100644 queue-3.2/net-usb-cdc_eem-fix-mtu.patch create mode 100644 queue-3.2/rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch create mode 100644 queue-3.2/series create mode 100644 queue-3.2/sky2-dont-overwrite-settings-for-phy-quick-link.patch create mode 100644 queue-3.2/tg3-fix-5717-serdes-powerdown-problem.patch create mode 100644 queue-3.2/x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch diff --git a/queue-3.2/fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch b/queue-3.2/fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch new file mode 100644 index 00000000000..7079ba1355a --- /dev/null +++ b/queue-3.2/fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch @@ -0,0 +1,46 @@ +From 89fd9ec230fe9c944c1dbaa8bce663bbab925b08 Mon Sep 17 00:00:00 2001 +From: Kenth Eriksson +Date: Tue, 27 Mar 2012 22:05:54 +0000 +Subject: Fix non TBI PHY access; a bad merge undid bug fix in a previous commit. + + +From: Kenth Eriksson + +[ Upstream commit 464b57da56910c8737ede75ad820b9a7afc46b3e ] + +The merge done in commit b26e478f undid bug fix in commit c3e072f8 +("net: fsl_pq_mdio: fix non tbi phy access"), with the result that non +TBI (e.g. MDIO) PHYs cannot be accessed. + +Signed-off-by: Kenth Eriksson +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/freescale/fsl_pq_mdio.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c ++++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c +@@ -356,16 +356,15 @@ static int fsl_pq_mdio_probe(struct plat + + if (prop) + tbiaddr = *prop; +- } +- +- if (tbiaddr == -1) { +- err = -EBUSY; + +- goto err_free_irqs; ++ if (tbiaddr == -1) { ++ err = -EBUSY; ++ goto err_free_irqs; ++ } else { ++ out_be32(tbipa, tbiaddr); ++ } + } + +- out_be32(tbipa, tbiaddr); +- + err = of_mdiobus_register(new_bus, np); + if (err) { + printk (KERN_ERR "%s: Cannot register as MDIO bus\n", diff --git a/queue-3.2/net-usb-cdc_eem-fix-mtu.patch b/queue-3.2/net-usb-cdc_eem-fix-mtu.patch new file mode 100644 index 00000000000..872600e538b --- /dev/null +++ b/queue-3.2/net-usb-cdc_eem-fix-mtu.patch @@ -0,0 +1,36 @@ +From 849adbfee29b57530b0ef8efcf64876427dcff0a Mon Sep 17 00:00:00 2001 +From: Rabin Vincent +Date: Thu, 29 Mar 2012 07:15:15 +0000 +Subject: net: usb: cdc_eem: fix mtu + + +From: Rabin Vincent + +[ Upstream commit 78fb72f7936c01d5b426c03a691eca082b03f2b9 ] + +Make CDC EEM recalculate the hard_mtu after adjusting the +hard_header_len. + +Without this, usbnet adjusts the MTU down to 1494 bytes, and the host is +unable to receive standard 1500-byte frames from the device. + +Tested with the Linux USB Ethernet gadget. + +Cc: Oliver Neukum +Signed-off-by: Rabin Vincent +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/cdc_eem.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/cdc_eem.c ++++ b/drivers/net/usb/cdc_eem.c +@@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, + /* no jumbogram (16K) support for now */ + + dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; ++ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; + + return 0; + } diff --git a/queue-3.2/rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch b/queue-3.2/rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch new file mode 100644 index 00000000000..12aada369a2 --- /dev/null +++ b/queue-3.2/rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch @@ -0,0 +1,39 @@ +From f2a6217bccca34c7c124dcdb24ca3f21f49cd168 Mon Sep 17 00:00:00 2001 +From: "danborkmann@iogearbox.net" +Date: Tue, 27 Mar 2012 22:47:43 +0000 +Subject: rose_dev: fix memcpy-bug in rose_set_mac_address + + +From: "danborkmann@iogearbox.net" + +[ Upstream commit 81213b5e8ae68e204aa7a3f83c4f9100405dbff9 ] + +If both addresses equal, nothing needs to be done. If the device is down, +then we simply copy the new address to dev->dev_addr. If the device is up, +then we add another loopback device with the new address, and if that does +not fail, we remove the loopback device with the old address. And only +then, we update the dev->dev_addr. + +Signed-off-by: Daniel Borkmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/rose/rose_dev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/rose/rose_dev.c ++++ b/net/rose/rose_dev.c +@@ -96,11 +96,11 @@ static int rose_set_mac_address(struct n + struct sockaddr *sa = addr; + int err; + +- if (!memcpy(dev->dev_addr, sa->sa_data, dev->addr_len)) ++ if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len)) + return 0; + + if (dev->flags & IFF_UP) { +- err = rose_add_loopback_node((rose_address *)dev->dev_addr); ++ err = rose_add_loopback_node((rose_address *)sa->sa_data); + if (err) + return err; + diff --git a/queue-3.2/series b/queue-3.2/series new file mode 100644 index 00000000000..72129f6f5ac --- /dev/null +++ b/queue-3.2/series @@ -0,0 +1,6 @@ +x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch +tg3-fix-5717-serdes-powerdown-problem.patch +sky2-dont-overwrite-settings-for-phy-quick-link.patch +rose_dev-fix-memcpy-bug-in-rose_set_mac_address.patch +net-usb-cdc_eem-fix-mtu.patch +fix-non-tbi-phy-access-a-bad-merge-undid-bug-fix-in-a-previous-commit.patch diff --git a/queue-3.2/sky2-dont-overwrite-settings-for-phy-quick-link.patch b/queue-3.2/sky2-dont-overwrite-settings-for-phy-quick-link.patch new file mode 100644 index 00000000000..9a0f48ca735 --- /dev/null +++ b/queue-3.2/sky2-dont-overwrite-settings-for-phy-quick-link.patch @@ -0,0 +1,40 @@ +From 711d298e7b64b7c55477d8f59aa97a01d4c78000 Mon Sep 17 00:00:00 2001 +From: Lino Sanfilippo +Date: Fri, 30 Mar 2012 07:28:59 +0000 +Subject: sky2: dont overwrite settings for PHY Quick link + + +From: Lino Sanfilippo + +[ Upstream commit 2240eb4ae3dc4acff20d1a8947c441c451513e37 ] + +This patch corrects a bug in function sky2_open() of the Marvell Yukon 2 driver +in which the settings for PHY quick link are overwritten. + +Signed-off-by: Lino Sanfilippo +Acked-by: Stephen Hemminger +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/sky2.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/marvell/sky2.c ++++ b/drivers/net/ethernet/marvell/sky2.c +@@ -1766,13 +1766,14 @@ static int sky2_open(struct net_device * + + sky2_hw_up(sky2); + ++ /* Enable interrupts from phy/mac for port */ ++ imask = sky2_read32(hw, B0_IMSK); ++ + if (hw->chip_id == CHIP_ID_YUKON_OPT || + hw->chip_id == CHIP_ID_YUKON_PRM || + hw->chip_id == CHIP_ID_YUKON_OP_2) + imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */ + +- /* Enable interrupts from phy/mac for port */ +- imask = sky2_read32(hw, B0_IMSK); + imask |= portirq_msk[port]; + sky2_write32(hw, B0_IMSK, imask); + sky2_read32(hw, B0_IMSK); diff --git a/queue-3.2/tg3-fix-5717-serdes-powerdown-problem.patch b/queue-3.2/tg3-fix-5717-serdes-powerdown-problem.patch new file mode 100644 index 00000000000..4ae9040a739 --- /dev/null +++ b/queue-3.2/tg3-fix-5717-serdes-powerdown-problem.patch @@ -0,0 +1,35 @@ +From e9e4503037d097919f2f75d1510f76fdc7ade322 Mon Sep 17 00:00:00 2001 +From: Matt Carlson +Date: Mon, 2 Apr 2012 09:01:40 +0000 +Subject: tg3: Fix 5717 serdes powerdown problem + + +From: Matt Carlson + +[ Upstream commit 085f1afc56619bda424941412fdeaff1e32c21dc ] + +If port 0 of a 5717 serdes device powers down, it hides the phy from +port 1. This patch works around the problem by keeping port 0's phy +powered up. + +Signed-off-by: Matt Carlson +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/tg3.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/tg3.c ++++ b/drivers/net/ethernet/broadcom/tg3.c +@@ -2794,7 +2794,9 @@ static void tg3_power_down_phy(struct tg + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && +- (tp->phy_flags & TG3_PHYFLG_MII_SERDES))) ++ (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) || ++ (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && ++ !tp->pci_fn)) + return; + + if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX || diff --git a/queue-3.2/x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch b/queue-3.2/x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch new file mode 100644 index 00000000000..e0766e4958b --- /dev/null +++ b/queue-3.2/x86-bpf_jit-fix-a-bug-in-emitting-the-16-bit-immediate-operand-of-and.patch @@ -0,0 +1,33 @@ +From 9b4c86fd07e1c29945883fb881c117c8e9cb14db Mon Sep 17 00:00:00 2001 +From: "zhuangfeiran@ict.ac.cn" +Date: Wed, 28 Mar 2012 23:27:00 +0000 +Subject: x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND + + +From: "zhuangfeiran@ict.ac.cn" + +[ Upstream commit 1d24fb3684f347226747c6b11ea426b7b992694e ] + +When K >= 0xFFFF0000, AND needs the two least significant bytes of K as +its operand, but EMIT2() gives it the least significant byte of K and +0x2. EMIT() should be used here to replace EMIT2(). + +Signed-off-by: Feiran Zhuang +Acked-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/net/bpf_jit_comp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/net/bpf_jit_comp.c ++++ b/arch/x86/net/bpf_jit_comp.c +@@ -289,7 +289,7 @@ void bpf_jit_compile(struct sk_filter *f + EMIT2(0x24, K & 0xFF); /* and imm8,%al */ + } else if (K >= 0xFFFF0000) { + EMIT2(0x66, 0x25); /* and imm16,%ax */ +- EMIT2(K, 2); ++ EMIT(K, 2); + } else { + EMIT1_off32(0x25, K); /* and imm32,%eax */ + } -- 2.47.3