All of lore.kernel.org
 help / color / mirror / Atom feed
* [ 01/59] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 02/59] tg3: Fix 5717 serdes powerdown problem Greg KH
                   ` (57 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Feiran Zhuang, Eric Dumazet, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: "zhuangfeiran@ict.ac.cn" <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  <zhuangfeiran@ict.ac.cn>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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 */
 				}



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

* [ 02/59] tg3: Fix 5717 serdes powerdown problem
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
  2012-04-11 23:10 ` [ 01/59] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 03/59] sky2: dont overwrite settings for PHY Quick link Greg KH
                   ` (56 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Matt Carlson, Michael Chan, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Matt Carlson <mcarlson@broadcom.com>

[ 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 <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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 ||



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

* [ 03/59] sky2: dont overwrite settings for PHY Quick link
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
  2012-04-11 23:10 ` [ 01/59] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND Greg KH
  2012-04-11 23:10 ` [ 02/59] tg3: Fix 5717 serdes powerdown problem Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 04/59] rose_dev: fix memcpy-bug in rose_set_mac_address Greg KH
                   ` (55 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Lino Sanfilippo, Stephen Hemminger,
	David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Lino Sanfilippo <LinoSanfilippo@gmx.de>

[ 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 <LinoSanfilippo@gmx.de>
Acked-by: Stephen Hemminger <shemminger@vyattta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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);



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

* [ 04/59] rose_dev: fix memcpy-bug in rose_set_mac_address
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (2 preceding siblings ...)
  2012-04-11 23:10 ` [ 03/59] sky2: dont overwrite settings for PHY Quick link Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 05/59] net: usb: cdc_eem: fix mtu Greg KH
                   ` (54 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Borkmann, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: "danborkmann@iogearbox.net" <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 <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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;
 



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

* [ 05/59] net: usb: cdc_eem: fix mtu
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (3 preceding siblings ...)
  2012-04-11 23:10 ` [ 04/59] rose_dev: fix memcpy-bug in rose_set_mac_address Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit Greg KH
                   ` (53 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Oliver Neukum, Rabin Vincent, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Rabin Vincent <rabin@rab.in>

[ 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 <oliver@neukum.name>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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;
 }



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

* [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (4 preceding siblings ...)
  2012-04-11 23:10 ` [ 05/59] net: usb: cdc_eem: fix mtu Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-12  4:55   ` Ben Hutchings
  2012-04-11 23:10 ` [ 07/59] ASoC: wm8994: Update WM8994 DCS calibration Greg KH
                   ` (52 subsequent siblings)
  58 siblings, 1 reply; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Kenth Eriksson, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Kenth Eriksson <kenth.eriksson@transmode.com>

[ 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 <kenth.eriksson@transmode.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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",



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

* [ 07/59] ASoC: wm8994: Update WM8994 DCS calibration
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (5 preceding siblings ...)
  2012-04-11 23:10 ` [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 08/59] mtd: ixp4xx: oops in ixp4xx_flash_probe Greg KH
                   ` (51 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Mark Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit e16605855d58803fe0608417150c7a618b4f8243 upstream.

Based on latest production information.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/wm8994.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3190,7 +3190,7 @@ static int wm8994_codec_probe(struct snd
 		case 2:
 		case 3:
 			wm8994->hubs.dcs_codes_l = -9;
-			wm8994->hubs.dcs_codes_r = -5;
+			wm8994->hubs.dcs_codes_r = -7;
 			break;
 		default:
 			break;



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

* [ 08/59] mtd: ixp4xx: oops in ixp4xx_flash_probe
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (6 preceding siblings ...)
  2012-04-11 23:10 ` [ 07/59] ASoC: wm8994: Update WM8994 DCS calibration Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 09/59] mtd: mips: lantiq: reintroduce support for cmdline partitions Greg KH
                   ` (50 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Marc Kleine-Budde, Artem Bityutskiy,
	David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marc Kleine-Budde <mkl@blackshift.org>

commit a3c1e3b732b3708a80e4035b9d845f3f7c7dd0c9 upstream.

In commit "c797533 mtd: abstract last MTD partition parser argument" the
third argument of "mtd_device_parse_register()" changed from start address
of the MTD device to a pointer to a struct.

The "ixp4xx_flash_probe()" function was not converted properly, causing
an oops during boot.

This patch fixes the problem by filling the needed information into a
"struct mtd_part_parser_data" and passing it to
"mtd_device_parse_register()".

Signed-off-by: Marc Kleine-Budde <mkl@blackshift.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/maps/ixp4xx.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -182,6 +182,9 @@ static int ixp4xx_flash_probe(struct pla
 {
 	struct flash_platform_data *plat = dev->dev.platform_data;
 	struct ixp4xx_flash_info *info;
+	struct mtd_part_parser_data ppdata = {
+		.origin = dev->resource->start,
+	};
 	int err = -1;
 
 	if (!plat)
@@ -247,7 +250,7 @@ static int ixp4xx_flash_probe(struct pla
 	/* Use the fast version */
 	info->map.write = ixp4xx_write16;
 
-	err = mtd_device_parse_register(info->mtd, probes, dev->resource->start,
+	err = mtd_device_parse_register(info->mtd, probes, &ppdata,
 			plat->parts, plat->nr_parts);
 	if (err) {
 		printk(KERN_ERR "Could not parse partitions\n");



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

* [ 09/59] mtd: mips: lantiq: reintroduce support for cmdline partitions
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (7 preceding siblings ...)
  2012-04-11 23:10 ` [ 08/59] mtd: ixp4xx: oops in ixp4xx_flash_probe Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 10/59] mtd: nand: gpmi: use correct member for checking NAND_BBT_USE_FLASH Greg KH
                   ` (49 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Schwierzeck, John Crispin,
	Artem Bityutskiy, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

commit bf011f2ed53d587fdd8148c173c4f09ed77bdf1a upstream.

Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
command line parsing of MTD partitions does not work anymore.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/maps/lantiq-flash.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -45,6 +45,7 @@ struct ltq_mtd {
 };
 
 static char ltq_map_name[] = "ltq_nor";
+static const char *ltq_probe_types[] __devinitconst = { "cmdlinepart", NULL };
 
 static map_word
 ltq_read16(struct map_info *map, unsigned long adr)
@@ -168,7 +169,7 @@ ltq_mtd_probe(struct platform_device *pd
 	cfi->addr_unlock1 ^= 1;
 	cfi->addr_unlock2 ^= 1;
 
-	err = mtd_device_parse_register(ltq_mtd->mtd, NULL, 0,
+	err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, 0,
 			ltq_mtd_data->parts, ltq_mtd_data->nr_parts);
 	if (err) {
 		dev_err(&pdev->dev, "failed to add partitions\n");



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

* [ 10/59] mtd: nand: gpmi: use correct member for checking NAND_BBT_USE_FLASH
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (8 preceding siblings ...)
  2012-04-11 23:10 ` [ 09/59] mtd: mips: lantiq: reintroduce support for cmdline partitions Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 11/59] mtd: sst25l: initialize writebufsize Greg KH
                   ` (48 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Wolfram Sang, Huang Shijie,
	Artem Bityutskiy, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wolfram Sang <w.sang@pengutronix.de>

commit 5289966ea576a062b80319975b31b661c196ff9d upstream.

This has been moved from .options to .bbt_options meanwhile. So, it
currently checks for something totally different (NAND_OWN_BUFFERS) and
decides according to that.

Artem Bityutskiy: the options were moved in
a40f734 mtd: nand: consolidate redundant flash-based BBT flags

Artem Bityutskiy: CCing -stable

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1124,7 +1124,7 @@ static int gpmi_block_markbad(struct mtd
 		chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
 
 	/* Do we have a flash based bad block table ? */
-	if (chip->options & NAND_BBT_USE_FLASH)
+	if (chip->bbt_options & NAND_BBT_USE_FLASH)
 		ret = nand_update_bbt(mtd, ofs);
 	else {
 		chipnr = (int)(ofs >> chip->chip_shift);



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

* [ 11/59] mtd: sst25l: initialize writebufsize
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (9 preceding siblings ...)
  2012-04-11 23:10 ` [ 10/59] mtd: nand: gpmi: use correct member for checking NAND_BBT_USE_FLASH Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 12/59] mtd: block2mtd: " Greg KH
                   ` (47 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Artem Bityutskiy, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

commit c4cc625ea5958d065c21cc0fcea29e9ed8f3d2bc upstream.

The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.

Set writebufsize to the flash page size because it is the maximum amount of
data it writes at a time.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/devices/sst25l.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -402,6 +402,7 @@ static int __devinit sst25l_probe(struct
 	flash->mtd.flags	= MTD_CAP_NORFLASH;
 	flash->mtd.erasesize	= flash_info->erase_size;
 	flash->mtd.writesize	= flash_info->page_size;
+	flash->mtd.writebufsize	= flash_info->page_size;
 	flash->mtd.size		= flash_info->page_size * flash_info->nr_pages;
 	flash->mtd.erase	= sst25l_erase;
 	flash->mtd.read		= sst25l_read;



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

* [ 12/59] mtd: block2mtd: initialize writebufsize
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (10 preceding siblings ...)
  2012-04-11 23:10 ` [ 11/59] mtd: sst25l: initialize writebufsize Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 13/59] mtd: lart: " Greg KH
                   ` (46 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Artem Bityutskiy, Joern Engel, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

commit b604387411ec6a072e95910099262616edd2bd2f upstream.

The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.

However, we forgot to set this parameter for block2mtd. Set it to PAGE_SIZE
because this is actually the amount of data we write at a time.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: Joern Engel <joern@lazybastard.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/devices/block2mtd.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -284,6 +284,7 @@ static struct block2mtd_dev *add_device(
 	dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
 	dev->mtd.erasesize = erase_size;
 	dev->mtd.writesize = 1;
+	dev->mtd.writebufsize = PAGE_SIZE;
 	dev->mtd.type = MTD_RAM;
 	dev->mtd.flags = MTD_CAP_RAM;
 	dev->mtd.erase = block2mtd_erase;



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

* [ 13/59] mtd: lart: initialize writebufsize
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (11 preceding siblings ...)
  2012-04-11 23:10 ` [ 12/59] mtd: block2mtd: " Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 14/59] mtd: m25p80: set writebufsize Greg KH
                   ` (45 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Artem Bityutskiy, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

commit fcc44a07dae0af16e84e93425fc8afe642ddc603 upstream.

The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.

Set writebufsize to 4 because this drivers writes at max 4 bytes at a time.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/devices/lart.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mtd/devices/lart.c
+++ b/drivers/mtd/devices/lart.c
@@ -630,6 +630,7 @@ static int __init lart_flash_init (void)
    mtd.name = module_name;
    mtd.type = MTD_NORFLASH;
    mtd.writesize = 1;
+   mtd.writebufsize = 4;
    mtd.flags = MTD_CAP_NORFLASH;
    mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN;
    mtd.erasesize = FLASH_BLOCKSIZE_MAIN;



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

* [ 14/59] mtd: m25p80: set writebufsize
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (12 preceding siblings ...)
  2012-04-11 23:10 ` [ 13/59] mtd: lart: " Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 15/59] ACPI: Do cpufreq clamping for throttling per package v2 Greg KH
                   ` (44 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Brian Norris, Artem Bityutskiy, David Woodhouse

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Brian Norris <computersforpeace@gmail.com>

commit b54f47c8bcfc5f766bf13ec31bd7dd1d4726d33b upstream.

Using UBI on m25p80 can give messages like:

    UBI error: io_init: bad write buffer size 0 for 1 min. I/O unit

We need to initialize writebufsize; I think "page_size" is the correct
"bufsize", although I'm not sure. Comments?

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/devices/m25p80.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -932,6 +932,7 @@ static int __devinit m25p_probe(struct s
 	ppdata.of_node = spi->dev.of_node;
 	flash->mtd.dev.parent = &spi->dev;
 	flash->page_size = info->page_size;
+	flash->mtd.writebufsize = flash->page_size;
 
 	if (info->addr_width)
 		flash->addr_width = info->addr_width;



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

* [ 15/59] ACPI: Do cpufreq clamping for throttling per package v2
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (13 preceding siblings ...)
  2012-04-11 23:10 ` [ 14/59] mtd: m25p80: set writebufsize Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 16/59] PNPACPI: Fix device ref leaking in acpi_pnp_match Greg KH
                   ` (43 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Andi Kleen, Len Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andi Kleen <andi@firstfloor.org>

commit 2815ab92ba3ab27556212cc306288dc95692824b upstream.

On Intel CPUs the processor typically uses the highest frequency
set by any logical CPU. When the system overheats
Linux first forces the frequency to the lowest available one
to lower the temperature.

However this was done only per logical CPU, which means all
logical CPUs in a package would need to go through this before
the frequency is actually lowered.

Worse this delay actually prevents real throttling, because
the real throttle code only proceeds when the lowest frequency
is already reached.

So when a throttle event happens force the lowest frequency
for all CPUs in the package where it happened. The per CPU
state is now kept per package, not per logical CPU. An alternative
would be to do it per cpufreq unit, but since we want to bring
down the temperature of the complete chip it's better
to do it for all.

In principle it may even make sense to do it for all CPUs,
but I kept it on the package for now.

With this change the frequency is actually lowered, which
in terms also allows real throttling to proceed.

I also removed an unnecessary per cpu variable initialization.

v2: Fix package mapping

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/processor_thermal.c |   45 ++++++++++++++++++++++++++++++++-------
 1 file changed, 37 insertions(+), 8 deletions(-)

--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -58,6 +58,27 @@ ACPI_MODULE_NAME("processor_thermal");
 static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg);
 static unsigned int acpi_thermal_cpufreq_is_init = 0;
 
+#define reduction_pctg(cpu) \
+	per_cpu(cpufreq_thermal_reduction_pctg, phys_package_first_cpu(cpu))
+
+/*
+ * Emulate "per package data" using per cpu data (which should really be
+ * provided elsewhere)
+ *
+ * Note we can lose a CPU on cpu hotunplug, in this case we forget the state
+ * temporarily. Fortunately that's not a big issue here (I hope)
+ */
+static int phys_package_first_cpu(int cpu)
+{
+	int i;
+	int id = topology_physical_package_id(cpu);
+
+	for_each_online_cpu(i)
+		if (topology_physical_package_id(i) == id)
+			return i;
+	return 0;
+}
+
 static int cpu_has_cpufreq(unsigned int cpu)
 {
 	struct cpufreq_policy policy;
@@ -77,7 +98,7 @@ static int acpi_thermal_cpufreq_notifier
 
 	max_freq = (
 	    policy->cpuinfo.max_freq *
-	    (100 - per_cpu(cpufreq_thermal_reduction_pctg, policy->cpu) * 20)
+	    (100 - reduction_pctg(policy->cpu) * 20)
 	) / 100;
 
 	cpufreq_verify_within_limits(policy, 0, max_freq);
@@ -103,16 +124,28 @@ static int cpufreq_get_cur_state(unsigne
 	if (!cpu_has_cpufreq(cpu))
 		return 0;
 
-	return per_cpu(cpufreq_thermal_reduction_pctg, cpu);
+	return reduction_pctg(cpu);
 }
 
 static int cpufreq_set_cur_state(unsigned int cpu, int state)
 {
+	int i;
+
 	if (!cpu_has_cpufreq(cpu))
 		return 0;
 
-	per_cpu(cpufreq_thermal_reduction_pctg, cpu) = state;
-	cpufreq_update_policy(cpu);
+	reduction_pctg(cpu) = state;
+
+	/*
+	 * Update all the CPUs in the same package because they all
+	 * contribute to the temperature and often share the same
+	 * frequency.
+	 */
+	for_each_online_cpu(i) {
+		if (topology_physical_package_id(i) ==
+		    topology_physical_package_id(cpu))
+			cpufreq_update_policy(i);
+	}
 	return 0;
 }
 
@@ -120,10 +153,6 @@ void acpi_thermal_cpufreq_init(void)
 {
 	int i;
 
-	for (i = 0; i < nr_cpu_ids; i++)
-		if (cpu_present(i))
-			per_cpu(cpufreq_thermal_reduction_pctg, i) = 0;
-
 	i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block,
 				      CPUFREQ_POLICY_NOTIFIER);
 	if (!i)



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

* [ 16/59] PNPACPI: Fix device ref leaking in acpi_pnp_match
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (14 preceding siblings ...)
  2012-04-11 23:10 ` [ 15/59] ACPI: Do cpufreq clamping for throttling per package v2 Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 17/59] ACPICA: Fix regression in FADT revision checks Greg KH
                   ` (42 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Yinghai Lu, Len Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yinghai Lu <yinghai@kernel.org>

commit 89e96ada572fb216e582dbe3f64e1a6939a37f74 upstream.

During testing pci root bus removal, found some root bus bridge is not freed.
If booting with pnpacpi=off, those hostbridge could be freed without problem.
It turns out that some devices reference are not released during acpi_pnp_match.
that match should not hold one device ref during every calling.
Add pu_device calling before returning.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pnp/pnpacpi/core.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -321,9 +321,14 @@ static int __init acpi_pnp_match(struct
 {
 	struct acpi_device *acpi = to_acpi_device(dev);
 	struct pnp_dev *pnp = _pnp;
+	struct device *physical_device;
+
+	physical_device = acpi_get_physical_device(acpi->handle);
+	if (physical_device)
+		put_device(physical_device);
 
 	/* true means it matched */
-	return !acpi_get_physical_device(acpi->handle)
+	return !physical_device
 	    && compare_pnp_id(pnp->id, acpi_device_hid(acpi));
 }
 



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

* [ 17/59] ACPICA: Fix regression in FADT revision checks
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (15 preceding siblings ...)
  2012-04-11 23:10 ` [ 16/59] PNPACPI: Fix device ref leaking in acpi_pnp_match Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 18/59] modpost: fix ALL_INIT_DATA_SECTIONS Greg KH
                   ` (41 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Julian Anastasov, Bob Moore, Len Brown,
	Jonathan Nieder, Josh Boyer

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Julian Anastasov <ja@ssi.bg>

commit 3e80acd1af40fcd91a200b0416a7616b20c5d647 upstream.

	commit 64b3db22c04586997ab4be46dd5a5b99f8a2d390 (2.6.39),
"Remove use of unreliable FADT revision field" causes regression
for old P4 systems because now cst_control and other fields are
not reset to 0.

	The effect is that acpi_processor_power_init will notice
cst_control != 0 and a write to CST_CNT register is performed
that should not happen. As result, the system oopses after the
"No _CST, giving up" message, sometimes in acpi_ns_internalize_name,
sometimes in acpi_ns_get_type, usually at random places. May be
during migration to CPU 1 in acpi_processor_get_throttling.

	Every one of these settings help to avoid this problem:
 - acpi=off
 - processor.nocst=1
 - maxcpus=1

	The fix is to update acpi_gbl_FADT.header.length after
the original value is used to check for old revisions.

https://bugzilla.kernel.org/show_bug.cgi?id=42700
https://bugzilla.redhat.com/show_bug.cgi?id=727865

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Cc: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/acpica/tbfadt.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -350,10 +350,6 @@ static void acpi_tb_convert_fadt(void)
 	u32 address32;
 	u32 i;
 
-	/* Update the local FADT table header length */
-
-	acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
-
 	/*
 	 * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
 	 * Later code will always use the X 64-bit field. Also, check for an
@@ -395,6 +391,10 @@ static void acpi_tb_convert_fadt(void)
 		acpi_gbl_FADT.boot_flags = 0;
 	}
 
+	/* Update the local FADT table header length */
+
+	acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
+
 	/*
 	 * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
 	 * generic address structures as necessary. Later code will always use



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

* [ 18/59] modpost: fix ALL_INIT_DATA_SECTIONS
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (16 preceding siblings ...)
  2012-04-11 23:10 ` [ 17/59] ACPICA: Fix regression in FADT revision checks Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 19/59] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value Greg KH
                   ` (40 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jan Beulich, Michal Marek

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Beulich <JBeulich@suse.com>

commit 9aaf440f8fabcebf9ea79a62ccf4c212e6544b49 upstream.

This was lacking a comma between two supposed to be separate strings.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 scripts/mod/modpost.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -849,7 +849,7 @@ static void check_section(const char *mo
 
 #define ALL_INIT_DATA_SECTIONS \
 	".init.setup$", ".init.rodata$", \
-	".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \
+	".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \
 	".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
 #define ALL_EXIT_DATA_SECTIONS \
 	".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"



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

* [ 19/59] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (17 preceding siblings ...)
  2012-04-11 23:10 ` [ 18/59] modpost: fix ALL_INIT_DATA_SECTIONS Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 20/59] tracing: Fix ftrace stack trace entries Greg KH
                   ` (39 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jiang Liu, Jiang Liu, Keping Chen, Thomas Gleixner

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jiang Liu <liuj97@gmail.com>

commit f5cb92ac82d06cb583c1f66666314c5c0a4d7913 upstream.

irq_move_masked_irq() checks the return code of
chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is
also a valid return code, which is there to avoid a redundant copy of
the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid
the redundant copy, we also fail to adjust the thread affinity of an
eventually threaded interrupt handler.

Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return
values correctly by checking the valid return values seperately.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Keping Chen <chenkeping@huawei.com>
Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/irq/migration.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -43,12 +43,16 @@ void irq_move_masked_irq(struct irq_data
 	 * masking the irqs.
 	 */
 	if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
-		   < nr_cpu_ids))
-		if (!chip->irq_set_affinity(&desc->irq_data,
-					    desc->pending_mask, false)) {
+		   < nr_cpu_ids)) {
+		int ret = chip->irq_set_affinity(&desc->irq_data,
+						 desc->pending_mask, false);
+		switch (ret) {
+		case IRQ_SET_MASK_OK:
 			cpumask_copy(desc->irq_data.affinity, desc->pending_mask);
+		case IRQ_SET_MASK_OK_NOCOPY:
 			irq_set_thread_affinity(desc);
 		}
+	}
 
 	cpumask_clear(desc->pending_mask);
 }



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

* [ 20/59] tracing: Fix ftrace stack trace entries
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (18 preceding siblings ...)
  2012-04-11 23:10 ` [ 19/59] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 21/59] tracing: Fix ent_size in trace output Greg KH
                   ` (38 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Wolfgang Mauerer, Steven Rostedt

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>

commit 01de982abf8c9e10fc3089e10585cd2cc914bdab upstream.

8 hex characters tell only half the tale for 64 bit CPUs,
so use the appropriate length.

Link: http://lkml.kernel.org/r/1332411501-8059-2-git-send-email-wolfgang.mauerer@siemens.com

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/trace_entries.h |   16 ++++++++++++----
 kernel/trace/trace_export.c  |    2 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

--- a/kernel/trace/trace_entries.h
+++ b/kernel/trace/trace_entries.h
@@ -156,6 +156,12 @@ FTRACE_ENTRY_DUP(wakeup, ctx_switch_entr
 
 #define FTRACE_STACK_ENTRIES	8
 
+#ifndef CONFIG_64BIT
+# define IP_FMT "%08lx"
+#else
+# define IP_FMT "%016lx"
+#endif
+
 FTRACE_ENTRY(kernel_stack, stack_entry,
 
 	TRACE_STACK,
@@ -165,8 +171,9 @@ FTRACE_ENTRY(kernel_stack, stack_entry,
 		__dynamic_array(unsigned long,	caller	)
 	),
 
-	F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
-		 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
+	F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
+		 "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
+		 "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
 		 __entry->caller[0], __entry->caller[1], __entry->caller[2],
 		 __entry->caller[3], __entry->caller[4], __entry->caller[5],
 		 __entry->caller[6], __entry->caller[7])
@@ -181,8 +188,9 @@ FTRACE_ENTRY(user_stack, userstack_entry
 		__array(	unsigned long,	caller, FTRACE_STACK_ENTRIES	)
 	),
 
-	F_printk("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
-		 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n",
+	F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
+		 "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
+		 "\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n",
 		 __entry->caller[0], __entry->caller[1], __entry->caller[2],
 		 __entry->caller[3], __entry->caller[4], __entry->caller[5],
 		 __entry->caller[6], __entry->caller[7])
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -150,7 +150,7 @@ ftrace_define_fields_##name(struct ftrac
 #define __dynamic_array(type, item)
 
 #undef F_printk
-#define F_printk(fmt, args...) #fmt ", "  __stringify(args)
+#define F_printk(fmt, args...) __stringify(fmt) ", "  __stringify(args)
 
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, etype, tstruct, print)		\



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

* [ 21/59] tracing: Fix ent_size in trace output
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (19 preceding siblings ...)
  2012-04-11 23:10 ` [ 20/59] tracing: Fix ftrace stack trace entries Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 22/59] m68k/mac: Add missing platform check before registering platform devices Greg KH
                   ` (37 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Thomas Gleixner, Steven Rostedt

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steven Rostedt <srostedt@redhat.com>

commit 12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b upstream.

When reading the trace file, the records of each of the per_cpu buffers
are examined to find the next event to print out. At the point of looking
at the event, the size of the event is recorded. But if the first event is
chosen, the other events in the other CPU buffers will reset the event size
that is stored in the iterator descriptor, causing the event size passed to
the output functions to be incorrect.

In most cases this is not a problem, but for the case of stack traces, it
is. With the change to the stack tracing to record a dynamic number of
back traces, the output depends on the size of the entry instead of the
fixed 8 back traces. When the entry size is not correct, the back traces
would not be fully printed.

Note, reading from the per-cpu trace files were not affected.

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/trace.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1642,6 +1642,7 @@ __find_next_entry(struct trace_iterator
 	int cpu_file = iter->cpu_file;
 	u64 next_ts = 0, ts;
 	int next_cpu = -1;
+	int next_size = 0;
 	int cpu;
 
 	/*
@@ -1673,9 +1674,12 @@ __find_next_entry(struct trace_iterator
 			next_cpu = cpu;
 			next_ts = ts;
 			next_lost = lost_events;
+			next_size = iter->ent_size;
 		}
 	}
 
+	iter->ent_size = next_size;
+
 	if (ent_cpu)
 		*ent_cpu = next_cpu;
 



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

* [ 22/59] m68k/mac: Add missing platform check before registering platform devices
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (20 preceding siblings ...)
  2012-04-11 23:10 ` [ 21/59] tracing: Fix ent_size in trace output Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 23/59] mac80211: fix possible tid_rx->reorder_timer use after free Greg KH
                   ` (36 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Geert Uytterhoeven

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <geert@linux-m68k.org>

commit 6cfeba53911d6d2f17ebbd1246893557d5ff5aeb upstream.

On multi-platform kernels, the Mac platform devices should be registered
when running on Mac only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/m68k/mac/config.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -950,6 +950,9 @@ int __init mac_platform_init(void)
 {
 	u8 *swim_base;
 
+	if (!MACH_IS_MAC)
+		return -ENODEV;
+
 	/*
 	 * Serial devices
 	 */



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

* [ 23/59] mac80211: fix possible tid_rx->reorder_timer use after free
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (21 preceding siblings ...)
  2012-04-11 23:10 ` [ 22/59] m68k/mac: Add missing platform check before registering platform devices Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:10 ` [ 24/59] rtlwifi: rtl8192ce: rtl8192cu: rtl8192de: Fix low-gain setting when scanning Greg KH
                   ` (35 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, jan p. springer, Stanislaw Gruszka,
	John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit d72308bff5c2fa207949a5925b020bce74495e33 upstream.

Is possible that we will arm the tid_rx->reorder_timer after
del_timer_sync() in ___ieee80211_stop_rx_ba_session(). We need to stop
timer after RCU grace period finish, so move it to
ieee80211_free_tid_rx(). Timer will not be armed again, as
rcu_dereference(sta->ampdu_mlme.tid_rx[tid]) will return NULL.

Debug object detected problem with the following warning:
ODEBUG: free active (active state 0) object type: timer_list hint: sta_rx_agg_reorder_timer_expired+0x0/0xf0 [mac80211]

Bug report (with all warning messages):
https://bugzilla.redhat.com/show_bug.cgi?id=804007

Reported-by: "jan p. springer" <jsd@igroup.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/mac80211/agg-rx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -49,6 +49,8 @@ static void ieee80211_free_tid_rx(struct
 		container_of(h, struct tid_ampdu_rx, rcu_head);
 	int i;
 
+	del_timer_sync(&tid_rx->reorder_timer);
+
 	for (i = 0; i < tid_rx->buf_size; i++)
 		dev_kfree_skb(tid_rx->reorder_buf[i]);
 	kfree(tid_rx->reorder_buf);
@@ -88,7 +90,6 @@ void ___ieee80211_stop_rx_ba_session(str
 				     tid, 0, reason);
 
 	del_timer_sync(&tid_rx->session_timer);
-	del_timer_sync(&tid_rx->reorder_timer);
 
 	call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
 }



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

* [ 24/59] rtlwifi: rtl8192ce: rtl8192cu: rtl8192de: Fix low-gain setting when scanning
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (22 preceding siblings ...)
  2012-04-11 23:10 ` [ 23/59] mac80211: fix possible tid_rx->reorder_timer use after free Greg KH
@ 2012-04-11 23:10 ` Greg KH
  2012-04-11 23:11 ` [ 25/59] drm: Validate requested virtual size against allocated fb size Greg KH
                   ` (34 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:10 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Larry Finger, John W. Linville

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Larry Finger <Larry.Finger@lwfinger.net>

commit 643c61e119459e9d750087b7b34be94491efebf9 upstream.

In https://bugzilla.redhat.com/show_bug.cgi?id=770207, slowdowns of driver
rtl8192ce are reported. One fix (commit a9b89e2) has already been applied,
and it helped, but the maximum RX speed would still drop to 1 Mbps. As in
the previous fix, the initial gain was determined to be the problem; however,
the problem arises from a setting of the gain when scans are started.

Driver rtl8192de also has the same code structure - this one is fixed as well.

Reported-and-Tested-by: Ivan Pesin <ivan.pesin@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
@@ -1968,7 +1968,7 @@ void rtl92c_phy_set_io(struct ieee80211_
 		break;
 	case IO_CMD_PAUSE_DM_BY_SCAN:
 		rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue;
-		dm_digtable.cur_igvalue = 0x17;
+		dm_digtable.cur_igvalue = 0x37;
 		rtl92c_dm_write_dig(hw);
 		break;
 	default:
--- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
@@ -3192,7 +3192,7 @@ static void rtl92d_phy_set_io(struct iee
 		break;
 	case IO_CMD_PAUSE_DM_BY_SCAN:
 		rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue;
-		de_digtable.cur_igvalue = 0x17;
+		de_digtable.cur_igvalue = 0x37;
 		rtl92d_dm_write_dig(hw);
 		break;
 	default:



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

* [ 25/59] drm: Validate requested virtual size against allocated fb size
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (23 preceding siblings ...)
  2012-04-11 23:10 ` [ 24/59] rtlwifi: rtl8192ce: rtl8192cu: rtl8192de: Fix low-gain setting when scanning Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 26/59] drm/radeon/kms: fix fans after resume Greg KH
                   ` (33 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Chris Wilson, Daniel Vetter, Dave Airlie

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Wilson <chris@chris-wilson.co.uk>

commit 62fb376e214d3c1bfdf6fbb77dac162f6da04d7e upstream.

mplayer -vo fbdev tries to create a screen that is twice as tall as the
allocated framebuffer for "doublebuffering". By default, and all in-tree
users, only sufficient memory is allocated and mapped to satisfy the
smallest framebuffer and the virtual size is no larger than the actual.
For these users, we should therefore reject any userspace request to
create a screen that requires a buffer larger than the framebuffer
originally allocated.

References: https://bugs.freedesktop.org/show_bug.cgi?id=38138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/drm_fb_helper.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -610,9 +610,13 @@ int drm_fb_helper_check_var(struct fb_va
 		return -EINVAL;
 
 	/* Need to resize the fb object !!! */
-	if (var->bits_per_pixel > fb->bits_per_pixel || var->xres > fb->width || var->yres > fb->height) {
+	if (var->bits_per_pixel > fb->bits_per_pixel ||
+	    var->xres > fb->width || var->yres > fb->height ||
+	    var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
 		DRM_DEBUG("fb userspace requested width/height/bpp is greater than current fb "
-			  "object %dx%d-%d > %dx%d-%d\n", var->xres, var->yres, var->bits_per_pixel,
+			  "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
+			  var->xres, var->yres, var->bits_per_pixel,
+			  var->xres_virtual, var->yres_virtual,
 			  fb->width, fb->height, fb->bits_per_pixel);
 		return -EINVAL;
 	}



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

* [ 26/59] drm/radeon/kms: fix fans after resume
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (24 preceding siblings ...)
  2012-04-11 23:11 ` [ 25/59] drm: Validate requested virtual size against allocated fb size Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 27/59] drm/i915: no-lvds quirk on MSI DC500 Greg KH
                   ` (32 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alex Deucher, Michel Dänzer, Dave Airlie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1941 bytes --]

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

commit 402976fe51b2d1a58a29ba06fa1ca5ace3a4cdcd upstream.

On pre-R600 asics, the SpeedFanControl table is not
executed as part of ASIC_Init as it is on newer asics.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29412

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/radeon/atom.c |   15 ++++++++++++++-
 drivers/gpu/drm/radeon/atom.h |    1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -1304,8 +1304,11 @@ struct atom_context *atom_parse(struct c
 
 int atom_asic_init(struct atom_context *ctx)
 {
+	struct radeon_device *rdev = ctx->card->dev->dev_private;
 	int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR);
 	uint32_t ps[16];
+	int ret;
+
 	memset(ps, 0, 64);
 
 	ps[0] = cpu_to_le32(CU32(hwi + ATOM_FWI_DEFSCLK_PTR));
@@ -1315,7 +1318,17 @@ int atom_asic_init(struct atom_context *
 
 	if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT))
 		return 1;
-	return atom_execute_table(ctx, ATOM_CMD_INIT, ps);
+	ret = atom_execute_table(ctx, ATOM_CMD_INIT, ps);
+	if (ret)
+		return ret;
+
+	memset(ps, 0, 64);
+
+	if (rdev->family < CHIP_R600) {
+		if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL))
+			atom_execute_table(ctx, ATOM_CMD_SPDFANCNTL, ps);
+	}
+	return ret;
 }
 
 void atom_destroy(struct atom_context *ctx)
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -44,6 +44,7 @@
 #define ATOM_CMD_SETSCLK	0x0A
 #define ATOM_CMD_SETMCLK	0x0B
 #define ATOM_CMD_SETPCLK	0x0C
+#define ATOM_CMD_SPDFANCNTL	0x39
 
 #define ATOM_DATA_FWI_PTR	0xC
 #define ATOM_DATA_IIO_PTR	0x32



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

* [ 27/59] drm/i915: no-lvds quirk on MSI DC500
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (25 preceding siblings ...)
  2012-04-11 23:11 ` [ 26/59] drm/radeon/kms: fix fans after resume Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 28/59] drm/i915: Sanitize BIOS debugging bits from PIPECONF Greg KH
                   ` (31 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Anisse Astier, Chris Wilson, Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Anisse Astier <anisse@astier.eu>

commit 97effadb65ed08809e1720c8d3ee80b73a93665c upstream.

This hardware doesn't have an LVDS, it's a desktop box. Fix incorrect
LVDS detection.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_lvds.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -731,6 +731,14 @@ static const struct dmi_system_id intel_
 			DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"),
 		},
 	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "MSI Wind Box DC500",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+			DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
+		},
+	},
 
 	{ }	/* terminating entry */
 };



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

* [ 28/59] drm/i915: Sanitize BIOS debugging bits from PIPECONF
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (26 preceding siblings ...)
  2012-04-11 23:11 ` [ 27/59] drm/i915: no-lvds quirk on MSI DC500 Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 29/59] drm/i915: Add lock on drm_helper_resume_force_mode Greg KH
                   ` (30 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Chris Wilson, Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Wilson <chris@chris-wilson.co.uk>

commit f47166d2b0001fcb752b40c5a2d4db986dfbea68 upstream.

Quoting the BSpec from time immemorial:

  PIPEACONF, bits 28:27: Frame Start Delay (Debug)

  Used to delay the frame start signal that is sent to the display planes.
  Care must be taken to insure that there are enough lines during VBLANK
  to support this setting.

An instance of the BIOS leaving these bits set was found in the wild,
where it caused our modesetting to go all squiffy and skewiff.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47271
Reported-and-tested-by: Eva Wang <evawang@linpus.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43012
Reported-and-tested-by: Carl Richell <carl@system76.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/i915_reg.h      |    1 +
 drivers/gpu/drm/i915/intel_display.c |    6 ++++++
 2 files changed, 7 insertions(+)

--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2312,6 +2312,7 @@
 #define   PIPECONF_DISABLE	0
 #define   PIPECONF_DOUBLE_WIDE	(1<<30)
 #define   I965_PIPECONF_ACTIVE	(1<<30)
+#define   PIPECONF_FRAME_START_DELAY_MASK (3<<27)
 #define   PIPECONF_SINGLE_WIDE	0
 #define   PIPECONF_PIPE_UNLOCKED 0
 #define   PIPECONF_PIPE_LOCKED	(1<<25)
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7278,6 +7278,12 @@ static void intel_sanitize_modesetting(s
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 reg, val;
 
+	/* Clear any frame start delays used for debugging left by the BIOS */
+	for_each_pipe(pipe) {
+		reg = PIPECONF(pipe);
+		I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
+	}
+
 	if (HAS_PCH_SPLIT(dev))
 		return;
 



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

* [ 29/59] drm/i915: Add lock on drm_helper_resume_force_mode
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (27 preceding siblings ...)
  2012-04-11 23:11 ` [ 28/59] drm/i915: Sanitize BIOS debugging bits from PIPECONF Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 30/59] drm/i915: quirk away broken OpRegion VBT Greg KH
                   ` (29 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Sean Paul, Chris Wilson, Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sean Paul <seanpaul@chromium.org>

commit 927a2f119e8235238a2fc64871051b16c9bdae75 upstream.

i915_drm_thaw was not locking the mode_config lock when calling
drm_helper_resume_force_mode. When there were multiple wake sources,
this caused FDI training failure on SNB which in turn corrupted the
display.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/i915_drv.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -508,7 +508,9 @@ static int i915_drm_thaw(struct drm_devi
 		drm_irq_install(dev);
 
 		/* Resume the modeset for every activated CRTC */
+		mutex_lock(&dev->mode_config.mutex);
 		drm_helper_resume_force_mode(dev);
+		mutex_unlock(&dev->mode_config.mutex);
 
 		if (IS_IRONLAKE_M(dev))
 			ironlake_enable_rc6(dev);



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

* [ 30/59] drm/i915: quirk away broken OpRegion VBT
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (28 preceding siblings ...)
  2012-04-11 23:11 ` [ 29/59] drm/i915: Add lock on drm_helper_resume_force_mode Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 31/59] r8169: runtime resume before shutdown Greg KH
                   ` (28 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Markus Heinz, Chris Wilson, Rodrigo Vivi,
	Daniel Vetter

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 25e341cfc33d94435472983825163e97fe370a6c upstream.

Somehow the BIOS manages to screw things up when copying the VBT
around, because the one we scrap from the VBIOS rom actually works.

Tested-by: Markus Heinz <markus.heinz@uni-dortmund.de>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_bios.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -24,6 +24,7 @@
  *    Eric Anholt <eric@anholt.net>
  *
  */
+#include <linux/dmi.h>
 #include <drm/drm_dp_helper.h>
 #include "drmP.h"
 #include "drm.h"
@@ -621,6 +622,26 @@ init_vbt_defaults(struct drm_i915_privat
 	dev_priv->edp.bpp = 18;
 }
 
+static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
+{
+	DRM_DEBUG_KMS("Falling back to manually reading VBT from "
+		      "VBIOS ROM for %s\n",
+		      id->ident);
+	return 1;
+}
+
+static const struct dmi_system_id intel_no_opregion_vbt[] = {
+	{
+		.callback = intel_no_opregion_vbt_callback,
+		.ident = "ThinkCentre A57",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
+		},
+	},
+	{ }
+};
+
 /**
  * intel_parse_bios - find VBT and initialize settings from the BIOS
  * @dev: DRM device
@@ -641,7 +662,7 @@ intel_parse_bios(struct drm_device *dev)
 	init_vbt_defaults(dev_priv);
 
 	/* XXX Should this validation be moved to intel_opregion.c? */
-	if (dev_priv->opregion.vbt) {
+	if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
 		struct vbt_header *vbt = dev_priv->opregion.vbt;
 		if (memcmp(vbt->signature, "$VBT", 4) == 0) {
 			DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",



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

* [ 31/59] r8169: runtime resume before shutdown.
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (29 preceding siblings ...)
  2012-04-11 23:11 ` [ 30/59] drm/i915: quirk away broken OpRegion VBT Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 32/59] target: Fix unsupported WRITE_SAME sense payload Greg KH
                   ` (27 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Sameer Nanda, Francois Romieu,
	Rafael J. Wysocki, Hayes Wang, Alan Stern, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu@fr.zoreil.com>

commit 2a15cd2ff488a9fdb55e5e34060f499853b27c77 upstream.

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor. As the device was programmed by .runtime_suspend() to wake
on link changes, it is thus brought back up as soon as the link recovers.

Resuming every suspended device through the driver core would slow things
down and it is not clear how many devices really need it now.

Original report and D0 transition patch by Sameer Nanda. Patch has been
changed to comply with advices by Rafael J. Wysocki and the PM folks.

Reported-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Hayes Wang <hayeswang@realtek.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/realtek/r8169.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6194,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rtl8169_private *tp = netdev_priv(dev);
+	struct device *d = &pdev->dev;
+
+	pm_runtime_get_sync(d);
 
 	rtl8169_net_suspend(dev);
 
@@ -6215,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev
 		pci_wake_from_d3(pdev, true);
 		pci_set_power_state(pdev, PCI_D3hot);
 	}
+
+	pm_runtime_put_noidle(d);
 }
 
 static struct pci_driver rtl8169_pci_driver = {



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

* [ 32/59] target: Fix unsupported WRITE_SAME sense payload
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (30 preceding siblings ...)
  2012-04-11 23:11 ` [ 31/59] r8169: runtime resume before shutdown Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 33/59] kgdb,debug_core: pass the breakpoint struct instead of address and memory Greg KH
                   ` (26 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Martin Svec, Nicholas Bellinger

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin Svec <martin.svec@zoner.cz>

commit 67236c44741e250199ccd77f1115568e68cf8848 upstream.

This patch fixes a bug in target-core where unsupported WRITE_SAME ops
from a target_check_write_same_discard() failure was incorrectly
returning CHECK_CONDITION w/ TCM_INVALID_CDB_FIELD sense data.
This was causing some clients to not properly fall back, so go ahead
and use the correct TCM_UNSUPPORTED_SCSI_OPCODE sense for this case.

Reported-by: Martin Svec <martin.svec@zoner.cz>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/target_core_transport.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2666,7 +2666,7 @@ static int transport_generic_cmd_sequenc
 			cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
 
 			if (target_check_write_same_discard(&cdb[10], dev) < 0)
-				goto out_invalid_cdb_field;
+				goto out_unsupported_cdb;
 			if (!passthrough)
 				cmd->execute_task = target_emulate_write_same;
 			break;
@@ -2949,7 +2949,7 @@ static int transport_generic_cmd_sequenc
 		cmd->se_cmd_flags |= SCF_SCSI_CONTROL_SG_IO_CDB;
 
 		if (target_check_write_same_discard(&cdb[1], dev) < 0)
-			goto out_invalid_cdb_field;
+			goto out_unsupported_cdb;
 		if (!passthrough)
 			cmd->execute_task = target_emulate_write_same;
 		break;
@@ -2972,7 +2972,7 @@ static int transport_generic_cmd_sequenc
 		 * of byte 1 bit 3 UNMAP instead of original reserved field
 		 */
 		if (target_check_write_same_discard(&cdb[1], dev) < 0)
-			goto out_invalid_cdb_field;
+			goto out_unsupported_cdb;
 		if (!passthrough)
 			cmd->execute_task = target_emulate_write_same;
 		break;



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

* [ 33/59] kgdb,debug_core: pass the breakpoint struct instead of address and memory
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (31 preceding siblings ...)
  2012-04-11 23:11 ` [ 32/59] target: Fix unsupported WRITE_SAME sense payload Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 34/59] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA Greg KH
                   ` (25 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jason Wessel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit 98b54aa1a2241b59372468bd1e9c2d207bdba54b upstream.

There is extra state information that needs to be exposed in the
kgdb_bpt structure for tracking how a breakpoint was installed.  The
debug_core only uses the the probe_kernel_write() to install
breakpoints, but this is not enough for all the archs.  Some arch such
as x86 need to use text_poke() in order to install a breakpoint into a
read only page.

Passing the kgdb_bpt structure to kgdb_arch_set_breakpoint() and
kgdb_arch_remove_breakpoint() allows other archs to set the type
variable which indicates how the breakpoint was installed.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/kgdb.h      |    4 +--
 kernel/debug/debug_core.c |   53 ++++++++++++++++++++--------------------------
 2 files changed, 26 insertions(+), 31 deletions(-)

--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -207,8 +207,8 @@ extern void kgdb_arch_set_pc(struct pt_r
 
 /* Optional functions. */
 extern int kgdb_validate_break_address(unsigned long addr);
-extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr);
-extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle);
+extern int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt);
+extern int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt);
 
 /**
  *	kgdb_arch_late - Perform any architecture specific initalization.
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -157,37 +157,39 @@ early_param("nokgdbroundup", opt_nokgdbr
  * Weak aliases for breakpoint management,
  * can be overriden by architectures when needed:
  */
-int __weak kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
+int __weak kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
 {
 	int err;
 
-	err = probe_kernel_read(saved_instr, (char *)addr, BREAK_INSTR_SIZE);
+	err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
+				BREAK_INSTR_SIZE);
 	if (err)
 		return err;
-
-	return probe_kernel_write((char *)addr, arch_kgdb_ops.gdb_bpt_instr,
-				  BREAK_INSTR_SIZE);
+	err = probe_kernel_write((char *)bpt->bpt_addr,
+				 arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
+	return err;
 }
 
-int __weak kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
+int __weak kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
 {
-	return probe_kernel_write((char *)addr,
-				  (char *)bundle, BREAK_INSTR_SIZE);
+	return probe_kernel_write((char *)bpt->bpt_addr,
+				  (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
 }
 
 int __weak kgdb_validate_break_address(unsigned long addr)
 {
-	char tmp_variable[BREAK_INSTR_SIZE];
+	struct kgdb_bkpt tmp;
 	int err;
-	/* Validate setting the breakpoint and then removing it.  In the
+	/* Validate setting the breakpoint and then removing it.  If the
 	 * remove fails, the kernel needs to emit a bad message because we
 	 * are deep trouble not being able to put things back the way we
 	 * found them.
 	 */
-	err = kgdb_arch_set_breakpoint(addr, tmp_variable);
+	tmp.bpt_addr = addr;
+	err = kgdb_arch_set_breakpoint(&tmp);
 	if (err)
 		return err;
-	err = kgdb_arch_remove_breakpoint(addr, tmp_variable);
+	err = kgdb_arch_remove_breakpoint(&tmp);
 	if (err)
 		printk(KERN_ERR "KGDB: Critical breakpoint error, kernel "
 		   "memory destroyed at: %lx", addr);
@@ -231,7 +233,6 @@ static void kgdb_flush_swbreak_addr(unsi
  */
 int dbg_activate_sw_breakpoints(void)
 {
-	unsigned long addr;
 	int error;
 	int ret = 0;
 	int i;
@@ -240,16 +241,15 @@ int dbg_activate_sw_breakpoints(void)
 		if (kgdb_break[i].state != BP_SET)
 			continue;
 
-		addr = kgdb_break[i].bpt_addr;
-		error = kgdb_arch_set_breakpoint(addr,
-				kgdb_break[i].saved_instr);
+		error = kgdb_arch_set_breakpoint(&kgdb_break[i]);
 		if (error) {
 			ret = error;
-			printk(KERN_INFO "KGDB: BP install failed: %lx", addr);
+			printk(KERN_INFO "KGDB: BP install failed: %lx",
+			       kgdb_break[i].bpt_addr);
 			continue;
 		}
 
-		kgdb_flush_swbreak_addr(addr);
+		kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
 		kgdb_break[i].state = BP_ACTIVE;
 	}
 	return ret;
@@ -298,7 +298,6 @@ int dbg_set_sw_break(unsigned long addr)
 
 int dbg_deactivate_sw_breakpoints(void)
 {
-	unsigned long addr;
 	int error;
 	int ret = 0;
 	int i;
@@ -306,15 +305,14 @@ int dbg_deactivate_sw_breakpoints(void)
 	for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
 		if (kgdb_break[i].state != BP_ACTIVE)
 			continue;
-		addr = kgdb_break[i].bpt_addr;
-		error = kgdb_arch_remove_breakpoint(addr,
-					kgdb_break[i].saved_instr);
+		error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
 		if (error) {
-			printk(KERN_INFO "KGDB: BP remove failed: %lx\n", addr);
+			printk(KERN_INFO "KGDB: BP remove failed: %lx\n",
+			       kgdb_break[i].bpt_addr);
 			ret = error;
 		}
 
-		kgdb_flush_swbreak_addr(addr);
+		kgdb_flush_swbreak_addr(kgdb_break[i].bpt_addr);
 		kgdb_break[i].state = BP_SET;
 	}
 	return ret;
@@ -348,7 +346,6 @@ int kgdb_isremovedbreak(unsigned long ad
 
 int dbg_remove_all_break(void)
 {
-	unsigned long addr;
 	int error;
 	int i;
 
@@ -356,12 +353,10 @@ int dbg_remove_all_break(void)
 	for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
 		if (kgdb_break[i].state != BP_ACTIVE)
 			goto setundefined;
-		addr = kgdb_break[i].bpt_addr;
-		error = kgdb_arch_remove_breakpoint(addr,
-				kgdb_break[i].saved_instr);
+		error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);
 		if (error)
 			printk(KERN_ERR "KGDB: breakpoint remove failed: %lx\n",
-			   addr);
+			       kgdb_break[i].bpt_addr);
 setundefined:
 		kgdb_break[i].state = BP_UNDEFINED;
 	}



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

* [ 34/59] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (32 preceding siblings ...)
  2012-04-11 23:11 ` [ 33/59] kgdb,debug_core: pass the breakpoint struct instead of address and memory Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 35/59] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP Greg KH
                   ` (24 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jason Wessel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit 456ca7ff24841bf2d2a2dfd690fe7d42ef70d932 upstream.

On x86 the kgdb test suite will oops when the kernel is compiled with
CONFIG_DEBUG_RODATA and you run the tests after boot time. This is
regression has existed since 2.6.26 by commit: b33cb815 (kgdbts: Use
HW breakpoints with CONFIG_DEBUG_RODATA).

The test suite can use hw breakpoints for all the tests, but it has to
execute the hardware breakpoint specific tests first in order to
determine that the hw breakpoints actually work.  Specifically the
very first test causes an oops:

# echo V1I1 > /sys/module/kgdbts/parameters/kgdbts
kgdb: Registered I/O driver kgdbts.
kgdbts:RUN plant and detach test

Entering kdb (current=0xffff880017aa9320, pid 1078) on processor 0 due to Keyboard Entry
[0]kdb> kgdbts: ERROR PUT: end of test buffer on 'plant_and_detach_test' line 1 expected OK got $E14#aa
WARNING: at drivers/misc/kgdbts.c:730 run_simple_test+0x151/0x2c0()
[...oops clipped...]

This commit re-orders the running of the tests and puts the RODATA
check into its own function so as to correctly avoid the kernel oops
by detecting and using the hw breakpoints.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/kgdbts.c |   52 ++++++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 24 deletions(-)

--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -885,6 +885,22 @@ static void run_singlestep_break_test(vo
 	kgdbts_break_test();
 }
 
+static void test_debug_rodata(void)
+{
+#ifdef CONFIG_DEBUG_RODATA
+	/* Until there is an api to write to read-only text segments, use
+	 * HW breakpoints for the remainder of any tests, else print a
+	 * failure message if hw breakpoints do not work.
+	 */
+	if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
+		eprintk("kgdbts: HW breakpoints BROKEN, ending tests\n");
+		return;
+	}
+	force_hwbrks = 1;
+	v1printk("kgdbts:Using HW breakpoints for SW breakpoint tests\n");
+#endif /* CONFIG_DEBUG_RODATA */
+}
+
 static void kgdbts_run_tests(void)
 {
 	char *ptr;
@@ -907,6 +923,18 @@ static void kgdbts_run_tests(void)
 	if (ptr)
 		sstep_test = simple_strtol(ptr+1, NULL, 10);
 
+	/* All HW break point tests */
+	if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
+		hwbreaks_ok = 1;
+		v1printk("kgdbts:RUN hw breakpoint test\n");
+		run_breakpoint_test(1);
+		v1printk("kgdbts:RUN hw write breakpoint test\n");
+		run_hw_break_test(1);
+		v1printk("kgdbts:RUN access write breakpoint test\n");
+		run_hw_break_test(0);
+	}
+	test_debug_rodata();
+
 	/* required internal KGDB tests */
 	v1printk("kgdbts:RUN plant and detach test\n");
 	run_plant_and_detach_test(0);
@@ -924,35 +952,11 @@ static void kgdbts_run_tests(void)
 
 	/* ===Optional tests=== */
 
-	/* All HW break point tests */
-	if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT) {
-		hwbreaks_ok = 1;
-		v1printk("kgdbts:RUN hw breakpoint test\n");
-		run_breakpoint_test(1);
-		v1printk("kgdbts:RUN hw write breakpoint test\n");
-		run_hw_break_test(1);
-		v1printk("kgdbts:RUN access write breakpoint test\n");
-		run_hw_break_test(0);
-	}
-
 	if (nmi_sleep) {
 		v1printk("kgdbts:RUN NMI sleep %i seconds test\n", nmi_sleep);
 		run_nmi_sleep_test(nmi_sleep);
 	}
 
-#ifdef CONFIG_DEBUG_RODATA
-	/* Until there is an api to write to read-only text segments, use
-	 * HW breakpoints for the remainder of any tests, else print a
-	 * failure message if hw breakpoints do not work.
-	 */
-	if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
-		eprintk("kgdbts: HW breakpoints do not work,"
-			"skipping remaining tests\n");
-		return;
-	}
-	force_hwbrks = 1;
-#endif /* CONFIG_DEBUG_RODATA */
-
 	/* If the do_fork test is run it will be the last test that is
 	 * executed because a kernel thread will be spawned at the very
 	 * end to unregister the debug hooks.



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

* [ 35/59] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (33 preceding siblings ...)
  2012-04-11 23:11 ` [ 34/59] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 36/59] kgdbts: (2 " Greg KH
                   ` (23 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jason Wessel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit 486c5987a00a89d56c2c04c506417ef8f823ca2e upstream.

The do_fork and sys_open tests have never worked properly on anything
other than a UP configuration with the kgdb test suite.  This is
because the test suite did not fully implement the behavior of a real
debugger.  A real debugger tracks the state of what thread it asked to
single step and can correctly continue other threads of execution or
conditionally stop while waiting for the original thread single step
request to return.

Below is a simple method to cause a fatal kernel oops with the kgdb
test suite on a 4 processor x86 system:

while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
echo V1I1F1000 > /sys/module/kgdbts/parameters/kgdbts

Very soon after starting the test the kernel will oops with a message like:

kgdbts: BP mismatch 3b7da66480 expected ffffffff8106a590
WARNING: at drivers/misc/kgdbts.c:303 check_and_rewind_pc+0xe0/0x100()
Call Trace:
 [<ffffffff812994a0>] check_and_rewind_pc+0xe0/0x100
 [<ffffffff81298945>] validate_simple_test+0x25/0xc0
 [<ffffffff81298f77>] run_simple_test+0x107/0x2c0
 [<ffffffff81298a18>] kgdbts_put_char+0x18/0x20

The warn will turn to a hard kernel crash shortly after that because
the pc will not get properly rewound to the right value after hitting
a breakpoint leading to a hard lockup.

This change is broken up into 2 pieces because archs that have hw
single stepping (2.6.26 and up) need different changes than archs that
do not have hw single stepping (3.0 and up).  This change implements
the correct behavior for an arch that supports hw single stepping.

A minor defect was fixed where sys_open should be do_sys_open
for the sys_open break point test.  This solves the problem of running
a 64 bit with a 32 bit user space.  The sys_open() never gets called
when using the 32 bit file system for the kgdb testsuite because the
32 bit binaries invoke the compat_sys_open() call leading to the test
never completing.

In order to mimic a real debugger, the kgdb test suite now tracks the
most recent thread that was continued (cont_thread_id), with the
intent to single step just this thread.  When the response to the
single step request stops in a different thread that hit the original
break point that thread will now get continued, while the debugger
waits for the thread with the single step pending.  Here is a high
level description of the sequence of events.

   cont_instead_of_sstep = 0;

1) set breakpoint at do_fork
2) continue
3)   Save the thread id where we stop to cont_thread_id
4) Remove breakpoint at do_fork
5) Reset the PC if needed depending on kernel exception type
6) if (cont_instead_of_sstep) { continue } else { single step }
7)   Check where we stopped
       if current thread != cont_thread_id {
           cont_instead_of_sstep = 1;
           goto step 5
       } else {
           cont_instead_of_sstep = 0;
       }
8) clean up and run test again if needed

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/kgdbts.c |   54 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 11 deletions(-)

--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -134,6 +134,9 @@ static int force_hwbrks;
 static int hwbreaks_ok;
 static int hw_break_val;
 static int hw_break_val2;
+static int cont_instead_of_sstep;
+static unsigned long cont_thread_id;
+static unsigned long sstep_thread_id;
 #if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_SPARC)
 static int arch_needs_sstep_emulation = 1;
 #else
@@ -211,7 +214,7 @@ static unsigned long lookup_addr(char *a
 	if (!strcmp(arg, "kgdbts_break_test"))
 		addr = (unsigned long)kgdbts_break_test;
 	else if (!strcmp(arg, "sys_open"))
-		addr = (unsigned long)sys_open;
+		addr = (unsigned long)do_sys_open;
 	else if (!strcmp(arg, "do_fork"))
 		addr = (unsigned long)do_fork;
 	else if (!strcmp(arg, "hw_break_val"))
@@ -283,6 +286,16 @@ static void hw_break_val_write(void)
 	hw_break_val++;
 }
 
+static int get_thread_id_continue(char *put_str, char *arg)
+{
+	char *ptr = &put_str[11];
+
+	if (put_str[1] != 'T' || put_str[2] != '0')
+		return 1;
+	kgdb_hex2long(&ptr, &cont_thread_id);
+	return 0;
+}
+
 static int check_and_rewind_pc(char *put_str, char *arg)
 {
 	unsigned long addr = lookup_addr(arg);
@@ -324,6 +337,18 @@ static int check_single_step(char *put_s
 	gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
 	v2printk("Singlestep stopped at IP: %lx\n",
 		   instruction_pointer(&kgdbts_regs));
+
+	if (sstep_thread_id != cont_thread_id && !arch_needs_sstep_emulation) {
+		/*
+		 * Ensure we stopped in the same thread id as before, else the
+		 * debugger should continue until the original thread that was
+		 * single stepped is scheduled again, emulating gdb's behavior.
+		 */
+		v2printk("ThrID does not match: %lx\n", cont_thread_id);
+		cont_instead_of_sstep = 1;
+		ts.idx -= 4;
+		return 0;
+	}
 	if (instruction_pointer(&kgdbts_regs) == addr) {
 		eprintk("kgdbts: SingleStep failed at %lx\n",
 			   instruction_pointer(&kgdbts_regs));
@@ -368,7 +393,12 @@ static int got_break(char *put_str, char
 static void emul_sstep_get(char *arg)
 {
 	if (!arch_needs_sstep_emulation) {
-		fill_get_buf(arg);
+		if (cont_instead_of_sstep) {
+			cont_instead_of_sstep = 0;
+			fill_get_buf("c");
+		} else {
+			fill_get_buf(arg);
+		}
 		return;
 	}
 	switch (sstep_state) {
@@ -398,9 +428,11 @@ static void emul_sstep_get(char *arg)
 static int emul_sstep_put(char *put_str, char *arg)
 {
 	if (!arch_needs_sstep_emulation) {
-		if (!strncmp(put_str+1, arg, 2))
-			return 0;
-		return 1;
+		char *ptr = &put_str[11];
+		if (put_str[1] != 'T' || put_str[2] != '0')
+			return 1;
+		kgdb_hex2long(&ptr, &sstep_thread_id);
+		return 0;
 	}
 	switch (sstep_state) {
 	case 1:
@@ -502,10 +534,10 @@ static struct test_struct bad_read_test[
 static struct test_struct singlestep_break_test[] = {
 	{ "?", "S0*" }, /* Clear break points */
 	{ "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
-	{ "c", "T0*", }, /* Continue */
+	{ "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
+	{ "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "g", "kgdbts_break_test", NULL, check_and_rewind_pc },
 	{ "write", "OK", write_regs }, /* Write registers */
-	{ "kgdbts_break_test", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
 	{ "g", "kgdbts_break_test", NULL, check_single_step },
 	{ "kgdbts_break_test", "OK", sw_break, }, /* set sw breakpoint */
@@ -523,10 +555,10 @@ static struct test_struct singlestep_bre
 static struct test_struct do_fork_test[] = {
 	{ "?", "S0*" }, /* Clear break points */
 	{ "do_fork", "OK", sw_break, }, /* set sw breakpoint */
-	{ "c", "T0*", }, /* Continue */
+	{ "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
+	{ "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
 	{ "write", "OK", write_regs }, /* Write registers */
-	{ "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
 	{ "g", "do_fork", NULL, check_single_step },
 	{ "do_fork", "OK", sw_break, }, /* set sw breakpoint */
@@ -541,10 +573,10 @@ static struct test_struct do_fork_test[]
 static struct test_struct sys_open_test[] = {
 	{ "?", "S0*" }, /* Clear break points */
 	{ "sys_open", "OK", sw_break, }, /* set sw breakpoint */
-	{ "c", "T0*", }, /* Continue */
+	{ "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
+	{ "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
 	{ "write", "OK", write_regs }, /* Write registers */
-	{ "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
 	{ "g", "sys_open", NULL, check_single_step },
 	{ "sys_open", "OK", sw_break, }, /* set sw breakpoint */



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

* [ 36/59] kgdbts: (2 of 2) fix single step awareness to work correctly with SMP
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (34 preceding siblings ...)
  2012-04-11 23:11 ` [ 35/59] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 37/59] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() Greg KH
                   ` (22 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jason Wessel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit 23bbd8e346f1ef3fc1219c79cea53d8d52b207d8 upstream.

The do_fork and sys_open tests have never worked properly on anything
other than a UP configuration with the kgdb test suite.  This is
because the test suite did not fully implement the behavior of a real
debugger.  A real debugger tracks the state of what thread it asked to
single step and can correctly continue other threads of execution or
conditionally stop while waiting for the original thread single step
request to return.

Below is a simple method to cause a fatal kernel oops with the kgdb
test suite on a 2 processor ARM system:

while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
echo V1I1F100 > /sys/module/kgdbts/parameters/kgdbts

Very soon after starting the test the kernel will start warning with
messages like:

kgdbts: BP mismatch c002487c expected c0024878
------------[ cut here ]------------
WARNING: at drivers/misc/kgdbts.c:317 check_and_rewind_pc+0x9c/0xc4()
[<c01f6520>] (check_and_rewind_pc+0x9c/0xc4)
[<c01f595c>] (validate_simple_test+0x3c/0xc4)
[<c01f60d4>] (run_simple_test+0x1e8/0x274)

The kernel will eventually recovers, but the test suite has completely
failed to test anything useful.

This patch implements behavior similar to a real debugger that does
not rely on hardware single stepping by using only software planted
breakpoints.

In order to mimic a real debugger, the kgdb test suite now tracks the
most recent thread that was continued (cont_thread_id), with the
intent to single step just this thread.  When the response to the
single step request stops in a different thread that hit the original
break point that thread will now get continued, while the debugger
waits for the thread with the single step pending.  Here is a high
level description of the sequence of events.

   cont_instead_of_sstep = 0;

1) set breakpoint at do_fork
2) continue
3)   Save the thread id where we stop to cont_thread_id
4) Remove breakpoint at do_fork
5) Reset the PC if needed depending on kernel exception type
6) soft single step
7)   Check where we stopped
       if current thread != cont_thread_id {
           if (here for more than 2 times for the same thead) {
              ### must be a really busy system, start test again ###
	      goto step 1
           }
           goto step 5
       } else {
           cont_instead_of_sstep = 0;
       }
8) clean up and run test again if needed
9) Clear out any threads that were waiting on a break point at the
   point in time the test is ended with get_cont_catch().  This
   happens sometimes because breakpoints are used in place of single
   stepping and some threads could have been in the debugger exception
   handling queue because breakpoints were hit concurrently on
   different CPUs.  This also means we wait at least one second before
   unplumbing the debugger connection at the very end, so as respond
   to any debug threads waiting to be serviced.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/kgdbts.c |   73 ++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 62 insertions(+), 11 deletions(-)

--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -142,7 +142,9 @@ static int arch_needs_sstep_emulation =
 #else
 static int arch_needs_sstep_emulation;
 #endif
+static unsigned long cont_addr;
 static unsigned long sstep_addr;
+static int restart_from_top_after_write;
 static int sstep_state;
 
 /* Storage for the registers, in GDB format. */
@@ -190,7 +192,8 @@ static int kgdbts_unreg_thread(void *ptr
 	 */
 	while (!final_ack)
 		msleep_interruptible(1500);
-
+	/* Pause for any other threads to exit after final ack. */
+	msleep_interruptible(1000);
 	if (configured)
 		kgdb_unregister_io_module(&kgdbts_io_ops);
 	configured = 0;
@@ -312,13 +315,21 @@ static int check_and_rewind_pc(char *put
 	if (addr + BREAK_INSTR_SIZE == ip)
 		offset = -BREAK_INSTR_SIZE;
 #endif
-	if (strcmp(arg, "silent") && ip + offset != addr) {
+
+	if (arch_needs_sstep_emulation && sstep_addr &&
+	    ip + offset == sstep_addr &&
+	    ((!strcmp(arg, "sys_open") || !strcmp(arg, "do_fork")))) {
+		/* This is special case for emulated single step */
+		v2printk("Emul: rewind hit single step bp\n");
+		restart_from_top_after_write = 1;
+	} else if (strcmp(arg, "silent") && ip + offset != addr) {
 		eprintk("kgdbts: BP mismatch %lx expected %lx\n",
 			   ip + offset, addr);
 		return 1;
 	}
 	/* Readjust the instruction pointer if needed */
 	ip += offset;
+	cont_addr = ip;
 #ifdef GDB_ADJUSTS_BREAK_OFFSET
 	instruction_pointer_set(&kgdbts_regs, ip);
 #endif
@@ -328,6 +339,8 @@ static int check_and_rewind_pc(char *put
 static int check_single_step(char *put_str, char *arg)
 {
 	unsigned long addr = lookup_addr(arg);
+	static int matched_id;
+
 	/*
 	 * From an arch indepent point of view the instruction pointer
 	 * should be on a different instruction
@@ -338,17 +351,28 @@ static int check_single_step(char *put_s
 	v2printk("Singlestep stopped at IP: %lx\n",
 		   instruction_pointer(&kgdbts_regs));
 
-	if (sstep_thread_id != cont_thread_id && !arch_needs_sstep_emulation) {
+	if (sstep_thread_id != cont_thread_id) {
 		/*
 		 * Ensure we stopped in the same thread id as before, else the
 		 * debugger should continue until the original thread that was
 		 * single stepped is scheduled again, emulating gdb's behavior.
 		 */
 		v2printk("ThrID does not match: %lx\n", cont_thread_id);
+		if (arch_needs_sstep_emulation) {
+			if (matched_id &&
+			    instruction_pointer(&kgdbts_regs) != addr)
+				goto continue_test;
+			matched_id++;
+			ts.idx -= 2;
+			sstep_state = 0;
+			return 0;
+		}
 		cont_instead_of_sstep = 1;
 		ts.idx -= 4;
 		return 0;
 	}
+continue_test:
+	matched_id = 0;
 	if (instruction_pointer(&kgdbts_regs) == addr) {
 		eprintk("kgdbts: SingleStep failed at %lx\n",
 			   instruction_pointer(&kgdbts_regs));
@@ -390,6 +414,31 @@ static int got_break(char *put_str, char
 	return 1;
 }
 
+static void get_cont_catch(char *arg)
+{
+	/* Always send detach because the test is completed at this point */
+	fill_get_buf("D");
+}
+
+static int put_cont_catch(char *put_str, char *arg)
+{
+	/* This is at the end of the test and we catch any and all input */
+	v2printk("kgdbts: cleanup task: %lx\n", sstep_thread_id);
+	ts.idx--;
+	return 0;
+}
+
+static int emul_reset(char *put_str, char *arg)
+{
+	if (strncmp(put_str, "$OK", 3))
+		return 1;
+	if (restart_from_top_after_write) {
+		restart_from_top_after_write = 0;
+		ts.idx = -1;
+	}
+	return 0;
+}
+
 static void emul_sstep_get(char *arg)
 {
 	if (!arch_needs_sstep_emulation) {
@@ -443,8 +492,7 @@ static int emul_sstep_put(char *put_str,
 		v2printk("Stopped at IP: %lx\n",
 			 instruction_pointer(&kgdbts_regs));
 		/* Want to stop at IP + break instruction size by default */
-		sstep_addr = instruction_pointer(&kgdbts_regs) +
-			BREAK_INSTR_SIZE;
+		sstep_addr = cont_addr + BREAK_INSTR_SIZE;
 		break;
 	case 2:
 		if (strncmp(put_str, "$OK", 3)) {
@@ -456,6 +504,9 @@ static int emul_sstep_put(char *put_str,
 		if (strncmp(put_str, "$T0", 3)) {
 			eprintk("kgdbts: failed continue sstep\n");
 			return 1;
+		} else {
+			char *ptr = &put_str[11];
+			kgdb_hex2long(&ptr, &sstep_thread_id);
 		}
 		break;
 	case 4:
@@ -558,13 +609,13 @@ static struct test_struct do_fork_test[]
 	{ "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
 	{ "do_fork", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "g", "do_fork", NULL, check_and_rewind_pc }, /* check location */
-	{ "write", "OK", write_regs }, /* Write registers */
+	{ "write", "OK", write_regs, emul_reset }, /* Write registers */
 	{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
 	{ "g", "do_fork", NULL, check_single_step },
 	{ "do_fork", "OK", sw_break, }, /* set sw breakpoint */
 	{ "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
 	{ "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
-	{ "", "" },
+	{ "", "", get_cont_catch, put_cont_catch },
 };
 
 /* Test for hitting a breakpoint at sys_open for what ever the number
@@ -576,13 +627,13 @@ static struct test_struct sys_open_test[
 	{ "c", "T0*", NULL, get_thread_id_continue }, /* Continue */
 	{ "sys_open", "OK", sw_rem_break }, /*remove breakpoint */
 	{ "g", "sys_open", NULL, check_and_rewind_pc }, /* check location */
-	{ "write", "OK", write_regs }, /* Write registers */
+	{ "write", "OK", write_regs, emul_reset }, /* Write registers */
 	{ "s", "T0*", emul_sstep_get, emul_sstep_put }, /* Single step */
 	{ "g", "sys_open", NULL, check_single_step },
 	{ "sys_open", "OK", sw_break, }, /* set sw breakpoint */
 	{ "7", "T0*", skip_back_repeat_test }, /* Loop based on repeat_test */
 	{ "D", "OK", NULL, final_ack_set }, /* detach and unregister I/O */
-	{ "", "" },
+	{ "", "", get_cont_catch, put_cont_catch },
 };
 
 /*
@@ -725,8 +776,8 @@ static int run_simple_test(int is_get_ch
 	/* This callback is a put char which is when kgdb sends data to
 	 * this I/O module.
 	 */
-	if (ts.tst[ts.idx].get[0] == '\0' &&
-		ts.tst[ts.idx].put[0] == '\0') {
+	if (ts.tst[ts.idx].get[0] == '\0' && ts.tst[ts.idx].put[0] == '\0' &&
+	    !ts.tst[ts.idx].get_handler) {
 		eprintk("kgdbts: ERROR: beyond end of test on"
 			   " '%s' line %i\n", ts.name, ts.idx);
 		return 0;



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

* [ 37/59] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke()
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (35 preceding siblings ...)
  2012-04-11 23:11 ` [ 36/59] kgdbts: (2 " Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 38/59] CIFS: Fix VFS lock usage for oplocked files Greg KH
                   ` (21 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Jason Wessel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit 3751d3e85cf693e10e2c47c03c8caa65e171099b upstream.

There has long been a limitation using software breakpoints with a
kernel compiled with CONFIG_DEBUG_RODATA going back to 2.6.26. For
this particular patch, it will apply cleanly and has been tested all
the way back to 2.6.36.

The kprobes code uses the text_poke() function which accommodates
writing a breakpoint into a read-only page.  The x86 kgdb code can
solve the problem similarly by overriding the default breakpoint
set/remove routines and using text_poke() directly.

The x86 kgdb code will first attempt to use the traditional
probe_kernel_write(), and next try using a the text_poke() function.
The break point install method is tracked such that the correct break
point removal routine will get called later on.

Cc: x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Inspried-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/kgdb.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/misc/kgdbts.c  |   17 -------------
 include/linux/kgdb.h   |    3 +-
 3 files changed, 62 insertions(+), 18 deletions(-)

--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -43,6 +43,8 @@
 #include <linux/smp.h>
 #include <linux/nmi.h>
 #include <linux/hw_breakpoint.h>
+#include <linux/uaccess.h>
+#include <linux/memory.h>
 
 #include <asm/debugreg.h>
 #include <asm/apicdef.h>
@@ -740,6 +742,64 @@ void kgdb_arch_set_pc(struct pt_regs *re
 	regs->ip = ip;
 }
 
+int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
+{
+	int err;
+	char opc[BREAK_INSTR_SIZE];
+
+	bpt->type = BP_BREAKPOINT;
+	err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
+				BREAK_INSTR_SIZE);
+	if (err)
+		return err;
+	err = probe_kernel_write((char *)bpt->bpt_addr,
+				 arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE);
+#ifdef CONFIG_DEBUG_RODATA
+	if (!err)
+		return err;
+	/*
+	 * It is safe to call text_poke() because normal kernel execution
+	 * is stopped on all cores, so long as the text_mutex is not locked.
+	 */
+	if (mutex_is_locked(&text_mutex))
+		return -EBUSY;
+	text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr,
+		  BREAK_INSTR_SIZE);
+	err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
+	if (err)
+		return err;
+	if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE))
+		return -EINVAL;
+	bpt->type = BP_POKE_BREAKPOINT;
+#endif /* CONFIG_DEBUG_RODATA */
+	return err;
+}
+
+int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
+{
+#ifdef CONFIG_DEBUG_RODATA
+	int err;
+	char opc[BREAK_INSTR_SIZE];
+
+	if (bpt->type != BP_POKE_BREAKPOINT)
+		goto knl_write;
+	/*
+	 * It is safe to call text_poke() because normal kernel execution
+	 * is stopped on all cores, so long as the text_mutex is not locked.
+	 */
+	if (mutex_is_locked(&text_mutex))
+		goto knl_write;
+	text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE);
+	err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
+	if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE))
+		goto knl_write;
+	return err;
+knl_write:
+#endif /* CONFIG_DEBUG_RODATA */
+	return probe_kernel_write((char *)bpt->bpt_addr,
+				  (char *)bpt->saved_instr, BREAK_INSTR_SIZE);
+}
+
 struct kgdb_arch arch_kgdb_ops = {
 	/* Breakpoint instruction: */
 	.gdb_bpt_instr		= { 0xcc },
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -968,22 +968,6 @@ static void run_singlestep_break_test(vo
 	kgdbts_break_test();
 }
 
-static void test_debug_rodata(void)
-{
-#ifdef CONFIG_DEBUG_RODATA
-	/* Until there is an api to write to read-only text segments, use
-	 * HW breakpoints for the remainder of any tests, else print a
-	 * failure message if hw breakpoints do not work.
-	 */
-	if (!(arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT && hwbreaks_ok)) {
-		eprintk("kgdbts: HW breakpoints BROKEN, ending tests\n");
-		return;
-	}
-	force_hwbrks = 1;
-	v1printk("kgdbts:Using HW breakpoints for SW breakpoint tests\n");
-#endif /* CONFIG_DEBUG_RODATA */
-}
-
 static void kgdbts_run_tests(void)
 {
 	char *ptr;
@@ -1016,7 +1000,6 @@ static void kgdbts_run_tests(void)
 		v1printk("kgdbts:RUN access write breakpoint test\n");
 		run_hw_break_test(0);
 	}
-	test_debug_rodata();
 
 	/* required internal KGDB tests */
 	v1printk("kgdbts:RUN plant and detach test\n");
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -63,7 +63,8 @@ enum kgdb_bptype {
 	BP_HARDWARE_BREAKPOINT,
 	BP_WRITE_WATCHPOINT,
 	BP_READ_WATCHPOINT,
-	BP_ACCESS_WATCHPOINT
+	BP_ACCESS_WATCHPOINT,
+	BP_POKE_BREAKPOINT,
 };
 
 enum kgdb_bpstate {



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

* [ 38/59] CIFS: Fix VFS lock usage for oplocked files
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (36 preceding siblings ...)
  2012-04-11 23:11 ` [ 37/59] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 39/59] [PATCH] ARM: tegra: remove Tegra30 errata from MACH_TEGRA_DT Greg KH
                   ` (20 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jeff Layton, Pavel Shilovsky, Steve French

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Shilovsky <piastry@etersoft.ru>

commit 66189be74ff5f9f3fd6444315b85be210d07cef2 upstream.

We can deadlock if we have a write oplock and two processes
use the same file handle. In this case the first process can't
unlock its lock if the second process blocked on the lock in the
same time.

Fix it by using posix_lock_file rather than posix_lock_file_wait
under cinode->lock_mutex. If we request a blocking lock and
posix_lock_file indicates that there is another lock that prevents
us, wait untill that lock is released and restart our call.

Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/cifs/file.c     |   10 +++++++++-
 fs/locks.c         |    3 ++-
 include/linux/fs.h |    5 +++++
 3 files changed, 16 insertions(+), 2 deletions(-)

--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -835,13 +835,21 @@ cifs_posix_lock_set(struct file *file, s
 	if ((flock->fl_flags & FL_POSIX) == 0)
 		return rc;
 
+try_again:
 	mutex_lock(&cinode->lock_mutex);
 	if (!cinode->can_cache_brlcks) {
 		mutex_unlock(&cinode->lock_mutex);
 		return rc;
 	}
-	rc = posix_lock_file_wait(file, flock);
+
+	rc = posix_lock_file(file, flock, NULL);
 	mutex_unlock(&cinode->lock_mutex);
+	if (rc == FILE_LOCK_DEFERRED) {
+		rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next);
+		if (!rc)
+			goto try_again;
+		locks_delete_block(flock);
+	}
 	return rc;
 }
 
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -510,12 +510,13 @@ static void __locks_delete_block(struct
 
 /*
  */
-static void locks_delete_block(struct file_lock *waiter)
+void locks_delete_block(struct file_lock *waiter)
 {
 	lock_flocks();
 	__locks_delete_block(waiter);
 	unlock_flocks();
 }
+EXPORT_SYMBOL(locks_delete_block);
 
 /* Insert waiter into blocker's block list.
  * We use a circular list so that processes can be easily woken up in
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1203,6 +1203,7 @@ extern int vfs_setlease(struct file *, l
 extern int lease_modify(struct file_lock **, int);
 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
+extern void locks_delete_block(struct file_lock *waiter);
 extern void lock_flocks(void);
 extern void unlock_flocks(void);
 #else /* !CONFIG_FILE_LOCKING */
@@ -1347,6 +1348,10 @@ static inline int lock_may_write(struct
 	return 1;
 }
 
+static inline void locks_delete_block(struct file_lock *waiter)
+{
+}
+
 static inline void lock_flocks(void)
 {
 }



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

* [ 39/59] [PATCH] ARM: tegra: remove Tegra30 errata from MACH_TEGRA_DT
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (37 preceding siblings ...)
  2012-04-11 23:11 ` [ 38/59] CIFS: Fix VFS lock usage for oplocked files Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 40/59] mmc: sdhci-dove: Fix compile error by including module.h Greg KH
                   ` (19 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, olof@lixom.net, Stephen Warren

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stephen Warren <swarren@nvidia.com>

[no upstream commit match, as this is a fix for a mis-applied patch in the
previous 3.2-stable release. - gregkh]

Commit 83e4194 "ARM: tegra: select required CPU and L2 errata options"
contained two chunks; one was errata for Tegra20 (correctly applied)
and the second errata for Tegra30. The latter was accidentally applied
to the wrong config option; Tegra30 support wasn't added until v3.3,
and so the second chunk should have just been dropped. This patch does
so.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/mach-tegra/Kconfig |    5 -----
 1 file changed, 5 deletions(-)

--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -61,11 +61,6 @@ config MACH_SEABOARD
 config MACH_TEGRA_DT
 	bool "Generic Tegra board (FDT support)"
 	select USE_OF
-	select ARM_ERRATA_743622
-	select ARM_ERRATA_751472
-	select ARM_ERRATA_754322
-	select ARM_ERRATA_764369
-	select PL310_ERRATA_769419 if CACHE_L2X0
 	help
 	  Support for generic nVidia Tegra boards using Flattened Device Tree
 



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

* [ 40/59] mmc: sdhci-dove: Fix compile error by including module.h
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (38 preceding siblings ...)
  2012-04-11 23:11 ` [ 39/59] [PATCH] ARM: tegra: remove Tegra30 errata from MACH_TEGRA_DT Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 41/59] mmc: atmel-mci: correct data timeout computation Greg KH
                   ` (18 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alf Høgemark, Chris Ball

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alf Høgemark <alf@i100.no>

commit 8c2fc8e413ecc2c96b696e28d4eb1bc6cee8dc84 upstream.

This patch fixes a compile error in drivers/mmc/host/sdhci-dove.c
by including the linux/module.h file.

Signed-off-by: Alf Høgemark <alf@i100.no>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci-dove.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mmc/host/sdhci-dove.c
+++ b/drivers/mmc/host/sdhci-dove.c
@@ -20,6 +20,7 @@
  */
 
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/mmc/host.h>
 
 #include "sdhci-pltfm.h"



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

* [ 41/59] mmc: atmel-mci: correct data timeout computation
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (39 preceding siblings ...)
  2012-04-11 23:11 ` [ 40/59] mmc: sdhci-dove: Fix compile error by including module.h Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 42/59] tcm_fc: Add abort flag for gracefully handling exchange timeout Greg KH
                   ` (17 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Ludovic Desroches, Nicolas Ferre, Chris Ball

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ludovic Desroches <ludovic.desroches@atmel.com>

commit 66292ad92c6d3f2f1c137a1c826b331ca8595dfd upstream.

The HSMCI operates at a rate of up to Master Clock divided by two.
Moreover previous calculation can cause overflows and so wrong
timeouts.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/atmel-mci.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -480,7 +480,14 @@ err:
 static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host,
 					unsigned int ns)
 {
-	return (ns * (host->bus_hz / 1000000) + 999) / 1000;
+	/*
+	 * It is easier here to use us instead of ns for the timeout,
+	 * it prevents from overflows during calculation.
+	 */
+	unsigned int us = DIV_ROUND_UP(ns, 1000);
+
+	/* Maximum clock frequency is host->bus_hz/2 */
+	return us * (DIV_ROUND_UP(host->bus_hz, 2000000));
 }
 
 static void atmci_set_timeout(struct atmel_mci *host,



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

* [ 42/59] tcm_fc: Add abort flag for gracefully handling exchange timeout
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (40 preceding siblings ...)
  2012-04-11 23:11 ` [ 41/59] mmc: atmel-mci: correct data timeout computation Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 43/59] tcm_fc: Do not free tpg structure during wq allocation failure Greg KH
                   ` (16 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Mark Rustad, Kiran Patil, Nicholas Bellinger

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Rustad <mark.d.rustad@intel.com>

commit e1c4038282c7586c3544542b37872c434669d3ac upstream.

Add abort flag and use it to terminate processing when an exchange
is timed out or is reset. The abort flag is used in place of the
transport_generic_free_cmd function call in the reset and timeout
cases, because calling that function in that context would free
memory that was in use. The aborted flag allows the lifetime to
be managed in a more normal way, while truncating the processing.

This change eliminates a source of memory corruption which
manifested in a variety of ugly ways.

(nab: Drop unused struct fc_exch *ep in ft_recv_seq)

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Acked-by: Kiran Patil <Kiran.patil@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/tcm_fc/tcm_fc.h  |    1 +
 drivers/target/tcm_fc/tfc_cmd.c |   10 ++++++++--
 drivers/target/tcm_fc/tfc_io.c  |    2 ++
 3 files changed, 11 insertions(+), 2 deletions(-)

--- a/drivers/target/tcm_fc/tcm_fc.h
+++ b/drivers/target/tcm_fc/tcm_fc.h
@@ -124,6 +124,7 @@ struct ft_cmd {
 	/* Local sense buffer */
 	unsigned char ft_sense_buffer[TRANSPORT_SENSE_BUFFER];
 	u32 was_ddp_setup:1;		/* Set only if ddp is setup */
+	u32 aborted:1;			/* Set if aborted by reset or timeout */
 	struct scatterlist *sg;		/* Set only if DDP is setup */
 	u32 sg_cnt;			/* No. of item in scatterlist */
 };
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -130,6 +130,8 @@ int ft_queue_status(struct se_cmd *se_cm
 	struct fc_exch *ep;
 	size_t len;
 
+	if (cmd->aborted)
+		return 0;
 	ft_dump_cmd(cmd, __func__);
 	ep = fc_seq_exch(cmd->seq);
 	lport = ep->lp;
@@ -196,6 +198,8 @@ int ft_write_pending(struct se_cmd *se_c
 
 	ft_dump_cmd(cmd, __func__);
 
+	if (cmd->aborted)
+		return 0;
 	ep = fc_seq_exch(cmd->seq);
 	lport = ep->lp;
 	fp = fc_frame_alloc(lport, sizeof(*txrdy));
@@ -266,10 +270,10 @@ static void ft_recv_seq(struct fc_seq *s
 	struct ft_cmd *cmd = arg;
 	struct fc_frame_header *fh;
 
-	if (IS_ERR(fp)) {
+	if (unlikely(IS_ERR(fp))) {
 		/* XXX need to find cmd if queued */
 		cmd->seq = NULL;
-		transport_generic_free_cmd(&cmd->se_cmd, 0);
+		cmd->aborted = true;
 		return;
 	}
 
@@ -447,6 +451,8 @@ int ft_queue_tm_resp(struct se_cmd *se_c
 	struct se_tmr_req *tmr = se_cmd->se_tmr_req;
 	enum fcp_resp_rsp_codes code;
 
+	if (cmd->aborted)
+		return 0;
 	switch (tmr->response) {
 	case TMR_FUNCTION_COMPLETE:
 		code = FCP_TMF_CMPL;
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -84,6 +84,8 @@ int ft_queue_data_in(struct se_cmd *se_c
 	void *from;
 	void *to = NULL;
 
+	if (cmd->aborted)
+		return 0;
 	ep = fc_seq_exch(cmd->seq);
 	lport = ep->lp;
 	cmd->seq = lport->tt.seq_start_next(cmd->seq);



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

* [ 43/59] tcm_fc: Do not free tpg structure during wq allocation failure
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (41 preceding siblings ...)
  2012-04-11 23:11 ` [ 42/59] tcm_fc: Add abort flag for gracefully handling exchange timeout Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 44/59] sysctl: fix write access to dmesg_restrict/kptr_restrict Greg KH
                   ` (15 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Mark Rustad, Kiran Patil, Nicholas Bellinger

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Rustad <mark.d.rustad@intel.com>

commit 06383f10c49f507220594a455c6491ca6f8c94ab upstream.

Avoid freeing a registered tpg structure if an alloc_workqueue call
fails.  This fixes a bug where the failure was leaking memory associated
with se_portal_group setup during the original core_tpg_register() call.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Acked-by: Kiran Patil <Kiran.patil@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/tcm_fc/tfc_conf.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -304,6 +304,7 @@ static struct se_portal_group *ft_add_tp
 {
 	struct ft_lport_acl *lacl;
 	struct ft_tpg *tpg;
+	struct workqueue_struct *wq;
 	unsigned long index;
 	int ret;
 
@@ -325,18 +326,20 @@ static struct se_portal_group *ft_add_tp
 	tpg->lport_acl = lacl;
 	INIT_LIST_HEAD(&tpg->lun_list);
 
-	ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,
-				tpg, TRANSPORT_TPG_TYPE_NORMAL);
-	if (ret < 0) {
+	wq = alloc_workqueue("tcm_fc", 0, 1);
+	if (!wq) {
 		kfree(tpg);
 		return NULL;
 	}
 
-	tpg->workqueue = alloc_workqueue("tcm_fc", 0, 1);
-	if (!tpg->workqueue) {
+	ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,
+				tpg, TRANSPORT_TPG_TYPE_NORMAL);
+	if (ret < 0) {
+		destroy_workqueue(wq);
 		kfree(tpg);
 		return NULL;
 	}
+	tpg->workqueue = wq;
 
 	mutex_lock(&ft_lport_lock);
 	list_add_tail(&tpg->list, &lacl->tpg_list);



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

* [ 44/59] sysctl: fix write access to dmesg_restrict/kptr_restrict
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (42 preceding siblings ...)
  2012-04-11 23:11 ` [ 43/59] tcm_fc: Do not free tpg structure during wq allocation failure Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 45/59] modpost: Fix modpost license checking of vmlinux.o Greg KH
                   ` (14 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Phillip Lougher, Kees Cook, Serge Hallyn,
	Richard Weinberger, James Morris

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kees Cook <keescook@chromium.org>

commit 620f6e8e855d6d447688a5f67a4e176944a084e8 upstream.

Commit bfdc0b4 adds code to restrict access to dmesg_restrict,
however, it incorrectly alters kptr_restrict rather than
dmesg_restrict.

The original patch from Richard Weinberger
(https://lkml.org/lkml/2011/3/14/362) alters dmesg_restrict as
expected, and so the patch seems to have been misapplied.

This adds the CAP_SYS_ADMIN check to both dmesg_restrict and
kptr_restrict, since both are sensitive.

Reported-by: Phillip Lougher <plougher@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/sysctl.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -166,7 +166,7 @@ static int proc_taint(struct ctl_table *
 #endif
 
 #ifdef CONFIG_PRINTK
-static int proc_dmesg_restrict(struct ctl_table *table, int write,
+static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
 				void __user *buffer, size_t *lenp, loff_t *ppos);
 #endif
 
@@ -713,7 +713,7 @@ static struct ctl_table kern_table[] = {
 		.data		= &dmesg_restrict,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec_minmax,
+		.proc_handler	= proc_dointvec_minmax_sysadmin,
 		.extra1		= &zero,
 		.extra2		= &one,
 	},
@@ -722,7 +722,7 @@ static struct ctl_table kern_table[] = {
 		.data		= &kptr_restrict,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dmesg_restrict,
+		.proc_handler	= proc_dointvec_minmax_sysadmin,
 		.extra1		= &zero,
 		.extra2		= &two,
 	},
@@ -2422,7 +2422,7 @@ static int proc_taint(struct ctl_table *
 }
 
 #ifdef CONFIG_PRINTK
-static int proc_dmesg_restrict(struct ctl_table *table, int write,
+static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
 				void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	if (write && !capable(CAP_SYS_ADMIN))



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

* [ 45/59] modpost: Fix modpost license checking of vmlinux.o
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (43 preceding siblings ...)
  2012-04-11 23:11 ` [ 44/59] sysctl: fix write access to dmesg_restrict/kptr_restrict Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 46/59] x86/PCI: use host bridge _CRS info on MSI MS-7253 Greg KH
                   ` (13 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Frank Rowand, Alessio Igor Bogani

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frank Rowand <frank.rowand@am.sony.com>

commit 258f742635360175564e9470eb060ff4d4b984e7 upstream.

Commit f02e8a6596b7 ("module: Sort exported symbols") sorts symbols
placing each of them in its own elf section.  This sorting and merging
into the canonical sections are done by the linker.

Unfortunately modpost to generate Module.symvers file parses vmlinux.o
(which is not linked yet) and all modules object files (which aren't
linked yet).  These aren't sanitized by the linker yet.  That breaks
modpost that can't detect license properly for modules.

This patch makes modpost aware of the new exported symbols structure.

[ This above is a slightly corrected version of the explanation of the
  problem, copied from commit 62a2635610db ("modpost: Fix modpost's
  license checking V3").  That commit fixed the problem for module
  object files, but not for vmlinux.o.  This patch fixes modpost for
  vmlinux.o. ]

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: Alessio Igor Bogani <abogani@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 scripts/mod/modpost.c |    7 +++++--
 scripts/mod/modpost.h |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -132,8 +132,10 @@ static struct module *new_module(char *m
 	/* strip trailing .o */
 	s = strrchr(p, '.');
 	if (s != NULL)
-		if (strcmp(s, ".o") == 0)
+		if (strcmp(s, ".o") == 0) {
 			*s = '\0';
+			mod->is_dot_o = 1;
+		}
 
 	/* add to list */
 	mod->name = p;
@@ -587,7 +589,8 @@ static void handle_modversions(struct mo
 	unsigned int crc;
 	enum export export;
 
-	if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0)
+	if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
+	    strncmp(symname, "__ksymtab", 9) == 0)
 		export = export_from_secname(info, get_secindex(info, sym));
 	else
 		export = export_from_sec(info, get_secindex(info, sym));
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -113,6 +113,7 @@ struct module {
 	int has_cleanup;
 	struct buffer dev_table_buf;
 	char	     srcversion[25];
+	int is_dot_o;
 };
 
 struct elf_info {



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

* [ 46/59] x86/PCI: use host bridge _CRS info on MSI MS-7253
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (44 preceding siblings ...)
  2012-04-11 23:11 ` [ 45/59] modpost: Fix modpost license checking of vmlinux.o Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 47/59] x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version Greg KH
                   ` (12 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Svante Signell, Jonathan Nieder,
	Bjorn Helgaas, Jesse Barnes

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jonathan Nieder <jrnieder@gmail.com>

commit 8411371709610c826bf65684f886bfdfb5780ca1 upstream.

In the spirit of commit 29cf7a30f8a0 ("x86/PCI: use host bridge _CRS
info on ASUS M2V-MX SE"), this DMI quirk turns on "pci_use_crs" by
default on a board that needs it.

This fixes boot failures and oopses introduced in 3e3da00c01d0
("x86/pci: AMD one chain system to use pci read out res").  The quirk
is quite targetted (to a specific board and BIOS version) for two
reasons:

 (1) to emphasize that this method of tackling the problem one quirk
     at a time is a little insane

 (2) to give BIOS vendors an opportunity to use simpler tables and
     allow us to return to generic behavior (whatever that happens to
     be) with a later BIOS update

In other words, I am not at all happy with having quirks like this.
But it is even worse for the kernel not to work out of the box on
these machines, so...

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=42619
Reported-by: Svante Signell <svante.signell@telia.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/pci/acpi.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -54,6 +54,17 @@ static const struct dmi_system_id pci_us
 			DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
 		},
 	},
+	/* https://bugzilla.kernel.org/show_bug.cgi?id=42619 */
+	{
+		.callback = set_use_crs,
+		.ident = "MSI MS-7253",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+			DMI_MATCH(DMI_BOARD_NAME, "MS-7253"),
+			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "V1.6"),
+		},
+	},
 	{}
 };
 



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

* [ 47/59] x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (45 preceding siblings ...)
  2012-04-11 23:11 ` [ 46/59] x86/PCI: use host bridge _CRS info on MSI MS-7253 Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 48/59] TOMOYO: Fix mount flags checking order Greg KH
                   ` (11 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Carlos Luna, Bjorn Helgaas,
	Jonathan Nieder, Jesse Barnes

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jonathan Nieder <jrnieder@gmail.com>

commit a97f4f5e524bcd09a85ef0b8821a14d35e69335f upstream.

Carlos was getting

	WARNING: at drivers/pci/pci.c:118 pci_ioremap_bar+0x24/0x52()

when probing his sound card, and sound did not work.  After adding
pci=use_crs to the kernel command line, no more trouble.

Ok, we can add a quirk.  dmidecode output reveals that this is an MSI
MS-7253, for which we already have a quirk, but the short-sighted
author tied the quirk to a single BIOS version, making it not kick in
on Carlos's machine with BIOS V1.2.  If a later BIOS update makes it
no longer necessary to look at the _CRS info it will still be
harmless, so let's stop trying to guess which versions have and don't
have accurate _CRS tables.

Addresses https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5533
Also see <https://bugzilla.kernel.org/show_bug.cgi?id=42619>.

Reported-by: Carlos Luna <caralu74@gmail.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/pci/acpi.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -62,7 +62,6 @@ static const struct dmi_system_id pci_us
 			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
 			DMI_MATCH(DMI_BOARD_NAME, "MS-7253"),
 			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "V1.6"),
 		},
 	},
 	{}



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

* [ 48/59] TOMOYO: Fix mount flags checking order.
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (46 preceding siblings ...)
  2012-04-11 23:11 ` [ 47/59] x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 49/59] Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries" Greg KH
                   ` (10 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Tetsuo Handa, James Morris

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>

commit df91e49477a9be15921cb2854e1d12a3bdb5e425 upstream.

Userspace can pass in arbitrary combinations of MS_* flags to mount().

If both MS_BIND and one of MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE are
passed, device name which should be checked for MS_BIND was not checked because
MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE had higher priority than MS_BIND.

If both one of MS_BIND/MS_MOVE and MS_REMOUNT are passed, device name which
should not be checked for MS_REMOUNT was checked because MS_BIND/MS_MOVE had
higher priority than MS_REMOUNT.

Fix these bugs by changing priority to MS_REMOUNT -> MS_BIND ->
MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE -> MS_MOVE as with do_mount() does.

Also, unconditionally return -EINVAL if more than one of
MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE is passed so that TOMOYO will not
generate inaccurate audit logs, for commit 7a2e8a8f "VFS: Sanity check mount
flags passed to change_mnt_propagation()" clarified that these flags must be
exclusively passed.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 security/tomoyo/mount.c |   38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

--- a/security/tomoyo/mount.c
+++ b/security/tomoyo/mount.c
@@ -199,30 +199,32 @@ int tomoyo_mount_permission(char *dev_na
 	if (flags & MS_REMOUNT) {
 		type = tomoyo_mounts[TOMOYO_MOUNT_REMOUNT];
 		flags &= ~MS_REMOUNT;
-	}
-	if (flags & MS_MOVE) {
-		type = tomoyo_mounts[TOMOYO_MOUNT_MOVE];
-		flags &= ~MS_MOVE;
-	}
-	if (flags & MS_BIND) {
+	} else if (flags & MS_BIND) {
 		type = tomoyo_mounts[TOMOYO_MOUNT_BIND];
 		flags &= ~MS_BIND;
-	}
-	if (flags & MS_UNBINDABLE) {
-		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_UNBINDABLE];
-		flags &= ~MS_UNBINDABLE;
-	}
-	if (flags & MS_PRIVATE) {
+	} else if (flags & MS_SHARED) {
+		if (flags & (MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
+			return -EINVAL;
+		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SHARED];
+		flags &= ~MS_SHARED;
+	} else if (flags & MS_PRIVATE) {
+		if (flags & (MS_SHARED | MS_SLAVE | MS_UNBINDABLE))
+			return -EINVAL;
 		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_PRIVATE];
 		flags &= ~MS_PRIVATE;
-	}
-	if (flags & MS_SLAVE) {
+	} else if (flags & MS_SLAVE) {
+		if (flags & (MS_SHARED | MS_PRIVATE | MS_UNBINDABLE))
+			return -EINVAL;
 		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SLAVE];
 		flags &= ~MS_SLAVE;
-	}
-	if (flags & MS_SHARED) {
-		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_SHARED];
-		flags &= ~MS_SHARED;
+	} else if (flags & MS_UNBINDABLE) {
+		if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE))
+			return -EINVAL;
+		type = tomoyo_mounts[TOMOYO_MOUNT_MAKE_UNBINDABLE];
+		flags &= ~MS_UNBINDABLE;
+	} else if (flags & MS_MOVE) {
+		type = tomoyo_mounts[TOMOYO_MOUNT_MOVE];
+		flags &= ~MS_MOVE;
 	}
 	if (!type)
 		type = "<NULL>";



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

* [ 49/59] Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries"
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (47 preceding siblings ...)
  2012-04-11 23:11 ` [ 48/59] TOMOYO: Fix mount flags checking order Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 50/59] acer-wmi: No wifi rfkill on Sony machines Greg KH
                   ` (9 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Konrad Rzeszutek Wilk, Jon Dufresne,
	Suresh Siddha, yinghai, Josh Boyer, Ingo Molnar, Teck Choon Giam,
	Ben Guthro

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

This reverts commit 273fb194e86b795b08a724c7646d0f694949070b
[73d63d038ee9f769f5e5b46792d227fe20e442c5 upstream]

It causes problems, so needs to be reverted from 3.2-stable for now.

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jon Dufresne <jon@jondufresne.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: <yinghai@kernel.org>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Teck Choon Giam <giamteckchoon@gmail.com>
Cc: Ben Guthro <ben@guthro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/apic/io_apic.c |   40 ++++++++--------------------------------
 1 file changed, 8 insertions(+), 32 deletions(-)

--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3963,36 +3963,18 @@ int mp_find_ioapic_pin(int ioapic, u32 g
 static __init int bad_ioapic(unsigned long address)
 {
 	if (nr_ioapics >= MAX_IO_APICS) {
-		pr_warn("WARNING: Max # of I/O APICs (%d) exceeded (found %d), skipping\n",
-			MAX_IO_APICS, nr_ioapics);
+		printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded "
+		       "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics);
 		return 1;
 	}
 	if (!address) {
-		pr_warn("WARNING: Bogus (zero) I/O APIC address found in table, skipping!\n");
+		printk(KERN_WARNING "WARNING: Bogus (zero) I/O APIC address"
+		       " found in table, skipping!\n");
 		return 1;
 	}
 	return 0;
 }
 
-static __init int bad_ioapic_register(int idx)
-{
-	union IO_APIC_reg_00 reg_00;
-	union IO_APIC_reg_01 reg_01;
-	union IO_APIC_reg_02 reg_02;
-
-	reg_00.raw = io_apic_read(idx, 0);
-	reg_01.raw = io_apic_read(idx, 1);
-	reg_02.raw = io_apic_read(idx, 2);
-
-	if (reg_00.raw == -1 && reg_01.raw == -1 && reg_02.raw == -1) {
-		pr_warn("I/O APIC 0x%x registers return all ones, skipping!\n",
-			mpc_ioapic_addr(idx));
-		return 1;
-	}
-
-	return 0;
-}
-
 void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
 {
 	int idx = 0;
@@ -4009,12 +3991,6 @@ void __init mp_register_ioapic(int id, u
 	ioapics[idx].mp_config.apicaddr = address;
 
 	set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
-
-	if (bad_ioapic_register(idx)) {
-		clear_fixmap(FIX_IO_APIC_BASE_0 + idx);
-		return;
-	}
-
 	ioapics[idx].mp_config.apicid = io_apic_unique_id(id);
 	ioapics[idx].mp_config.apicver = io_apic_get_version(idx);
 
@@ -4035,10 +4011,10 @@ void __init mp_register_ioapic(int id, u
 	if (gsi_cfg->gsi_end >= gsi_top)
 		gsi_top = gsi_cfg->gsi_end + 1;
 
-	pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n",
-		idx, mpc_ioapic_id(idx),
-		mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
-		gsi_cfg->gsi_base, gsi_cfg->gsi_end);
+	printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
+	       "GSI %d-%d\n", idx, mpc_ioapic_id(idx),
+	       mpc_ioapic_ver(idx), mpc_ioapic_addr(idx),
+	       gsi_cfg->gsi_base, gsi_cfg->gsi_end);
 
 	nr_ioapics++;
 }



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

* [ 50/59] acer-wmi: No wifi rfkill on Sony machines
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (48 preceding siblings ...)
  2012-04-11 23:11 ` [ 49/59] Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries" Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 51/59] Fix length of buffer copied in __nfs4_get_acl_uncached Greg KH
                   ` (8 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Carlos Corbacho, Matthew Garrett,
	Mattia Dongili, Dimitris N, Lee, Chun-Yi

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>

commit 5719b81988f3c24ff694dc3a37e35b35630a3966 upstream.

The wireless rfkill should charged by sony-laptop but not acer-wmi.
So, add Sony's SNY5001 acpi device to blacklist in acer-wmi.

Tested on Sony Vaio

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Dimitris N <ddarlac@gmail.com>
Tested-by: Dimitris N <ddarlac@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/platform/x86/acer-wmi.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -692,6 +692,7 @@ static const struct acpi_device_id norfk
 	{ "VPC2004", 0},
 	{ "IBM0068", 0},
 	{ "LEN0068", 0},
+	{ "SNY5001", 0},	/* sony-laptop in charge */
 	{ "", 0},
 };
 



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

* [ 51/59] Fix length of buffer copied in __nfs4_get_acl_uncached
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (49 preceding siblings ...)
  2012-04-11 23:11 ` [ 50/59] acer-wmi: No wifi rfkill on Sony machines Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 52/59] sched/x86: Fix overflow in cyc2ns_offset Greg KH
                   ` (7 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Sachin Prabhu, Trond Myklebust, Josh Boyer

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sachin Prabhu <sprabhu@redhat.com>

commit 20e0fa98b751facf9a1101edaefbc19c82616a68 upstream.

_copy_from_pages() used to copy data from the temporary buffer to the
user passed buffer is passed the wrong size parameter when copying
data. res.acl_len contains both the bitmap and acl lenghts while
acl_len contains the acl length after adjusting for the bitmap size.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/nfs4proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3618,7 +3618,7 @@ static ssize_t __nfs4_get_acl_uncached(s
 		if (acl_len > buflen)
 			goto out_free;
 		_copy_from_pages(buf, pages, res.acl_data_offset,
-				res.acl_len);
+				acl_len);
 	}
 	ret = acl_len;
 out_free:



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

* [ 52/59] sched/x86: Fix overflow in cyc2ns_offset
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (50 preceding siblings ...)
  2012-04-11 23:11 ` [ 51/59] Fix length of buffer copied in __nfs4_get_acl_uncached Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 53/59] mfd: Clear twl6030 IRQ status register only once Greg KH
                   ` (6 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Salman Qazi, John Stultz, Peter Zijlstra,
	Paul Turner, john stultz, Ingo Molnar, Mike Galbraith

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Salman Qazi <sqazi@google.com>

commit 9993bc635d01a6ee7f6b833b4ee65ce7c06350b1 upstream.

When a machine boots up, the TSC generally gets reset.  However,
when kexec is used to boot into a kernel, the TSC value would be
carried over from the previous kernel.  The computation of
cycns_offset in set_cyc2ns_scale is prone to an overflow, if the
machine has been up more than 208 days prior to the kexec.  The
overflow happens when we multiply *scale, even though there is
enough room to store the final answer.

We fix this issue by decomposing tsc_now into the quotient and
remainder of division by CYC2NS_SCALE_FACTOR and then performing
the multiplication separately on the two components.

Refactor code to share the calculation with the previous
fix in __cycles_2_ns().

Signed-off-by: Salman Qazi <sqazi@google.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Turner <pjt@google.com>
Cc: john stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20120310004027.19291.88460.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/include/asm/timer.h |    8 ++------
 arch/x86/kernel/tsc.c        |    3 ++-
 include/linux/kernel.h       |   13 +++++++++++++
 3 files changed, 17 insertions(+), 7 deletions(-)

--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -57,14 +57,10 @@ DECLARE_PER_CPU(unsigned long long, cyc2
 
 static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
 {
-	unsigned long long quot;
-	unsigned long long rem;
 	int cpu = smp_processor_id();
 	unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
-	quot = (cyc >> CYC2NS_SCALE_FACTOR);
-	rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
-	ns += quot * per_cpu(cyc2ns, cpu) +
-		((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
+	ns += mult_frac(cyc, per_cpu(cyc2ns, cpu),
+			(1UL << CYC2NS_SCALE_FACTOR));
 	return ns;
 }
 
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -622,7 +622,8 @@ static void set_cyc2ns_scale(unsigned lo
 
 	if (cpu_khz) {
 		*scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;
-		*offset = ns_now - (tsc_now * *scale >> CYC2NS_SCALE_FACTOR);
+		*offset = ns_now - mult_frac(tsc_now, *scale,
+					     (1UL << CYC2NS_SCALE_FACTOR));
 	}
 
 	sched_clock_idle_wakeup_event(0);
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -85,6 +85,19 @@
 }							\
 )
 
+/*
+ * Multiplies an integer by a fraction, while avoiding unnecessary
+ * overflow or loss of precision.
+ */
+#define mult_frac(x, numer, denom)(			\
+{							\
+	typeof(x) quot = (x) / (denom);			\
+	typeof(x) rem  = (x) % (denom);			\
+	(quot * (numer)) + ((rem * (numer)) / (denom));	\
+}							\
+)
+
+
 #define _RET_IP_		(unsigned long)__builtin_return_address(0)
 #define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })
 



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

* [ 53/59] mfd: Clear twl6030 IRQ status register only once
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (51 preceding siblings ...)
  2012-04-11 23:11 ` [ 52/59] sched/x86: Fix overflow in cyc2ns_offset Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 54/59] USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus" Greg KH
                   ` (5 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Santosh Shilimkar, Nishanth Menon, Samuel Ortiz

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nishanth Menon <nm@ti.com>

commit 3f8349e6e98ba0455437724589072523865eae5e upstream.

TWL6030 family of PMIC use a shadow interrupt status register
while kernel processes the current interrupt event.
However, any write(0 or 1) to register INT_STS_A, INT_STS_B or
INT_STS_C clears all 3 interrupt status registers.

Since clear of the interrupt is done on 32k clk, depending on I2C
bus speed, we could in-adverently clear the status of a interrupt
status pending on shadow register in the current implementation.
This is due to the fact that multi-byte i2c write operation into
three seperate status register could result in multiple load
and clear of status and result in lost interrupts.

Instead, doing a single byte write to INT_STS_A register with 0x0
will clear all three interrupt status registers without the related
risk.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mfd/twl6030-irq.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -187,8 +187,17 @@ static int twl6030_irq_thread(void *data
 			}
 		local_irq_enable();
 		}
-		ret = twl_i2c_write(TWL_MODULE_PIH, sts.bytes,
-				REG_INT_STS_A, 3); /* clear INT_STS_A */
+
+		/*
+		 * NOTE:
+		 * Simulation confirms that documentation is wrong w.r.t the
+		 * interrupt status clear operation. A single *byte* write to
+		 * any one of STS_A to STS_C register results in all three
+		 * STS registers being reset. Since it does not matter which
+		 * value is written, all three registers are cleared on a
+		 * single byte write, so we just use 0x0 to clear.
+		 */
+		ret = twl_i2c_write_u8(TWL_MODULE_PIH, 0x00, REG_INT_STS_A);
 		if (ret)
 			pr_warning("twl6030: I2C error in clearing PIH ISR\n");
 



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

* [ 54/59] USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus"
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (52 preceding siblings ...)
  2012-04-11 23:11 ` [ 53/59] mfd: Clear twl6030 IRQ status register only once Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 55/59] ioat: fix size of completion for Xen Greg KH
                   ` (4 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Guan Xin, David S. Miller

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Guan Xin <guanx.bac@gmail.com>

commit a2daf263107ba3eb6db33931881731fa51c95045 upstream.

Added Vendor/Device Id of Motorola Rokr E6 (22b8:6027) so it can be
recognized by the "zaurus" USBNet driver.
Applies to Linux 3.2.13 and 2.6.39.4.
Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/usb/zaurus.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/net/usb/zaurus.c
+++ b/drivers/net/usb/zaurus.c
@@ -332,6 +332,11 @@ static const struct usb_device_id	produc
 	.driver_info = ZAURUS_PXA_INFO,
 },
 {
+	/* Motorola Rokr E6 */
+	USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM,
+			USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+	.driver_info = (unsigned long) &bogus_mdlm_info,
+}, {
 	/* Motorola MOTOMAGX phones */
 	USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
 			USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),



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

* [ 55/59] ioat: fix size of completion for Xen
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (53 preceding siblings ...)
  2012-04-11 23:11 ` [ 54/59] USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus" Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 56/59] ASoC: ak4642: fixup: mute needs +1 step Greg KH
                   ` (3 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jonathan Nieder, William Dauchy,
	Dave Jiang, Dan Williams

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Williams <dan.j.williams@intel.com>

commit 275029353953c2117941ade84f02a2303912fad1 upstream.

Starting with v3.2 Jonathan reports that Xen crashes loading the ioatdma
driver.  A debug run shows:

  ioatdma 0000:00:16.4: desc[0]: (0x300cc7000->0x300cc7040) cookie: 0 flags: 0x2 ctl: 0x29 (op: 0 int_en: 1 compl: 1)
  ...
  ioatdma 0000:00:16.4: ioat_get_current_completion: phys_complete: 0xcc7000

...which shows that in this environment GFP_KERNEL memory may be backed
by a 64-bit dma address.  This breaks the driver's assumption that an
unsigned long should be able to contain the physical address for
descriptor memory.  Switch to dma_addr_t which beyond being the right
size, is the true type for the data i.e. an io-virtual address
inidicating the engine's last processed descriptor.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Reported-by: William Dauchy <wdauchy@gmail.com>
Tested-by: William Dauchy <wdauchy@gmail.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/dma/ioat/dma.c    |   16 ++++++++--------
 drivers/dma/ioat/dma.h    |    6 +++---
 drivers/dma/ioat/dma_v2.c |    8 ++++----
 drivers/dma/ioat/dma_v3.c |    8 ++++----
 4 files changed, 19 insertions(+), 19 deletions(-)

--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -548,9 +548,9 @@ void ioat_dma_unmap(struct ioat_chan_com
 			   PCI_DMA_TODEVICE, flags, 0);
 }
 
-unsigned long ioat_get_current_completion(struct ioat_chan_common *chan)
+dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan)
 {
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 	u64 completion;
 
 	completion = *chan->completion;
@@ -571,7 +571,7 @@ unsigned long ioat_get_current_completio
 }
 
 bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
-			   unsigned long *phys_complete)
+			   dma_addr_t *phys_complete)
 {
 	*phys_complete = ioat_get_current_completion(chan);
 	if (*phys_complete == chan->last_completion)
@@ -582,14 +582,14 @@ bool ioat_cleanup_preamble(struct ioat_c
 	return true;
 }
 
-static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
+static void __cleanup(struct ioat_dma_chan *ioat, dma_addr_t phys_complete)
 {
 	struct ioat_chan_common *chan = &ioat->base;
 	struct list_head *_desc, *n;
 	struct dma_async_tx_descriptor *tx;
 
-	dev_dbg(to_dev(chan), "%s: phys_complete: %lx\n",
-		 __func__, phys_complete);
+	dev_dbg(to_dev(chan), "%s: phys_complete: %llx\n",
+		 __func__, (unsigned long long) phys_complete);
 	list_for_each_safe(_desc, n, &ioat->used_desc) {
 		struct ioat_desc_sw *desc;
 
@@ -655,7 +655,7 @@ static void __cleanup(struct ioat_dma_ch
 static void ioat1_cleanup(struct ioat_dma_chan *ioat)
 {
 	struct ioat_chan_common *chan = &ioat->base;
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 
 	prefetch(chan->completion);
 
@@ -701,7 +701,7 @@ static void ioat1_timer_event(unsigned l
 		mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
 		spin_unlock_bh(&ioat->desc_lock);
 	} else if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
-		unsigned long phys_complete;
+		dma_addr_t phys_complete;
 
 		spin_lock_bh(&ioat->desc_lock);
 		/* if we haven't made progress and we have already
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -88,7 +88,7 @@ struct ioatdma_device {
 struct ioat_chan_common {
 	struct dma_chan common;
 	void __iomem *reg_base;
-	unsigned long last_completion;
+	dma_addr_t last_completion;
 	spinlock_t cleanup_lock;
 	dma_cookie_t completed_cookie;
 	unsigned long state;
@@ -333,7 +333,7 @@ int __devinit ioat_dma_self_test(struct
 void __devexit ioat_dma_remove(struct ioatdma_device *device);
 struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev,
 					      void __iomem *iobase);
-unsigned long ioat_get_current_completion(struct ioat_chan_common *chan);
+dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan);
 void ioat_init_channel(struct ioatdma_device *device,
 		       struct ioat_chan_common *chan, int idx);
 enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
@@ -341,7 +341,7 @@ enum dma_status ioat_dma_tx_status(struc
 void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags,
 		    size_t len, struct ioat_dma_descriptor *hw);
 bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
-			   unsigned long *phys_complete);
+			   dma_addr_t *phys_complete);
 void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
 void ioat_kobject_del(struct ioatdma_device *device);
 extern const struct sysfs_ops ioat_sysfs_ops;
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -126,7 +126,7 @@ static void ioat2_start_null_desc(struct
 	spin_unlock_bh(&ioat->prep_lock);
 }
 
-static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
+static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
 {
 	struct ioat_chan_common *chan = &ioat->base;
 	struct dma_async_tx_descriptor *tx;
@@ -178,7 +178,7 @@ static void __cleanup(struct ioat2_dma_c
 static void ioat2_cleanup(struct ioat2_dma_chan *ioat)
 {
 	struct ioat_chan_common *chan = &ioat->base;
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 
 	spin_lock_bh(&chan->cleanup_lock);
 	if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -259,7 +259,7 @@ int ioat2_reset_sync(struct ioat_chan_co
 static void ioat2_restart_channel(struct ioat2_dma_chan *ioat)
 {
 	struct ioat_chan_common *chan = &ioat->base;
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 
 	ioat2_quiesce(chan, 0);
 	if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -274,7 +274,7 @@ void ioat2_timer_event(unsigned long dat
 	struct ioat_chan_common *chan = &ioat->base;
 
 	if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
-		unsigned long phys_complete;
+		dma_addr_t phys_complete;
 		u64 status;
 
 		status = ioat_chansts(chan);
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -256,7 +256,7 @@ static bool desc_has_ext(struct ioat_rin
  * The difference from the dma_v2.c __cleanup() is that this routine
  * handles extended descriptors and dma-unmapping raid operations.
  */
-static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
+static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
 {
 	struct ioat_chan_common *chan = &ioat->base;
 	struct ioat_ring_ent *desc;
@@ -314,7 +314,7 @@ static void __cleanup(struct ioat2_dma_c
 static void ioat3_cleanup(struct ioat2_dma_chan *ioat)
 {
 	struct ioat_chan_common *chan = &ioat->base;
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 
 	spin_lock_bh(&chan->cleanup_lock);
 	if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -333,7 +333,7 @@ static void ioat3_cleanup_event(unsigned
 static void ioat3_restart_channel(struct ioat2_dma_chan *ioat)
 {
 	struct ioat_chan_common *chan = &ioat->base;
-	unsigned long phys_complete;
+	dma_addr_t phys_complete;
 
 	ioat2_quiesce(chan, 0);
 	if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -348,7 +348,7 @@ static void ioat3_timer_event(unsigned l
 	struct ioat_chan_common *chan = &ioat->base;
 
 	if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
-		unsigned long phys_complete;
+		dma_addr_t phys_complete;
 		u64 status;
 
 		status = ioat_chansts(chan);



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

* [ 56/59] ASoC: ak4642: fixup: mute needs +1 step
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (54 preceding siblings ...)
  2012-04-11 23:11 ` [ 55/59] ioat: fix size of completion for Xen Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 57/59] cred: copy_process() should clear child->replacement_session_keyring Greg KH
                   ` (2 subsequent siblings)
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Kuninori Morimoto, Mark Brown

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

commit 1f99e44cf059d2ed43c5a0724fa738b83800f725 upstream.

ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute.
But current settings didn't care +1 step for mute.
This patch adds it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/ak4642.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -144,7 +144,7 @@
  * min : 0xFE : -115.0 dB
  * mute: 0xFF
  */
-static const DECLARE_TLV_DB_SCALE(out_tlv, -11500, 50, 1);
+static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
 
 static const struct snd_kcontrol_new ak4642_snd_controls[] = {
 



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

* [ 57/59] cred: copy_process() should clear child->replacement_session_keyring
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (55 preceding siblings ...)
  2012-04-11 23:11 ` [ 56/59] ASoC: ak4642: fixup: mute needs +1 step Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 58/59] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume Greg KH
  2012-04-11 23:11 ` [ 59/59] Bluetooth: Fix l2cap conn failures for ssp devices Greg KH
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Oleg Nesterov, David Howells

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oleg Nesterov <oleg@redhat.com>

commit 79549c6dfda0603dba9a70a53467ce62d9335c33 upstream.

keyctl_session_to_parent(task) sets ->replacement_session_keyring,
it should be processed and cleared by key_replace_session_keyring().

However, this task can fork before it notices TIF_NOTIFY_RESUME and
the new child gets the bogus ->replacement_session_keyring copied by
dup_task_struct(). This is obviously wrong and, if nothing else, this
leads to put_cred(already_freed_cred).

change copy_creds() to clear this member. If copy_process() fails
before this point the wrong ->replacement_session_keyring doesn't
matter, exit_creds() won't be called.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/cred.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -385,6 +385,8 @@ int copy_creds(struct task_struct *p, un
 	struct cred *new;
 	int ret;
 
+	p->replacement_session_keyring = NULL;
+
 	if (
 #ifdef CONFIG_KEYS
 		!p->cred->thread_keyring &&



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

* [ 58/59] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (56 preceding siblings ...)
  2012-04-11 23:11 ` [ 57/59] cred: copy_process() should clear child->replacement_session_keyring Greg KH
@ 2012-04-11 23:11 ` Greg KH
  2012-04-11 23:11 ` [ 59/59] Bluetooth: Fix l2cap conn failures for ssp devices Greg KH
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Joerg Roedel

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Joerg Roedel <joerg.roedel@amd.com>

commit 9ddd592a191b32f2ee6c4b6ed2bd52665c3a49f5 upstream

Unfortunatly the interrupts for the event log and the
peripheral page-faults are only enabled at boot but not
re-enabled at resume. Fix that for 3.2.

Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 drivers/iommu/amd_iommu_init.c |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1033,8 +1033,9 @@ static int iommu_setup_msi(struct amd_io
 {
 	int r;
 
-	if (pci_enable_msi(iommu->dev))
-		return 1;
+	r = pci_enable_msi(iommu->dev);
+	if (r)
+		return r;
 
 	r = request_threaded_irq(iommu->dev->irq,
 				 amd_iommu_int_handler,
@@ -1044,24 +1045,33 @@ static int iommu_setup_msi(struct amd_io
 
 	if (r) {
 		pci_disable_msi(iommu->dev);
-		return 1;
+		return r;
 	}
 
 	iommu->int_enabled = true;
-	iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
 
 	return 0;
 }
 
 static int iommu_init_msi(struct amd_iommu *iommu)
 {
+	int ret;
+
 	if (iommu->int_enabled)
-		return 0;
+		goto enable_faults;
 
 	if (pci_find_capability(iommu->dev, PCI_CAP_ID_MSI))
-		return iommu_setup_msi(iommu);
+		ret = iommu_setup_msi(iommu);
+	else
+		ret = -ENODEV;
+
+	if (ret)
+		return ret;
 
-	return 1;
+enable_faults:
+	iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
+
+	return 0;
 }
 
 /****************************************************************************



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

* [ 59/59] Bluetooth: Fix l2cap conn failures for ssp devices
  2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
                   ` (57 preceding siblings ...)
  2012-04-11 23:11 ` [ 58/59] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume Greg KH
@ 2012-04-11 23:11 ` Greg KH
  58 siblings, 0 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:11 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Peter Hurley, Daniel Wagner,
	Marcel Holtmann, Johan Hedberg

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Peter Hurley <peter@hurleysoftware.com>

commit 18daf1644e634bae951a6e3d4d19d89170209762 upstream

Commit 330605423c fixed l2cap conn establishment for non-ssp remote
devices by not setting HCI_CONN_ENCRYPT_PEND every time conn security
is tested (which was always returning failure on any subsequent
security checks).

However, this broke l2cap conn establishment for ssp remote devices
when an ACL link was already established at SDP-level security. This
fix ensures that encryption must be pending whenever authentication
is also pending.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>

---
 net/bluetooth/hci_conn.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -608,6 +608,10 @@ static int hci_conn_auth(struct hci_conn
 
 	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
 		struct hci_cp_auth_requested cp;
+
+		/* encrypt must be pending if auth is also pending */
+		set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
+
 		cp.handle = cpu_to_le16(conn->handle);
 		hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
 							sizeof(cp), &cp);



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

* [ 00/59] 3.2.15-stable review
@ 2012-04-11 23:12 Greg KH
  2012-04-11 23:10 ` [ 01/59] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND Greg KH
                   ` (58 more replies)
  0 siblings, 59 replies; 65+ messages in thread
From: Greg KH @ 2012-04-11 23:12 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

This is the start of the stable review cycle for the 3.2.15 release.
There are 59 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Fri Apr 13 23:10:33 UTC 2012.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.2.15-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-------------
 Makefile                                           |    4 +-
 arch/arm/mach-tegra/Kconfig                        |    5 -
 arch/m68k/mac/config.c                             |    3 +
 arch/x86/include/asm/timer.h                       |    8 +-
 arch/x86/kernel/apic/io_apic.c                     |   40 +----
 arch/x86/kernel/kgdb.c                             |   60 ++++++++
 arch/x86/kernel/tsc.c                              |    3 +-
 arch/x86/net/bpf_jit_comp.c                        |    2 +-
 arch/x86/pci/acpi.c                                |   10 ++
 drivers/acpi/acpica/tbfadt.c                       |    8 +-
 drivers/acpi/processor_thermal.c                   |   45 +++++-
 drivers/dma/ioat/dma.c                             |   16 +-
 drivers/dma/ioat/dma.h                             |    6 +-
 drivers/dma/ioat/dma_v2.c                          |    8 +-
 drivers/dma/ioat/dma_v3.c                          |    8 +-
 drivers/gpu/drm/drm_fb_helper.c                    |    8 +-
 drivers/gpu/drm/i915/i915_drv.c                    |    2 +
 drivers/gpu/drm/i915/i915_reg.h                    |    1 +
 drivers/gpu/drm/i915/intel_bios.c                  |   23 ++-
 drivers/gpu/drm/i915/intel_display.c               |    6 +
 drivers/gpu/drm/i915/intel_lvds.c                  |    8 +
 drivers/gpu/drm/radeon/atom.c                      |   15 +-
 drivers/gpu/drm/radeon/atom.h                      |    1 +
 drivers/iommu/amd_iommu_init.c                     |   24 ++-
 drivers/mfd/twl6030-irq.c                          |   13 +-
 drivers/misc/kgdbts.c                              |  160 ++++++++++++++------
 drivers/mmc/host/atmel-mci.c                       |    9 +-
 drivers/mmc/host/sdhci-dove.c                      |    1 +
 drivers/mtd/devices/block2mtd.c                    |    1 +
 drivers/mtd/devices/lart.c                         |    1 +
 drivers/mtd/devices/m25p80.c                       |    1 +
 drivers/mtd/devices/sst25l.c                       |    1 +
 drivers/mtd/maps/ixp4xx.c                          |    5 +-
 drivers/mtd/maps/lantiq-flash.c                    |    3 +-
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c             |    2 +-
 drivers/net/ethernet/broadcom/tg3.c                |    4 +-
 drivers/net/ethernet/freescale/fsl_pq_mdio.c       |   13 +-
 drivers/net/ethernet/marvell/sky2.c                |    5 +-
 drivers/net/ethernet/realtek/r8169.c               |    5 +
 drivers/net/usb/cdc_eem.c                          |    1 +
 drivers/net/usb/zaurus.c                           |    5 +
 drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c       |    2 +-
 drivers/platform/x86/acer-wmi.c                    |    1 +
 drivers/pnp/pnpacpi/core.c                         |    7 +-
 drivers/target/target_core_transport.c             |    6 +-
 drivers/target/tcm_fc/tcm_fc.h                     |    1 +
 drivers/target/tcm_fc/tfc_cmd.c                    |   10 +-
 drivers/target/tcm_fc/tfc_conf.c                   |   13 +-
 drivers/target/tcm_fc/tfc_io.c                     |    2 +
 fs/cifs/file.c                                     |   10 +-
 fs/locks.c                                         |    3 +-
 fs/nfs/nfs4proc.c                                  |    2 +-
 include/linux/fs.h                                 |    5 +
 include/linux/kernel.h                             |   13 ++
 include/linux/kgdb.h                               |    7 +-
 kernel/cred.c                                      |    2 +
 kernel/debug/debug_core.c                          |   53 +++----
 kernel/irq/migration.c                             |   10 +-
 kernel/sysctl.c                                    |    8 +-
 kernel/trace/trace.c                               |    4 +
 kernel/trace/trace_entries.h                       |   16 +-
 kernel/trace/trace_export.c                        |    2 +-
 net/bluetooth/hci_conn.c                           |    4 +
 net/mac80211/agg-rx.c                              |    3 +-
 net/rose/rose_dev.c                                |    4 +-
 scripts/mod/modpost.c                              |    9 +-
 scripts/mod/modpost.h                              |    1 +
 security/tomoyo/mount.c                            |   38 ++---
 sound/soc/codecs/ak4642.c                          |    2 +-
 sound/soc/codecs/wm8994.c                          |    2 +-
 71 files changed, 550 insertions(+), 236 deletions(-)


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

* Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
  2012-04-11 23:10 ` [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit Greg KH
@ 2012-04-12  4:55   ` Ben Hutchings
       [not found]     ` <OFFBE17A27.42E05B7A-ONC12579DE.00262282-C12579DE.0026AD98@transmode.se>
  2012-04-16  0:16       ` Paul Gortmaker
  0 siblings, 2 replies; 65+ messages in thread
From: Ben Hutchings @ 2012-04-12  4:55 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, stable, torvalds, akpm, alan, Kenth Eriksson,
	David S. Miller

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

On Wed, 2012-04-11 at 16:10 -0700, Greg KH wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> 
> From: Kenth Eriksson <kenth.eriksson@transmode.com>
> 
> [ 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.
[...]

This doesn't look relevant to 3.2.

$ git describe --contains b26e478f
v3.3-rc1~182^2~207
$ git describe --contains c3e072f8
v3.3-rc1~182^2~598
$ git show c3e072f8 | head -8
commit c3e072f8a6c5625028531c40ec65f7e301531be2
Author: Baruch Siach <baruch@tkos.co.il>
Date:   Mon Nov 14 08:21:30 2011 +0200

    net: fsl_pq_mdio: fix non tbi phy access
    
    Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
    -EBUSY when the "tbi-phy" node is missing. Fix this.
$ git describe --contains 952c5ca1
v3.3-rc1~182^2~603
$ git rev-list v3.2..v3.2.14 drivers/net/ethernet/freescale/fsl_pq_mdio.c
$

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program than vice versa.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
       [not found]     ` <OFFBE17A27.42E05B7A-ONC12579DE.00262282-C12579DE.0026AD98@transmode.se>
@ 2012-04-12 15:02       ` Ben Hutchings
  0 siblings, 0 replies; 65+ messages in thread
From: Ben Hutchings @ 2012-04-12 15:02 UTC (permalink / raw)
  To: Kenth Eriksson
  Cc: akpm, alan, David S. Miller, Greg KH, linux-kernel, stable, torvalds

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

On Thu, 2012-04-12 at 09:02 +0200, Kenth Eriksson wrote:
> Ben Hutchings <ben@decadent.org.uk> wrote on 2012/04/12 06:55:06:
> 
> > From: Ben Hutchings <ben@decadent.org.uk> 
> > To: Greg KH <gregkh@linuxfoundation.org> 
> > Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
> torvalds@linux-
> > foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
> Kenth 
> > Eriksson <kenth.eriksson@transmode.com>, "David S. Miller"
> <davem@davemloft.net> 
> > Date: 2012/04/12 06:55 
> > Subject: Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug
> fix in a 
> > previous commit. 
> > 
> > On Wed, 2012-04-11 at 16:10 -0700, Greg KH wrote:
> > > 3.2-stable review patch.  If anyone has any objections, please let
> me know.
> > > 
> > > ------------------
> > > 
> > > 
> > > From: Kenth Eriksson <kenth.eriksson@transmode.com>
> > > 
> > > [ 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.
> > [...]
> > 
> > This doesn't look relevant to 3.2.
> > 
> > $ git describe --contains b26e478f
> > v3.3-rc1~182^2~207
> > $ git describe --contains c3e072f8
> > v3.3-rc1~182^2~598
> > $ git show c3e072f8 | head -8
> > commit c3e072f8a6c5625028531c40ec65f7e301531be2
> > Author: Baruch Siach <baruch@tkos.co.il>
> > Date:   Mon Nov 14 08:21:30 2011 +0200
> > 
> >     net: fsl_pq_mdio: fix non tbi phy access
> >     
> >     Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address
> configuration) .probe returns
> >     -EBUSY when the "tbi-phy" node is missing. Fix this.
> > $ git describe --contains 952c5ca1
> > v3.3-rc1~182^2~603
> > $ git rev-list v3.2..v3.2.14
> drivers/net/ethernet/freescale/fsl_pq_mdio.c
> > $
> > 
> 
> The error is present in 3.2 as well, but the patch may not apply. 3.3
> contains both a fix for the error: 
> 
> http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commit;h=c3e072f8a6c5625028531c40ec65f7e301531be2 
> 
> and a bad merge. 

So it wasn't actually introduced by 952c5ca1?

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program than vice versa.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
  2012-04-12  4:55   ` Ben Hutchings
@ 2012-04-16  0:16       ` Paul Gortmaker
  2012-04-16  0:16       ` Paul Gortmaker
  1 sibling, 0 replies; 65+ messages in thread
From: Paul Gortmaker @ 2012-04-16  0:16 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Greg KH, linux-kernel, stable, torvalds, akpm, alan,
	Kenth Eriksson, David S. Miller, afleming

On Thu, Apr 12, 2012 at 12:55 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Wed, 2012-04-11 at 16:10 -0700, Greg KH wrote:
>> 3.2-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>>
>> From: Kenth Eriksson <kenth.eriksson@transmode.com>
>>
>> [ 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.
> [...]
>
> This doesn't look relevant to 3.2.
>
> $ git describe --contains b26e478f
> v3.3-rc1~182^2~207
> $ git describe --contains c3e072f8
> v3.3-rc1~182^2~598
> $ git show c3e072f8 | head -8
> commit c3e072f8a6c5625028531c40ec65f7e301531be2
> Author: Baruch Siach <baruch@tkos.co.il>
> Date:   Mon Nov 14 08:21:30 2011 +0200
>
>    net: fsl_pq_mdio: fix non tbi phy access
>
>    Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
>    -EBUSY when the "tbi-phy" node is missing. Fix this.
> $ git describe --contains 952c5ca1
> v3.3-rc1~182^2~603
> $ git rev-list v3.2..v3.2.14 drivers/net/ethernet/freescale/fsl_pq_mdio.c

I think 952c5ca1 is a red herring;  What is called out as the regression
commit appeared in tree earlier than that as 28d8ea2d568.

$ git describe --contains 28d8ea2d568
v3.2-rc6~3^2~6
$ git show 952c5ca1|diffstat -p0
 b/drivers/net/ethernet/freescale/fsl_pq_mdio.c |   53 +++----------------------
 1 file changed, 8 insertions(+), 45 deletions(-)
$ git show  28d8ea2d568 | diffstat -p0
 b/drivers/net/ethernet/freescale/fsl_pq_mdio.c |   53 +++----------------------
 1 file changed, 8 insertions(+), 45 deletions(-)
$

I documented some history about this in commit 1ee4af86fa16d636.

I wasn't aware of the bad merge at the time; adding the TBI node to
my mpc836x board DTS simply fixed the issue with no source changes.

Paul.

> $
>
> Ben.
>
> --
> Ben Hutchings
> It is easier to change the specification to fit the program than vice versa.

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

* Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
@ 2012-04-16  0:16       ` Paul Gortmaker
  0 siblings, 0 replies; 65+ messages in thread
From: Paul Gortmaker @ 2012-04-16  0:16 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Greg KH, linux-kernel, stable, torvalds, akpm, alan,
	Kenth Eriksson, David S. Miller, afleming

On Thu, Apr 12, 2012 at 12:55 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Wed, 2012-04-11 at 16:10 -0700, Greg KH wrote:
>> 3.2-stable review patch. �If anyone has any objections, please let me know.
>>
>> ------------------
>>
>>
>> From: Kenth Eriksson <kenth.eriksson@transmode.com>
>>
>> [ 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.
> [...]
>
> This doesn't look relevant to 3.2.
>
> $ git describe --contains b26e478f
> v3.3-rc1~182^2~207
> $ git describe --contains c3e072f8
> v3.3-rc1~182^2~598
> $ git show c3e072f8 | head -8
> commit c3e072f8a6c5625028531c40ec65f7e301531be2
> Author: Baruch Siach <baruch@tkos.co.il>
> Date: � Mon Nov 14 08:21:30 2011 +0200
>
> � �net: fsl_pq_mdio: fix non tbi phy access
>
> � �Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
> � �-EBUSY when the "tbi-phy" node is missing. Fix this.
> $ git describe --contains 952c5ca1
> v3.3-rc1~182^2~603
> $ git rev-list v3.2..v3.2.14 drivers/net/ethernet/freescale/fsl_pq_mdio.c

I think 952c5ca1 is a red herring;  What is called out as the regression
commit appeared in tree earlier than that as 28d8ea2d568.

$ git describe --contains 28d8ea2d568
v3.2-rc6~3^2~6
$ git show 952c5ca1|diffstat -p0
 b/drivers/net/ethernet/freescale/fsl_pq_mdio.c |   53 +++----------------------
 1 file changed, 8 insertions(+), 45 deletions(-)
$ git show  28d8ea2d568 | diffstat -p0
 b/drivers/net/ethernet/freescale/fsl_pq_mdio.c |   53 +++----------------------
 1 file changed, 8 insertions(+), 45 deletions(-)
$

I documented some history about this in commit 1ee4af86fa16d636.

I wasn't aware of the bad merge at the time; adding the TBI node to
my mpc836x board DTS simply fixed the issue with no source changes.

Paul.

> $
>
> Ben.
>
> --
> Ben Hutchings
> It is easier to change the specification to fit the program than vice versa.

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

* Re: [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.
  2012-04-16  0:16       ` Paul Gortmaker
  (?)
@ 2012-04-16  0:32       ` Ben Hutchings
  -1 siblings, 0 replies; 65+ messages in thread
From: Ben Hutchings @ 2012-04-16  0:32 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Greg KH, linux-kernel, stable, torvalds, akpm, alan,
	Kenth Eriksson, David S. Miller, afleming

[-- Attachment #1: Type: text/plain, Size: 1787 bytes --]

On Sun, 2012-04-15 at 20:16 -0400, Paul Gortmaker wrote:
> On Thu, Apr 12, 2012 at 12:55 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Wed, 2012-04-11 at 16:10 -0700, Greg KH wrote:
> >> 3.2-stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >>
> >> From: Kenth Eriksson <kenth.eriksson@transmode.com>
> >>
> >> [ 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.
> > [...]
> >
> > This doesn't look relevant to 3.2.
> >
> > $ git describe --contains b26e478f
> > v3.3-rc1~182^2~207
> > $ git describe --contains c3e072f8
> > v3.3-rc1~182^2~598
> > $ git show c3e072f8 | head -8
> > commit c3e072f8a6c5625028531c40ec65f7e301531be2
> > Author: Baruch Siach <baruch@tkos.co.il>
> > Date:   Mon Nov 14 08:21:30 2011 +0200
> >
> >    net: fsl_pq_mdio: fix non tbi phy access
> >
> >    Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
> >    -EBUSY when the "tbi-phy" node is missing. Fix this.
> > $ git describe --contains 952c5ca1
> > v3.3-rc1~182^2~603
> > $ git rev-list v3.2..v3.2.14 drivers/net/ethernet/freescale/fsl_pq_mdio.c
> 
> I think 952c5ca1 is a red herring;  What is called out as the regression
> commit appeared in tree earlier than that as 28d8ea2d568.

I see, the same patch was applied on two different branches and one of
those got into 3.2.

This fix was included in 3.2.15 despite my objection, so everyone should
be happy now.

Ben.

-- 
Ben Hutchings
This sentence contradicts itself - no actually it doesn't.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-04-16  0:32 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 23:12 [ 00/59] 3.2.15-stable review Greg KH
2012-04-11 23:10 ` [ 01/59] x86 bpf_jit: fix a bug in emitting the 16-bit immediate operand of AND Greg KH
2012-04-11 23:10 ` [ 02/59] tg3: Fix 5717 serdes powerdown problem Greg KH
2012-04-11 23:10 ` [ 03/59] sky2: dont overwrite settings for PHY Quick link Greg KH
2012-04-11 23:10 ` [ 04/59] rose_dev: fix memcpy-bug in rose_set_mac_address Greg KH
2012-04-11 23:10 ` [ 05/59] net: usb: cdc_eem: fix mtu Greg KH
2012-04-11 23:10 ` [ 06/59] Fix non TBI PHY access; a bad merge undid bug fix in a previous commit Greg KH
2012-04-12  4:55   ` Ben Hutchings
     [not found]     ` <OFFBE17A27.42E05B7A-ONC12579DE.00262282-C12579DE.0026AD98@transmode.se>
2012-04-12 15:02       ` Ben Hutchings
2012-04-16  0:16     ` Paul Gortmaker
2012-04-16  0:16       ` Paul Gortmaker
2012-04-16  0:32       ` Ben Hutchings
2012-04-11 23:10 ` [ 07/59] ASoC: wm8994: Update WM8994 DCS calibration Greg KH
2012-04-11 23:10 ` [ 08/59] mtd: ixp4xx: oops in ixp4xx_flash_probe Greg KH
2012-04-11 23:10 ` [ 09/59] mtd: mips: lantiq: reintroduce support for cmdline partitions Greg KH
2012-04-11 23:10 ` [ 10/59] mtd: nand: gpmi: use correct member for checking NAND_BBT_USE_FLASH Greg KH
2012-04-11 23:10 ` [ 11/59] mtd: sst25l: initialize writebufsize Greg KH
2012-04-11 23:10 ` [ 12/59] mtd: block2mtd: " Greg KH
2012-04-11 23:10 ` [ 13/59] mtd: lart: " Greg KH
2012-04-11 23:10 ` [ 14/59] mtd: m25p80: set writebufsize Greg KH
2012-04-11 23:10 ` [ 15/59] ACPI: Do cpufreq clamping for throttling per package v2 Greg KH
2012-04-11 23:10 ` [ 16/59] PNPACPI: Fix device ref leaking in acpi_pnp_match Greg KH
2012-04-11 23:10 ` [ 17/59] ACPICA: Fix regression in FADT revision checks Greg KH
2012-04-11 23:10 ` [ 18/59] modpost: fix ALL_INIT_DATA_SECTIONS Greg KH
2012-04-11 23:10 ` [ 19/59] genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value Greg KH
2012-04-11 23:10 ` [ 20/59] tracing: Fix ftrace stack trace entries Greg KH
2012-04-11 23:10 ` [ 21/59] tracing: Fix ent_size in trace output Greg KH
2012-04-11 23:10 ` [ 22/59] m68k/mac: Add missing platform check before registering platform devices Greg KH
2012-04-11 23:10 ` [ 23/59] mac80211: fix possible tid_rx->reorder_timer use after free Greg KH
2012-04-11 23:10 ` [ 24/59] rtlwifi: rtl8192ce: rtl8192cu: rtl8192de: Fix low-gain setting when scanning Greg KH
2012-04-11 23:11 ` [ 25/59] drm: Validate requested virtual size against allocated fb size Greg KH
2012-04-11 23:11 ` [ 26/59] drm/radeon/kms: fix fans after resume Greg KH
2012-04-11 23:11 ` [ 27/59] drm/i915: no-lvds quirk on MSI DC500 Greg KH
2012-04-11 23:11 ` [ 28/59] drm/i915: Sanitize BIOS debugging bits from PIPECONF Greg KH
2012-04-11 23:11 ` [ 29/59] drm/i915: Add lock on drm_helper_resume_force_mode Greg KH
2012-04-11 23:11 ` [ 30/59] drm/i915: quirk away broken OpRegion VBT Greg KH
2012-04-11 23:11 ` [ 31/59] r8169: runtime resume before shutdown Greg KH
2012-04-11 23:11 ` [ 32/59] target: Fix unsupported WRITE_SAME sense payload Greg KH
2012-04-11 23:11 ` [ 33/59] kgdb,debug_core: pass the breakpoint struct instead of address and memory Greg KH
2012-04-11 23:11 ` [ 34/59] kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA Greg KH
2012-04-11 23:11 ` [ 35/59] kgdbts: (1 of 2) fix single step awareness to work correctly with SMP Greg KH
2012-04-11 23:11 ` [ 36/59] kgdbts: (2 " Greg KH
2012-04-11 23:11 ` [ 37/59] x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() Greg KH
2012-04-11 23:11 ` [ 38/59] CIFS: Fix VFS lock usage for oplocked files Greg KH
2012-04-11 23:11 ` [ 39/59] [PATCH] ARM: tegra: remove Tegra30 errata from MACH_TEGRA_DT Greg KH
2012-04-11 23:11 ` [ 40/59] mmc: sdhci-dove: Fix compile error by including module.h Greg KH
2012-04-11 23:11 ` [ 41/59] mmc: atmel-mci: correct data timeout computation Greg KH
2012-04-11 23:11 ` [ 42/59] tcm_fc: Add abort flag for gracefully handling exchange timeout Greg KH
2012-04-11 23:11 ` [ 43/59] tcm_fc: Do not free tpg structure during wq allocation failure Greg KH
2012-04-11 23:11 ` [ 44/59] sysctl: fix write access to dmesg_restrict/kptr_restrict Greg KH
2012-04-11 23:11 ` [ 45/59] modpost: Fix modpost license checking of vmlinux.o Greg KH
2012-04-11 23:11 ` [ 46/59] x86/PCI: use host bridge _CRS info on MSI MS-7253 Greg KH
2012-04-11 23:11 ` [ 47/59] x86/PCI: do not tie MSI MS-7253 use_crs quirk to BIOS version Greg KH
2012-04-11 23:11 ` [ 48/59] TOMOYO: Fix mount flags checking order Greg KH
2012-04-11 23:11 ` [ 49/59] Revert "x86/ioapic: Add register level checks to detect bogus io-apic entries" Greg KH
2012-04-11 23:11 ` [ 50/59] acer-wmi: No wifi rfkill on Sony machines Greg KH
2012-04-11 23:11 ` [ 51/59] Fix length of buffer copied in __nfs4_get_acl_uncached Greg KH
2012-04-11 23:11 ` [ 52/59] sched/x86: Fix overflow in cyc2ns_offset Greg KH
2012-04-11 23:11 ` [ 53/59] mfd: Clear twl6030 IRQ status register only once Greg KH
2012-04-11 23:11 ` [ 54/59] USB: Add Motorola Rokr E6 Id to the USBNet driver "zaurus" Greg KH
2012-04-11 23:11 ` [ 55/59] ioat: fix size of completion for Xen Greg KH
2012-04-11 23:11 ` [ 56/59] ASoC: ak4642: fixup: mute needs +1 step Greg KH
2012-04-11 23:11 ` [ 57/59] cred: copy_process() should clear child->replacement_session_keyring Greg KH
2012-04-11 23:11 ` [ 58/59] iommu/amd: Make sure IOMMU interrupts are re-enabled on resume Greg KH
2012-04-11 23:11 ` [ 59/59] Bluetooth: Fix l2cap conn failures for ssp devices Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.