linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.12 001/111] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 002/111] gpio: squelch a compiler warning Jiri Slaby
                   ` (111 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ian Wilson, Pablo Neira Ayuso, Jiri Slaby

From: Ian Wilson <iwilson@brocade.com>

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

===============

[ upstream commit 78146572b9cd20452da47951812f35b1ad4906be ]

nfnl_cthelper_parse_tuple() is called from nfnl_cthelper_new(),
nfnl_cthelper_get() and nfnl_cthelper_del().  In each case they pass
a pointer to an nf_conntrack_tuple data structure local variable:

    struct nf_conntrack_tuple tuple;
    ...
    ret = nfnl_cthelper_parse_tuple(&tuple, tb[NFCTH_TUPLE]);

The problem is that this local variable is not initialized, and
nfnl_cthelper_parse_tuple() only initializes two fields: src.l3num and
dst.protonum.  This leaves all other fields with undefined values
based on whatever is on the stack:

    tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM]));
    tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]);

The symptom observed was that when the rpc and tns helpers were added
then traffic to port 1536 was being sent to user-space.

Signed-off-by: Ian Wilson <iwilson@brocade.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/netfilter/nfnetlink_cthelper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 9e287cb56a04..7f035f0772ee 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -77,6 +77,9 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple,
 	if (!tb[NFCTH_TUPLE_L3PROTONUM] || !tb[NFCTH_TUPLE_L4PROTONUM])
 		return -EINVAL;
 
+	/* Not all fields are initialized so first zero the tuple */
+	memset(tuple, 0, sizeof(struct nf_conntrack_tuple));
+
 	tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM]));
 	tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]);
 
-- 
2.4.2


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

* [PATCH 3.12 002/111] gpio: squelch a compiler warning
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 001/111] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple() Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 003/111] libata: Update Crucial/Micron blacklist Jiri Slaby
                   ` (110 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Martin Kaiser, Martin Kaiser, Greg Kroah-Hartman,
	Jiri Slaby

From: Martin Kaiser <lists@kaiser.cx>

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

===============

drivers/gpio/gpiolib-of.c: In function 'of_gpiochip_find_and_xlate':
drivers/gpio/gpiolib-of.c:52:21: warning: assignment makes integer from pointer without a cast [enabled by default]
   gg_data->out_gpio = ERR_PTR(ret);
                     ^
This was introduced in 72464765733575dc89c509f16caabc2af47fda79, a
backport of upstream commit 7b8792bbdffdff3abda704f89c6a45ea97afdc62.

The upstream kernel changed the type of out_gpio from int to struct gpio_desc *
as part of a larger refactoring that wasn't backported

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 836af49da901..1c031878b6ab 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -49,7 +49,7 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data)
 		 * Return false to keep looking, as more than one gpio chip
 		 * could be registered per of-node.
 		 */
-		gg_data->out_gpio = ERR_PTR(ret);
+		gg_data->out_gpio = ret;
 		return false;
 	 }
 
-- 
2.4.2


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

* [PATCH 3.12 003/111] libata: Update Crucial/Micron blacklist
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 001/111] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple() Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 002/111] gpio: squelch a compiler warning Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 004/111] libata: Blacklist queued TRIM on all Samsung 800-series Jiri Slaby
                   ` (109 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Martin K. Petersen, Tejun Heo, Jiri Slaby

From: "Martin K. Petersen" <martin.petersen@oracle.com>

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

===============

commit ff7f53fb82a7801a778e5902bdbbc5e195ab0de0 upstream.

Micron has released an updated firmware (MU02) for M510/M550/MX100
drives to fix the issues with queued TRIM. Queued TRIM remains broken on
M500 but is working fine on later drives such as M600 and MX200.

Tweak our blacklist to reflect the above.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=71371
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/libata-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a428f6c7aa7c..38c4394ccc05 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4225,9 +4225,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 
 	/* devices that don't properly handle queued TRIM commands */
 	{ "Micron_M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Crucial_CT???M500SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Micron_M550*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Crucial_CT*M550SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Crucial_CT*M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Micron_M5[15]0*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Crucial_CT*M550*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Crucial_CT*MX100*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Samsung SSD 850 PRO*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 
 	/*
-- 
2.4.2


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

* [PATCH 3.12 004/111] libata: Blacklist queued TRIM on all Samsung 800-series
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (2 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 003/111] libata: Update Crucial/Micron blacklist Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 005/111] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected Jiri Slaby
                   ` (108 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Martin K. Petersen, Tejun Heo, Jiri Slaby

From: "Martin K. Petersen" <martin.petersen@oracle.com>

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

===============

commit 9a9324d3969678d44b330e1230ad2c8ae67acf81 upstream.

The queued TRIM problems appear to be generic to Samsung's firmware and
not tied to a particular model. A recent update to the 840 EVO firmware
introduced the same issue as we saw on 850 Pro.

Blacklist queued TRIM on all 800-series drives while we work this issue
with Samsung.

Reported-by: Günter Waller <g.wal@web.de>
Reported-by: Sven Köhler <sven.koehler@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/libata-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 38c4394ccc05..c36bd031ebdd 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4229,7 +4229,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	{ "Micron_M5[15]0*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT*M550*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT*MX100*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Samsung SSD 850 PRO*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+	{ "Samsung SSD 8*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 
 	/*
 	 * Some WD SATA-I drives spin up and down erratically when the link
-- 
2.4.2


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

* [PATCH 3.12 005/111] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (3 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 004/111] libata: Blacklist queued TRIM on all Samsung 800-series Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 006/111] hpsa: refine the pci enable/disable handling Jiri Slaby
                   ` (107 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Konrad Rzeszutek Wilk, Borislav Petkov,
	H. Peter Anvin, Linus Torvalds, Michael Chan, Thomas Gleixner,
	boris.ostrovsky, cascardo, david.vrabel, sanjeevb, siva.kallam,
	vyasevich, xen-devel, Ingo Molnar, Jiri Slaby

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

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

===============

commit a6dfa128ce5c414ab46b1d690f7a1b8decb8526d upstream.

A huge amount of NIC drivers use the DMA API, however if
compiled under 32-bit an very important part of the DMA API can
be ommitted leading to the drivers not working at all
(especially if used with 'swiotlb=force iommu=soft').

As Prashant Sreedharan explains it: "the driver [tg3] uses
DEFINE_DMA_UNMAP_ADDR(), dma_unmap_addr_set() to keep a copy of
the dma "mapping" and dma_unmap_addr() to get the "mapping"
value. On most of the platforms this is a no-op, but ... with
"iommu=soft and swiotlb=force" this house keeping is required,
... otherwise we pass 0 while calling pci_unmap_/pci_dma_sync_
instead of the DMA address."

As such enable this even when using 32-bit kernels.

Reported-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Prashant Sreedharan <prashant@broadcom.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: boris.ostrovsky@oracle.com
Cc: cascardo@linux.vnet.ibm.com
Cc: david.vrabel@citrix.com
Cc: sanjeevb@broadcom.com
Cc: siva.kallam@broadcom.com
Cc: vyasevich@gmail.com
Cc: xen-devel@lists.xensource.com
Link: http://lkml.kernel.org/r/20150417190448.GA9462@l.oracle.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5b5c6ea1a76c..0cda30450825 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -156,7 +156,7 @@ config SBUS
 
 config NEED_DMA_MAP_STATE
 	def_bool y
-	depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG
+	depends on X86_64 || INTEL_IOMMU || DMA_API_DEBUG || SWIOTLB
 
 config NEED_SG_DMA_LENGTH
 	def_bool y
-- 
2.4.2


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

* [PATCH 3.12 006/111] hpsa: refine the pci enable/disable handling
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (4 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 005/111] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 007/111] hpsa: add missing pci_set_master in kdump path Jiri Slaby
                   ` (106 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tomas Henzl, Christoph Hellwig, Jiri Slaby

From: Tomas Henzl <thenzl@redhat.com>

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

===============

commit 132aa220b45d60e9b20def1e9d8be9422eed9616 upstream.

When a second(kdump) kernel starts and the hard reset method is used
the driver calls pci_disable_device without previously enabling it,
so the kernel shows a warning -
[   16.876248] WARNING: at drivers/pci/pci.c:1431 pci_disable_device+0x84/0x90()
[   16.882686] Device hpsa
disabling already-disabled device
...
This patch fixes it, in addition to this I tried to balance also some other pairs
of enable/disable device in the driver.
Unfortunately I wasn't able to verify the functionality for the case of a sw reset,
because of a lack of proper hw.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/hpsa.c | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index d535e7504ea0..3639f05fafd0 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3920,10 +3920,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev)
 
 	/* Save the PCI command register */
 	pci_read_config_word(pdev, 4, &command_register);
-	/* Turn the board off.  This is so that later pci_restore_state()
-	 * won't turn the board on before the rest of config space is ready.
-	 */
-	pci_disable_device(pdev);
 	pci_save_state(pdev);
 
 	/* find the first memory BAR, so we can find the cfg table */
@@ -3971,11 +3967,6 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev)
 		goto unmap_cfgtable;
 
 	pci_restore_state(pdev);
-	rc = pci_enable_device(pdev);
-	if (rc) {
-		dev_warn(&pdev->dev, "failed to enable device.\n");
-		goto unmap_cfgtable;
-	}
 	pci_write_config_word(pdev, 4, command_register);
 
 	/* Some devices (notably the HP Smart Array 5i Controller)
@@ -4470,6 +4461,23 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 	if (!reset_devices)
 		return 0;
 
+	/* kdump kernel is loading, we don't know in which state is
+	 * the pci interface. The dev->enable_cnt is equal zero
+	 * so we call enable+disable, wait a while and switch it on.
+	 */
+	rc = pci_enable_device(pdev);
+	if (rc) {
+		dev_warn(&pdev->dev, "Failed to enable PCI device\n");
+		return -ENODEV;
+	}
+	pci_disable_device(pdev);
+	msleep(260);			/* a randomly chosen number */
+	rc = pci_enable_device(pdev);
+	if (rc) {
+		dev_warn(&pdev->dev, "failed to enable device.\n");
+		return -ENODEV;
+	}
+
 	/* Reset the controller with a PCI power-cycle or via doorbell */
 	rc = hpsa_kdump_hard_reset_controller(pdev);
 
@@ -4478,10 +4486,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 	 * "performant mode".  Or, it might be 640x, which can't reset
 	 * due to concerns about shared bbwc between 6402/6404 pair.
 	 */
-	if (rc == -ENOTSUPP)
-		return rc; /* just try to do the kdump anyhow. */
-	if (rc)
-		return -ENODEV;
+	if (rc) {
+		if (rc != -ENOTSUPP) /* just try to do the kdump anyhow. */
+			rc = -ENODEV;
+		goto out_disable;
+	}
 
 	/* Now try to get the controller to respond to a no-op */
 	dev_warn(&pdev->dev, "Waiting for controller to respond to no-op\n");
@@ -4492,7 +4501,11 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 			dev_warn(&pdev->dev, "no-op failed%s\n",
 					(i < 11 ? "; re-trying" : ""));
 	}
-	return 0;
+
+out_disable:
+
+	pci_disable_device(pdev);
+	return rc;
 }
 
 static int hpsa_allocate_cmd_pool(struct ctlr_info *h)
@@ -4635,6 +4648,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
 		iounmap(h->transtable);
 	if (h->cfgtable)
 		iounmap(h->cfgtable);
+	pci_disable_device(h->pdev);
 	pci_release_regions(h->pdev);
 	kfree(h);
 }
-- 
2.4.2


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

* [PATCH 3.12 007/111] hpsa: add missing pci_set_master in kdump path
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (5 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 006/111] hpsa: refine the pci enable/disable handling Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 008/111] hpsa: turn off interrupts when kdump starts Jiri Slaby
                   ` (105 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tomas Henzl, Christoph Hellwig, Jiri Slaby

From: Tomas Henzl <thenzl@redhat.com>

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

===============

commit 859c75aba20264d87dd026bab0d0ca3bff385955 upstream.

Add a call to pci_set_master(...)  missing in the previous
patch "hpsa: refine the pci enable/disable handling".
Found thanks to Rob Elliot.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Tested-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 3639f05fafd0..74f5cebde95a 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4477,7 +4477,7 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 		dev_warn(&pdev->dev, "failed to enable device.\n");
 		return -ENODEV;
 	}
-
+	pci_set_master(pdev);
 	/* Reset the controller with a PCI power-cycle or via doorbell */
 	rc = hpsa_kdump_hard_reset_controller(pdev);
 
-- 
2.4.2


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

* [PATCH 3.12 008/111] hpsa: turn off interrupts when kdump starts
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (6 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 007/111] hpsa: add missing pci_set_master in kdump path Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 009/111] aio: change exit_aio() to load mm->ioctx_table once and avoid rcu_read_lock() Jiri Slaby
                   ` (104 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Tomas Henzl, Don Brace, Christoph Hellwig, Jiri Slaby

From: Tomas Henzl <thenzl@redhat.com>

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

===============

commit 3b747298786355c6934b0892fc9ae4ca44105192 upstream.

Sometimes when the card is restarted it may cause -
"irq 16: nobody cared (try booting with the "irqpoll" option)"
that is likely caused so, that the card, after the hard reset
finishes, pulls on the irq. Disabling the ints before or after
the hpsa_kdump_hard_reset_controller fixes it.

At this point we can't know in which state the card is,
so using SA5_INTR_OFF + SA5_REPLY_INTR_MASK_OFFSET defines directly,
instead of the function the drivers provides, seems to be apropriate.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/hpsa.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 74f5cebde95a..64e15408a354 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4457,6 +4457,7 @@ static void hpsa_hba_inquiry(struct ctlr_info *h)
 static int hpsa_init_reset_devices(struct pci_dev *pdev)
 {
 	int rc, i;
+	void __iomem *vaddr;
 
 	if (!reset_devices)
 		return 0;
@@ -4478,6 +4479,15 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 		return -ENODEV;
 	}
 	pci_set_master(pdev);
+
+	vaddr = pci_ioremap_bar(pdev, 0);
+	if (vaddr == NULL) {
+		rc = -ENOMEM;
+		goto out_disable;
+	}
+	writel(SA5_INTR_OFF, vaddr + SA5_REPLY_INTR_MASK_OFFSET);
+	iounmap(vaddr);
+
 	/* Reset the controller with a PCI power-cycle or via doorbell */
 	rc = hpsa_kdump_hard_reset_controller(pdev);
 
-- 
2.4.2


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

* [PATCH 3.12 009/111] aio: change exit_aio() to load mm->ioctx_table once and avoid rcu_read_lock()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (7 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 008/111] hpsa: turn off interrupts when kdump starts Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 010/111] aio: fix serial draining in exit_aio() Jiri Slaby
                   ` (103 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Oleg Nesterov, Benjamin LaHaise, Jiri Slaby

From: Oleg Nesterov <oleg@redhat.com>

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

===============

commit 4b70ac5fd9b58bfaa5f25b4ea48f528aefbf3308 upstream.

On 04/30, Benjamin LaHaise wrote:
>
> > -		ctx->mmap_size = 0;
> > -
> > -		kill_ioctx(mm, ctx, NULL);
> > +		if (ctx) {
> > +			ctx->mmap_size = 0;
> > +			kill_ioctx(mm, ctx, NULL);
> > +		}
>
> Rather than indenting and moving the two lines changing mmap_size and the
> kill_ioctx() call, why not just do "if (!ctx) ... continue;"?  That reduces
> the number of lines changed and avoid excessive indentation.

OK. To me the code looks better/simpler with "if (ctx)", but this is subjective
of course, I won't argue.

The patch still removes the empty line between mmap_size = 0 and kill_ioctx(),
we reset mmap_size only for kill_ioctx(). But feel free to remove this change.

-------------------------------------------------------------------------------
Subject: [PATCH v3 1/2] aio: change exit_aio() to load mm->ioctx_table once and avoid rcu_read_lock()

1. We can read ->ioctx_table only once and we do not read rcu_read_lock()
   or even rcu_dereference().

   This mm has no users, nobody else can play with ->ioctx_table. Otherwise
   the code is buggy anyway, if we need rcu_read_lock() in a loop because
   ->ioctx_table can be updated then kfree(table) is obviously wrong.

2. Update the comment. "exit_mmap(mm) is coming" is the good reason to avoid
   munmap(), but another reason is that we simply can't do vm_munmap() unless
   current->mm == mm and this is not true in general, the caller is mmput().

3. We do not really need to nullify mm->ioctx_table before return, probably
   the current code does this to catch the potential problems. But in this
   case RCU_INIT_POINTER(NULL) looks better.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/aio.c | 44 +++++++++++++++++---------------------------
 1 file changed, 17 insertions(+), 27 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 7bdf3467bf24..aafb96629f49 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -801,38 +801,25 @@ EXPORT_SYMBOL(wait_on_sync_kiocb);
  */
 void exit_aio(struct mm_struct *mm)
 {
-	struct kioctx_table *table;
-	struct kioctx *ctx;
-	unsigned i = 0;
+	struct kioctx_table *table = rcu_dereference_raw(mm->ioctx_table);
+	int i;
 
-	while (1) {
+	if (!table)
+		return;
+
+	for (i = 0; i < table->nr; ++i) {
+		struct kioctx *ctx = table->table[i];
 		struct completion requests_done =
 			COMPLETION_INITIALIZER_ONSTACK(requests_done);
 
-		rcu_read_lock();
-		table = rcu_dereference(mm->ioctx_table);
-
-		do {
-			if (!table || i >= table->nr) {
-				rcu_read_unlock();
-				rcu_assign_pointer(mm->ioctx_table, NULL);
-				if (table)
-					kfree(table);
-				return;
-			}
-
-			ctx = table->table[i++];
-		} while (!ctx);
-
-		rcu_read_unlock();
-
+		if (!ctx)
+			continue;
 		/*
-		 * We don't need to bother with munmap() here -
-		 * exit_mmap(mm) is coming and it'll unmap everything.
-		 * Since aio_free_ring() uses non-zero ->mmap_size
-		 * as indicator that it needs to unmap the area,
-		 * just set it to 0; aio_free_ring() is the only
-		 * place that uses ->mmap_size, so it's safe.
+		 * We don't need to bother with munmap() here - exit_mmap(mm)
+		 * is coming and it'll unmap everything. And we simply can't,
+		 * this is not necessarily our ->mm.
+		 * Since kill_ioctx() uses non-zero ->mmap_size as indicator
+		 * that it needs to unmap the area, just set it to 0.
 		 */
 		ctx->mmap_size = 0;
 
@@ -841,6 +828,9 @@ void exit_aio(struct mm_struct *mm)
 		/* Wait until all IO for the context are done. */
 		wait_for_completion(&requests_done);
 	}
+
+	RCU_INIT_POINTER(mm->ioctx_table, NULL);
+	kfree(table);
 }
 
 static void put_reqs_available(struct kioctx *ctx, unsigned nr)
-- 
2.4.2


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

* [PATCH 3.12 010/111] aio: fix serial draining in exit_aio()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (8 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 009/111] aio: change exit_aio() to load mm->ioctx_table once and avoid rcu_read_lock() Jiri Slaby
@ 2015-06-10 15:25 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 011/111] mnt: Fail collect_mounts when applied to unmounted mounts Jiri Slaby
                   ` (102 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:25 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jens Axboe, Jiri Slaby

From: Jens Axboe <axboe@fb.com>

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

===============

commit dc48e56d761610da4ea1088d1bea0a030b8e3e43 upstream.

exit_aio() currently serializes killing io contexts. Each context
killing ends up having to do percpu_ref_kill(), which in turns has
to wait for an RCU grace period. This can take a long time, depending
on the number of contexts. And there's no point in doing them serially,
when we could be waiting for all of them in one fell swoop.

This patches makes my fio thread offload test case exit 0.2s instead
of almost 6s.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/aio.c | 49 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index aafb96629f49..329e6c1f3a43 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -77,6 +77,11 @@ struct kioctx_cpu {
 	unsigned		reqs_available;
 };
 
+struct ctx_rq_wait {
+	struct completion comp;
+	atomic_t count;
+};
+
 struct kioctx {
 	struct percpu_ref	users;
 	atomic_t		dead;
@@ -115,7 +120,7 @@ struct kioctx {
 	/*
 	 * signals when all in-flight requests are done
 	 */
-	struct completion *requests_done;
+	struct ctx_rq_wait	*rq_wait;
 
 	struct {
 		/*
@@ -521,8 +526,8 @@ static void free_ioctx_reqs(struct percpu_ref *ref)
 	struct kioctx *ctx = container_of(ref, struct kioctx, reqs);
 
 	/* At this point we know that there are no any in-flight requests */
-	if (ctx->requests_done)
-		complete(ctx->requests_done);
+	if (ctx->rq_wait && atomic_dec_and_test(&ctx->rq_wait->count))
+		complete(&ctx->rq_wait->comp);
 
 	INIT_WORK(&ctx->free_work, free_ioctx);
 	schedule_work(&ctx->free_work);
@@ -738,7 +743,7 @@ err:
  *	the rapid destruction of the kioctx.
  */
 static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx,
-		struct completion *requests_done)
+		      struct ctx_rq_wait *wait)
 {
 	if (!atomic_xchg(&ctx->dead, 1)) {
 		struct kioctx_table *table;
@@ -767,11 +772,11 @@ static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx,
 		if (ctx->mmap_size)
 			vm_munmap(ctx->mmap_base, ctx->mmap_size);
 
-		ctx->requests_done = requests_done;
+		ctx->rq_wait = wait;
 		percpu_ref_kill(&ctx->users);
 	} else {
-		if (requests_done)
-			complete(requests_done);
+		if (wait && atomic_dec_and_test(&wait->count))
+			complete(&wait->comp);
 	}
 }
 
@@ -802,18 +807,24 @@ EXPORT_SYMBOL(wait_on_sync_kiocb);
 void exit_aio(struct mm_struct *mm)
 {
 	struct kioctx_table *table = rcu_dereference_raw(mm->ioctx_table);
-	int i;
+	struct ctx_rq_wait wait;
+	int i, skipped;
 
 	if (!table)
 		return;
 
+	atomic_set(&wait.count, table->nr);
+	init_completion(&wait.comp);
+
+	skipped = 0;
 	for (i = 0; i < table->nr; ++i) {
 		struct kioctx *ctx = table->table[i];
-		struct completion requests_done =
-			COMPLETION_INITIALIZER_ONSTACK(requests_done);
 
-		if (!ctx)
+		if (!ctx) {
+			skipped++;
 			continue;
+		}
+
 		/*
 		 * We don't need to bother with munmap() here - exit_mmap(mm)
 		 * is coming and it'll unmap everything. And we simply can't,
@@ -823,10 +834,12 @@ void exit_aio(struct mm_struct *mm)
 		 */
 		ctx->mmap_size = 0;
 
-		kill_ioctx(mm, ctx, &requests_done);
+		kill_ioctx(mm, ctx, &wait);
+	}
 
+	if (!atomic_sub_and_test(skipped, &wait.count)) {
 		/* Wait until all IO for the context are done. */
-		wait_for_completion(&requests_done);
+		wait_for_completion(&wait.comp);
 	}
 
 	RCU_INIT_POINTER(mm->ioctx_table, NULL);
@@ -1238,21 +1251,23 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
 {
 	struct kioctx *ioctx = lookup_ioctx(ctx);
 	if (likely(NULL != ioctx)) {
-		struct completion requests_done =
-			COMPLETION_INITIALIZER_ONSTACK(requests_done);
+		struct ctx_rq_wait wait;
+
+		init_completion(&wait.comp);
+		atomic_set(&wait.count, 1);
 
 		/* Pass requests_done to kill_ioctx() where it can be set
 		 * in a thread-safe way. If we try to set it here then we have
 		 * a race condition if two io_destroy() called simultaneously.
 		 */
-		kill_ioctx(current->mm, ioctx, &requests_done);
+		kill_ioctx(current->mm, ioctx, &wait);
 		percpu_ref_put(&ioctx->users);
 
 		/* Wait until all IO for the context are done. Otherwise kernel
 		 * keep using user-space buffers even if user thinks the context
 		 * is destroyed.
 		 */
-		wait_for_completion(&requests_done);
+		wait_for_completion(&wait.comp);
 
 		return 0;
 	}
-- 
2.4.2


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

* [PATCH 3.12 011/111] mnt: Fail collect_mounts when applied to unmounted mounts
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (9 preceding siblings ...)
  2015-06-10 15:25 ` [PATCH 3.12 010/111] aio: fix serial draining in exit_aio() Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 012/111] cn: verify msg->len before making callback Jiri Slaby
                   ` (101 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Eric W. Biederman, Jiri Slaby

From: "Eric W. Biederman" <ebiederm@xmission.com>

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

===============

commit cd4a40174b71acd021877341684d8bb1dc8ea4ae upstream.

The only users of collect_mounts are in audit_tree.c

In audit_trim_trees and audit_add_tree_rule the path passed into
collect_mounts is generated from kern_path passed an audit_tree
pathname which is guaranteed to be an absolute path.   In those cases
collect_mounts is obviously intended to work on mounted paths and
if a race results in paths that are unmounted when collect_mounts
it is reasonable to fail early.

The paths passed into audit_tag_tree don't have the absolute path
check.  But are used to play with fsnotify and otherwise interact with
the audit_trees, so again operating only on mounted paths appears
reasonable.

Avoid having to worry about what happens when we try and audit
unmounted filesystems by restricting collect_mounts to mounts
that appear in the mount tree.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/namespace.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 247f34d43dda..185cd1aefa14 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1467,8 +1467,11 @@ struct vfsmount *collect_mounts(struct path *path)
 {
 	struct mount *tree;
 	namespace_lock();
-	tree = copy_tree(real_mount(path->mnt), path->dentry,
-			 CL_COPY_ALL | CL_PRIVATE);
+	if (!check_mnt(real_mount(path->mnt)))
+		tree = ERR_PTR(-EINVAL);
+	else
+		tree = copy_tree(real_mount(path->mnt), path->dentry,
+				 CL_COPY_ALL | CL_PRIVATE);
 	namespace_unlock();
 	if (IS_ERR(tree))
 		return ERR_CAST(tree);
-- 
2.4.2


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

* [PATCH 3.12 012/111] cn: verify msg->len before making callback
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (10 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 011/111] mnt: Fail collect_mounts when applied to unmounted mounts Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 013/111] HID: debug: fix error handling in hid_debug_events_read() Jiri Slaby
                   ` (100 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, David Fries, Greg Kroah-Hartman, Jiri Slaby

From: David Fries <David@Fries.net>

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

===============

commit a30cfa475d1a26c18f1998ba1e034a4e2ab4c7a8 upstream.

The struct cn_msg len field comes from userspace and needs to be
validated.  More logical to do so here where the cn_msg pointer is
pulled out of the sk_buff than the callback which is passed cn_msg *
and might assume no validation is needed.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: David Fries <David@Fries.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/connector/connector.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index a36749f1e44a..fb1bad083aa9 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -122,12 +122,18 @@ EXPORT_SYMBOL_GPL(cn_netlink_send);
  */
 static int cn_call_callback(struct sk_buff *skb)
 {
+	struct nlmsghdr *nlh;
 	struct cn_callback_entry *i, *cbq = NULL;
 	struct cn_dev *dev = &cdev;
 	struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb));
 	struct netlink_skb_parms *nsp = &NETLINK_CB(skb);
 	int err = -ENODEV;
 
+	/* verify msg->len is within skb */
+	nlh = nlmsg_hdr(skb);
+	if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len)
+		return -EINVAL;
+
 	spin_lock_bh(&dev->cbdev->queue_lock);
 	list_for_each_entry(i, &dev->cbdev->queue_list, callback_entry) {
 		if (cn_cb_equal(&i->id.id, &msg->id)) {
-- 
2.4.2


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

* [PATCH 3.12 013/111] HID: debug: fix error handling in hid_debug_events_read()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (11 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 012/111] cn: verify msg->len before making callback Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 014/111] Input: usbtouchscreen - add new model from IRTOUCHSYSTEMS Jiri Slaby
                   ` (99 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jiri Kosina, Jiri Slaby

From: Jiri Kosina <jkosina@suse.cz>

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

===============

commit 8fec02a73e31407e14986fca67dab48d4f777f0e upstream.

In the unlikely case of hdev vanishing while hid_debug_events_read() was
sleeping, we can't really break out of the case switch as with other cases,
as on the way out we'll try to remove ourselves from the hdev waitqueue.

Fix this by taking a shortcut exit path and avoiding cleanup that doesn't
make sense in case hdev doesn't exist any more anyway.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hid/hid-debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 8453214ec376..c607d953270c 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1027,7 +1027,8 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
 
 				if (!list->hdev || !list->hdev->debug) {
 					ret = -EIO;
-					break;
+					set_current_state(TASK_RUNNING);
+					goto out;
 				}
 
 				/* allow O_NONBLOCK from other threads */
-- 
2.4.2


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

* [PATCH 3.12 014/111] Input: usbtouchscreen - add new model from IRTOUCHSYSTEMS
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (12 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 013/111] HID: debug: fix error handling in hid_debug_events_read() Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 015/111] Input: cros_ec_keyb - fix clearing keyboard state on wakeup Jiri Slaby
                   ` (98 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Lars Poeschel, Dmitry Torokhov, Jiri Slaby

From: Lars Poeschel <poeschel@lemonage.de>

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

===============

commit dbea4032f8024e5ea886341f7c39cf023e30e828 upstream.

This adds support for another model of IRTOUCH SYSTEMS Co.,LtD infrared
touchscreens. The USB vendorID/deviceID is 6615/0012. It is also sold
under the label "Elektrosil".

The datasheet states that coordinates for x and y are in the range from
0 to 32767.

Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/touchscreen/usbtouchscreen.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 5f87bed05467..e565530e3596 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -133,6 +133,7 @@ enum {
 	DEVTYPE_GUNZE,
 	DEVTYPE_DMC_TSC10,
 	DEVTYPE_IRTOUCH,
+	DEVTYPE_IRTOUCH_HIRES,
 	DEVTYPE_IDEALTEK,
 	DEVTYPE_GENERAL_TOUCH,
 	DEVTYPE_GOTOP,
@@ -199,6 +200,7 @@ static const struct usb_device_id usbtouch_devices[] = {
 #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
 	{USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
 	{USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
+	{USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES},
 #endif
 
 #ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
@@ -1178,6 +1180,15 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
 		.rept_size	= 8,
 		.read_data	= irtouch_read_data,
 	},
+
+	[DEVTYPE_IRTOUCH_HIRES] = {
+		.min_xc		= 0x0,
+		.max_xc		= 0x7fff,
+		.min_yc		= 0x0,
+		.max_yc		= 0x7fff,
+		.rept_size	= 8,
+		.read_data	= irtouch_read_data,
+	},
 #endif
 
 #ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
-- 
2.4.2


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

* [PATCH 3.12 015/111] Input: cros_ec_keyb - fix clearing keyboard state on wakeup
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (13 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 014/111] Input: usbtouchscreen - add new model from IRTOUCHSYSTEMS Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 016/111] Input: xpad - add support for Xbox One controllers Jiri Slaby
                   ` (97 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tomeu Vizoso, Dmitry Torokhov, Jiri Slaby

From: Tomeu Vizoso <tomeu.vizoso@collabora.com>

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

===============

commit ef30a406468a3eae007210ae0dc5ed8d5eb59b7d upstream.

As the comment right before explains, the keyboard state is to be cleared
only if the EC wasn't a wakeup source in the last suspend.

Without this commit, there's an unneeded delay when resuming from suspend
and we also lose the key that was pressed while suspended.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/keyboard/cros_ec_keyb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 7e8b0a52af25..528de9cdf075 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -309,7 +309,7 @@ static int cros_ec_keyb_resume(struct device *dev)
 	 * wake source (e.g. the lid is open and the user might press a key to
 	 * wake) then the key scan buffer should be preserved.
 	 */
-	if (ckdev->ec->was_wake_device)
+	if (!ckdev->ec->was_wake_device)
 		cros_ec_keyb_clear_keyboard(ckdev);
 
 	return 0;
-- 
2.4.2


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

* [PATCH 3.12 016/111] Input: xpad - add support for Xbox One controllers
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (14 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 015/111] Input: cros_ec_keyb - fix clearing keyboard state on wakeup Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 017/111] Input: xpad - add Thrustmaster as Xbox 360 controller vendor Jiri Slaby
                   ` (96 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ted Mielczarek, Dmitry Torokhov, Jiri Slaby

From: Ted Mielczarek <ted@mielczarek.org>

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

===============

commit 1a48ff81b3912be5fadae3fafde6c2f632246a4c upstream.

Xbox One controllers require an initialization message to start sending
data, so xpad_init_output becomes a required function. The Xbox One
controller does not have LEDs like the Xbox 360 controller, so that
functionality is not implemented. The format of messages controlling rumble
is currently undocumented, so rumble support is not yet implemented.

Note that Xbox One controller advertises three interfaces with the same
interface class, subclass and protocol, so we have to also match against
interface number.

Signed-off-by: Ted Mielczarek <ted@mielczarek.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/joystick/xpad.c | 174 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 157 insertions(+), 17 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 90c7f97ea0ad..86a98b76e578 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -96,7 +96,8 @@
 #define XTYPE_XBOX        0
 #define XTYPE_XBOX360     1
 #define XTYPE_XBOX360W    2
-#define XTYPE_UNKNOWN     3
+#define XTYPE_XBOXONE     3
+#define XTYPE_UNKNOWN     4
 
 static bool dpad_to_buttons;
 module_param(dpad_to_buttons, bool, S_IRUGO);
@@ -122,6 +123,7 @@ static const struct xpad_device {
 	{ 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX },
 	{ 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX },
 	{ 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },
+	{ 0x045e, 0x02d1, "Microsoft X-Box One pad", 0, XTYPE_XBOXONE },
 	{ 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
 	{ 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
 	{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -264,10 +266,12 @@ static const signed short xpad_abs_triggers[] = {
 	-1
 };
 
-/* Xbox 360 has a vendor-specific class, so we cannot match it with only
+/*
+ * Xbox 360 has a vendor-specific class, so we cannot match it with only
  * USB_INTERFACE_INFO (also specifically refused by USB subsystem), so we
  * match against vendor id as well. Wired Xbox 360 devices have protocol 1,
- * wireless controllers have protocol 129. */
+ * wireless controllers have protocol 129.
+ */
 #define XPAD_XBOX360_VENDOR_PROTOCOL(vend,pr) \
 	.match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \
 	.idVendor = (vend), \
@@ -278,9 +282,20 @@ static const signed short xpad_abs_triggers[] = {
 	{ XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \
 	{ XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) }
 
+/* The Xbox One controller uses subclass 71 and protocol 208. */
+#define XPAD_XBOXONE_VENDOR_PROTOCOL(vend, pr) \
+	.match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \
+	.idVendor = (vend), \
+	.bInterfaceClass = USB_CLASS_VENDOR_SPEC, \
+	.bInterfaceSubClass = 71, \
+	.bInterfaceProtocol = (pr)
+#define XPAD_XBOXONE_VENDOR(vend) \
+	{ XPAD_XBOXONE_VENDOR_PROTOCOL(vend, 208) }
+
 static struct usb_device_id xpad_table[] = {
 	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* X-Box USB-IF not approved class */
 	XPAD_XBOX360_VENDOR(0x045e),		/* Microsoft X-Box 360 controllers */
+	XPAD_XBOXONE_VENDOR(0x045e),		/* Microsoft X-Box One controllers */
 	XPAD_XBOX360_VENDOR(0x046d),		/* Logitech X-Box 360 style controllers */
 	XPAD_XBOX360_VENDOR(0x0738),		/* Mad Catz X-Box 360 controllers */
 	{ USB_DEVICE(0x0738, 0x4540) },		/* Mad Catz Beat Pad */
@@ -314,12 +329,10 @@ struct usb_xpad {
 	struct urb *bulk_out;
 	unsigned char *bdata;
 
-#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
 	struct urb *irq_out;		/* urb for interrupt out report */
 	unsigned char *odata;		/* output data */
 	dma_addr_t odata_dma;
 	struct mutex odata_mutex;
-#endif
 
 #if defined(CONFIG_JOYSTICK_XPAD_LEDS)
 	struct xpad_led *led;
@@ -506,6 +519,105 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha
 	xpad360_process_packet(xpad, cmd, &data[4]);
 }
 
+/*
+ *	xpadone_process_buttons
+ *
+ *	Process a button update packet from an Xbox one controller.
+ */
+static void xpadone_process_buttons(struct usb_xpad *xpad,
+				struct input_dev *dev,
+				unsigned char *data)
+{
+	/* menu/view buttons */
+	input_report_key(dev, BTN_START,  data[4] & 0x04);
+	input_report_key(dev, BTN_SELECT, data[4] & 0x08);
+
+	/* buttons A,B,X,Y */
+	input_report_key(dev, BTN_A,	data[4] & 0x10);
+	input_report_key(dev, BTN_B,	data[4] & 0x20);
+	input_report_key(dev, BTN_X,	data[4] & 0x40);
+	input_report_key(dev, BTN_Y,	data[4] & 0x80);
+
+	/* digital pad */
+	if (xpad->mapping & MAP_DPAD_TO_BUTTONS) {
+		/* dpad as buttons (left, right, up, down) */
+		input_report_key(dev, BTN_TRIGGER_HAPPY1, data[5] & 0x04);
+		input_report_key(dev, BTN_TRIGGER_HAPPY2, data[5] & 0x08);
+		input_report_key(dev, BTN_TRIGGER_HAPPY3, data[5] & 0x01);
+		input_report_key(dev, BTN_TRIGGER_HAPPY4, data[5] & 0x02);
+	} else {
+		input_report_abs(dev, ABS_HAT0X,
+				 !!(data[5] & 0x08) - !!(data[5] & 0x04));
+		input_report_abs(dev, ABS_HAT0Y,
+				 !!(data[5] & 0x02) - !!(data[5] & 0x01));
+	}
+
+	/* TL/TR */
+	input_report_key(dev, BTN_TL,	data[5] & 0x10);
+	input_report_key(dev, BTN_TR,	data[5] & 0x20);
+
+	/* stick press left/right */
+	input_report_key(dev, BTN_THUMBL, data[5] & 0x40);
+	input_report_key(dev, BTN_THUMBR, data[5] & 0x80);
+
+	if (!(xpad->mapping & MAP_STICKS_TO_NULL)) {
+		/* left stick */
+		input_report_abs(dev, ABS_X,
+				 (__s16) le16_to_cpup((__le16 *)(data + 10)));
+		input_report_abs(dev, ABS_Y,
+				 ~(__s16) le16_to_cpup((__le16 *)(data + 12)));
+
+		/* right stick */
+		input_report_abs(dev, ABS_RX,
+				 (__s16) le16_to_cpup((__le16 *)(data + 14)));
+		input_report_abs(dev, ABS_RY,
+				 ~(__s16) le16_to_cpup((__le16 *)(data + 16)));
+	}
+
+	/* triggers left/right */
+	if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) {
+		input_report_key(dev, BTN_TL2,
+				 (__u16) le16_to_cpup((__le16 *)(data + 6)));
+		input_report_key(dev, BTN_TR2,
+				 (__u16) le16_to_cpup((__le16 *)(data + 8)));
+	} else {
+		input_report_abs(dev, ABS_Z,
+				 (__u16) le16_to_cpup((__le16 *)(data + 6)));
+		input_report_abs(dev, ABS_RZ,
+				 (__u16) le16_to_cpup((__le16 *)(data + 8)));
+	}
+
+	input_sync(dev);
+}
+
+/*
+ *	xpadone_process_packet
+ *
+ *	Completes a request by converting the data into events for the
+ *	input subsystem. This version is for the Xbox One controller.
+ *
+ *	The report format was gleaned from
+ *	https://github.com/kylelemons/xbox/blob/master/xbox.go
+ */
+
+static void xpadone_process_packet(struct usb_xpad *xpad,
+				u16 cmd, unsigned char *data)
+{
+	struct input_dev *dev = xpad->dev;
+
+	switch (data[0]) {
+	case 0x20:
+		xpadone_process_buttons(xpad, dev, data);
+		break;
+
+	case 0x07:
+		/* the xbox button has its own special report */
+		input_report_key(dev, BTN_MODE, data[4] & 0x01);
+		input_sync(dev);
+		break;
+	}
+}
+
 static void xpad_irq_in(struct urb *urb)
 {
 	struct usb_xpad *xpad = urb->context;
@@ -538,6 +650,9 @@ static void xpad_irq_in(struct urb *urb)
 	case XTYPE_XBOX360W:
 		xpad360w_process_packet(xpad, 0, xpad->idata);
 		break;
+	case XTYPE_XBOXONE:
+		xpadone_process_packet(xpad, 0, xpad->idata);
+		break;
 	default:
 		xpad_process_packet(xpad, 0, xpad->idata);
 	}
@@ -571,7 +686,6 @@ static void xpad_bulk_out(struct urb *urb)
 	}
 }
 
-#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
 static void xpad_irq_out(struct urb *urb)
 {
 	struct usb_xpad *xpad = urb->context;
@@ -609,6 +723,7 @@ exit:
 static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 {
 	struct usb_endpoint_descriptor *ep_irq_out;
+	int ep_irq_out_idx;
 	int error;
 
 	if (xpad->xtype == XTYPE_UNKNOWN)
@@ -629,7 +744,10 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
 		goto fail2;
 	}
 
-	ep_irq_out = &intf->cur_altsetting->endpoint[1].desc;
+	/* Xbox One controller has in/out endpoints swapped. */
+	ep_irq_out_idx = xpad->xtype == XTYPE_XBOXONE ? 0 : 1;
+	ep_irq_out = &intf->cur_altsetting->endpoint[ep_irq_out_idx].desc;
+
 	usb_fill_int_urb(xpad->irq_out, xpad->udev,
 			 usb_sndintpipe(xpad->udev, ep_irq_out->bEndpointAddress),
 			 xpad->odata, XPAD_PKT_LEN,
@@ -657,11 +775,6 @@ static void xpad_deinit_output(struct usb_xpad *xpad)
 				xpad->odata, xpad->odata_dma);
 	}
 }
-#else
-static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) { return 0; }
-static void xpad_deinit_output(struct usb_xpad *xpad) {}
-static void xpad_stop_output(struct usb_xpad *xpad) {}
-#endif
 
 #ifdef CONFIG_JOYSTICK_XPAD_FF
 static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect *effect)
@@ -728,7 +841,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
 
 static int xpad_init_ff(struct usb_xpad *xpad)
 {
-	if (xpad->xtype == XTYPE_UNKNOWN)
+	if (xpad->xtype == XTYPE_UNKNOWN || xpad->xtype == XTYPE_XBOXONE)
 		return 0;
 
 	input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);
@@ -837,6 +950,14 @@ static int xpad_open(struct input_dev *dev)
 	if (usb_submit_urb(xpad->irq_in, GFP_KERNEL))
 		return -EIO;
 
+	if (xpad->xtype == XTYPE_XBOXONE) {
+		/* Xbox one controller needs to be initialized. */
+		xpad->odata[0] = 0x05;
+		xpad->odata[1] = 0x20;
+		xpad->irq_out->transfer_buffer_length = 2;
+		return usb_submit_urb(xpad->irq_out, GFP_KERNEL);
+	}
+
 	return 0;
 }
 
@@ -852,6 +973,7 @@ static void xpad_close(struct input_dev *dev)
 
 static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
 {
+	struct usb_xpad *xpad = input_get_drvdata(input_dev);
 	set_bit(abs, input_dev->absbit);
 
 	switch (abs) {
@@ -863,7 +985,10 @@ static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
 		break;
 	case ABS_Z:
 	case ABS_RZ:	/* the triggers (if mapped to axes) */
-		input_set_abs_params(input_dev, abs, 0, 255, 0, 0);
+		if (xpad->xtype == XTYPE_XBOXONE)
+			input_set_abs_params(input_dev, abs, 0, 1023, 0, 0);
+		else
+			input_set_abs_params(input_dev, abs, 0, 255, 0, 0);
 		break;
 	case ABS_HAT0X:
 	case ABS_HAT0Y:	/* the d-pad (only if dpad is mapped to axes */
@@ -878,6 +1003,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 	struct usb_xpad *xpad;
 	struct input_dev *input_dev;
 	struct usb_endpoint_descriptor *ep_irq_in;
+	int ep_irq_in_idx;
 	int i, error;
 
 	for (i = 0; xpad_device[i].idVendor; i++) {
@@ -886,6 +1012,16 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 			break;
 	}
 
+	if (xpad_device[i].xtype == XTYPE_XBOXONE &&
+	    intf->cur_altsetting->desc.bInterfaceNumber != 0) {
+		/*
+		 * The Xbox One controller lists three interfaces all with the
+		 * same interface class, subclass and protocol. Differentiate by
+		 * interface number.
+		 */
+		return -ENODEV;
+	}
+
 	xpad = kzalloc(sizeof(struct usb_xpad), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!xpad || !input_dev) {
@@ -956,7 +1092,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 		__set_bit(xpad_common_btn[i], input_dev->keybit);
 
 	/* set up model-specific ones */
-	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W) {
+	if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W ||
+	    xpad->xtype == XTYPE_XBOXONE) {
 		for (i = 0; xpad360_btn[i] >= 0; i++)
 			__set_bit(xpad360_btn[i], input_dev->keybit);
 	} else {
@@ -969,7 +1106,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 			__set_bit(xpad_btn_pad[i], input_dev->keybit);
 	} else {
 		for (i = 0; xpad_abs_pad[i] >= 0; i++)
-		    xpad_set_up_abs(input_dev, xpad_abs_pad[i]);
+			xpad_set_up_abs(input_dev, xpad_abs_pad[i]);
 	}
 
 	if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) {
@@ -992,7 +1129,10 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 	if (error)
 		goto fail5;
 
-	ep_irq_in = &intf->cur_altsetting->endpoint[0].desc;
+	/* Xbox One controller has in/out endpoints swapped. */
+	ep_irq_in_idx = xpad->xtype == XTYPE_XBOXONE ? 1 : 0;
+	ep_irq_in = &intf->cur_altsetting->endpoint[ep_irq_in_idx].desc;
+
 	usb_fill_int_urb(xpad->irq_in, udev,
 			 usb_rcvintpipe(udev, ep_irq_in->bEndpointAddress),
 			 xpad->idata, XPAD_PKT_LEN, xpad_irq_in,
-- 
2.4.2


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

* [PATCH 3.12 017/111] Input: xpad - add Thrustmaster as Xbox 360 controller vendor
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (15 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 016/111] Input: xpad - add support for Xbox One controllers Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 018/111] Input: xpad - add rumble support for Xbox One controller Jiri Slaby
                   ` (95 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tommi Rantala, Dmitry Torokhov, Jiri Slaby

From: Tommi Rantala <tt.rantala@gmail.com>

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

===============

commit 4dfb15cd5aaa6682e93854a74b394a1c95b82621 upstream.

Add Thrustmaster as Xbox 360 controller vendor. This is required for
example to make the GP XID (044f:b326) gamepad work.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 86a98b76e578..b0575bc518c1 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -294,6 +294,7 @@ static const signed short xpad_abs_triggers[] = {
 
 static struct usb_device_id xpad_table[] = {
 	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* X-Box USB-IF not approved class */
+	XPAD_XBOX360_VENDOR(0x044f),		/* Thrustmaster X-Box 360 controllers */
 	XPAD_XBOX360_VENDOR(0x045e),		/* Microsoft X-Box 360 controllers */
 	XPAD_XBOXONE_VENDOR(0x045e),		/* Microsoft X-Box One controllers */
 	XPAD_XBOX360_VENDOR(0x046d),		/* Logitech X-Box 360 style controllers */
-- 
2.4.2


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

* [PATCH 3.12 018/111] Input: xpad - add rumble support for Xbox One controller
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (16 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 017/111] Input: xpad - add Thrustmaster as Xbox 360 controller vendor Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 019/111] usb: chipidea: debug: avoid out of bound read Jiri Slaby
                   ` (94 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ming-ting Yao Wei, Dmitry Torokhov, Jiri Slaby

From: Ming-ting Yao Wei <mwei@lxde.org>

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

===============

commit 0604949ce3b9a59cff419daf706272620a9a0df0 upstream.

This adds rumble support for Xbox One controller by sending continuous
rumble command. Trigger button rumbling is not yet implemented.

Signed-off-by: Ming-ting Yao Wei <mwei@lxde.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/joystick/xpad.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index b0575bc518c1..94d8cb9b4981 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -31,12 +31,14 @@
  *  - the iForce driver    drivers/char/joystick/iforce.c
  *  - the skeleton-driver  drivers/usb/usb-skeleton.c
  *  - Xbox 360 information http://www.free60.org/wiki/Gamepad
+ *  - Xbox One information https://github.com/quantus/xbox-one-controller-protocol
  *
  * Thanks to:
  *  - ITO Takayuki for providing essential xpad information on his website
  *  - Vojtech Pavlik     - iforce driver / input subsystem
  *  - Greg Kroah-Hartman - usb-skeleton driver
  *  - XBOX Linux project - extra USB id's
+ *  - Pekka Pöyry (quantus) - Xbox One controller reverse engineering
  *
  * TODO:
  *  - fine tune axes (especially trigger axes)
@@ -829,6 +831,23 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
 
 			return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
 
+		case XTYPE_XBOXONE:
+			xpad->odata[0] = 0x09; /* activate rumble */
+			xpad->odata[1] = 0x08;
+			xpad->odata[2] = 0x00;
+			xpad->odata[3] = 0x08; /* continuous effect */
+			xpad->odata[4] = 0x00; /* simple rumble mode */
+			xpad->odata[5] = 0x03; /* L and R actuator only */
+			xpad->odata[6] = 0x00; /* TODO: LT actuator */
+			xpad->odata[7] = 0x00; /* TODO: RT actuator */
+			xpad->odata[8] = strong / 256;	/* left actuator */
+			xpad->odata[9] = weak / 256;	/* right actuator */
+			xpad->odata[10] = 0x80;	/* length of pulse */
+			xpad->odata[11] = 0x00;	/* stop period of pulse */
+			xpad->irq_out->transfer_buffer_length = 12;
+
+			return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
+
 		default:
 			dev_dbg(&xpad->dev->dev,
 				"%s - rumble command sent to unsupported xpad type: %d\n",
@@ -842,7 +861,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
 
 static int xpad_init_ff(struct usb_xpad *xpad)
 {
-	if (xpad->xtype == XTYPE_UNKNOWN || xpad->xtype == XTYPE_XBOXONE)
+	if (xpad->xtype == XTYPE_UNKNOWN)
 		return 0;
 
 	input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);
-- 
2.4.2


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

* [PATCH 3.12 019/111] usb: chipidea: debug: avoid out of bound read
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (17 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 018/111] Input: xpad - add rumble support for Xbox One controller Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 020/111] Added another USB product ID for ELAN touchscreen quirks Jiri Slaby
                   ` (93 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Heinrich Schuchardt, Peter Chen, Jiri Slaby

From: Heinrich Schuchardt <xypron.glpk@gmx.de>

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

===============

commit bd5fb0aec3dd7cde7ec4c397b10e55d4c9626d8d upstream.

A string written by the user may not be zero terminated.

sscanf may read memory beyond the buffer if no zero byte
is found.

For testing build with CONFIG_USB_CHIPIDEA=y, CONFIG_USB_CHIPIDEA_DEBUG=y.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/chipidea/debug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 96d899aee473..92f0cc442d46 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -84,9 +84,13 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
 	char buf[32];
 	int ret;
 
-	if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
+	count = min_t(size_t, sizeof(buf) - 1, count);
+	if (copy_from_user(buf, ubuf, count))
 		return -EFAULT;
 
+	/* sscanf requires a zero terminated string */
+	buf[count] = '\0';
+
 	if (sscanf(buf, "%u", &mode) != 1)
 		return -EINVAL;
 
-- 
2.4.2


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

* [PATCH 3.12 020/111] Added another USB product ID for ELAN touchscreen quirks.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (18 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 019/111] usb: chipidea: debug: avoid out of bound read Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 021/111] staging: wlags49_h2: fix extern inline functions Jiri Slaby
                   ` (92 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Logan Gunthorpe, Greg Kroah-Hartman, Jiri Slaby

From: Logan Gunthorpe <logang@deltatee.com>

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

===============

commit dc703ec22074d9c71a12da20670369fac3ea4296 upstream.

I've had the same issue as described in commit

c68929f75dfcb6354918862b91b5778585de1fa5

Except my touchscreen's ID is

ID 04f3:0125 Elan Microelectronics Corp.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/core/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index f2121b56e681..5014a4282352 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -105,6 +105,9 @@ static const struct usb_device_id usb_quirk_list[] = {
 	{ USB_DEVICE(0x04f3, 0x010c), .driver_info =
 			USB_QUIRK_DEVICE_QUALIFIER },
 
+	{ USB_DEVICE(0x04f3, 0x0125), .driver_info =
+			USB_QUIRK_DEVICE_QUALIFIER },
+
 	{ USB_DEVICE(0x04f3, 0x016f), .driver_info =
 			USB_QUIRK_DEVICE_QUALIFIER },
 
-- 
2.4.2


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

* [PATCH 3.12 021/111] staging: wlags49_h2: fix extern inline functions
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (19 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 020/111] Added another USB product ID for ELAN touchscreen quirks Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 022/111] staging, rtl8192e, LLVMLinux: Change extern inline to static inline Jiri Slaby
                   ` (91 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Greg Kroah-Hartman, Jiri Slaby

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

===============

Patch not upstream as this driver is deleted there.

Fix up some "extern inline" functions as they break the build when using
a "modern" complier (i.e. gcc5).

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/wlags49_h2/wl_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h
index 78129e93920f..1ecb5cb44bd5 100644
--- a/drivers/staging/wlags49_h2/wl_internal.h
+++ b/drivers/staging/wlags49_h2/wl_internal.h
@@ -1013,7 +1013,7 @@ static inline void wl_unlock(struct wl_private *lp,
 /* Interrupt enable disable functions                               */
 /********************************************************************/
 
-extern inline void wl_act_int_on(struct wl_private *lp)
+static inline void wl_act_int_on(struct wl_private *lp)
 {
 	/*
 	 * Only do something when the driver is handling
@@ -1025,7 +1025,7 @@ extern inline void wl_act_int_on(struct wl_private *lp)
 	}
 }
 
-extern inline void wl_act_int_off(struct wl_private *lp)
+static inline void wl_act_int_off(struct wl_private *lp)
 {
 	/*
 	 * Only do something when the driver is handling
-- 
2.4.2


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

* [PATCH 3.12 022/111] staging, rtl8192e, LLVMLinux: Change extern inline to static inline
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (20 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 021/111] staging: wlags49_h2: fix extern inline functions Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 023/111] staging: rtl8712, rtl8712: avoid lots of build warnings Jiri Slaby
                   ` (90 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Behan Webster, Arnd Bergmann, Jiri Slaby

From: Behan Webster <behanw@converseincode.com>

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

===============

commit 6d91857d4826b382b3fd4fad95f52713be646f96 upstream.

With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the opposite thing from older versions of gcc
(emits code for an externally linkable version of the inline function).

"static inline" does the intended behavior in all cases instead.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/rtl8192e/rtllib.h         | 4 ++--
 drivers/staging/rtl8192e/rtllib_softmac.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 05ef49f24cd9..daa2ce7ba702 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -2943,12 +2943,12 @@ void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);
 
 extern const long rtllib_wlan_frequencies[];
 
-extern inline void rtllib_increment_scans(struct rtllib_device *ieee)
+static inline void rtllib_increment_scans(struct rtllib_device *ieee)
 {
 	ieee->scans++;
 }
 
-extern inline int rtllib_get_scans(struct rtllib_device *ieee)
+static inline int rtllib_get_scans(struct rtllib_device *ieee)
 {
 	return ieee->scans;
 }
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 0cbf6f5593a3..7a5be03a862e 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -341,7 +341,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
 	}
 }
 
-inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
+static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
 {
 	unsigned int len, rate_len;
 	u8 *tag;
-- 
2.4.2


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

* [PATCH 3.12 023/111] staging: rtl8712, rtl8712: avoid lots of build warnings
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (21 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 022/111] staging, rtl8192e, LLVMLinux: Change extern inline to static inline Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 024/111] staging, rtl8192e, LLVMLinux: Remove unused inline prototype Jiri Slaby
                   ` (89 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Arnd Bergmann, Larry Finger, Florian Schilhabel,
	Jiri Slaby

From: Arnd Bergmann <arnd@arndb.de>

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

===============

commit 0c9f3a65c5eb7fe1fc611a22eb8a8b71ea865998 upstream.

The rtl8712 driver has an 'extern inline' function that contains an
'if', which causes lots of warnings with CONFIG_PROFILE_ALL_BRANCHES
overriding the definition of 'if':

drivers/staging/rtl8712/ieee80211.h:759:229: warning: '______f' is static but declared in inline function 'ieee80211_get_hdrlen' which is not static [enabled by default]

This changes the driver to use 'static inline' instead, which happens
to be the correct annotation anyway.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/rtl8187se/ieee80211/ieee80211.h |  4 ++--
 drivers/staging/rtl8192u/ieee80211/ieee80211.h  | 10 +++++-----
 drivers/staging/rtl8712/ieee80211.h             |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211.h b/drivers/staging/rtl8187se/ieee80211/ieee80211.h
index 7f015499cfae..b835b7f02455 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211.h
@@ -1447,12 +1447,12 @@ extern void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, shor
 
 extern const long ieee80211_wlan_frequencies[];
 
-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
 {
 	ieee->scans++;
 }
 
-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
 {
 	return ieee->scans;
 }
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index bc64f05a7e6a..b1a0380ee596 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -2250,7 +2250,7 @@ static inline void *ieee80211_priv(struct net_device *dev)
 	return ((struct ieee80211_device *)netdev_priv(dev))->priv;
 }
 
-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
 {
 	/* Single white space is for Linksys APs */
 	if (essid_len == 1 && essid[0] == ' ')
@@ -2266,7 +2266,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
 	return 1;
 }
 
-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
+static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
 {
 	/*
 	 * It is possible for both access points and our device to support
@@ -2292,7 +2292,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod
 	return 0;
 }
 
-extern inline int ieee80211_get_hdrlen(u16 fc)
+static inline int ieee80211_get_hdrlen(u16 fc)
 {
 	int hdrlen = IEEE80211_3ADDR_LEN;
 
@@ -2578,12 +2578,12 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee);
 
 extern const long ieee80211_wlan_frequencies[];
 
-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
 {
 	ieee->scans++;
 }
 
-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
 {
 	return ieee->scans;
 }
diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h
index da4000e49da6..8269be80437a 100644
--- a/drivers/staging/rtl8712/ieee80211.h
+++ b/drivers/staging/rtl8712/ieee80211.h
@@ -734,7 +734,7 @@ enum ieee80211_state {
 #define IEEE_G            (1<<2)
 #define IEEE_MODE_MASK    (IEEE_A|IEEE_B|IEEE_G)
 
-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
 {
 	/* Single white space is for Linksys APs */
 	if (essid_len == 1 && essid[0] == ' ')
@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
 	return 1;
 }
 
-extern inline int ieee80211_get_hdrlen(u16 fc)
+static inline int ieee80211_get_hdrlen(u16 fc)
 {
 	int hdrlen = 24;
 
-- 
2.4.2


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

* [PATCH 3.12 024/111] staging, rtl8192e, LLVMLinux: Remove unused inline prototype
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (22 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 023/111] staging: rtl8712, rtl8712: avoid lots of build warnings Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 025/111] kernel: use the gnu89 standard explicitly Jiri Slaby
                   ` (88 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Behan Webster, Arnd Bergmann, Jiri Slaby

From: Behan Webster <behanw@converseincode.com>

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

===============

commit 62ec95f86d2850b7ce6d73fb236a6fcf48411aea upstream.

rtllib_probe_req is defined as "static inline" in rtllib_softmac.c however it
is declared differently as "extern inline" in rtllib_softmac.h. Since it isn't
used outside of the scope of rtllib_softmac, it makes sense to remove the
incorrect declaration.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/rtl8192e/rtllib.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index daa2ce7ba702..29c3b2740ccf 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -2761,7 +2761,6 @@ extern void rtllib_stop_scan(struct rtllib_device *ieee);
 extern bool rtllib_act_scanning(struct rtllib_device *ieee, bool sync_scan);
 extern void rtllib_stop_scan_syncro(struct rtllib_device *ieee);
 extern void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh);
-extern inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee);
 extern u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee);
 extern void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee,
 					  short pwr);
-- 
2.4.2


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

* [PATCH 3.12 025/111] kernel: use the gnu89 standard explicitly
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (23 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 024/111] staging, rtl8192e, LLVMLinux: Remove unused inline prototype Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 026/111] qla2xxx: remove redundant declaration in 'qla_gbl.h' Jiri Slaby
                   ` (87 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Kirill A. Shutemov, Sasha Levin, Linus Torvalds,
	Jiri Slaby

From: "Kirill A. Shutemov" <kirill@shutemov.name>

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

===============

commit 51b97e354ba9fce1890cf38ecc754aa49677fc89 upstream.

Sasha Levin reports:
 "gcc5 changes the default standard to c11, which makes kernel build
  unhappy

  Explicitly define the kernel standard to be gnu89 which should keep
  everything working exactly like it was before gcc5"

There are multiple small issues with the new default, but the biggest
issue seems to be that the old - and very useful - GNU extension to
allow a cast in front of an initializer has gone away.

Patch updated by Kirill:
 "I'm pretty sure all gcc versions you can build kernel with supports
  -std=gnu89.  cc-option is redunrant.

  We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"

Note by Andrew Pinski:
 "Yes it was reported and both problems relating to this extension has
  been added to gnu99 and gnu11.  Though there are other issues with the
  kernel dealing with extern inline have different semantics between
  gnu89 and gnu99/11"

End result: we may be able to move up to a newer stdc model eventually,
but right now the newer models have some annoying deficiencies, so the
traditional "gnu89" model ends up being the preferred one.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index baf73c808c04..065ac2d16cfb 100644
--- a/Makefile
+++ b/Makefile
@@ -241,7 +241,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 
 HOSTCC       = gcc
 HOSTCXX      = g++
-HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
 HOSTCXXFLAGS = -O2
 
 # Decide whether to build built-in, modular, or both.
@@ -373,7 +373,9 @@ KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		   -fno-strict-aliasing -fno-common \
 		   -Werror-implicit-function-declaration \
 		   -Wno-format-security \
-		   -fno-delete-null-pointer-checks
+		   -fno-delete-null-pointer-checks \
+		   -std=gnu89
+
 KBUILD_AFLAGS_KERNEL :=
 KBUILD_CFLAGS_KERNEL :=
 KBUILD_AFLAGS   := -D__ASSEMBLY__
-- 
2.4.2


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

* [PATCH 3.12 026/111] qla2xxx: remove redundant declaration in 'qla_gbl.h'
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (24 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 025/111] kernel: use the gnu89 standard explicitly Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 027/111] amd64_edac: Add support for newer F16h models Jiri Slaby
                   ` (86 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Chen Gang, Christoph Hellwig, Jiri Slaby

From: Chen Gang <gang.chen.5i5j@gmail.com>

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

===============

commit 9493c2422cae272d6f1f567cbb424195defe4176 upstream.

Remove 2 redundant extern inline functions: qla8044_set_qsnt_ready() and
qla8044_need_reset_handler(). At present, within upstream next kernel
source code, they are only used within "drivers/scsi/qla2xxx/qla_nx2.c".

The related error and warnings (with allmodconfig under tile):

    CC [M]  drivers/scsi/qla2xxx/qla_nx2.o
  drivers/scsi/qla2xxx/qla_nx2.c:1633:1: error: static declaration of 'qla8044_need_reset_handler' follows non-static declaration
   qla8044_need_reset_handler(struct scsi_qla_host *vha)
   ^
  In file included from drivers/scsi/qla2xxx/qla_def.h:3706:0,
                   from drivers/scsi/qla2xxx/qla_nx2.c:11:
  drivers/scsi/qla2xxx/qla_gbl.h:756:20: note: previous declaration of 'qla8044_need_reset_handler' was here
   extern inline void qla8044_need_reset_handler(struct scsi_qla_host *vha);
                      ^
  drivers/scsi/qla2xxx/qla_gbl.h:756:20: warning: inline function 'qla8044_need_reset_handler' declared but never defined
  make[3]: *** [drivers/scsi/qla2xxx/qla_nx2.o] Error 1
  make[2]: *** [drivers/scsi/qla2xxx] Error 2
  make[1]: *** [drivers/scsi] Error 2
  make: *** [drivers] Error 2

    CC [M]  drivers/scsi/qla2xxx/qla_tmpl.o
  In file included from drivers/scsi/qla2xxx/qla_def.h:3706:0,
                   from drivers/scsi/qla2xxx/qla_tmpl.c:7:
  drivers/scsi/qla2xxx/qla_gbl.h:755:20: warning: inline function 'qla8044_set_qsnt_ready' declared but never defined
   extern inline void qla8044_set_qsnt_ready(struct scsi_qla_host *vha);
                    ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Acked-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/qla2xxx/qla_gbl.h | 2 --
 drivers/scsi/qla2xxx/qla_nx2.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 4446bf5fe292..fafb3fa3929f 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -721,8 +721,6 @@ extern void qla8044_set_idc_dontreset(struct scsi_qla_host *ha);
 extern int qla8044_rd_direct(struct scsi_qla_host *vha, const uint32_t crb_reg);
 extern void qla8044_wr_direct(struct scsi_qla_host *vha,
 			      const uint32_t crb_reg, const uint32_t value);
-extern inline void qla8044_set_qsnt_ready(struct scsi_qla_host *vha);
-extern inline void qla8044_need_reset_handler(struct scsi_qla_host *vha);
 extern int qla8044_device_state_handler(struct scsi_qla_host *vha);
 extern void qla8044_clear_qsnt_ready(struct scsi_qla_host *vha);
 extern void qla8044_clear_drv_active(struct scsi_qla_host *vha);
diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c
index 8164cc9e7286..996f400c20ad 100644
--- a/drivers/scsi/qla2xxx/qla_nx2.c
+++ b/drivers/scsi/qla2xxx/qla_nx2.c
@@ -146,7 +146,7 @@ qla8044_rmw_crb_reg(struct scsi_qla_host *vha,
 	return;
 }
 
-inline void
+static inline void
 qla8044_set_qsnt_ready(struct scsi_qla_host *vha)
 {
 	uint32_t qsnt_state;
-- 
2.4.2


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

* [PATCH 3.12 027/111] amd64_edac: Add support for newer F16h models
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (25 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 026/111] qla2xxx: remove redundant declaration in 'qla_gbl.h' Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 028/111] hwmon: (k10temp) Add support for AMD F16 M30h processor Jiri Slaby
                   ` (85 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Aravind Gopalakrishnan, Borislav Petkov, Jiri Slaby

From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>

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

===============

commit 85a8885bd0e00569108aa7b5e26b89c752e3cd51 upstream.

Extend ECC decoding support for F16h M30h. Tested on F16h M30h with ECC
turned on using mce_amd_inj module and the patch works fine.

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Link: http://lkml.kernel.org/r/1392913726-16961-1-git-send-email-Aravind.Gopalakrishnan@amd.com
Tested-by: Arindam Nath <Arindam.Nath@amd.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kernel/amd_nb.c  |  2 ++
 drivers/edac/amd64_edac.c | 24 ++++++++++++++++++++++++
 drivers/edac/amd64_edac.h |  3 +++
 include/linux/pci_ids.h   |  2 ++
 4 files changed, 31 insertions(+)

diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 59554dca96ec..6523534671b6 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -22,6 +22,7 @@ const struct pci_device_id amd_nb_misc_ids[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{}
 };
 EXPORT_SYMBOL(amd_nb_misc_ids);
@@ -30,6 +31,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
 	{}
 };
 
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 10162af430c5..7a7d5d5d7d6d 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1806,6 +1806,17 @@ static struct amd64_family_type amd64_family_types[] = {
 			.read_dct_pci_cfg	= f10_read_dct_pci_cfg,
 		}
 	},
+	[F16_M30H_CPUS] = {
+		.ctl_name = "F16h_M30h",
+		.f1_id = PCI_DEVICE_ID_AMD_16H_M30H_NB_F1,
+		.f3_id = PCI_DEVICE_ID_AMD_16H_M30H_NB_F3,
+		.ops = {
+			.early_channel_count	= f1x_early_channel_count,
+			.map_sysaddr_to_csrow	= f1x_map_sysaddr_to_csrow,
+			.dbam_to_cs		= f16_dbam_to_chip_select,
+			.read_dct_pci_cfg	= f10_read_dct_pci_cfg,
+		}
+	},
 };
 
 /*
@@ -2596,6 +2607,11 @@ static struct amd64_family_type *amd64_per_family_init(struct amd64_pvt *pvt)
 		break;
 
 	case 0x16:
+		if (pvt->model == 0x30) {
+			fam_type = &amd64_family_types[F16_M30H_CPUS];
+			pvt->ops = &amd64_family_types[F16_M30H_CPUS].ops;
+			break;
+		}
 		fam_type		= &amd64_family_types[F16_CPUS];
 		pvt->ops		= &amd64_family_types[F16_CPUS].ops;
 		break;
@@ -2848,6 +2864,14 @@ static DEFINE_PCI_DEVICE_TABLE(amd64_pci_table) = {
 		.class		= 0,
 		.class_mask	= 0,
 	},
+	{
+		.vendor		= PCI_VENDOR_ID_AMD,
+		.device		= PCI_DEVICE_ID_AMD_16H_M30H_NB_F2,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.class		= 0,
+		.class_mask	= 0,
+	},
 
 	{0, }
 };
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index d2443cfa0698..eff9eed80353 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -176,6 +176,8 @@
 #define PCI_DEVICE_ID_AMD_15H_NB_F2	0x1602
 #define PCI_DEVICE_ID_AMD_16H_NB_F1	0x1531
 #define PCI_DEVICE_ID_AMD_16H_NB_F2	0x1532
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F1 0x1581
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F2 0x1582
 
 /*
  * Function 1 - Address Map
@@ -308,6 +310,7 @@ enum amd_families {
 	F15_CPUS,
 	F15_M30H_CPUS,
 	F16_CPUS,
+	F16_M30H_CPUS,
 	NUM_FAMILIES,
 };
 
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 057c1d8c77e5..5695d8a0aedb 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -528,6 +528,8 @@
 #define PCI_DEVICE_ID_AMD_15H_NB_F5	0x1605
 #define PCI_DEVICE_ID_AMD_16H_NB_F3	0x1533
 #define PCI_DEVICE_ID_AMD_16H_NB_F4	0x1534
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F3 0x1583
+#define PCI_DEVICE_ID_AMD_16H_M30H_NB_F4 0x1584
 #define PCI_DEVICE_ID_AMD_CNB17H_F3	0x1703
 #define PCI_DEVICE_ID_AMD_LANCE		0x2000
 #define PCI_DEVICE_ID_AMD_LANCE_HOME	0x2001
-- 
2.4.2


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

* [PATCH 3.12 028/111] hwmon: (k10temp) Add support for AMD F16 M30h processor
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (26 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 027/111] amd64_edac: Add support for newer F16h models Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 029/111] hwmon: (k10temp) Add support for F15h M60h Jiri Slaby
                   ` (84 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Aravind Gopalakrishnan, Guenter Roeck, Jiri Slaby

From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>

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

===============

commit ec0159503ae74aeb834e78366bdf4b9663ca1129 upstream.

Adding new PCI ID to support AMD F16 M30h processor (Mullins).
While at it, modify Kconfig and Doc files to reflect the
support for newer processors

Note: PCI ID for this processor will make it into pci_ids.h
as part of this patch:
http://marc.info/?l=linux-kernel&m=139291362126057&w=2
which should be pulled into 3.15 when merge window opens
(It currently sits in 'for-next' branch of bp.git-
https://git.kernel.org/cgit/linux/kernel/git/bp/bp.git/log/?h=for-next)

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/hwmon/k10temp | 6 +++---
 drivers/hwmon/Kconfig       | 4 ++--
 drivers/hwmon/k10temp.c     | 1 +
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index 4dfdc8f83633..ee6d30ec1522 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -11,8 +11,8 @@ Supported chips:
   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
 * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
 * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
-* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
-* AMD Family 16h processors: "Kabini"
+* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity", "Kaveri"
+* AMD Family 16h processors: "Kabini", "Mullins"
 
   Prefix: 'k10temp'
   Addresses scanned: PCI space
@@ -46,7 +46,7 @@ Description
 -----------
 
 This driver permits reading of the internal temperature sensor of AMD
-Family 10h/11h/12h/14h/15h processors.
+Family 10h/11h/12h/14h/15h/16h processors.
 
 All these processors have a sensor, but on those for Socket F or AM2+,
 the sensor may return inconsistent values (erratum 319).  The driver
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index dea5e11cf53a..f383eb364461 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -296,8 +296,8 @@ config SENSORS_K10TEMP
 	  If you say yes here you get support for the temperature
 	  sensor(s) inside your CPU. Supported are later revisions of
 	  the AMD Family 10h and all revisions of the AMD Family 11h,
-	  12h (Llano), 14h (Brazos), 15h (Bulldozer/Trinity) and
-	  16h (Kabini) microarchitectures.
+	  12h (Llano), 14h (Brazos), 15h (Bulldozer/Trinity/Kaveri) and
+	  16h (Kabini/Mullins) microarchitectures.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called k10temp.
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 758774f4454c..d6339b018769 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -212,6 +212,7 @@ static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
+	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{}
 };
 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
-- 
2.4.2


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

* [PATCH 3.12 029/111] hwmon: (k10temp) Add support for F15h M60h
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (27 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 028/111] hwmon: (k10temp) Add support for AMD F16 M30h processor Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 030/111] storvsc: Set the SRB flags correctly when no data transfer is needed Jiri Slaby
                   ` (83 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Aravind Gopalakrishnan, Aravind Gopalakrishnan,
	Guenter Roeck, Jiri Slaby

From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>

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

===============

commit f89ce2706d8341c921b96e13a00b951a10eed308 upstream.

This patch adds temperature monitoring support for F15h M60h processor.
 - Add new pci device id for the relevant processor
 - The functionality of REG_REPORTED_TEMPERATURE is moved to
   D0F0xBC_xD820_0CA4 [Reported Temperature Control]
   - So, use this to get CUR_TEMP value
   - Since we need an indirect register access, protect this with
     a mutex lock
 - Add Kconfig, Doc entries to indicate support for this processor.

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
[Guenter Roeck: Declare new mutex and function static]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/hwmon/k10temp |  2 +-
 drivers/hwmon/Kconfig       |  4 ++--
 drivers/hwmon/k10temp.c     | 35 ++++++++++++++++++++++++++++++++---
 3 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index ee6d30ec1522..254d2f55345a 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -11,7 +11,7 @@ Supported chips:
   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
 * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
 * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
-* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity", "Kaveri"
+* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity", "Kaveri", "Carrizo"
 * AMD Family 16h processors: "Kabini", "Mullins"
 
   Prefix: 'k10temp'
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index f383eb364461..331204f78382 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -296,8 +296,8 @@ config SENSORS_K10TEMP
 	  If you say yes here you get support for the temperature
 	  sensor(s) inside your CPU. Supported are later revisions of
 	  the AMD Family 10h and all revisions of the AMD Family 11h,
-	  12h (Llano), 14h (Brazos), 15h (Bulldozer/Trinity/Kaveri) and
-	  16h (Kabini/Mullins) microarchitectures.
+	  12h (Llano), 14h (Brazos), 15h (Bulldozer/Trinity/Kaveri/Carrizo)
+	  and 16h (Kabini/Mullins) microarchitectures.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called k10temp.
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index d6339b018769..d77f2d63a6c9 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -33,6 +33,9 @@ static bool force;
 module_param(force, bool, 0444);
 MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
 
+/* Provide lock for writing to NB_SMU_IND_ADDR */
+static DEFINE_MUTEX(nb_smu_ind_mutex);
+
 /* CPUID function 0x80000001, ebx */
 #define CPUID_PKGTYPE_MASK	0xf0000000
 #define CPUID_PKGTYPE_F		0x00000000
@@ -51,13 +54,38 @@ MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
 #define REG_NORTHBRIDGE_CAPABILITIES	0xe8
 #define  NB_CAP_HTC			0x00000400
 
+/*
+ * For F15h M60h, functionality of REG_REPORTED_TEMPERATURE
+ * has been moved to D0F0xBC_xD820_0CA4 [Reported Temperature
+ * Control]
+ */
+#define F15H_M60H_REPORTED_TEMP_CTRL_OFFSET	0xd8200ca4
+#define PCI_DEVICE_ID_AMD_15H_M60H_NB_F3	0x1573
+
+static void amd_nb_smu_index_read(struct pci_dev *pdev, unsigned int devfn,
+				  int offset, u32 *val)
+{
+	mutex_lock(&nb_smu_ind_mutex);
+	pci_bus_write_config_dword(pdev->bus, devfn,
+				   0xb8, offset);
+	pci_bus_read_config_dword(pdev->bus, devfn,
+				  0xbc, val);
+	mutex_unlock(&nb_smu_ind_mutex);
+}
+
 static ssize_t show_temp(struct device *dev,
 			 struct device_attribute *attr, char *buf)
 {
 	u32 regval;
-
-	pci_read_config_dword(to_pci_dev(dev),
-			      REG_REPORTED_TEMPERATURE, &regval);
+	struct pci_dev *pdev = to_pci_dev(dev);
+
+	if (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model == 0x60) {
+		amd_nb_smu_index_read(pdev, PCI_DEVFN(0, 0),
+				      F15H_M60H_REPORTED_TEMP_CTRL_OFFSET,
+				      &regval);
+	} else {
+		pci_read_config_dword(pdev, REG_REPORTED_TEMPERATURE, &regval);
+	}
 	return sprintf(buf, "%u\n", (regval >> 21) * 125);
 }
 
@@ -211,6 +239,7 @@ static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
+	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M60H_NB_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{}
-- 
2.4.2


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

* [PATCH 3.12 030/111] storvsc: Set the SRB flags correctly when no data transfer is needed
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (28 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 029/111] hwmon: (k10temp) Add support for F15h M60h Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 031/111] perf/x86/amd/ibs: Update IBS MSRs and feature definitions Jiri Slaby
                   ` (82 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, K. Y. Srinivasan, James Bottomley, Jiri Slaby

From: "K. Y. Srinivasan" <kys@microsoft.com>

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

===============

commit dc45708ca9988656d706940df5fd102672c5de92 upstream.

Set the SRB flags correctly when there is no data transfer.  Without this
change some IHV drivers will fail valid commands such as TEST_UNIT_READY.

Cc: <stable@vger.kernel.org>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/storvsc_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 97892f258043..3bb6646bb406 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1625,8 +1625,7 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
 		break;
 	default:
 		vm_srb->data_in = UNKNOWN_TYPE;
-		vm_srb->win8_extension.srb_flags |= (SRB_FLAGS_DATA_IN |
-						     SRB_FLAGS_DATA_OUT);
+		vm_srb->win8_extension.srb_flags |= SRB_FLAGS_NO_DATA_TRANSFER;
 		break;
 	}
 
-- 
2.4.2


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

* [PATCH 3.12 031/111] perf/x86/amd/ibs: Update IBS MSRs and feature definitions
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (29 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 030/111] storvsc: Set the SRB flags correctly when no data transfer is needed Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 032/111] powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space Jiri Slaby
                   ` (81 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Aravind Gopalakrishnan, Paolo Bonzini, Jan Kiszka,
	Len Brown, Fenghua Yu, Peter Zijlstra, paulus, acme, Ingo Molnar,
	Jiri Slaby

From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>

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

===============

commit 904cb3677f3adcd3d837be0a0d0b14251ba8d6f7 upstream.

New Fam15h models carry extra feature bits and extend
the MSR register space for IBS ops. Adding them here.

While at it, add functionality to read IbsBrTarget and
OpData4 depending on their availability if user wants a
PERF_SAMPLE_RAW.

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <paulus@samba.org>
Cc: <acme@kernel.org>
Link: http://lkml.kernel.org/r/1415651066-13523-1-git-send-email-Aravind.Gopalakrishnan@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/include/asm/perf_event.h        |  3 +++
 arch/x86/include/uapi/asm/msr-index.h    |  1 +
 arch/x86/kernel/cpu/perf_event_amd_ibs.c | 15 +++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index 8249df45d2f2..348d9ac94d4e 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -169,6 +169,9 @@ struct x86_pmu_capability {
 #define IBS_CAPS_BRNTRGT		(1U<<5)
 #define IBS_CAPS_OPCNTEXT		(1U<<6)
 #define IBS_CAPS_RIPINVALIDCHK		(1U<<7)
+#define IBS_CAPS_OPBRNFUSE		(1U<<8)
+#define IBS_CAPS_FETCHCTLEXTD		(1U<<9)
+#define IBS_CAPS_OPDATA4		(1U<<10)
 
 #define IBS_CAPS_DEFAULT		(IBS_CAPS_AVAIL		\
 					 | IBS_CAPS_FETCHSAM	\
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index 228d95f6592a..dbb591390b9e 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -201,6 +201,7 @@
 #define MSR_AMD64_IBSOP_REG_MASK	((1UL<<MSR_AMD64_IBSOP_REG_COUNT)-1)
 #define MSR_AMD64_IBSCTL		0xc001103a
 #define MSR_AMD64_IBSBRTARGET		0xc001103b
+#define MSR_AMD64_IBSOPDATA4		0xc001103d
 #define MSR_AMD64_IBS_REG_COUNT_MAX	8 /* includes MSR_AMD64_IBSBRTARGET */
 
 /* Fam 16h MSRs */
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
index 4b8e4d3cd6ea..6a4b5456240a 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
@@ -565,6 +565,21 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 				       perf_ibs->offset_max,
 				       offset + 1);
 	} while (offset < offset_max);
+	if (event->attr.sample_type & PERF_SAMPLE_RAW) {
+		/*
+		 * Read IbsBrTarget and IbsOpData4 separately
+		 * depending on their availability.
+		 * Can't add to offset_max as they are staggered
+		 */
+		if (ibs_caps & IBS_CAPS_BRNTRGT) {
+			rdmsrl(MSR_AMD64_IBSBRTARGET, *buf++);
+			size++;
+		}
+		if (ibs_caps & IBS_CAPS_OPDATA4) {
+			rdmsrl(MSR_AMD64_IBSOPDATA4, *buf++);
+			size++;
+		}
+	}
 	ibs_data.size = sizeof(u64) * size;
 
 	regs = *iregs;
-- 
2.4.2


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

* [PATCH 3.12 032/111] powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (30 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 031/111] perf/x86/amd/ibs: Update IBS MSRs and feature definitions Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 033/111] vhost/scsi: potential memory corruption Jiri Slaby
                   ` (80 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, jmarchan, Benjamin Herrenschmidt, Jiri Slaby

From: "jmarchan@redhat.com" <jmarchan@redhat.com>

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

===============

commit 19751c07b3728748c1253627ce94e6906fa5e273 upstream.

According to Posix, if MAP_FIXED is specified mmap shall set ENOMEM if
the requested mapping exceeds the allowed range for address space of
the process. The generic code set it right, but the specific powerpc
slice_get_unmapped_area() function currently returns -EINVAL in that
case.
This patch corrects it.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/powerpc/mm/slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 7ce9cf3b6988..b0c75cc15efc 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -408,7 +408,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
 	if (fixed && (addr & ((1ul << pshift) - 1)))
 		return -EINVAL;
 	if (fixed && addr > (mm->task_size - len))
-		return -EINVAL;
+		return -ENOMEM;
 
 	/* If hint, make sure it matches our alignment restrictions */
 	if (!fixed && addr) {
-- 
2.4.2


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

* [PATCH 3.12 033/111] vhost/scsi: potential memory corruption
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (31 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 032/111] powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 034/111] Fix corrupt SMB2 ioctl requests Jiri Slaby
                   ` (79 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Dan Carpenter, Nicholas Bellinger, Jiri Slaby

From: Dan Carpenter <dan.carpenter@oracle.com>

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

===============

commit 59c816c1f24df0204e01851431d3bab3eb76719c upstream.

This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.

I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so
anything higher than 255 then it is invalid.  I have made that the limit
now.

In vhost_scsi_send_evt() we mask away values higher than 255, but now
that the limit has changed, we don't need the mask.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/vhost/scsi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index d7fddc7d10d5..2874f18313b7 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1132,7 +1132,7 @@ tcm_vhost_send_evt(struct vhost_scsi *vs,
 		 * lun[4-7] need to be zero according to virtio-scsi spec.
 		 */
 		evt->event.lun[0] = 0x01;
-		evt->event.lun[1] = tpg->tport_tpgt & 0xFF;
+		evt->event.lun[1] = tpg->tport_tpgt;
 		if (lun->unpacked_lun >= 256)
 			evt->event.lun[2] = lun->unpacked_lun >> 8 | 0x40 ;
 		evt->event.lun[3] = lun->unpacked_lun & 0xFF;
@@ -2002,12 +2002,12 @@ tcm_vhost_make_tpg(struct se_wwn *wwn,
 			struct tcm_vhost_tport, tport_wwn);
 
 	struct tcm_vhost_tpg *tpg;
-	unsigned long tpgt;
+	u16 tpgt;
 	int ret;
 
 	if (strstr(name, "tpgt_") != name)
 		return ERR_PTR(-EINVAL);
-	if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)
+	if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET)
 		return ERR_PTR(-EINVAL);
 
 	tpg = kzalloc(sizeof(struct tcm_vhost_tpg), GFP_KERNEL);
-- 
2.4.2


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

* [PATCH 3.12 034/111] Fix corrupt SMB2 ioctl requests
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (32 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 033/111] vhost/scsi: potential memory corruption Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 035/111] rtlwifi: rtl8192cu: Fix kernel deadlock Jiri Slaby
                   ` (78 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Steve French, Jiri Slaby

From: Steve French <smfrench@gmail.com>

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

===============

commit 7ff8d45c9dccf0744404d6fe44468ede7c1b9533 upstream.

We were off by one calculating the length of ioctls in some cases
because the protocol specification for SMB2 ioctl includes a mininum
one byte payload but not all SMB2 ioctl requests actually have
a data buffer to send. We were also not zeroing out the
return buffer (in case of error this is helpful).

Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/cifs/smb2pdu.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 1f096f694030..1bf0ba805ef5 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1228,6 +1228,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 
 	cifs_dbg(FYI, "SMB2 IOCTL\n");
 
+	*out_data = NULL;
 	/* zero out returned data len, in case of error */
 	if (plen)
 		*plen = 0;
@@ -1273,11 +1274,23 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 		req->Flags = 0;
 
 	iov[0].iov_base = (char *)req;
-	/* 4 for rfc1002 length field */
-	iov[0].iov_len = get_rfc1002_length(req) + 4;
 
-	if (indatalen)
-		inc_rfc1001_len(req, indatalen);
+	/*
+	 * If no input data, the size of ioctl struct in
+	 * protocol spec still includes a 1 byte data buffer,
+	 * but if input data passed to ioctl, we do not
+	 * want to double count this, so we do not send
+	 * the dummy one byte of data in iovec[0] if sending
+	 * input data (in iovec[1]). We also must add 4 bytes
+	 * in first iovec to allow for rfc1002 length field.
+	 */
+
+	if (indatalen) {
+		iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
+		inc_rfc1001_len(req, indatalen - 1);
+	} else
+		iov[0].iov_len = get_rfc1002_length(req) + 4;
+
 
 	rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0);
 	rsp = (struct smb2_ioctl_rsp *)iov[0].iov_base;
-- 
2.4.2


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

* [PATCH 3.12 035/111] rtlwifi: rtl8192cu: Fix kernel deadlock
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (33 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 034/111] Fix corrupt SMB2 ioctl requests Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 036/111] ARM: fix missing syscall trace exit Jiri Slaby
                   ` (77 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Larry Finger, Bernhard Wiedemann, Takashi Iwai,
	Kalle Valo, Jiri Slaby

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

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

===============

commit 414b7e3b9ce8b0577f613e656fdbc36b34b444dd upstream.

The USB mini-driver in rtlwifi, which is used by rtl8192cu, issues a call to
usb_control_msg() with a timeout value of 0. In some instances where the
interface is shutting down, this infinite wait results in a CPU deadlock. A
one second timeout fixes this problem without affecting any normal operations.

This bug is reported at https://bugzilla.novell.com/show_bug.cgi?id=927786.

Reported-by: Bernhard Wiedemann <bwiedemann@suse.com>
Tested-by: Bernhard Wiedemann <bwiedemann@suse.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Cc: Bernhard Wiedemann <bwiedemann@suse.com>
Cc: Takashi Iwai<tiwai@suse.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/wireless/rtlwifi/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 97924743ecf6..832560aa2274 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -126,7 +126,7 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request,
 
 	do {
 		status = usb_control_msg(udev, pipe, request, reqtype, value,
-					 index, pdata, len, 0); /*max. timeout*/
+					 index, pdata, len, 1000);
 		if (status < 0) {
 			/* firmware download is checksumed, don't retry */
 			if ((value >= FW_8192C_START_ADDRESS &&
-- 
2.4.2


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

* [PATCH 3.12 036/111] ARM: fix missing syscall trace exit
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (34 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 035/111] rtlwifi: rtl8192cu: Fix kernel deadlock Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 037/111] mm: numa: initialise numa balancing after jump label initialisation Jiri Slaby
                   ` (76 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Russell King, Jiri Slaby

From: Russell King <rmk+kernel@arm.linux.org.uk>

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

===============

commit 1b97937246d8b97c0760d16d8992c7937bdf5e6a upstream.

Josh Stone reports:

  I've discovered a case where both arm and arm64 will miss a ptrace
  syscall-exit that they should report.  If the syscall is entered
  without TIF_SYSCALL_TRACE set, then it goes on the fast path.  It's
  then possible to have TIF_SYSCALL_TRACE added in the middle of the
  syscall, but ret_fast_syscall doesn't check this flag again.

Fix this by always checking for a syscall trace in the fast exit path.

Reported-by: Josh Stone <jistone@redhat.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/kernel/entry-common.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index bc6bd9683ba4..c70b4e195d2e 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -32,7 +32,9 @@ ret_fast_syscall:
  UNWIND(.fnstart	)
  UNWIND(.cantunwind	)
 	disable_irq				@ disable interrupts
-	ldr	r1, [tsk, #TI_FLAGS]
+	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
+	tst	r1, #_TIF_SYSCALL_WORK
+	bne	__sys_trace_return
 	tst	r1, #_TIF_WORK_MASK
 	bne	fast_work_pending
 	asm_trace_hardirqs_on
-- 
2.4.2


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

* [PATCH 3.12 037/111] mm: numa: initialise numa balancing after jump label initialisation
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (35 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 036/111] ARM: fix missing syscall trace exit Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 038/111] KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages Jiri Slaby
                   ` (75 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Mel Gorman, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Mel Gorman <mgorman@suse.de>

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

===============

commit c297663c0b3930491a3cb2aba4b6e5a7159c3503 upstream.

The command line parsing takes place before jump labels are initialised
which generates a warning if numa_balancing= is specified and
CONFIG_JUMP_LABEL is set.

On older kernels before commit c4b2c0c5f647 ("static_key: WARN on usage
before jump_label_init was called") the kernel would have crashed.  This
patch enables automatic numa balancing later in the initialisation
process if numa_balancing= is specified.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/mempolicy.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3650036bb910..e63ade49ea24 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2576,7 +2576,7 @@ void mpol_free_shared_policy(struct shared_policy *p)
 }
 
 #ifdef CONFIG_NUMA_BALANCING
-static bool __initdata numabalancing_override;
+static int __initdata numabalancing_override;
 
 static void __init check_numabalancing_enable(void)
 {
@@ -2585,9 +2585,14 @@ static void __init check_numabalancing_enable(void)
 	if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED))
 		numabalancing_default = true;
 
+	/* Parsed by setup_numabalancing. override == 1 enables, -1 disables */
+	if (numabalancing_override)
+		set_numabalancing_state(numabalancing_override == 1);
+
 	if (nr_node_ids > 1 && !numabalancing_override) {
-		printk(KERN_INFO "Enabling automatic NUMA balancing. "
-			"Configure with numa_balancing= or sysctl");
+		printk(KERN_INFO "%s automatic NUMA balancing. "
+			"Configure with numa_balancing= or sysctl",
+			numabalancing_default ? "Enabling" : "Disabling");
 		set_numabalancing_state(numabalancing_default);
 	}
 }
@@ -2597,13 +2602,12 @@ static int __init setup_numabalancing(char *str)
 	int ret = 0;
 	if (!str)
 		goto out;
-	numabalancing_override = true;
 
 	if (!strcmp(str, "enable")) {
-		set_numabalancing_state(true);
+		numabalancing_override = 1;
 		ret = 1;
 	} else if (!strcmp(str, "disable")) {
-		set_numabalancing_state(false);
+		numabalancing_override = -1;
 		ret = 1;
 	}
 out:
-- 
2.4.2


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

* [PATCH 3.12 038/111] KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (36 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 037/111] mm: numa: initialise numa balancing after jump label initialisation Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 039/111] net: socket: Fix the wrong returns for recvmsg and sendmsg Jiri Slaby
                   ` (74 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Paolo Bonzini, Jiri Slaby

From: Paolo Bonzini <pbonzini@redhat.com>

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

===============

commit 898761158be7682082955e3efa4ad24725305fc7 upstream.

smep_andnot_wp is initialized in kvm_init_shadow_mmu and shadow pages
should not be reused for different values of it.  Thus, it has to be
added to the mask in kvm_mmu_pte_write.

Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 8ad01b4e60cc..b759853d78fe 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4123,7 +4123,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
 	++vcpu->kvm->stat.mmu_pte_write;
 	kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE);
 
-	mask.cr0_wp = mask.cr4_pae = mask.nxe = 1;
+	mask.cr0_wp = mask.cr4_pae = mask.nxe = mask.smep_andnot_wp = 1;
 	for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn) {
 		if (detect_write_misaligned(sp, gpa, bytes) ||
 		      detect_write_flooding(sp)) {
-- 
2.4.2


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

* [PATCH 3.12 039/111] net: socket: Fix the wrong returns for recvmsg and sendmsg
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (37 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 038/111] KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 040/111] fs, omfs: add NULL terminator in the end up the token list Jiri Slaby
                   ` (73 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Junling Zheng, Hanbing Xu, Li Zefan, Al Viro,
	David Miller, Jiri Slaby

From: Junling Zheng <zhengjunling@huawei.com>

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

===============

Based on 08adb7dabd4874cc5666b4490653b26534702ce0 upstream.

We found that after v3.10.73, recvmsg might return -EFAULT while -EINVAL
was expected.

We tested it through the recvmsg01 testcase come from LTP testsuit. It set
msg->msg_namelen to -1 and the recvmsg syscall returned errno 14, which is
unexpected (errno 22 is expected):

recvmsg01    4  TFAIL  :  invalid socket length ; returned -1 (expected -1),
errno 14 (expected 22)

Linux mainline has no this bug for commit 08adb7dab fixes it accidentally.
However, it is too large and complex to be backported to LTS 3.10.

Commit 281c9c36 (net: compat: Update get_compat_msghdr() to match
copy_msghdr_from_user() behaviour) made get_compat_msghdr() return
error if msg_sys->msg_namelen was negative, which changed the behaviors
of recvmsg and sendmsg syscall in a lib32 system:

Before commit 281c9c36, get_compat_msghdr() wouldn't fail and it would
return -EINVAL in move_addr_to_user() or somewhere if msg_sys->msg_namelen
was invalid and then syscall returned -EINVAL, which is correct.

And now, when msg_sys->msg_namelen is negative, get_compat_msghdr() will
fail and wants to return -EINVAL, however, the outer syscall will return
-EFAULT directly, which is unexpected.

This patch gets the return value of get_compat_msghdr() as well as
copy_msghdr_from_user(), then returns this expected value if
get_compat_msghdr() fails.

Fixes: 281c9c36 (net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviour)
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Hanbing Xu <xuhanbing@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/socket.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 3afb43efd3e5..432b0bddd9e1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1993,14 +1993,12 @@ static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
 	int err, ctl_len, total_len;
 
 	err = -EFAULT;
-	if (MSG_CMSG_COMPAT & flags) {
-		if (get_compat_msghdr(msg_sys, msg_compat))
-			return -EFAULT;
-	} else {
+	if (MSG_CMSG_COMPAT & flags)
+		err = get_compat_msghdr(msg_sys, msg_compat);
+	else
 		err = copy_msghdr_from_user(msg_sys, msg);
-		if (err)
-			return err;
-	}
+	if (err)
+		return err;
 
 	if (msg_sys->msg_iovlen > UIO_FASTIOV) {
 		err = -EMSGSIZE;
@@ -2205,14 +2203,12 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
 	struct sockaddr __user *uaddr;
 	int __user *uaddr_len;
 
-	if (MSG_CMSG_COMPAT & flags) {
-		if (get_compat_msghdr(msg_sys, msg_compat))
-			return -EFAULT;
-	} else {
+	if (MSG_CMSG_COMPAT & flags)
+		err = get_compat_msghdr(msg_sys, msg_compat);
+	else
 		err = copy_msghdr_from_user(msg_sys, msg);
-		if (err)
-			return err;
-	}
+	if (err)
+		return err;
 
 	if (msg_sys->msg_iovlen > UIO_FASTIOV) {
 		err = -EMSGSIZE;
-- 
2.4.2


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

* [PATCH 3.12 040/111] fs, omfs: add NULL terminator in the end up the token list
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (38 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 039/111] net: socket: Fix the wrong returns for recvmsg and sendmsg Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 041/111] lguest: fix out-by-one error in address checking Jiri Slaby
                   ` (72 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Sasha Levin, Bob Copeland, Andrew Morton,
	Linus Torvalds, Jiri Slaby

From: Sasha Levin <sasha.levin@oracle.com>

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

===============

commit dcbff39da3d815f08750552fdd04f96b51751129 upstream.

match_token() expects a NULL terminator at the end of the token list so
that it would know where to stop.  Not having one causes it to overrun
to invalid memory.

In practice, passing a mount option that omfs didn't recognize would
sometimes panic the system.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/omfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index d8b0afde2179..2dba0caf1f4a 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -361,7 +361,7 @@ nomem:
 }
 
 enum {
-	Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask
+	Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask, Opt_err
 };
 
 static const match_table_t tokens = {
@@ -370,6 +370,7 @@ static const match_table_t tokens = {
 	{Opt_umask, "umask=%o"},
 	{Opt_dmask, "dmask=%o"},
 	{Opt_fmask, "fmask=%o"},
+	{Opt_err, NULL},
 };
 
 static int parse_options(char *options, struct omfs_sb_info *sbi)
-- 
2.4.2


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

* [PATCH 3.12 041/111] lguest: fix out-by-one error in address checking.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (39 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 040/111] fs, omfs: add NULL terminator in the end up the token list Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 042/111] libceph: request a new osdmap if lingering request maps to no osd Jiri Slaby
                   ` (71 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Rusty Russell, Linus Torvalds, Jiri Slaby

From: Rusty Russell <rusty@rustcorp.com.au>

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

===============

commit 83a35114d0e4583e6b0ca39502e68b6a92e2910c upstream.

This bug has been there since day 1; addresses in the top guest physical
page weren't considered valid.  You could map that page (the check in
check_gpte() is correct), but if a guest tried to put a pagetable there
we'd check that address manually when walking it, and kill the guest.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/lguest/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index 0bf1e4edf04d..19da22249bd8 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -176,7 +176,7 @@ static void unmap_switcher(void)
 bool lguest_address_ok(const struct lguest *lg,
 		       unsigned long addr, unsigned long len)
 {
-	return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr);
+	return addr+len <= lg->pfn_limit * PAGE_SIZE && (addr+len >= addr);
 }
 
 /*
-- 
2.4.2


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

* [PATCH 3.12 042/111] libceph: request a new osdmap if lingering request maps to no osd
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (40 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 041/111] lguest: fix out-by-one error in address checking Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 043/111] xen/events: don't bind non-percpu VIRQs with percpu chip Jiri Slaby
                   ` (70 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ilya Dryomov, Jiri Slaby

From: Ilya Dryomov <idryomov@gmail.com>

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

===============

commit b0494532214bdfbf241e94fabab5dd46f7b82631 upstream.

This commit does two things.  First, if there are any homeless
lingering requests, we now request a new osdmap even if the osdmap that
is being processed brought no changes, i.e. if a given lingering
request turned homeless in one of the previous epochs and remained
homeless in the current epoch.  Not doing so leaves us with a stale
osdmap and as a result we may miss our window for reestablishing the
watch and lose notifies.

MON=1 OSD=1:

    # cat linger-needmap.sh
    #!/bin/bash
    rbd create --size 1 test
    DEV=$(rbd map test)
    ceph osd out 0
    rbd map dne/dne # obtain a new osdmap as a side effect (!)
    sleep 1
    ceph osd in 0
    rbd resize --size 2 test
    # rbd info test | grep size -> 2M
    # blockdev --getsize $DEV -> 1M

N.B.: Not obtaining a new osdmap in between "osd out" and "osd in"
above is enough to make it miss that resize notify, but that is a
bug^Wlimitation of ceph watch/notify v1.

Second, homeless lingering requests are now kicked just like those
lingering requests whose mapping has changed.  This is mainly to
recognize that a homeless lingering request makes no sense and to
preserve the invariant that a registered lingering request is not
sitting on any of r_req_lru_item lists.  This spares us a WARN_ON,
which commit ba9d114ec557 ("libceph: clear r_req_lru_item in
__unregister_linger_request()") tried to fix the _wrong_ way.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ceph/osd_client.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index aab733629265..2458db2966cf 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1709,20 +1709,29 @@ static void kick_requests(struct ceph_osd_client *osdc, bool force_resend,
 		err = __map_request(osdc, req,
 				    force_resend || force_resend_writes);
 		dout("__map_request returned %d\n", err);
-		if (err == 0)
-			continue;  /* no change and no osd was specified */
 		if (err < 0)
 			continue;  /* hrm! */
-		if (req->r_osd == NULL) {
-			dout("tid %llu maps to no valid osd\n", req->r_tid);
-			needmap++;  /* request a newer map */
-			continue;
-		}
+		if (req->r_osd == NULL || err > 0) {
+			if (req->r_osd == NULL) {
+				dout("lingering %p tid %llu maps to no osd\n",
+				     req, req->r_tid);
+				/*
+				 * A homeless lingering request makes
+				 * no sense, as it's job is to keep
+				 * a particular OSD connection open.
+				 * Request a newer map and kick the
+				 * request, knowing that it won't be
+				 * resent until we actually get a map
+				 * that can tell us where to send it.
+				 */
+				needmap++;
+			}
 
-		dout("kicking lingering %p tid %llu osd%d\n", req, req->r_tid,
-		     req->r_osd ? req->r_osd->o_osd : -1);
-		__register_request(osdc, req);
-		__unregister_linger_request(osdc, req);
+			dout("kicking lingering %p tid %llu osd%d\n", req,
+			     req->r_tid, req->r_osd ? req->r_osd->o_osd : -1);
+			__register_request(osdc, req);
+			__unregister_linger_request(osdc, req);
+		}
 	}
 	reset_changed_osds(osdc);
 	mutex_unlock(&osdc->request_mutex);
-- 
2.4.2


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

* [PATCH 3.12 043/111] xen/events: don't bind non-percpu VIRQs with percpu chip
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (41 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 042/111] libceph: request a new osdmap if lingering request maps to no osd Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 044/111] hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE Jiri Slaby
                   ` (69 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, David Vrabel, Jiri Slaby

From: David Vrabel <david.vrabel@citrix.com>

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

===============

commit 77bb3dfdc0d554befad58fdefbc41be5bc3ed38a upstream.

A non-percpu VIRQ (e.g., VIRQ_CONSOLE) may be freed on a different
VCPU than it is bound to.  This can result in a race between
handle_percpu_irq() and removing the action in __free_irq() because
handle_percpu_irq() does not take desc->lock.  The interrupt handler
sees a NULL action and oopses.

Only use the percpu chip/handler for per-CPU VIRQs (like VIRQ_TIMER).

  # cat /proc/interrupts | grep virq
   40:      87246          0  xen-percpu-virq      timer0
   44:          0          0  xen-percpu-virq      debug0
   47:          0      20995  xen-percpu-virq      timer1
   51:          0          0  xen-percpu-virq      debug1
   69:          0          0   xen-dyn-virq      xen-pcpu
   74:          0          0   xen-dyn-virq      mce
   75:         29          0   xen-dyn-virq      hvc_console

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/hvc/hvc_xen.c |  2 +-
 drivers/xen/events.c      | 12 ++++++++----
 include/xen/events.h      |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index b4805adc50af..1dcee9a55914 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -289,7 +289,7 @@ static int xen_initial_domain_console_init(void)
 			return -ENOMEM;
 	}
 
-	info->irq = bind_virq_to_irq(VIRQ_CONSOLE, 0);
+	info->irq = bind_virq_to_irq(VIRQ_CONSOLE, 0, false);
 	info->vtermno = HVC_COOKIE;
 
 	spin_lock(&xencons_lock);
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 4035e833ea26..767fe735abd7 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -959,7 +959,7 @@ static int find_virq(unsigned int virq, unsigned int cpu)
 	return rc;
 }
 
-int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
+int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu)
 {
 	struct evtchn_bind_virq bind_virq;
 	int evtchn, irq, ret;
@@ -973,8 +973,12 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
 		if (irq < 0)
 			goto out;
 
-		irq_set_chip_and_handler_name(irq, &xen_percpu_chip,
-					      handle_percpu_irq, "virq");
+		if (percpu)
+			irq_set_chip_and_handler_name(irq, &xen_percpu_chip,
+						      handle_percpu_irq, "virq");
+		else
+			irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
+						      handle_edge_irq, "virq");
 
 		bind_virq.virq = virq;
 		bind_virq.vcpu = cpu;
@@ -1101,7 +1105,7 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
 {
 	int irq, retval;
 
-	irq = bind_virq_to_irq(virq, cpu);
+	irq = bind_virq_to_irq(virq, cpu, irqflags & IRQF_PERCPU);
 	if (irq < 0)
 		return irq;
 	retval = request_irq(irq, handler, irqflags, devname, dev_id);
diff --git a/include/xen/events.h b/include/xen/events.h
index c9ea10ee2273..7e1a8adc41fb 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -12,7 +12,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
 			      irq_handler_t handler,
 			      unsigned long irqflags, const char *devname,
 			      void *dev_id);
-int bind_virq_to_irq(unsigned int virq, unsigned int cpu);
+int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu);
 int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
 			    irq_handler_t handler,
 			    unsigned long irqflags, const char *devname,
-- 
2.4.2


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

* [PATCH 3.12 044/111] hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (42 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 043/111] xen/events: don't bind non-percpu VIRQs with percpu chip Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 045/111] hwmon: (nct6775) Add missing sysfs attribute initialization Jiri Slaby
                   ` (68 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Chris Lesiak, Guenter Roeck, Jiri Slaby

From: Chris Lesiak <chris.lesiak@licor.com>

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

===============

commit adba657533bdd255f7b78bc8a324091f46b294cd upstream.

When configured via device tree, the associated iio device needs to be
measuring voltage for the conversion to resistance to be correct.
Return -EINVAL if that is not the case.

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/ntc_thermistor.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index e76feb86a1d4..3660cb6fc68a 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -181,8 +181,10 @@ static struct ntc_thermistor_platform_data *
 ntc_thermistor_parse_dt(struct platform_device *pdev)
 {
 	struct iio_channel *chan;
+	enum iio_chan_type type;
 	struct device_node *np = pdev->dev.of_node;
 	struct ntc_thermistor_platform_data *pdata;
+	int ret;
 
 	if (!np)
 		return NULL;
@@ -195,6 +197,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev)
 	if (IS_ERR(chan))
 		return ERR_CAST(chan);
 
+	ret = iio_get_channel_type(chan, &type);
+	if (ret < 0)
+		return ERR_PTR(ret);
+
+	if (type != IIO_VOLTAGE)
+		return ERR_PTR(-EINVAL);
+
 	if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv))
 		return ERR_PTR(-ENODEV);
 	if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm))
-- 
2.4.2


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

* [PATCH 3.12 045/111] hwmon: (nct6775) Add missing sysfs attribute initialization
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (43 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 044/111] hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 046/111] lib: Fix strnlen_user() to not touch memory after specified maximum Jiri Slaby
                   ` (67 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Guenter Roeck, Jiri Slaby

From: Guenter Roeck <linux@roeck-us.net>

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

===============

commit 1b63bf617206ff35b93c57c67bbe067ac735a85a upstream.

The following error message is seen when loading the nct6775 driver
with DEBUG_LOCK_ALLOC enabled.

BUG: key ffff88040b2f0030 not in .data!
------------[ cut here ]------------
WARNING: CPU: 0 PID: 186 at kernel/locking/lockdep.c:2988
				lockdep_init_map+0x469/0x630()
DEBUG_LOCKS_WARN_ON(1)

Caused by a missing call to sysfs_attr_init() when initializing
sysfs attributes.

Reported-by: Alexey Orishko <alexey.orishko@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/nct6775.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 6eb03ce2cff4..b6d28439f1b9 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -978,6 +978,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
 				 (*t)->dev_attr.attr.name, tg->base + i);
 			if ((*t)->s2) {
 				a2 = &su->u.a2;
+				sysfs_attr_init(&a2->dev_attr.attr);
 				a2->dev_attr.attr.name = su->name;
 				a2->nr = (*t)->u.s.nr + i;
 				a2->index = (*t)->u.s.index;
@@ -988,6 +989,7 @@ nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
 				*attrs = &a2->dev_attr.attr;
 			} else {
 				a = &su->u.a1;
+				sysfs_attr_init(&a->dev_attr.attr);
 				a->dev_attr.attr.name = su->name;
 				a->index = (*t)->u.index + i;
 				a->dev_attr.attr.mode =
-- 
2.4.2


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

* [PATCH 3.12 046/111] lib: Fix strnlen_user() to not touch memory after specified maximum
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (44 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 045/111] hwmon: (nct6775) Add missing sysfs attribute initialization Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 047/111] d_walk() might skip too much Jiri Slaby
                   ` (66 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jan Kara, Linus Torvalds, Jiri Slaby

From: Jan Kara <jack@suse.cz>

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

===============

commit f18c34e483ff6b1d9866472221e4015b3a4698e4 upstream.

If the specified maximum length of the string is a multiple of unsigned
long, we would load one long behind the specified maximum.  If that
happens to be in a next page, we can hit a page fault although we were
not expected to.

Fix the off-by-one bug in the test whether we are at the end of the
specified range.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 lib/strnlen_user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index a28df5206d95..11649615c505 100644
--- a/lib/strnlen_user.c
+++ b/lib/strnlen_user.c
@@ -57,7 +57,8 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count,
 			return res + find_zero(data) + 1 - align;
 		}
 		res += sizeof(unsigned long);
-		if (unlikely(max < sizeof(unsigned long)))
+		/* We already handled 'unsigned long' bytes. Did we do it all ? */
+		if (unlikely(max <= sizeof(unsigned long)))
 			break;
 		max -= sizeof(unsigned long);
 		if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
-- 
2.4.2


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

* [PATCH 3.12 047/111] d_walk() might skip too much
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (45 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 046/111] lib: Fix strnlen_user() to not touch memory after specified maximum Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 048/111] ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724 Jiri Slaby
                   ` (65 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Al Viro, Jiri Slaby

From: Al Viro <viro@zeniv.linux.org.uk>

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

===============

commit 2159184ea01e4ae7d15f2017e296d4bc82d5aeb0 upstream.

when we find that a child has died while we'd been trying to ascend,
we should go into the first live sibling itself, rather than its sibling.

Off-by-one in question had been introduced in "deal with deadlock in
d_walk()" and the fix needs to be backported to all branches this one
has been backported to.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/dcache.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index eb540b00d027..e619730ade4c 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1154,13 +1154,13 @@ ascend:
 		/* might go back up the wrong parent if we have had a rename. */
 		if (need_seqretry(&rename_lock, seq))
 			goto rename_retry;
-		next = child->d_child.next;
-		while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) {
+		/* go into the first sibling still alive */
+		do {
+			next = child->d_child.next;
 			if (next == &this_parent->d_subdirs)
 				goto ascend;
 			child = list_entry(next, struct dentry, d_child);
-			next = next->next;
-		}
+		} while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED));
 		rcu_read_unlock();
 		goto resume;
 	}
-- 
2.4.2


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

* [PATCH 3.12 048/111] ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (46 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 047/111] d_walk() might skip too much Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 049/111] ALSA: hda - Add headphone quirk for Lifebook E752 Jiri Slaby
                   ` (64 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, David Henningsson, Takashi Iwai, Jiri Slaby

From: David Henningsson <david.henningsson@canonical.com>

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

===============

commit 6ffc0898b29a2811a6c0569c5dd9b581980110df upstream.

This patch adds support for Conexant HD Audio codecs
CX20721, CX20722, CX20723 and CX20724.

BugLink: https://bugs.launchpad.net/bugs/1454656
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_conexant.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 9baf0037866f..c036e60c34fe 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3575,6 +3575,14 @@ static const struct hda_codec_preset snd_hda_preset_conexant[] = {
 	  .patch = patch_conexant_auto },
 	{ .id = 0x14f150b9, .name = "CX20665",
 	  .patch = patch_conexant_auto },
+	{ .id = 0x14f150f1, .name = "CX20721",
+	  .patch = patch_conexant_auto },
+	{ .id = 0x14f150f2, .name = "CX20722",
+	  .patch = patch_conexant_auto },
+	{ .id = 0x14f150f3, .name = "CX20723",
+	  .patch = patch_conexant_auto },
+	{ .id = 0x14f150f4, .name = "CX20724",
+	  .patch = patch_conexant_auto },
 	{ .id = 0x14f1510f, .name = "CX20751/2",
 	  .patch = patch_conexant_auto },
 	{ .id = 0x14f15110, .name = "CX20751/2",
@@ -3609,6 +3617,10 @@ MODULE_ALIAS("snd-hda-codec-id:14f150ab");
 MODULE_ALIAS("snd-hda-codec-id:14f150ac");
 MODULE_ALIAS("snd-hda-codec-id:14f150b8");
 MODULE_ALIAS("snd-hda-codec-id:14f150b9");
+MODULE_ALIAS("snd-hda-codec-id:14f150f1");
+MODULE_ALIAS("snd-hda-codec-id:14f150f2");
+MODULE_ALIAS("snd-hda-codec-id:14f150f3");
+MODULE_ALIAS("snd-hda-codec-id:14f150f4");
 MODULE_ALIAS("snd-hda-codec-id:14f1510f");
 MODULE_ALIAS("snd-hda-codec-id:14f15110");
 MODULE_ALIAS("snd-hda-codec-id:14f15111");
-- 
2.4.2


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

* [PATCH 3.12 049/111] ALSA: hda - Add headphone quirk for Lifebook E752
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (47 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 048/111] ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 050/111] ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls Jiri Slaby
                   ` (63 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Takashi Iwai, Jiri Slaby

From: Takashi Iwai <tiwai@suse.de>

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

===============

commit 88776f366ede7d9cdce60bd2c9753dd6d6fa8b77 upstream.

Fujitsu Lifebook E752 laptop needs a similar quirk done for Lifebook
T731.  Otherwise the headphone is always muted.

Reported-and-tested-by: Christian Weber <we_chris@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_realtek.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f2db52abc73a..cd621d02a093 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4142,6 +4142,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
+	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
-- 
2.4.2


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

* [PATCH 3.12 050/111] ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (48 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 049/111] ALSA: hda - Add headphone quirk for Lifebook E752 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 051/111] ASoC: wm8960: fix "RINPUT3" audio route error Jiri Slaby
                   ` (62 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Mark Brown, Jiri Slaby

From: Axel Lin <axel.lin@ingics.com>

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

===============

commit 545774bd6e1427d98dde77244329d2311c5eca6f upstream.

mc13xxx_reg_rmw() won't change any bit if passing 0 to the mask field.
Pass AUDIO_SSI_SEL instead of 0 for the mask field to set AUDIO_SSI_SEL
bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/soc/codecs/mc13783.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index ea141e1d6f28..310d0194268d 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -603,14 +603,14 @@ static int mc13783_probe(struct snd_soc_codec *codec)
 				AUDIO_SSI_SEL, 0);
 	else
 		mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_CODEC,
-				0, AUDIO_SSI_SEL);
+				AUDIO_SSI_SEL, AUDIO_SSI_SEL);
 
 	if (priv->dac_ssi_port == MC13783_SSI1_PORT)
 		mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC,
 				AUDIO_SSI_SEL, 0);
 	else
 		mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC,
-				0, AUDIO_SSI_SEL);
+				AUDIO_SSI_SEL, AUDIO_SSI_SEL);
 
 	mc13xxx_unlock(priv->mc13xxx);
 
-- 
2.4.2


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

* [PATCH 3.12 051/111] ASoC: wm8960: fix "RINPUT3" audio route error
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (49 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 050/111] ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 052/111] ASoC: wm8994: correct BCLK DIV 348 to 384 Jiri Slaby
                   ` (61 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Zidan Wang, Mark Brown, Jiri Slaby

From: Zidan Wang <zidan.wang@freescale.com>

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

===============

commit 85e36a1f4a735d991ba5106781ea48e89a0b8901 upstream.

It should be "RINPUT3" instead of "LINPUT3" route to "Right Input
Mixer".

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/soc/codecs/wm8960.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 2a0bfb848512..edfd4edaa864 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -392,7 +392,7 @@ static const struct snd_soc_dapm_route audio_paths[] = {
 	{ "Right Input Mixer", "Boost Switch", "Right Boost Mixer", },
 	{ "Right Input Mixer", NULL, "RINPUT1", },  /* Really Boost Switch */
 	{ "Right Input Mixer", NULL, "RINPUT2" },
-	{ "Right Input Mixer", NULL, "LINPUT3" },
+	{ "Right Input Mixer", NULL, "RINPUT3" },
 
 	{ "Left ADC", NULL, "Left Input Mixer" },
 	{ "Right ADC", NULL, "Right Input Mixer" },
-- 
2.4.2


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

* [PATCH 3.12 052/111] ASoC: wm8994: correct BCLK DIV 348 to 384
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (50 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 051/111] ASoC: wm8960: fix "RINPUT3" audio route error Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 053/111] target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST Jiri Slaby
                   ` (60 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Zidan Wang, Mark Brown, Jiri Slaby

From: Zidan Wang <zidan.wang@freescale.com>

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

===============

commit 17fc2e0a3db11889e942c5ab15a1fcb876638f25 upstream.

According to the RM of wm8958, BCLK DIV 348 doesn't exist, correct it
to 384.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/soc/codecs/wm8994.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c9ce9772e49b..d495d019f18b 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2740,7 +2740,7 @@ static struct {
 };
 
 static int fs_ratios[] = {
-	64, 128, 192, 256, 348, 512, 768, 1024, 1408, 1536
+	64, 128, 192, 256, 384, 512, 768, 1024, 1408, 1536
 };
 
 static int bclk_divs[] = {
-- 
2.4.2


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

* [PATCH 3.12 053/111] target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (51 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 052/111] ASoC: wm8994: correct BCLK DIV 348 to 384 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 054/111] xhci: fix isoc endpoint dequeue from advancing too far on transaction error Jiri Slaby
                   ` (59 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Andy Grover, Nicholas Bellinger, Jiri Slaby

From: Andy Grover <agrover@redhat.com>

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

===============

commit 5a7125c64def3b21f8147eca8b54949a60963942 upstream.

See https://bugzilla.redhat.com/show_bug.cgi?id=1025672

We need to put() the reference to the scsi host that we got in
pscsi_configure_device(). In VIRTUAL_HOST mode it is associated with
the dev_virt, not the hba_virt.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/target/target_core_pscsi.c | 3 +++
 drivers/target/target_core_pscsi.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 29f28808fc03..9b90cfacf75c 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -520,6 +520,7 @@ static int pscsi_configure_device(struct se_device *dev)
 					" pdv_host_id: %d\n", pdv->pdv_host_id);
 				return -EINVAL;
 			}
+			pdv->pdv_lld_host = sh;
 		}
 	} else {
 		if (phv->phv_mode == PHV_VIRTUAL_HOST_ID) {
@@ -602,6 +603,8 @@ static void pscsi_free_device(struct se_device *dev)
 		if ((phv->phv_mode == PHV_LLD_SCSI_HOST_NO) &&
 		    (phv->phv_lld_host != NULL))
 			scsi_host_put(phv->phv_lld_host);
+		else if (pdv->pdv_lld_host)
+			scsi_host_put(pdv->pdv_lld_host);
 
 		if ((sd->type == TYPE_DISK) || (sd->type == TYPE_ROM))
 			scsi_device_put(sd);
diff --git a/drivers/target/target_core_pscsi.h b/drivers/target/target_core_pscsi.h
index 1bd757dff8ee..820d3052b775 100644
--- a/drivers/target/target_core_pscsi.h
+++ b/drivers/target/target_core_pscsi.h
@@ -45,6 +45,7 @@ struct pscsi_dev_virt {
 	int	pdv_lun_id;
 	struct block_device *pdv_bd;
 	struct scsi_device *pdv_sd;
+	struct Scsi_Host *pdv_lld_host;
 } ____cacheline_aligned;
 
 typedef enum phv_modes {
-- 
2.4.2


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

* [PATCH 3.12 054/111] xhci: fix isoc endpoint dequeue from advancing too far on transaction error
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (52 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 053/111] target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 055/111] xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 Jiri Slaby
                   ` (58 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mathias Nyman, Jiri Slaby

From: Mathias Nyman <mathias.nyman@linux.intel.com>

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

===============

commit d104d0152a97fade389f47635b73a9ccc7295d0b upstream.

Isoc TDs usually consist of one TRB, sometimes two. When all goes well we
receive only one success event for a TD, and move the dequeue pointer to
the next TD.

This fails if the TD consists of two TRBs and we get a transfer error
on the first TRB, we will then see two events for that TD.

Fix this by making sure the event we get is for the last TRB in that TD
before moving the dequeue pointer to the next TD. This will resolve some
of the uvc and dvb issues with the
"ERROR Transfer event TRB DMA ptr not part of current TD" error message

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/xhci-ring.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 75dc6647ba22..05f04e7343eb 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2180,8 +2180,13 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		break;
 	case COMP_DEV_ERR:
 	case COMP_STALL:
+		frame->status = -EPROTO;
+		skip_td = true;
+		break;
 	case COMP_TX_ERR:
 		frame->status = -EPROTO;
+		if (event_trb != td->last_trb)
+			return 0;
 		skip_td = true;
 		break;
 	case COMP_STOP:
-- 
2.4.2


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

* [PATCH 3.12 055/111] xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (53 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 054/111] xhci: fix isoc endpoint dequeue from advancing too far on transaction error Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 056/111] xhci: gracefully handle xhci_irq dead device Jiri Slaby
                   ` (57 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mathias Nyman, Jiri Slaby

From: Mathias Nyman <mathias.nyman@linux.intel.com>

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

===============

commit 18cc2f4cbbaf825a4fedcf2d60fd388d291e0a38 upstream.

Our event ring consists of only one segment, and we risk filling
the event ring in case we get isoc transfers with short intervals
such as webcams that fill a TD every microframe (125us)

With 64 TRB segment size one usb camera could fill the event ring in 8ms.
A setup with several cameras and other devices can fill up the
event ring as it is shared between all devices.
This has occurred when uvcvideo queues 5 * 32TD URBs which then
get cancelled when the video mode changes. The cancelled URBs are returned
in the xhci interrupt context and blocks the interrupt handler from
handling the new events.

A full event ring will block xhci from scheduling traffic and affect all
devices conneted to the xhci, will see errors such as Missed Service
Intervals for isoc devices, and  and Split transaction errors for LS/FS
interrupt devices.

Increasing the TRB_PER_SEGMENT will also increase the default endpoint ring
size, which is welcome as for most isoc transfer we had to dynamically
expand the endpoint ring anyway to be able to queue the 5 * 32TDs uvcvideo
queues.

The default size used to be 64 TRBs per segment

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/xhci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index d14b3e17b906..510e9c0efd18 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1262,7 +1262,7 @@ union xhci_trb {
  * since the command ring is 64-byte aligned.
  * It must also be greater than 16.
  */
-#define TRBS_PER_SEGMENT	64
+#define TRBS_PER_SEGMENT	256
 /* Allow two commands + a link TRB, along with any reserved command TRBs */
 #define MAX_RSVD_CMD_TRBS	(TRBS_PER_SEGMENT - 3)
 #define TRB_SEGMENT_SIZE	(TRBS_PER_SEGMENT*16)
-- 
2.4.2


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

* [PATCH 3.12 056/111] xhci: gracefully handle xhci_irq dead device
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (54 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 055/111] xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 057/111] USB: visor: Match I330 phone more precisely Jiri Slaby
                   ` (56 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joe Lawrence, Mathias Nyman, Jiri Slaby

From: Joe Lawrence <joe.lawrence@stratus.com>

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

===============

commit 948fa13504f80b9765d2b753691ab94c83a10341 upstream.

If the xHCI host controller has died (ie, device removed) or suffered
other serious fatal error (STS_FATAL), then xhci_irq should handle this
condition with IRQ_HANDLED instead of -ESHUTDOWN.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/xhci-ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 05f04e7343eb..07aafa50f453 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2794,7 +2794,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
 		xhci_halt(xhci);
 hw_died:
 		spin_unlock(&xhci->lock);
-		return -ESHUTDOWN;
+		return IRQ_HANDLED;
 	}
 
 	/*
-- 
2.4.2


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

* [PATCH 3.12 057/111] USB: visor: Match I330 phone more precisely
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (55 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 056/111] xhci: gracefully handle xhci_irq dead device Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 058/111] USB: pl2303: Remove support for Samsung I330 Jiri Slaby
                   ` (55 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jason A. Donenfeld, Johan Hovold, Jiri Slaby

From: "Jason A. Donenfeld" <Jason@zx2c4.com>

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

===============

commit 82ee3aeb9295c5fc37fd2ddf20f13ac2b40ec97d upstream.

Samsung has just released a portable USB3 SSD, coming in a very small
and nice form factor. It's USB ID is 04e8:8001, which unfortunately is
already used by the Palm Visor driver for the Samsung I330 phone cradle.
Having pl2303 or visor pick up this device ID results in conflicts with
the usb-storage driver, which handles the newly released portable USB3
SSD.

To work around this conflict, I've dug up a mailing list post [1] from a
long time ago, in which a user posts the full USB descriptor
information. The most specific value in this appears to be the interface
class, which has value 255 (0xff). Since usb-storage requires an
interface class of 0x8, I believe it's correct to disambiguate the two
devices by matching on 0xff inside visor.

[1] http://permalink.gmane.org/gmane.linux.usb.user/4264

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/visor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 9910aa2edf4b..727905de0ba4 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -96,7 +96,7 @@ static struct usb_device_id id_table [] = {
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
-	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID),
+	{ USB_DEVICE_INTERFACE_CLASS(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID, 0xff),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
-- 
2.4.2


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

* [PATCH 3.12 058/111] USB: pl2303: Remove support for Samsung I330
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (56 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 057/111] USB: visor: Match I330 phone more precisely Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 059/111] USB: cp210x: add ID for KCF Technologies PRN device Jiri Slaby
                   ` (54 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jason A. Donenfeld, Johan Hovold, Jiri Slaby

From: "Jason A. Donenfeld" <Jason@zx2c4.com>

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

===============

commit 48ef23a4f686b1e4519d4193c20d26834ff810ff upstream.

This phone is already supported by the visor driver.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/pl2303.c | 1 -
 drivers/usb/serial/pl2303.h | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 81ab710c17ed..e47f9c642404 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -64,7 +64,6 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
 	{ USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
 	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
-	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) },
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_SX1) },
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) },
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X75) },
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 71fd9da1d6e7..e3b7af8adfb7 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -62,10 +62,6 @@
 #define ALCATEL_VENDOR_ID	0x11f7
 #define ALCATEL_PRODUCT_ID	0x02df
 
-/* Samsung I330 phone cradle */
-#define SAMSUNG_VENDOR_ID	0x04e8
-#define SAMSUNG_PRODUCT_ID	0x8001
-
 #define SIEMENS_VENDOR_ID	0x11f5
 #define SIEMENS_PRODUCT_ID_SX1	0x0001
 #define SIEMENS_PRODUCT_ID_X65	0x0003
-- 
2.4.2


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

* [PATCH 3.12 059/111] USB: cp210x: add ID for KCF Technologies PRN device
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (57 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 058/111] USB: pl2303: Remove support for Samsung I330 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 060/111] usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices Jiri Slaby
                   ` (53 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mark Edwards, Johan Hovold, Jiri Slaby

From: Mark Edwards <sonofaforester@gmail.com>

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

===============

commit c735ed74d83f8ecb45c4c4c95a16853c9c3c8157 upstream.

Added the USB serial console device ID for KCF Technologies PRN device
which has a USB port for its serial console.

Signed-off-by: Mark Edwards <sonofaforester@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/cp210x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 622d349fd7da..9cb09dad969d 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -127,6 +127,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
 	{ USB_DEVICE(0x10C4, 0x8977) },	/* CEL MeshWorks DevKit Device */
+	{ USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */
 	{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
-- 
2.4.2


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

* [PATCH 3.12 060/111] usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (58 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 059/111] USB: cp210x: add ID for KCF Technologies PRN device Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 061/111] usb: gadget: configfs: Fix interfaces array NULL-termination Jiri Slaby
                   ` (52 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hans de Goede, Jiri Slaby

From: Hans de Goede <hdegoede@redhat.com>

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

===============

commit 172115090f5e739660b97694618a2ba86457063a upstream.

Without this flag some versions of these enclosures do not work.

Reported-and-tested-by: Christian Schaller <cschalle@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/storage/unusual_devs.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 16a36b2ed902..00b47646522b 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -766,6 +766,13 @@ UNUSUAL_DEV(  0x059f, 0x0643, 0x0000, 0x0000,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_GO_SLOW ),
 
+/* Reported by Christian Schaller <cschalle@redhat.com> */
+UNUSUAL_DEV(  0x059f, 0x0651, 0x0000, 0x0000,
+		"LaCie",
+		"External HDD",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_WP_DETECT ),
+
 /* Submitted by Joel Bourquard <numlock@freesurf.ch>
  * Some versions of this device need the SubClass and Protocol overrides
  * while others don't.
-- 
2.4.2


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

* [PATCH 3.12 061/111] usb: gadget: configfs: Fix interfaces array NULL-termination
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (59 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 060/111] usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 062/111] powerpc: Align TOC to 256 bytes Jiri Slaby
                   ` (51 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Krzysztof Opasiak, Felipe Balbi, Jiri Slaby

From: Krzysztof Opasiak <k.opasiak@samsung.com>

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

===============

commit 903124fe1aa284f61745a9dd4fbfa0184e569fff upstream.

memset() to 0 interfaces array before reusing
usb_configuration structure.

This commit fix bug:

ln -s functions/acm.1 configs/c.1
ln -s functions/acm.2 configs/c.1
ln -s functions/acm.3 configs/c.1
echo "UDC name" > UDC
echo "" > UDC
rm configs/c.1/acm.*
rmdir functions/*
mkdir functions/ecm.usb0
ln -s functions/ecm.usb0 configs/c.1
echo "UDC name" > UDC

[   82.220969] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   82.229009] pgd = c0004000
[   82.231698] [00000000] *pgd=00000000
[   82.235260] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[   82.240638] Modules linked in:
[   82.243681] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.0.0-rc2 #39
[   82.249926] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   82.256003] task: c07cd2f0 ti: c07c8000 task.ti: c07c8000
[   82.261393] PC is at composite_setup+0xe3c/0x1674
[   82.266073] LR is at composite_setup+0xf20/0x1674
[   82.270760] pc : [<c03510d4>]    lr : [<c03511b8>]    psr: 600001d3
[   82.270760] sp : c07c9df0  ip : c0806448  fp : ed8c9c9c
[   82.282216] r10: 00000001  r9 : 00000000  r8 : edaae918
[   82.287425] r7 : ed551cc0  r6 : 00007fff  r5 : 00000000  r4 : ed799634
[   82.293934] r3 : 00000003  r2 : 00010002  r1 : edaae918  r0 : 0000002e
[   82.300446] Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
[   82.307910] Control: 10c5387d  Table: 6bc1804a  DAC: 00000015
[   82.313638] Process swapper/0 (pid: 0, stack limit = 0xc07c8210)
[   82.319627] Stack: (0xc07c9df0 to 0xc07ca000)
[   82.323969] 9de0:                                     00000000 c06e65f4 00000000 c07c9f68
[   82.332130] 9e00: 00000067 c07c59ac 000003f7 edaae918 ed8c9c98 ed799690 eca2f140 200001d3
[   82.340289] 9e20: ee79a2d8 c07c9e88 c07c5304 ffff55db 00010002 edaae810 edaae860 eda96d50
[   82.348448] 9e40: 00000009 ee264510 00000007 c07ca444 edaae860 c0340890 c0827a40 ffff55e0
[   82.356607] 9e60: c0827a40 eda96e40 ee264510 edaae810 00000000 edaae860 00000007 c07ca444
[   82.364766] 9e80: edaae860 c0354170 c03407dc c033db4c edaae810 00000000 00000000 00000010
[   82.372925] 9ea0: 00000032 c0341670 00000000 00000000 00000001 eda96e00 00000000 00000000
[   82.381084] 9ec0: 00000000 00000032 c0803a23 ee1aa840 00000001 c005d54c 249e2450 00000000
[   82.389244] 9ee0: 200001d3 ee1aa840 ee1aa8a0 ed84f4c0 00000000 c07c9f68 00000067 c07c59ac
[   82.397403] 9f00: 00000000 c005d688 ee1aa840 ee1aa8a0 c07db4b4 c006009c 00000032 00000000
[   82.405562] 9f20: 00000001 c005ce20 c07c59ac c005cf34 f002000c c07ca780 c07c9f68 00000057
[   82.413722] 9f40: f0020000 413fc090 00000001 c00086b4 c000f804 60000053 ffffffff c07c9f9c
[   82.421880] 9f60: c0803a20 c0011fc0 00000000 00000000 c07c9fb8 c001bee0 c07ca4f0 c057004c
[   82.430040] 9f80: c07ca4fc c0803a20 c0803a20 413fc090 00000001 00000000 01000000 c07c9fb0
[   82.438199] 9fa0: c000f800 c000f804 60000053 ffffffff 00000000 c0050e70 c0803bc0 c0783bd8
[   82.446358] 9fc0: ffffffff ffffffff c0783664 00000000 00000000 c07b13e8 00000000 c0803e54
[   82.454517] 9fe0: c07ca480 c07b13e4 c07ce40c 4000406a 00000000 40008074 00000000 00000000
[   82.462689] [<c03510d4>] (composite_setup) from [<c0340890>] (s3c_hsotg_complete_setup+0xb4/0x418)
[   82.471626] [<c0340890>] (s3c_hsotg_complete_setup) from [<c0354170>] (usb_gadget_giveback_request+0xc/0x10)
[   82.481429] [<c0354170>] (usb_gadget_giveback_request) from [<c033db4c>] (s3c_hsotg_complete_request+0xcc/0x12c)
[   82.491583] [<c033db4c>] (s3c_hsotg_complete_request) from [<c0341670>] (s3c_hsotg_irq+0x4fc/0x558)
[   82.500614] [<c0341670>] (s3c_hsotg_irq) from [<c005d54c>] (handle_irq_event_percpu+0x50/0x150)
[   82.509291] [<c005d54c>] (handle_irq_event_percpu) from [<c005d688>] (handle_irq_event+0x3c/0x5c)
[   82.518145] [<c005d688>] (handle_irq_event) from [<c006009c>] (handle_fasteoi_irq+0xd4/0x18c)
[   82.526650] [<c006009c>] (handle_fasteoi_irq) from [<c005ce20>] (generic_handle_irq+0x20/0x30)
[   82.535242] [<c005ce20>] (generic_handle_irq) from [<c005cf34>] (__handle_domain_irq+0x6c/0xdc)
[   82.543923] [<c005cf34>] (__handle_domain_irq) from [<c00086b4>] (gic_handle_irq+0x2c/0x6c)
[   82.552256] [<c00086b4>] (gic_handle_irq) from [<c0011fc0>] (__irq_svc+0x40/0x74)
[   82.559716] Exception stack(0xc07c9f68 to 0xc07c9fb0)
[   82.564753] 9f60:                   00000000 00000000 c07c9fb8 c001bee0 c07ca4f0 c057004c
[   82.572913] 9f80: c07ca4fc c0803a20 c0803a20 413fc090 00000001 00000000 01000000 c07c9fb0
[   82.581069] 9fa0: c000f800 c000f804 60000053 ffffffff
[   82.586113] [<c0011fc0>] (__irq_svc) from [<c000f804>] (arch_cpu_idle+0x30/0x3c)
[   82.593491] [<c000f804>] (arch_cpu_idle) from [<c0050e70>] (cpu_startup_entry+0x128/0x1a4)
[   82.601740] [<c0050e70>] (cpu_startup_entry) from [<c0783bd8>] (start_kernel+0x350/0x3bc)
[   82.609890] Code: 0a000002 e3530005 05975010 15975008 (e5953000)
[   82.615965] ---[ end trace f57d5f599a5f1bfa ]---

Most of kernel code assume that interface array in
struct usb_configuration is NULL terminated.

When gadget is composed with configfs configuration
structure may be reused for different functions set.

This bug happens because purge_configs_funcs() sets
only next_interface_id to 0. Interface array still
contains pointers to already freed interfaces. If in
second try we add less interfaces than earlier we
may access unallocated memory when trying to get
interface descriptors.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/gadget/configfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 8f0d6141e5e6..d702525a32b7 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -757,6 +757,7 @@ static void purge_configs_funcs(struct gadget_info *gi)
 			}
 		}
 		c->next_interface_id = 0;
+		memset(c->interface, 0, sizeof(c->interface));
 		c->superspeed = 0;
 		c->highspeed = 0;
 		c->fullspeed = 0;
-- 
2.4.2


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

* [PATCH 3.12 062/111] powerpc: Align TOC to 256 bytes
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (60 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 061/111] usb: gadget: configfs: Fix interfaces array NULL-termination Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 063/111] mmc: atmel-mci: fix bad variable type for clkdiv Jiri Slaby
                   ` (50 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Anton Blanchard, Michael Ellerman, Jiri Slaby

From: Anton Blanchard <anton@samba.org>

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

===============

commit 5e95235ccd5442d4a4fe11ec4eb99ba1b7959368 upstream.

Recent toolchains force the TOC to be 256 byte aligned. We need
to enforce this alignment in our linker script, otherwise pointers
to our TOC variables (__toc_start, __prom_init_toc_start) could
be incorrect.

If they are bad, we die a few hundred instructions into boot.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/powerpc/kernel/vmlinux.lds.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index f096e72262f4..1db685104ffc 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -213,6 +213,7 @@ SECTIONS
 		*(.opd)
 	}
 
+	. = ALIGN(256);
 	.got : AT(ADDR(.got) - LOAD_OFFSET) {
 		__toc_start = .;
 #ifndef CONFIG_RELOCATABLE
-- 
2.4.2


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

* [PATCH 3.12 063/111] mmc: atmel-mci: fix bad variable type for clkdiv
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (61 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 062/111] powerpc: Align TOC to 256 bytes Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 064/111] ext4: fix NULL pointer dereference when journal restart fails Jiri Slaby
                   ` (49 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ludovic Desroches, Ulf Hansson, Jiri Slaby

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

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

===============

commit 60c8f783a18feb95ad967c87e9660caf09fb4700 upstream.

clkdiv is declared as an u32 but it can be set to a negative value
causing a huge divisor value. Change its type to int to avoid this case.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/mmc/host/atmel-mci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index a0752e9ce977..ebc5cd6518a0 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1301,7 +1301,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 	if (ios->clock) {
 		unsigned int clock_min = ~0U;
-		u32 clkdiv;
+		int clkdiv;
 
 		clk_prepare(host->mck);
 		unprepare_clk = true;
@@ -1330,7 +1330,12 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		/* Calculate clock divider */
 		if (host->caps.has_odd_clk_div) {
 			clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2;
-			if (clkdiv > 511) {
+			if (clkdiv < 0) {
+				dev_warn(&mmc->class_dev,
+					 "clock %u too fast; using %lu\n",
+					 clock_min, host->bus_hz / 2);
+				clkdiv = 0;
+			} else if (clkdiv > 511) {
 				dev_warn(&mmc->class_dev,
 				         "clock %u too slow; using %lu\n",
 				         clock_min, host->bus_hz / (511 + 2));
-- 
2.4.2


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

* [PATCH 3.12 064/111] ext4: fix NULL pointer dereference when journal restart fails
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (62 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 063/111] mmc: atmel-mci: fix bad variable type for clkdiv Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 065/111] ext4: check for zero length extent explicitly Jiri Slaby
                   ` (48 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Lukas Czerner, Theodore Ts'o, Jiri Slaby

From: Lukas Czerner <lczerner@redhat.com>

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

===============

commit 9d506594069355d1fb2de3f9104667312ff08ed3 upstream.

Currently when journal restart fails, we'll have the h_transaction of
the handle set to NULL to indicate that the handle has been effectively
aborted. We handle this situation quietly in the jbd2_journal_stop() and just
free the handle and exit because everything else has been done before we
attempted (and failed) to restart the journal.

Unfortunately there are a number of problems with that approach
introduced with commit

41a5b913197c "jbd2: invalidate handle if jbd2_journal_restart()
fails"

First of all in ext4 jbd2_journal_stop() will be called through
__ext4_journal_stop() where we would try to get a hold of the superblock
by dereferencing h_transaction which in this case would lead to NULL
pointer dereference and crash.

In addition we're going to free the handle regardless of the refcount
which is bad as well, because others up the call chain will still
reference the handle so we might potentially reference already freed
memory.

Moreover it's expected that we'll get aborted handle as well as detached
handle in some of the journalling function as the error propagates up
the stack, so it's unnecessary to call WARN_ON every time we get
detached handle.

And finally we might leak some memory by forgetting to free reserved
handle in jbd2_journal_stop() in the case where handle was detached from
the transaction (h_transaction is NULL).

Fix the NULL pointer dereference in __ext4_journal_stop() by just
calling jbd2_journal_stop() quietly as suggested by Jan Kara. Also fix
the potential memory leak in jbd2_journal_stop() and use proper
handle refcounting before we attempt to free it to avoid use-after-free
issues.

And finally remove all WARN_ON(!transaction) from the code so that we do
not get random traces when something goes wrong because when journal
restart fails we will get to some of those functions.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/ext4/ext4_jbd2.c   |  6 ++++++
 fs/jbd2/transaction.c | 25 ++++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 3fe29de832c8..ff42208417b9 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -87,6 +87,12 @@ int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle)
 		ext4_put_nojournal(handle);
 		return 0;
 	}
+
+	if (!handle->h_transaction) {
+		err = jbd2_journal_stop(handle);
+		return handle->h_err ? handle->h_err : err;
+	}
+
 	sb = handle->h_transaction->t_journal->j_private;
 	err = handle->h_err;
 	rc = jbd2_journal_stop(handle);
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index ab3815c856dc..775a9e1c0c45 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -551,7 +551,6 @@ int jbd2_journal_extend(handle_t *handle, int nblocks)
 	int result;
 	int wanted;
 
-	WARN_ON(!transaction);
 	if (is_handle_aborted(handle))
 		return -EROFS;
 	journal = transaction->t_journal;
@@ -627,7 +626,6 @@ int jbd2__journal_restart(handle_t *handle, int nblocks, gfp_t gfp_mask)
 	tid_t		tid;
 	int		need_to_start, ret;
 
-	WARN_ON(!transaction);
 	/* If we've had an abort of any type, don't even think about
 	 * actually doing the restart! */
 	if (is_handle_aborted(handle))
@@ -791,7 +789,6 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 	int need_copy = 0;
 	unsigned long start_lock, time_lock;
 
-	WARN_ON(!transaction);
 	if (is_handle_aborted(handle))
 		return -EROFS;
 	journal = transaction->t_journal;
@@ -1057,7 +1054,6 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
 	int err;
 
 	jbd_debug(5, "journal_head %p\n", jh);
-	WARN_ON(!transaction);
 	err = -EROFS;
 	if (is_handle_aborted(handle))
 		goto out;
@@ -1271,7 +1267,6 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	struct journal_head *jh;
 	int ret = 0;
 
-	WARN_ON(!transaction);
 	if (is_handle_aborted(handle))
 		return -EROFS;
 	journal = transaction->t_journal;
@@ -1407,7 +1402,6 @@ int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh)
 	int err = 0;
 	int was_modified = 0;
 
-	WARN_ON(!transaction);
 	if (is_handle_aborted(handle))
 		return -EROFS;
 	journal = transaction->t_journal;
@@ -1538,8 +1532,22 @@ int jbd2_journal_stop(handle_t *handle)
 	tid_t tid;
 	pid_t pid;
 
-	if (!transaction)
-		goto free_and_exit;
+	if (!transaction) {
+		/*
+		 * Handle is already detached from the transaction so
+		 * there is nothing to do other than decrease a refcount,
+		 * or free the handle if refcount drops to zero
+		 */
+		if (--handle->h_ref > 0) {
+			jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,
+							 handle->h_ref);
+			return err;
+		} else {
+			if (handle->h_rsv_handle)
+				jbd2_free_handle(handle->h_rsv_handle);
+			goto free_and_exit;
+		}
+	}
 	journal = transaction->t_journal;
 
 	J_ASSERT(journal_current_handle() == handle);
@@ -2381,7 +2389,6 @@ int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode)
 	transaction_t *transaction = handle->h_transaction;
 	journal_t *journal;
 
-	WARN_ON(!transaction);
 	if (is_handle_aborted(handle))
 		return -EROFS;
 	journal = transaction->t_journal;
-- 
2.4.2


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

* [PATCH 3.12 065/111] ext4: check for zero length extent explicitly
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (63 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 064/111] ext4: fix NULL pointer dereference when journal restart fails Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 066/111] jbd2: fix r_count overflows leading to buffer overflow in journal recovery Jiri Slaby
                   ` (47 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Eryu Guan, Theodore Ts'o, Jiri Slaby

From: Eryu Guan <guaneryu@gmail.com>

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

===============

commit 2f974865ffdfe7b9f46a9940836c8b167342563d upstream.

The following commit introduced a bug when checking for zero length extent

5946d08 ext4: check for overlapping extents in ext4_valid_extent_entries()

Zero length extent could pass the check if lblock is zero.

Adding the explicit check for zero length back.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/ext4/extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 33a676515df0..c9830686cbd5 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -361,7 +361,7 @@ static int ext4_valid_extent(struct inode *inode, struct ext4_extent *ext)
 	ext4_lblk_t lblock = le32_to_cpu(ext->ee_block);
 	ext4_lblk_t last = lblock + len - 1;
 
-	if (lblock > last)
+	if (len == 0 || lblock > last)
 		return 0;
 	return ext4_data_block_valid(EXT4_SB(inode->i_sb), block, len);
 }
-- 
2.4.2


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

* [PATCH 3.12 066/111] jbd2: fix r_count overflows leading to buffer overflow in journal recovery
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (64 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 065/111] ext4: check for zero length extent explicitly Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 067/111] libata: Add helper to determine when PHY events should be ignored Jiri Slaby
                   ` (46 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Darrick J. Wong, Theodore Ts'o, Jiri Slaby

From: "Darrick J. Wong" <darrick.wong@oracle.com>

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

===============

commit e531d0bceb402e643a4499de40dd3fa39d8d2e43 upstream.

The journal revoke block recovery code does not check r_count for
sanity, which means that an evil value of r_count could result in
the kernel reading off the end of the revoke table and into whatever
garbage lies beyond.  This could crash the kernel, so fix that.

However, in testing this fix, I discovered that the code to write
out the revoke tables also was not correctly checking to see if the
block was full -- the current offset check is fine so long as the
revoke table space size is a multiple of the record size, but this
is not true when either journal_csum_v[23] are set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/jbd2/recovery.c | 10 +++++++++-
 fs/jbd2/revoke.c   | 18 ++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index c4166471ddf0..f6372eec78b9 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -839,15 +839,23 @@ static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
 {
 	jbd2_journal_revoke_header_t *header;
 	int offset, max;
+	int csum_size = 0;
+	__u32 rcount;
 	int record_len = 4;
 
 	header = (jbd2_journal_revoke_header_t *) bh->b_data;
 	offset = sizeof(jbd2_journal_revoke_header_t);
-	max = be32_to_cpu(header->r_count);
+	rcount = be32_to_cpu(header->r_count);
 
 	if (!jbd2_revoke_block_csum_verify(journal, header))
 		return -EINVAL;
 
+	if (jbd2_journal_has_csum_v2or3(journal))
+		csum_size = sizeof(struct jbd2_journal_revoke_tail);
+	if (rcount > journal->j_blocksize - csum_size)
+		return -EINVAL;
+	max = rcount;
+
 	if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
 		record_len = 8;
 
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index d5e95a175c92..8ecf9b92f163 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -583,7 +583,7 @@ static void write_one_revoke_record(journal_t *journal,
 {
 	int csum_size = 0;
 	struct buffer_head *descriptor;
-	int offset;
+	int sz, offset;
 	journal_header_t *header;
 
 	/* If we are already aborting, this all becomes a noop.  We
@@ -600,9 +600,14 @@ static void write_one_revoke_record(journal_t *journal,
 	if (jbd2_journal_has_csum_v2or3(journal))
 		csum_size = sizeof(struct jbd2_journal_revoke_tail);
 
+	if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
+		sz = 8;
+	else
+		sz = 4;
+
 	/* Make sure we have a descriptor with space left for the record */
 	if (descriptor) {
-		if (offset >= journal->j_blocksize - csum_size) {
+		if (offset + sz > journal->j_blocksize - csum_size) {
 			flush_descriptor(journal, descriptor, offset, write_op);
 			descriptor = NULL;
 		}
@@ -625,16 +630,13 @@ static void write_one_revoke_record(journal_t *journal,
 		*descriptorp = descriptor;
 	}
 
-	if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) {
+	if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
 		* ((__be64 *)(&descriptor->b_data[offset])) =
 			cpu_to_be64(record->blocknr);
-		offset += 8;
-
-	} else {
+	else
 		* ((__be32 *)(&descriptor->b_data[offset])) =
 			cpu_to_be32(record->blocknr);
-		offset += 4;
-	}
+	offset += sz;
 
 	*offsetp = offset;
 }
-- 
2.4.2


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

* [PATCH 3.12 067/111] libata: Add helper to determine when PHY events should be ignored
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (65 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 066/111] jbd2: fix r_count overflows leading to buffer overflow in journal recovery Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 068/111] libata: Ignore spurious PHY event on LPM policy change Jiri Slaby
                   ` (45 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Gabriele Mazzotta, Tejun Heo, Jiri Slaby

From: Gabriele Mazzotta <gabriele.mzt@gmail.com>

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

===============

commit 8393b811f38acdf7fd8da2028708edad3e68ce1f upstream.

This is a preparation commit that will allow to add other criteria
according to which PHY events should be dropped.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/libahci.c     |  3 +--
 drivers/ata/libata-core.c | 19 +++++++++++++++++++
 include/linux/libata.h    |  1 +
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index cfb744709726..9764d9c0447e 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1693,8 +1693,7 @@ static void ahci_handle_port_interrupt(struct ata_port *ap,
 	if (unlikely(resetting))
 		status &= ~PORT_IRQ_BAD_PMP;
 
-	/* if LPM is enabled, PHYRDY doesn't mean anything */
-	if (ap->link.lpm_policy > ATA_LPM_MAX_POWER) {
+	if (sata_lpm_ignore_phy_events(&ap->link)) {
 		status &= ~PORT_IRQ_PHYRDY;
 		ahci_scr_write(&ap->link, SCR_ERROR, SERR_PHYRDY_CHG);
 	}
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c36bd031ebdd..55afb94d7ff7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6828,6 +6828,25 @@ u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, u32 val,
 	return tmp;
 }
 
+/**
+ *	sata_lpm_ignore_phy_events - test if PHY event should be ignored
+ *	@link: Link receiving the event
+ *
+ *	Test whether the received PHY event has to be ignored or not.
+ *
+ *	LOCKING:
+ *	None:
+ *
+ *	RETURNS:
+ *	True if the event has to be ignored.
+ */
+bool sata_lpm_ignore_phy_events(struct ata_link *link)
+{
+	/* if LPM is enabled, PHYRDY doesn't mean anything */
+	return !!(link->lpm_policy > ATA_LPM_MAX_POWER);
+}
+EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
+
 /*
  * Dummy port_ops
  */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e13b3aef0b0c..cf205c03d758 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1201,6 +1201,7 @@ extern struct ata_device *ata_dev_pair(struct ata_device *adev);
 extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
 extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
 extern void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, struct list_head *eh_q);
+extern bool sata_lpm_ignore_phy_events(struct ata_link *link);
 
 extern int ata_cable_40wire(struct ata_port *ap);
 extern int ata_cable_80wire(struct ata_port *ap);
-- 
2.4.2


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

* [PATCH 3.12 068/111] libata: Ignore spurious PHY event on LPM policy change
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (66 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 067/111] libata: Add helper to determine when PHY events should be ignored Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 069/111] rt2x00: add new rt2800usb device DWA 130 Jiri Slaby
                   ` (44 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Gabriele Mazzotta, Tejun Heo, Jiri Slaby

From: Gabriele Mazzotta <gabriele.mzt@gmail.com>

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

===============

commit 09c5b4803a80a5451d950d6a539d2eb311dc0fb1 upstream.

When the LPM policy is set to ATA_LPM_MAX_POWER, the device might
generate a spurious PHY event that cuases errors on the link.
Ignore this event if it occured within 10s after the policy change.

The timeout was chosen observing that on a Dell XPS13 9333 these
spurious events can occur up to roughly 6s after the policy change.

Link: http://lkml.kernel.org/g/3352987.ugV1Ipy7Z5@xps13
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/libata-core.c | 15 ++++++++++++++-
 drivers/ata/libata-eh.c   |  3 +++
 include/linux/libata.h    |  9 +++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 55afb94d7ff7..25dc7cdad863 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6842,8 +6842,21 @@ u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, u32 val,
  */
 bool sata_lpm_ignore_phy_events(struct ata_link *link)
 {
+	unsigned long lpm_timeout = link->last_lpm_change +
+				    msecs_to_jiffies(ATA_TMOUT_SPURIOUS_PHY);
+
 	/* if LPM is enabled, PHYRDY doesn't mean anything */
-	return !!(link->lpm_policy > ATA_LPM_MAX_POWER);
+	if (link->lpm_policy > ATA_LPM_MAX_POWER)
+		return true;
+
+	/* ignore the first PHY event after the LPM policy changed
+	 * as it is might be spurious
+	 */
+	if ((link->flags & ATA_LFLAG_CHANGED) &&
+	    time_before(jiffies, lpm_timeout))
+		return true;
+
+	return false;
 }
 EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 370462fa8e01..063036d876b0 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3481,6 +3481,9 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 		}
 	}
 
+	link->last_lpm_change = jiffies;
+	link->flags |= ATA_LFLAG_CHANGED;
+
 	return 0;
 
 fail:
diff --git a/include/linux/libata.h b/include/linux/libata.h
index cf205c03d758..b84e786ff990 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -204,6 +204,7 @@ enum {
 	ATA_LFLAG_SW_ACTIVITY	= (1 << 7), /* keep activity stats */
 	ATA_LFLAG_NO_LPM	= (1 << 8), /* disable LPM on this link */
 	ATA_LFLAG_RST_ONCE	= (1 << 9), /* limit recovery to one reset */
+	ATA_LFLAG_CHANGED	= (1 << 10), /* LPM state changed on this link */
 
 	/* struct ata_port flags */
 	ATA_FLAG_SLAVE_POSS	= (1 << 0), /* host supports slave dev */
@@ -307,6 +308,12 @@ enum {
 	 */
 	ATA_TMOUT_PMP_SRST_WAIT	= 5000,
 
+	/* When the LPM policy is set to ATA_LPM_MAX_POWER, there might
+	 * be a spurious PHY event, so ignore the first PHY event that
+	 * occurs within 10s after the policy change.
+	 */
+	ATA_TMOUT_SPURIOUS_PHY	= 10000,
+
 	/* ATA bus states */
 	BUS_UNKNOWN		= 0,
 	BUS_DMA			= 1,
@@ -785,6 +792,8 @@ struct ata_link {
 	struct ata_eh_context	eh_context;
 
 	struct ata_device	device[ATA_MAX_DEVICES];
+
+	unsigned long		last_lpm_change; /* when last LPM change happened */
 };
 #define ATA_LINK_CLEAR_BEGIN		offsetof(struct ata_link, active_tag)
 #define ATA_LINK_CLEAR_END		offsetof(struct ata_link, device[0])
-- 
2.4.2


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

* [PATCH 3.12 069/111] rt2x00: add new rt2800usb device DWA 130
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (67 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 068/111] libata: Ignore spurious PHY event on LPM policy change Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:26 ` [PATCH 3.12 070/111] gpio: gpio-kempld: Fix get_direction return value Jiri Slaby
                   ` (43 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Scott Branden, Pieter Truter, Kalle Valo,
	Larry Finger, Jiri Slaby

From: Scott Branden <sbranden@broadcom.com>

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

===============

commit ea345c145ff23197eab34d0c4d0c8a93d7bea8c6 upstream.

Add the USB Id to link the D-Link DWA 130 USB Wifi adapter
to the rt2830 driver.

Signed-off-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Pieter Truter <ptruter@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/wireless/rt2x00/rt2800usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index a44862ad84ec..021ed7f0e25f 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -994,6 +994,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
 	{ USB_DEVICE(0x07d1, 0x3c17) },
 	{ USB_DEVICE(0x2001, 0x3317) },
 	{ USB_DEVICE(0x2001, 0x3c1b) },
+	{ USB_DEVICE(0x2001, 0x3c25) },
 	/* Draytek */
 	{ USB_DEVICE(0x07fa, 0x7712) },
 	/* DVICO */
-- 
2.4.2


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

* [PATCH 3.12 070/111] gpio: gpio-kempld: Fix get_direction return value
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (68 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 069/111] rt2x00: add new rt2800usb device DWA 130 Jiri Slaby
@ 2015-06-10 15:26 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 071/111] crypto: s390/ghash - Fix incorrect ghash icv buffer handling Jiri Slaby
                   ` (42 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Michael Brunner, Michael Brunner, Linus Walleij,
	Jiri Slaby

From: Michael Brunner <mibru@gmx.de>

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

===============

commit f230e8ffc03f17bd9d6b90ea890b8252a8cc1821 upstream.

This patch fixes an inverted return value of the gpio get_direction
function.

The wrong value causes the direction sysfs entry and GPIO debugfs file
to indicate incorrect GPIO direction settings. In some cases it also
prevents setting GPIO output values.

The problem is also present in all other stable kernel versions since
linux-3.12.

Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpio/gpio-kempld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index efdc3924d7df..7717752cb8cf 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -117,7 +117,7 @@ static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 		= container_of(chip, struct kempld_gpio_data, chip);
 	struct kempld_device_data *pld = gpio->pld;
 
-	return kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
+	return !kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
 }
 
 static int kempld_gpio_pincount(struct kempld_device_data *pld)
-- 
2.4.2


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

* [PATCH 3.12 071/111] crypto: s390/ghash - Fix incorrect ghash icv buffer handling.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (69 preceding siblings ...)
  2015-06-10 15:26 ` [PATCH 3.12 070/111] gpio: gpio-kempld: Fix get_direction return value Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 072/111] mac80211: move WEP tailroom size check Jiri Slaby
                   ` (41 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Harald Freudenberger, Gerald Schaefer, Herbert Xu,
	Jiri Slaby

From: Harald Freudenberger <freude@linux.vnet.ibm.com>

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

===============

commit a1cae34e23b1293eccbcc8ee9b39298039c3952a upstream.

Multitheaded tests showed that the icv buffer in the current ghash
implementation is not handled correctly. A move of this working ghash
buffer value to the descriptor context fixed this. Code is tested and
verified with an multithreaded application via af_alg interface.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <geraldsc@linux.vnet.ibm.com>
Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/s390/crypto/ghash_s390.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/s390/crypto/ghash_s390.c b/arch/s390/crypto/ghash_s390.c
index 7940dc90e80b..b258110da952 100644
--- a/arch/s390/crypto/ghash_s390.c
+++ b/arch/s390/crypto/ghash_s390.c
@@ -16,11 +16,12 @@
 #define GHASH_DIGEST_SIZE	16
 
 struct ghash_ctx {
-	u8 icv[16];
-	u8 key[16];
+	u8 key[GHASH_BLOCK_SIZE];
 };
 
 struct ghash_desc_ctx {
+	u8 icv[GHASH_BLOCK_SIZE];
+	u8 key[GHASH_BLOCK_SIZE];
 	u8 buffer[GHASH_BLOCK_SIZE];
 	u32 bytes;
 };
@@ -28,8 +29,10 @@ struct ghash_desc_ctx {
 static int ghash_init(struct shash_desc *desc)
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
+	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 
 	memset(dctx, 0, sizeof(*dctx));
+	memcpy(dctx->key, ctx->key, GHASH_BLOCK_SIZE);
 
 	return 0;
 }
@@ -45,7 +48,6 @@ static int ghash_setkey(struct crypto_shash *tfm,
 	}
 
 	memcpy(ctx->key, key, GHASH_BLOCK_SIZE);
-	memset(ctx->icv, 0, GHASH_BLOCK_SIZE);
 
 	return 0;
 }
@@ -54,7 +56,6 @@ static int ghash_update(struct shash_desc *desc,
 			 const u8 *src, unsigned int srclen)
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
-	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 	unsigned int n;
 	u8 *buf = dctx->buffer;
 	int ret;
@@ -70,7 +71,7 @@ static int ghash_update(struct shash_desc *desc,
 		src += n;
 
 		if (!dctx->bytes) {
-			ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf,
+			ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf,
 					      GHASH_BLOCK_SIZE);
 			if (ret != GHASH_BLOCK_SIZE)
 				return -EIO;
@@ -79,7 +80,7 @@ static int ghash_update(struct shash_desc *desc,
 
 	n = srclen & ~(GHASH_BLOCK_SIZE - 1);
 	if (n) {
-		ret = crypt_s390_kimd(KIMD_GHASH, ctx, src, n);
+		ret = crypt_s390_kimd(KIMD_GHASH, dctx, src, n);
 		if (ret != n)
 			return -EIO;
 		src += n;
@@ -94,7 +95,7 @@ static int ghash_update(struct shash_desc *desc,
 	return 0;
 }
 
-static int ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)
+static int ghash_flush(struct ghash_desc_ctx *dctx)
 {
 	u8 *buf = dctx->buffer;
 	int ret;
@@ -104,24 +105,24 @@ static int ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)
 
 		memset(pos, 0, dctx->bytes);
 
-		ret = crypt_s390_kimd(KIMD_GHASH, ctx, buf, GHASH_BLOCK_SIZE);
+		ret = crypt_s390_kimd(KIMD_GHASH, dctx, buf, GHASH_BLOCK_SIZE);
 		if (ret != GHASH_BLOCK_SIZE)
 			return -EIO;
+
+		dctx->bytes = 0;
 	}
 
-	dctx->bytes = 0;
 	return 0;
 }
 
 static int ghash_final(struct shash_desc *desc, u8 *dst)
 {
 	struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
-	struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
 	int ret;
 
-	ret = ghash_flush(ctx, dctx);
+	ret = ghash_flush(dctx);
 	if (!ret)
-		memcpy(dst, ctx->icv, GHASH_BLOCK_SIZE);
+		memcpy(dst, dctx->icv, GHASH_BLOCK_SIZE);
 	return ret;
 }
 
-- 
2.4.2


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

* [PATCH 3.12 072/111] mac80211: move WEP tailroom size check
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (70 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 071/111] crypto: s390/ghash - Fix incorrect ghash icv buffer handling Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 073/111] ARM: dts: imx27: only map 4 Kbyte for fec registers Jiri Slaby
                   ` (40 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Janusz Dziedzic, Johannes Berg, Jiri Slaby

From: Janusz Dziedzic <janusz.dziedzic@tieto.com>

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

===============

commit 47b4e1fc4972cc43a19121bc2608a60aef3bf216 upstream.

Remove checking tailroom when adding IV as it uses only
headroom, and move the check to the ICV generation that
actually needs the tailroom.

In other case I hit such warning and datapath don't work,
when testing:
- IBSS + WEP
- ath9k with hw crypt enabled
- IPv6 data (ping6)

WARNING: CPU: 3 PID: 13301 at net/mac80211/wep.c:102 ieee80211_wep_add_iv+0x129/0x190 [mac80211]()
[...]
Call Trace:
[<ffffffff817bf491>] dump_stack+0x45/0x57
[<ffffffff8107746a>] warn_slowpath_common+0x8a/0xc0
[<ffffffff8107755a>] warn_slowpath_null+0x1a/0x20
[<ffffffffc09ae109>] ieee80211_wep_add_iv+0x129/0x190 [mac80211]
[<ffffffffc09ae7ab>] ieee80211_crypto_wep_encrypt+0x6b/0xd0 [mac80211]
[<ffffffffc09d3fb1>] invoke_tx_handlers+0xc51/0xf30 [mac80211]
[...]

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/mac80211/wep.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 6ee2b5863572..f21b142dee1f 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -98,8 +98,7 @@ static u8 *ieee80211_wep_add_iv(struct ieee80211_local *local,
 
 	hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
 
-	if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN ||
-		    skb_headroom(skb) < IEEE80211_WEP_IV_LEN))
+	if (WARN_ON(skb_headroom(skb) < IEEE80211_WEP_IV_LEN))
 		return NULL;
 
 	hdrlen = ieee80211_hdrlen(hdr->frame_control);
@@ -169,6 +168,9 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local,
 	size_t len;
 	u8 rc4key[3 + WLAN_KEY_LEN_WEP104];
 
+	if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN))
+		return -1;
+
 	iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx);
 	if (!iv)
 		return -1;
-- 
2.4.2


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

* [PATCH 3.12 073/111] ARM: dts: imx27: only map 4 Kbyte for fec registers
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (71 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 072/111] mac80211: move WEP tailroom size check Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 074/111] mm, numa: really disable NUMA balancing by default on single node machines Jiri Slaby
                   ` (39 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Philippe Reynes, Shawn Guo, Jiri Slaby

From: Philippe Reynes <tremyfr@gmail.com>

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

===============

commit a29ef819f3f34f89a1b9b6a939b4c1cdfe1e85ce upstream.

According to the imx27 documentation, fec has a 4 Kbyte
memory space map. Moreover, the actual 16 Kbyte mapping
overlaps the SCC (Security Controller) memory register
space. So, we reduce the memory register space to 4 Kbyte.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 9f0749e3eb88 ("ARM i.MX27: Add devicetree support")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/imx27.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index c07aea4f66cb..157e19066449 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -427,7 +427,7 @@
 
 			fec: ethernet@1002b000 {
 				compatible = "fsl,imx27-fec";
-				reg = <0x1002b000 0x4000>;
+				reg = <0x1002b000 0x1000>;
 				interrupts = <50>;
 				clocks = <&clks 48>, <&clks 67>;
 				clock-names = "ipg", "ahb";
-- 
2.4.2


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

* [PATCH 3.12 074/111] mm, numa: really disable NUMA balancing by default on single node machines
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (72 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 073/111] ARM: dts: imx27: only map 4 Kbyte for fec registers Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 075/111] svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures Jiri Slaby
                   ` (38 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Mel Gorman, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Mel Gorman <mgorman@suse.de>

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

===============

commit b0dc2b9bb4ab782115b964310518ee0b17784277 upstream.

NUMA balancing is meant to be disabled by default on UMA machines but
the check is using nr_node_ids (highest node) instead of
num_online_nodes (online nodes).

The consequences are that a UMA machine with a node ID of 1 or higher
will enable NUMA balancing.  This will incur useless overhead due to
minor faults with the impact depending on the workload.  These are the
impact on the stats when running a kernel build on a single node machine
whose node ID happened to be 1:

  			       vanilla     patched
  NUMA base PTE updates          5113158           0
  NUMA huge PMD updates              643           0
  NUMA page range updates        5442374           0
  NUMA hint faults               2109622           0
  NUMA hint local faults         2109622           0
  NUMA hint local percent            100         100
  NUMA pages migrated                  0           0

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index e63ade49ea24..51cd7d066e0f 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2589,7 +2589,7 @@ static void __init check_numabalancing_enable(void)
 	if (numabalancing_override)
 		set_numabalancing_state(numabalancing_override == 1);
 
-	if (nr_node_ids > 1 && !numabalancing_override) {
+	if (num_online_nodes() > 1 && !numabalancing_override) {
 		printk(KERN_INFO "%s automatic NUMA balancing. "
 			"Configure with numa_balancing= or sysctl",
 			numabalancing_default ? "Enabling" : "Disabling");
-- 
2.4.2


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

* [PATCH 3.12 075/111] svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (73 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 074/111] mm, numa: really disable NUMA balancing by default on single node machines Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 076/111] thermal: step_wise: Revert optimization Jiri Slaby
                   ` (37 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Scott Mayhew, J. Bruce Fields, Jiri Slaby

From: Scott Mayhew <smayhew@redhat.com>

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

===============

commit 9507271d960a1911a51683888837d75c171cd91f upstream.

In an environment where the KDC is running Active Directory, the
exported composite name field returned in the context could be large
enough to span a page boundary.  Attaching a scratch buffer to the
decoding xdr_stream helps deal with those cases.

The case where we saw this was actually due to behavior that's been
fixed in newer gss-proxy versions, but we're fixing it here too.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/sunrpc/auth_gss/gss_rpc_xdr.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c
index f0f78c5f1c7d..e0062c544ac8 100644
--- a/net/sunrpc/auth_gss/gss_rpc_xdr.c
+++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c
@@ -794,20 +794,26 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
 {
 	u32 value_follows;
 	int err;
+	struct page *scratch;
+
+	scratch = alloc_page(GFP_KERNEL);
+	if (!scratch)
+		return -ENOMEM;
+	xdr_set_scratch_buffer(xdr, page_address(scratch), PAGE_SIZE);
 
 	/* res->status */
 	err = gssx_dec_status(xdr, &res->status);
 	if (err)
-		return err;
+		goto out_free;
 
 	/* res->context_handle */
 	err = gssx_dec_bool(xdr, &value_follows);
 	if (err)
-		return err;
+		goto out_free;
 	if (value_follows) {
 		err = gssx_dec_ctx(xdr, res->context_handle);
 		if (err)
-			return err;
+			goto out_free;
 	} else {
 		res->context_handle = NULL;
 	}
@@ -815,11 +821,11 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
 	/* res->output_token */
 	err = gssx_dec_bool(xdr, &value_follows);
 	if (err)
-		return err;
+		goto out_free;
 	if (value_follows) {
 		err = gssx_dec_buffer(xdr, res->output_token);
 		if (err)
-			return err;
+			goto out_free;
 	} else {
 		res->output_token = NULL;
 	}
@@ -827,14 +833,17 @@ int gssx_dec_accept_sec_context(struct rpc_rqst *rqstp,
 	/* res->delegated_cred_handle */
 	err = gssx_dec_bool(xdr, &value_follows);
 	if (err)
-		return err;
+		goto out_free;
 	if (value_follows) {
 		/* we do not support upcall servers sending this data. */
-		return -EINVAL;
+		err = -EINVAL;
+		goto out_free;
 	}
 
 	/* res->options */
 	err = gssx_dec_option_array(xdr, &res->options);
 
+out_free:
+	__free_page(scratch);
 	return err;
 }
-- 
2.4.2


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

* [PATCH 3.12 076/111] thermal: step_wise: Revert optimization
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (74 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 075/111] svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 077/111] md/raid5: don't record new size if resize_stripes fails Jiri Slaby
                   ` (36 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jean Delvare

From: Jean Delvare <jdelvare@suse.de>

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

===============

Commit 178c2490b99f898efc06d1ad75cadc84f13021a6 ("thermal: step_wise:
cdev only needs update on a new target state") broke driver acerhdf.
That driver abused the step_wise thermal governor until the bang_bang
governor was available, and the optimization broke this usage model.

Kernels v3.12 to v3.18 are affected. In v3.19 the acerhdf driver was
switched to the bang_bang governor and that solved the problem.

For kernels v3.12 to v3.17, the bang_bang governor isn't available
yet so the easiest fix is to revert the optimization.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reported-by: Dieter Jurzitza (https://bugzilla.opensuse.org/show_bug.cgi?id=925961)
Tested-by: Peter Feuerer <peter@piie.net>
Tested-by: Dieter Jurzitza
---
 drivers/thermal/step_wise.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
index d89e781b0a18..769bfa3a4360 100644
--- a/drivers/thermal/step_wise.c
+++ b/drivers/thermal/step_wise.c
@@ -140,9 +140,6 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
 		old_target = instance->target;
 		instance->target = get_target_state(instance, trend, throttle);
 
-		if (old_target == instance->target)
-			continue;
-
 		/* Activate a passive thermal instance */
 		if (old_target == THERMAL_NO_TARGET &&
 			instance->target != THERMAL_NO_TARGET)
-- 
2.4.2


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

* [PATCH 3.12 077/111] md/raid5: don't record new size if resize_stripes fails.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (75 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 076/111] thermal: step_wise: Revert optimization Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 078/111] Input: elantech - fix semi-mt protocol for v3 HW Jiri Slaby
                   ` (35 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, NeilBrown, Jiri Slaby

From: NeilBrown <neilb@suse.de>

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

===============

commit 6e9eac2dcee5e19f125967dd2be3e36558c42fff upstream.

If any memory allocation in resize_stripes fails we will return
-ENOMEM, but in some cases we update conf->pool_size anyway.

This means that if we try again, the allocations will be assumed
to be larger than they are, and badness results.

So only update pool_size if there is no error.

This bug was introduced in 2.6.17 and the patch is suitable for
-stable.

Fixes: ad01c9e3752f ("[PATCH] md: Allow stripes to be expanded in preparation for expanding an array")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/raid5.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 09c18062bbc2..4881851c4b42 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1812,7 +1812,8 @@ static int resize_stripes(struct r5conf *conf, int newsize)
 
 	conf->slab_cache = sc;
 	conf->active_name = 1-conf->active_name;
-	conf->pool_size = newsize;
+	if (!err)
+		conf->pool_size = newsize;
 	return err;
 }
 
-- 
2.4.2


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

* [PATCH 3.12 000/111] 3.12.44-stable review
@ 2015-06-10 15:27 Jiri Slaby
  2015-06-10 15:25 ` [PATCH 3.12 001/111] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple() Jiri Slaby
                   ` (112 more replies)
  0 siblings, 113 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux, shuah.kh, linux-kernel, Jiri Slaby

This is the start of the stable review cycle for the 3.12.44 release.
There are 111 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 Jun 12 15:30:52 CEST 2015.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.44-rc1.xz
and the diffstat can be found below.

thanks,
js

===============


Al Viro (1):
  d_walk() might skip too much

Alex Deucher (1):
  drm/radeon: add new bonaire pci id

Alexander Stein (1):
  W1: ds2490: Increase timeout when waiting for status

Alexei Starovoitov (1):
  x86: bpf_jit: fix compilation of large bpf programs

Alexey Khoroshilov (1):
  EDAC: Properly unwind on failure path in edac_init()

Andrew Morton (1):
  fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length
    mappings

Andy Grover (1):
  target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST

Anton Blanchard (1):
  powerpc: Align TOC to 256 bytes

Aravind Gopalakrishnan (4):
  amd64_edac: Add support for newer F16h models
  hwmon: (k10temp) Add support for AMD F16 M30h processor
  hwmon: (k10temp) Add support for F15h M60h
  perf/x86/amd/ibs: Update IBS MSRs and feature definitions

Arnd Bergmann (1):
  staging: rtl8712, rtl8712: avoid lots of build warnings

Axel Lin (1):
  ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls

Behan Webster (2):
  staging, rtl8192e, LLVMLinux: Change extern inline to static inline
  staging, rtl8192e, LLVMLinux: Remove unused inline prototype

Benjamin Tissoires (1):
  Input: elantech - fix semi-mt protocol for v3 HW

Cass May (1):
  dgnc: Move DG_PART definition from Makefile to dgnc_driver.h

Chen Gang (3):
  qla2xxx: remove redundant declaration in 'qla_gbl.h'
  drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to
    "dgap_driver.h"
  drivers: staging: rtl8188eu: use 'ccflags-y' instead of EXTRA_CFLAGS
    in Makefile

Chris Lesiak (1):
  hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE

Christian König (2):
  drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling
  drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR
    handling"

Dan Carpenter (2):
  vhost/scsi: potential memory corruption
  isdn: icn: use strlcpy() when parsing setup options

Darrick J. Wong (1):
  jbd2: fix r_count overflows leading to buffer overflow in journal
    recovery

David Fries (1):
  cn: verify msg->len before making callback

David Henningsson (1):
  ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724

David Vrabel (1):
  xen/events: don't bind non-percpu VIRQs with percpu chip

Eric Dumazet (1):
  udp: fix behavior of wrong checksums

Eric W. Biederman (2):
  mnt: Fail collect_mounts when applied to unmounted mounts
  ipv4: Avoid crashing in ip_error

Eryu Guan (1):
  ext4: check for zero length extent explicitly

Finn Thain (1):
  m68k/mac: Fix out-of-bounds array index in OSS IRQ source
    initialization

Gabriele Mazzotta (2):
  libata: Add helper to determine when PHY events should be ignored
  libata: Ignore spurious PHY event on LPM policy change

Greg Kroah-Hartman (1):
  staging: wlags49_h2: fix extern inline functions

Guenter Roeck (1):
  hwmon: (nct6775) Add missing sysfs attribute initialization

Hans de Goede (1):
  usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices

Harald Freudenberger (1):
  crypto: s390/ghash - Fix incorrect ghash icv buffer handling.

Heinrich Schuchardt (1):
  usb: chipidea: debug: avoid out of bound read

Ian Campbell (1):
  xen: netback: read hotplug script once at start of day.

Ian Wilson (1):
  netfilter: Zero the tuple in nfnl_cthelper_parse_tuple()

Ilya Dryomov (1):
  libceph: request a new osdmap if lingering request maps to no osd

Jan Kara (1):
  lib: Fix strnlen_user() to not touch memory after specified maximum

Janusz Dziedzic (1):
  mac80211: move WEP tailroom size check

Jason A. Donenfeld (2):
  USB: visor: Match I330 phone more precisely
  USB: pl2303: Remove support for Samsung I330

Jean Delvare (1):
  thermal: step_wise: Revert optimization

Jens Axboe (1):
  aio: fix serial draining in exit_aio()

Jiri Kosina (1):
  HID: debug: fix error handling in hid_debug_events_read()

Joe Lawrence (1):
  xhci: gracefully handle xhci_irq dead device

Joerg Roedel (5):
  iommu/amd: Return the pte page-size in fetch_pte
  iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface
  iommu/amd: Optimize alloc_new_range for new fetch_pte interface
  iommu/amd: Optimize amd_iommu_iova_to_phys for new fetch_pte interface
  iommu/amd: Correctly encode huge pages in iommu page tables

Julia Lawall (1):
  NFC: pn533: fix error return code

Junling Zheng (1):
  net: socket: Fix the wrong returns for recvmsg and sendmsg

K. Y. Srinivasan (1):
  storvsc: Set the SRB flags correctly when no data transfer is needed

Kirill A. Shutemov (1):
  kernel: use the gnu89 standard explicitly

Konrad Rzeszutek Wilk (1):
  config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected

Krzysztof Opasiak (1):
  usb: gadget: configfs: Fix interfaces array NULL-termination

Larry Finger (1):
  rtlwifi: rtl8192cu: Fix kernel deadlock

Lars Poeschel (1):
  Input: usbtouchscreen - add new model from IRTOUCHSYSTEMS

Logan Gunthorpe (1):
  Added another USB product ID for ELAN touchscreen quirks.

Ludovic Desroches (1):
  mmc: atmel-mci: fix bad variable type for clkdiv

Lukas Czerner (1):
  ext4: fix NULL pointer dereference when journal restart fails

Mark Edwards (1):
  USB: cp210x: add ID for KCF Technologies PRN device

Mark Hounschell (1):
  sd: Disable support for 256 byte/sector disks

Mark Salyzyn (1):
  unix/caif: sk_socket can disappear when state is unlocked

Martin K. Petersen (2):
  libata: Update Crucial/Micron blacklist
  libata: Blacklist queued TRIM on all Samsung 800-series

Martin Kaiser (1):
  gpio: squelch a compiler warning

Mathias Nyman (2):
  xhci: fix isoc endpoint dequeue from advancing too far on transaction
    error
  xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256

Mel Gorman (2):
  mm: numa: initialise numa balancing after jump label initialisation
  mm, numa: really disable NUMA balancing by default on single node
    machines

Michael Brunner (1):
  gpio: gpio-kempld: Fix get_direction return value

Michal Hocko (1):
  fork: report pid reservation failure properly

Ming-ting Yao Wei (1):
  Input: xpad - add rumble support for Xbox One controller

NeilBrown (1):
  md/raid5: don't record new size if resize_stripes fails.

Nicholas Mc Guire (1):
  MIPS: KVM: Do not sign extend on unsigned MMIO load

Oleg Nesterov (1):
  aio: change exit_aio() to load mm->ioctx_table once and avoid
    rcu_read_lock()

Paolo Bonzini (1):
  KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages

Philippe Reynes (1):
  ARM: dts: imx27: only map 4 Kbyte for fec registers

Rafael J. Wysocki (1):
  ACPI / init: Fix the ordering of acpi_reserve_resources()

Richard Cochran (1):
  net: dp83640: fix broken calibration routine.

Richard Guy Briggs (1):
  lsm: copy comm before calling audit_log to avoid race in string
    printing

Russell King (1):
  ARM: fix missing syscall trace exit

Rusty Russell (1):
  lguest: fix out-by-one error in address checking.

Sasha Levin (2):
  fs, omfs: add NULL terminator in the end up the token list
  vfs: read file_handle only once in handle_to_path

Scott Branden (1):
  rt2x00: add new rt2800usb device DWA 130

Scott Mayhew (1):
  svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures

Stephan Mueller (2):
  crypto: rng - RNGs must return 0 in success case
  crypto: testmgr - fix RNG return code enforcement

Steve French (1):
  Fix corrupt SMB2 ioctl requests

Takashi Iwai (1):
  ALSA: hda - Add headphone quirk for Lifebook E752

Ted Mielczarek (1):
  Input: xpad - add support for Xbox One controllers

Thadeu Lima de Souza Cascardo (1):
  bridge: fix parsing of MLDv2 reports

Tomas Henzl (3):
  hpsa: refine the pci enable/disable handling
  hpsa: add missing pci_set_master in kdump path
  hpsa: turn off interrupts when kdump starts

Tomeu Vizoso (1):
  Input: cros_ec_keyb - fix clearing keyboard state on wakeup

Tommi Rantala (1):
  Input: xpad - add Thrustmaster as Xbox 360 controller vendor

WANG Cong (1):
  net_sched: invoke ->attach() after setting dev->qdisc

Zidan Wang (2):
  ASoC: wm8960: fix "RINPUT3" audio route error
  ASoC: wm8994: correct BCLK DIV 348 to 384

jmarchan@redhat.com (1):
  powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds
    the allowed address space

 Documentation/hwmon/k10temp                     |   6 +-
 Makefile                                        |   6 +-
 arch/arm/boot/dts/imx27.dtsi                    |   2 +-
 arch/arm/kernel/entry-common.S                  |   4 +-
 arch/m68k/mac/oss.c                             |   3 +-
 arch/mips/kvm/kvm_mips_emul.c                   |   2 +-
 arch/powerpc/kernel/vmlinux.lds.S               |   1 +
 arch/powerpc/mm/slice.c                         |   2 +-
 arch/s390/crypto/ghash_s390.c                   |  25 +--
 arch/x86/Kconfig                                |   2 +-
 arch/x86/include/asm/perf_event.h               |   3 +
 arch/x86/include/uapi/asm/msr-index.h           |   1 +
 arch/x86/kernel/amd_nb.c                        |   2 +
 arch/x86/kernel/cpu/perf_event_amd_ibs.c        |  15 ++
 arch/x86/kvm/mmu.c                              |   2 +-
 arch/x86/net/bpf_jit_comp.c                     |   7 +-
 crypto/ansi_cprng.c                             |   6 +-
 crypto/testmgr.c                                |   6 +-
 drivers/acpi/osl.c                              |   6 +-
 drivers/ata/libahci.c                           |   3 +-
 drivers/ata/libata-core.c                       |  41 ++++-
 drivers/ata/libata-eh.c                         |   3 +
 drivers/connector/connector.c                   |   6 +
 drivers/edac/amd64_edac.c                       |  24 +++
 drivers/edac/amd64_edac.h                       |   3 +
 drivers/edac/edac_mc_sysfs.c                    |   4 +-
 drivers/edac/edac_module.c                      |  13 +-
 drivers/gpio/gpio-kempld.c                      |   2 +-
 drivers/gpio/gpiolib-of.c                       |   2 +-
 drivers/gpu/drm/radeon/cik.c                    |   2 +-
 drivers/gpu/drm/radeon/ni.c                     |   3 +-
 drivers/gpu/drm/radeon/si.c                     |   2 +-
 drivers/hid/hid-debug.c                         |   3 +-
 drivers/hwmon/Kconfig                           |   4 +-
 drivers/hwmon/k10temp.c                         |  36 ++++-
 drivers/hwmon/nct6775.c                         |   2 +
 drivers/hwmon/ntc_thermistor.c                  |   9 ++
 drivers/input/joystick/xpad.c                   | 192 ++++++++++++++++++++++--
 drivers/input/keyboard/cros_ec_keyb.c           |   2 +-
 drivers/input/mouse/elantech.c                  |   2 +-
 drivers/input/touchscreen/usbtouchscreen.c      |  11 ++
 drivers/iommu/amd_iommu.c                       | 109 ++++++--------
 drivers/iommu/amd_iommu_types.h                 |   6 +
 drivers/isdn/icn/icn.c                          |   2 +-
 drivers/lguest/core.c                           |   2 +-
 drivers/md/raid5.c                              |   3 +-
 drivers/mmc/host/atmel-mci.c                    |   9 +-
 drivers/net/phy/dp83640.c                       |   2 +-
 drivers/net/wireless/rt2x00/rt2800usb.c         |   1 +
 drivers/net/wireless/rtlwifi/usb.c              |   2 +-
 drivers/net/xen-netback/xenbus.c                |  33 ++--
 drivers/nfc/pn533.c                             |   4 +-
 drivers/scsi/hpsa.c                             |  52 +++++--
 drivers/scsi/qla2xxx/qla_gbl.h                  |   2 -
 drivers/scsi/qla2xxx/qla_nx2.c                  |   2 +-
 drivers/scsi/sd.c                               |  19 +--
 drivers/scsi/storvsc_drv.c                      |   3 +-
 drivers/staging/dgap/Makefile                   |   2 -
 drivers/staging/dgap/dgap_driver.h              |   3 +
 drivers/staging/dgnc/Makefile                   |   2 -
 drivers/staging/dgnc/dgnc_driver.h              |   2 +
 drivers/staging/rtl8187se/ieee80211/ieee80211.h |   4 +-
 drivers/staging/rtl8188eu/Makefile              |   4 +-
 drivers/staging/rtl8192e/rtllib.h               |   5 +-
 drivers/staging/rtl8192e/rtllib_softmac.c       |   2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211.h  |  10 +-
 drivers/staging/rtl8712/ieee80211.h             |   4 +-
 drivers/staging/wlags49_h2/wl_internal.h        |   4 +-
 drivers/target/target_core_pscsi.c              |   3 +
 drivers/target/target_core_pscsi.h              |   1 +
 drivers/thermal/step_wise.c                     |   3 -
 drivers/tty/hvc/hvc_xen.c                       |   2 +-
 drivers/usb/chipidea/debug.c                    |   6 +-
 drivers/usb/core/quirks.c                       |   3 +
 drivers/usb/gadget/configfs.c                   |   1 +
 drivers/usb/host/xhci-ring.c                    |   7 +-
 drivers/usb/host/xhci.h                         |   2 +-
 drivers/usb/serial/cp210x.c                     |   1 +
 drivers/usb/serial/pl2303.c                     |   1 -
 drivers/usb/serial/pl2303.h                     |   4 -
 drivers/usb/serial/visor.c                      |   2 +-
 drivers/usb/storage/unusual_devs.h              |   7 +
 drivers/vhost/scsi.c                            |   6 +-
 drivers/w1/masters/ds2490.c                     |   2 +-
 drivers/xen/events.c                            |  12 +-
 fs/aio.c                                        |  83 +++++-----
 fs/binfmt_elf.c                                 |   2 +-
 fs/cifs/smb2pdu.c                               |  21 ++-
 fs/dcache.c                                     |   8 +-
 fs/ext4/ext4_jbd2.c                             |   6 +
 fs/ext4/extents.c                               |   2 +-
 fs/fhandle.c                                    |   5 +-
 fs/jbd2/recovery.c                              |  10 +-
 fs/jbd2/revoke.c                                |  18 ++-
 fs/jbd2/transaction.c                           |  25 +--
 fs/namespace.c                                  |   7 +-
 fs/omfs/inode.c                                 |   3 +-
 include/drm/drm_pciids.h                        |   1 +
 include/linux/libata.h                          |  10 ++
 include/linux/pci_ids.h                         |   2 +
 include/xen/events.h                            |   2 +-
 kernel/fork.c                                   |   5 +-
 kernel/pid.c                                    |  15 +-
 lib/strnlen_user.c                              |   3 +-
 mm/mempolicy.c                                  |  18 ++-
 net/bridge/br_multicast.c                       |   2 +-
 net/caif/caif_socket.c                          |   8 +
 net/ceph/osd_client.c                           |  31 ++--
 net/ipv4/route.c                                |   4 +
 net/ipv4/udp.c                                  |   6 +-
 net/ipv6/udp.c                                  |   6 +-
 net/mac80211/wep.c                              |   6 +-
 net/netfilter/nfnetlink_cthelper.c              |   3 +
 net/sched/sch_api.c                             |  10 +-
 net/socket.c                                    |  24 ++-
 net/sunrpc/auth_gss/gss_rpc_xdr.c               |  23 ++-
 net/unix/af_unix.c                              |   8 +
 security/lsm_audit.c                            |  15 +-
 sound/pci/hda/patch_conexant.c                  |  12 ++
 sound/pci/hda/patch_realtek.c                   |   1 +
 sound/soc/codecs/mc13783.c                      |   4 +-
 sound/soc/codecs/wm8960.c                       |   2 +-
 sound/soc/codecs/wm8994.c                       |   2 +-
 123 files changed, 857 insertions(+), 382 deletions(-)

-- 
2.4.2


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

* [PATCH 3.12 078/111] Input: elantech - fix semi-mt protocol for v3 HW
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (76 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 077/111] md/raid5: don't record new size if resize_stripes fails Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 079/111] sd: Disable support for 256 byte/sector disks Jiri Slaby
                   ` (34 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Benjamin Tissoires, Dmitry Torokhov, Jiri Slaby

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

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

===============

commit 3c0213d17a09601e0c6c0ae0e27caf70d988290f upstream.

When the v3 hardware sees more than one finger, it uses the semi-mt
protocol to report the touches. However, it currently works when
num_fingers is 0, 1 or 2, but when it is 3 and above, it sends only 1
finger as if num_fingers was 1.

This confuses userspace which knows how to deal with extra fingers
when all the slots are used, but not when some are missing.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90101

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/mouse/elantech.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 04a7d9f00928..71540c0eee44 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -314,7 +314,7 @@ static void elantech_report_semi_mt_data(struct input_dev *dev,
 					 unsigned int x2, unsigned int y2)
 {
 	elantech_set_slot(dev, 0, num_fingers != 0, x1, y1);
-	elantech_set_slot(dev, 1, num_fingers == 2, x2, y2);
+	elantech_set_slot(dev, 1, num_fingers >= 2, x2, y2);
 }
 
 /*
-- 
2.4.2


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

* [PATCH 3.12 079/111] sd: Disable support for 256 byte/sector disks
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (77 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 078/111] Input: elantech - fix semi-mt protocol for v3 HW Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 080/111] ACPI / init: Fix the ordering of acpi_reserve_resources() Jiri Slaby
                   ` (33 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Mark Hounschell, Hannes Reinecke, James Bottomley,
	Jiri Slaby

From: Mark Hounschell <dmarkh@cfl.rr.com>

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

===============

commit 74856fbf441929918c49ff262ace9835048e4e6a upstream.

256 bytes per sector support has been broken since 2.6.X,
and no-one stepped up to fix this.
So disable support for it.

Signed-off-by: Mark Hounschell <dmarkh@cfl.rr.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/sd.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 69d2a7060fde..6e361148911f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1580,6 +1580,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
 {
 	u64 start_lba = blk_rq_pos(scmd->request);
 	u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512);
+	u64 factor = scmd->device->sector_size / 512;
 	u64 bad_lba;
 	int info_valid;
 	/*
@@ -1601,16 +1602,9 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
 	if (scsi_bufflen(scmd) <= scmd->device->sector_size)
 		return 0;
 
-	if (scmd->device->sector_size < 512) {
-		/* only legitimate sector_size here is 256 */
-		start_lba <<= 1;
-		end_lba <<= 1;
-	} else {
-		/* be careful ... don't want any overflows */
-		u64 factor = scmd->device->sector_size / 512;
-		do_div(start_lba, factor);
-		do_div(end_lba, factor);
-	}
+	/* be careful ... don't want any overflows */
+	do_div(start_lba, factor);
+	do_div(end_lba, factor);
 
 	/* The bad lba was reported incorrectly, we have no idea where
 	 * the error is.
@@ -2177,8 +2171,7 @@ got_data:
 	if (sector_size != 512 &&
 	    sector_size != 1024 &&
 	    sector_size != 2048 &&
-	    sector_size != 4096 &&
-	    sector_size != 256) {
+	    sector_size != 4096) {
 		sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n",
 			  sector_size);
 		/*
@@ -2229,8 +2222,6 @@ got_data:
 		sdkp->capacity <<= 2;
 	else if (sector_size == 1024)
 		sdkp->capacity <<= 1;
-	else if (sector_size == 256)
-		sdkp->capacity >>= 1;
 
 	blk_queue_physical_block_size(sdp->request_queue,
 				      sdkp->physical_block_size);
-- 
2.4.2


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

* [PATCH 3.12 080/111] ACPI / init: Fix the ordering of acpi_reserve_resources()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (78 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 079/111] sd: Disable support for 256 byte/sector disks Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 081/111] drm/radeon: add new bonaire pci id Jiri Slaby
                   ` (32 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Rafael J. Wysocki, Jiri Slaby

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

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

===============

commit b9a5e5e18fbf223502c0b2264c15024e393da928 upstream.

Since acpi_reserve_resources() is defined as a device_initcall(),
there's no guarantee that it will be executed in the right order
with respect to the rest of the ACPI initialization code.  On some
systems this leads to breakage if, for example, the address range
that should be reserved for the ACPI fixed registers is given to
the PCI host bridge instead if the race is won by the wrong code
path.

Fix this by turning acpi_reserve_resources() into a void function
and calling it directly from within the ACPI initialization sequence.

Reported-and-tested-by: George McCollister <george.mccollister@gmail.com>
Link: http://marc.info/?t=143092384600002&r=1&w=2
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/acpi/osl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index ebe0ea2dff69..91f850585960 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -177,7 +177,7 @@ static void __init acpi_request_region (struct acpi_generic_address *gas,
 		request_mem_region(addr, length, desc);
 }
 
-static int __init acpi_reserve_resources(void)
+static void __init acpi_reserve_resources(void)
 {
 	acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length,
 		"ACPI PM1a_EVT_BLK");
@@ -206,10 +206,7 @@ static int __init acpi_reserve_resources(void)
 	if (!(acpi_gbl_FADT.gpe1_block_length & 0x1))
 		acpi_request_region(&acpi_gbl_FADT.xgpe1_block,
 			       acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK");
-
-	return 0;
 }
-device_initcall(acpi_reserve_resources);
 
 void acpi_os_printf(const char *fmt, ...)
 {
@@ -1764,6 +1761,7 @@ acpi_status __init acpi_os_initialize(void)
 
 acpi_status __init acpi_os_initialize1(void)
 {
+	acpi_reserve_resources();
 	kacpid_wq = alloc_workqueue("kacpid", 0, 1);
 	kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
 	kacpi_hotplug_wq = alloc_workqueue("kacpi_hotplug", 0, 1);
-- 
2.4.2


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

* [PATCH 3.12 081/111] drm/radeon: add new bonaire pci id
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (79 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 080/111] ACPI / init: Fix the ordering of acpi_reserve_resources() Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 082/111] drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling Jiri Slaby
                   ` (31 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Jiri Slaby

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

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

===============

commit fcf3b54282e4c5a95a1f45f67558bc105acdbc6a upstream.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/drm/drm_pciids.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index b521d1cd54fa..7571f433f0e3 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -186,6 +186,7 @@
 	{0x1002, 0x6658, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x665c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x665d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x665f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6663, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6664, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-- 
2.4.2


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

* [PATCH 3.12 082/111] drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (80 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 081/111] drm/radeon: add new bonaire pci id Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 083/111] drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling" Jiri Slaby
                   ` (30 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christian König, Alex Deucher, Jiri Slaby

From: Christian König <christian.koenig@amd.com>

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

===============

commit 607d48063512707a414e346972e2210dc71ab491 upstream.

The mapping range is inclusive between starting and ending addresses.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/cik.c       | 4 ++--
 drivers/gpu/drm/radeon/evergreen.c | 2 +-
 drivers/gpu/drm/radeon/ni.c        | 5 +++--
 drivers/gpu/drm/radeon/r600.c      | 2 +-
 drivers/gpu/drm/radeon/rv770.c     | 2 +-
 drivers/gpu/drm/radeon/si.c        | 4 ++--
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index bb4c6573a525..db86a9510b2c 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -4557,7 +4557,7 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(6));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
@@ -4575,7 +4575,7 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
 	 */
 	/* set vm size, must be a multiple of 4 */
 	WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0);
-	WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn);
+	WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn - 1);
 	for (i = 1; i < 16; i++) {
 		if (i < 8)
 			WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 063b72fbfe1e..204e6a9adf3c 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2424,7 +2424,7 @@ static int evergreen_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
 	WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index d5f7e8c14b2e..5ef61a48056b 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1241,7 +1241,7 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(6));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
@@ -1260,7 +1260,8 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
 	 */
 	for (i = 1; i < 8; i++) {
 		WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (i << 2), 0);
-		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), rdev->vm_manager.max_pfn);
+		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2),
+			rdev->vm_manager.max_pfn - 1);
 		WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
 			rdev->gart.table_addr >> 12);
 	}
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 2c0a0d7c2492..765833756909 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -942,7 +942,7 @@ static int r600_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_L1_TLB_MCB_RD_SEM_CNTL, tmp | ENABLE_SEMAPHORE_MODE);
 	WREG32(MC_VM_L1_TLB_MCB_WR_SEM_CNTL, tmp | ENABLE_SEMAPHORE_MODE);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index c4960ad71e5e..8cc9470df191 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -916,7 +916,7 @@ static int rv770_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
 	WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index c9f229f2048a..455b9516bdd2 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -3961,7 +3961,7 @@ static int si_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(0));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
@@ -3976,7 +3976,7 @@ static int si_pcie_gart_enable(struct radeon_device *rdev)
 	/* empty context1-15 */
 	/* set vm size, must be a multiple of 4 */
 	WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0);
-	WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn);
+	WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn - 1);
 	/* Assign the pt base to something valid for now; the pts used for
 	 * the VMs are determined by the application and setup and assigned
 	 * on the fly in the vm part of radeon_gart.c
-- 
2.4.2


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

* [PATCH 3.12 083/111] drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling"
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (81 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 082/111] drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 084/111] vfs: read file_handle only once in handle_to_path Jiri Slaby
                   ` (29 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christian König, Alex Deucher, Jiri Slaby

From: Christian König <christian.koenig@amd.com>

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

===============

commit 7c0411d2fabc2e2702c9871ffb603e251158b317 upstream.

We have that bug for years and some users report side effects when fixing it on older hardware.

So revert it for VM_CONTEXT0_PAGE_TABLE_END_ADDR, but keep it for VM 1-15.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/cik.c       | 2 +-
 drivers/gpu/drm/radeon/evergreen.c | 2 +-
 drivers/gpu/drm/radeon/ni.c        | 2 +-
 drivers/gpu/drm/radeon/r600.c      | 2 +-
 drivers/gpu/drm/radeon/rv770.c     | 2 +-
 drivers/gpu/drm/radeon/si.c        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index db86a9510b2c..944301337c58 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -4557,7 +4557,7 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(6));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 204e6a9adf3c..063b72fbfe1e 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2424,7 +2424,7 @@ static int evergreen_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
 	WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 5ef61a48056b..7dcf2ffddccf 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1241,7 +1241,7 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(6));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 765833756909..2c0a0d7c2492 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -942,7 +942,7 @@ static int r600_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_L1_TLB_MCB_RD_SEM_CNTL, tmp | ENABLE_SEMAPHORE_MODE);
 	WREG32(MC_VM_L1_TLB_MCB_WR_SEM_CNTL, tmp | ENABLE_SEMAPHORE_MODE);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 8cc9470df191..c4960ad71e5e 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -916,7 +916,7 @@ static int rv770_pcie_gart_enable(struct radeon_device *rdev)
 	WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
 	WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(0) |
 				RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 455b9516bdd2..7dcd3c81f42a 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -3961,7 +3961,7 @@ static int si_pcie_gart_enable(struct radeon_device *rdev)
 	       L2_CACHE_BIGK_FRAGMENT_SIZE(0));
 	/* setup context0 */
 	WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR, rdev->mc.gtt_start >> 12);
-	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, (rdev->mc.gtt_end >> 12) - 1);
+	WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR, rdev->mc.gtt_end >> 12);
 	WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR, rdev->gart.table_addr >> 12);
 	WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
 			(u32)(rdev->dummy_page.addr >> 12));
-- 
2.4.2


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

* [PATCH 3.12 084/111] vfs: read file_handle only once in handle_to_path
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (82 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 083/111] drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling" Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 085/111] fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings Jiri Slaby
                   ` (28 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sasha Levin, Al Viro, Linus Torvalds, Jiri Slaby

From: Sasha Levin <sasha.levin@oracle.com>

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

===============

commit 161f873b89136eb1e69477c847d5a5033239d9ba upstream.

We used to read file_handle twice.  Once to get the amount of extra
bytes, and once to fetch the entire structure.

This may be problematic since we do size verifications only after the
first read, so if the number of extra bytes changes in userspace between
the first and second calls, we'll have an incoherent view of
file_handle.

Instead, read the constant size once, and copy that over to the final
structure without having to re-read it again.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/fhandle.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/fhandle.c b/fs/fhandle.c
index 999ff5c3cab0..d59712dfa3e7 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -195,8 +195,9 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
 		goto out_err;
 	}
 	/* copy the full handle */
-	if (copy_from_user(handle, ufh,
-			   sizeof(struct file_handle) +
+	*handle = f_handle;
+	if (copy_from_user(&handle->f_handle,
+			   &ufh->f_handle,
 			   f_handle.handle_bytes)) {
 		retval = -EFAULT;
 		goto out_handle;
-- 
2.4.2


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

* [PATCH 3.12 085/111] fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (83 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 084/111] vfs: read file_handle only once in handle_to_path Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 086/111] drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h" Jiri Slaby
                   ` (27 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Andrew Morton, Michael Davidson, Linus Torvalds,
	Jiri Slaby

From: Andrew Morton <akpm@linux-foundation.org>

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

===============

commit 2b1d3ae940acd11be44c6eced5873d47c2e00ffa upstream.

load_elf_binary() returns `retval', not `error'.

Fixes: a87938b2e246b81b4fb ("fs/binfmt_elf.c: fix bug in loading of PIE binaries")
Reported-by: James Hogan <james.hogan@imgtec.com>
Cc: Michael Davidson <md@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/binfmt_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index ec6d0de19694..d872fda15539 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -822,7 +822,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
 			total_size = total_mapping_size(elf_phdata,
 							loc->elf_ex.e_phnum);
 			if (!total_size) {
-				error = -EINVAL;
+				retval = -EINVAL;
 				goto out_free_dentry;
 			}
 		}
-- 
2.4.2


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

* [PATCH 3.12 086/111] drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h"
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (84 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 085/111] fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 087/111] drivers: staging: rtl8188eu: use 'ccflags-y' instead of EXTRA_CFLAGS in Makefile Jiri Slaby
                   ` (26 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Chen Gang, Greg Kroah-Hartman, Jiri Slaby

From: Chen Gang <gang.chen@asianux.com>

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

===============

commit 6319c61aecc7acaf39a1dc0e81a8aac6a17499ee upstream.

Normally, the macros from command line are system specific macros (e.g
__linux, __KERNEL__ ...), and module own macros are usually defined in
their header files.

DG_NAME and DG_PART are driver 'dgap' owned macros which are used by
multiple files within driver, and need be defined in the driver main
header file.

So move DG_NAME and DG_PART to "dgap_driver.h", it not only can make
code clearer, but also can avoid compiling failure when EXTRA_CFLAGS
appended to make command line (e.g. "EXTRA_CFLAGS=-W").

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/dgap/Makefile      | 2 --
 drivers/staging/dgap/dgap_driver.h | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgap/Makefile b/drivers/staging/dgap/Makefile
index 9f1fce157c77..3abe8d2bb748 100644
--- a/drivers/staging/dgap/Makefile
+++ b/drivers/staging/dgap/Makefile
@@ -1,5 +1,3 @@
-EXTRA_CFLAGS += -DDG_NAME=\"dgap-1.3-16\" -DDG_PART=\"40002347_C\"
-
 obj-$(CONFIG_DGAP) += dgap.o
 
 
diff --git a/drivers/staging/dgap/dgap_driver.h b/drivers/staging/dgap/dgap_driver.h
index b1cf489a729c..1742f4071e4d 100644
--- a/drivers/staging/dgap/dgap_driver.h
+++ b/drivers/staging/dgap/dgap_driver.h
@@ -53,6 +53,9 @@
  * DPR((fmt, args, ...));	Only prints if DGAP_TRACER is defined at
  *				  compile time and dgap_debug!=0
  */
+#define	DG_NAME		"dgap-1.3-16"
+#define	DG_PART		"40002347_C"
+
 #define	PROCSTR		"dgap"			/* /proc entries	 */
 #define	DEVSTR		"/dev/dg/dgap"		/* /dev entries		 */
 #define	DRVSTR		"dgap"			/* Driver name string 
-- 
2.4.2


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

* [PATCH 3.12 087/111] drivers: staging: rtl8188eu: use 'ccflags-y' instead of EXTRA_CFLAGS in Makefile
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (85 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 086/111] drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h" Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 088/111] dgnc: Move DG_PART definition from Makefile to dgnc_driver.h Jiri Slaby
                   ` (25 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Chen Gang, Greg Kroah-Hartman, Jiri Slaby

From: Chen Gang <gang.chen@asianux.com>

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

===============

commit 97b0b6ca4c0f0f964d3c6918301ca45353ef8bc5 upstream.

If command line use EXTRA_CFLAGS (e.g. "EXTRA_CFLAGS=-mmedium-calls"
for arc architecture, with allmodconfig), it can not pass compiling,
the related error:

  drivers/staging/rtl8188eu/core/rtw_ap.c:22:27: fatal error: osdep_service.h: No such file or directory

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/rtl8188eu/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile
index 1639a45da948..d1173ab92bea 100644
--- a/drivers/staging/rtl8188eu/Makefile
+++ b/drivers/staging/rtl8188eu/Makefile
@@ -1,5 +1,3 @@
-EXTRA_CFLAGS += -I$(src)/include
-
 r8188eu-y :=				\
 		core/rtw_ap.o		\
 		core/rtw_br_ext.o	\
@@ -67,4 +65,4 @@ r8188eu-y :=				\
 
 obj-$(CONFIG_R8188EU)	:= r8188eu.o
 
-ccflags-y += -D__CHECK_ENDIAN__
+ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/include
-- 
2.4.2


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

* [PATCH 3.12 088/111] dgnc: Move DG_PART definition from Makefile to dgnc_driver.h
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (86 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 087/111] drivers: staging: rtl8188eu: use 'ccflags-y' instead of EXTRA_CFLAGS in Makefile Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 089/111] x86: bpf_jit: fix compilation of large bpf programs Jiri Slaby
                   ` (24 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Cass May, Greg Kroah-Hartman, Jiri Slaby

From: Cass May <cass@cassm.net>

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

===============

commit f11cc568758f23088c1f7a8369100c59e4c07bd6 upstream.

Avoid deprecated usage of EXTRA_CFLAGS by moving definition of DG_PART into dgnc_driver.h

Signed-off-by: Cass May <cass@cassm.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/staging/dgnc/Makefile      | 2 --
 drivers/staging/dgnc/dgnc_driver.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index 888c4334236b..9e1efcb8dcb7 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -1,5 +1,3 @@
-EXTRA_CFLAGS += -DDG_NAME=\"dgnc-1.3-16\" -DDG_PART=\"40002369_F\"
-
 obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
index 218b15dccb7d..dca389ff992f 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -59,6 +59,8 @@
 #define	APR(args)	do { PRINTF_TO_KMEM(args); printk(DRVSTR": "); printk args; \
 			   } while (0)
 #define	RAPR(args)	do { PRINTF_TO_KMEM(args); printk args; } while (0)
+#define	DG_NAME		"dgnc-1.3-16"
+#define	DG_PART		"40002369_F"		/* RPM part number	 */
 
 #define TRC_TO_CONSOLE 1
 
-- 
2.4.2


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

* [PATCH 3.12 089/111] x86: bpf_jit: fix compilation of large bpf programs
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (87 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 088/111] dgnc: Move DG_PART definition from Makefile to dgnc_driver.h Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 090/111] ipv4: Avoid crashing in ip_error Jiri Slaby
                   ` (23 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alexei Starovoitov, David S. Miller, Jiri Slaby

From: Alexei Starovoitov <ast@plumgrid.com>

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

===============

[ Upstream commit 3f7352bf21f8fd7ba3e2fcef9488756f188e12be ]

x86 has variable length encoding. x86 JIT compiler is trying
to pick the shortest encoding for given bpf instruction.
While doing so the jump targets are changing, so JIT is doing
multiple passes over the program. Typical program needs 3 passes.
Some very short programs converge with 2 passes. Large programs
may need 4 or 5. But specially crafted bpf programs may hit the
pass limit and if the program converges on the last iteration
the JIT compiler will be producing an image full of 'int 3' insns.
Fix this corner case by doing final iteration over bpf program.

Fixes: 0a14842f5a3c ("net: filter: Just In Time compiler for x86-64")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Tested-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/net/bpf_jit_comp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 4ed75dd81d05..1b72000b6be2 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -211,7 +211,12 @@ void bpf_jit_compile(struct sk_filter *fp)
 	}
 	cleanup_addr = proglen; /* epilogue address */
 
-	for (pass = 0; pass < 10; pass++) {
+	/* JITed image shrinks with every pass and the loop iterates
+	 * until the image stops shrinking. Very large bpf programs
+	 * may converge on the last pass. In such case do one more
+	 * pass to emit the final image
+	 */
+	for (pass = 0; pass < 10 || image; pass++) {
 		u8 seen_or_pass0 = (pass == 0) ? (SEEN_XREG | SEEN_DATAREF | SEEN_MEM) : seen;
 		/* no prologue/epilogue for trivial filters (RET something) */
 		proglen = 0;
-- 
2.4.2


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

* [PATCH 3.12 090/111] ipv4: Avoid crashing in ip_error
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (88 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 089/111] x86: bpf_jit: fix compilation of large bpf programs Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 091/111] bridge: fix parsing of MLDv2 reports Jiri Slaby
                   ` (22 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Eric W. Biederman, Vittorio Gambaletta,
	David S. Miller, Jiri Slaby

From: "Eric W. Biederman" <ebiederm@xmission.com>

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

===============

[ Upstream commit 381c759d9916c42959515ad34a6d467e24a88e93 ]

ip_error does not check if in_dev is NULL before dereferencing it.

IThe following sequence of calls is possible:
CPU A                          CPU B
ip_rcv_finish
    ip_route_input_noref()
        ip_route_input_slow()
                               inetdev_destroy()
    dst_input()

With the result that a network device can be destroyed while processing
an input packet.

A crash was triggered with only unicast packets in flight, and
forwarding enabled on the only network device.   The error condition
was created by the removal of the network device.

As such it is likely the that error code was -EHOSTUNREACH, and the
action taken by ip_error (if in_dev had been accessible) would have
been to not increment any counters and to have tried and likely failed
to send an icmp error as the network device is going away.

Therefore handle this weird case by just dropping the packet if
!in_dev.  It will result in dropping the packet sooner, and will not
result in an actual change of behavior.

Fixes: 251da4130115b ("ipv4: Cache ip_error() routes even when not forwarding.")
Reported-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Tested-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ipv4/route.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 3663200b8dba..bd5f3461d1ce 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -921,6 +921,10 @@ static int ip_error(struct sk_buff *skb)
 	bool send;
 	int code;
 
+	/* IP on this device is disabled. */
+	if (!in_dev)
+		goto out;
+
 	net = dev_net(rt->dst.dev);
 	if (!IN_DEV_FORWARD(in_dev)) {
 		switch (rt->dst.error) {
-- 
2.4.2


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

* [PATCH 3.12 091/111] bridge: fix parsing of MLDv2 reports
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (89 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 090/111] ipv4: Avoid crashing in ip_error Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 092/111] net: dp83640: fix broken calibration routine Jiri Slaby
                   ` (21 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thadeu Lima de Souza Cascardo, David S. Miller, Jiri Slaby

From: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>

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

===============

[ Upstream commit 47cc84ce0c2fe75c99ea5963c4b5704dd78ead54 ]

When more than a multicast address is present in a MLDv2 report, all but
the first address is ignored, because the code breaks out of the loop if
there has not been an error adding that address.

This has caused failures when two guests connected through the bridge
tried to communicate using IPv6. Neighbor discoveries would not be
transmitted to the other guest when both used a link-local address and a
static address.

This only happens when there is a MLDv2 querier in the network.

The fix will only break out of the loop when there is a failure adding a
multicast address.

The mdb before the patch:

dev ovirtmgmt port vnet0 grp ff02::1:ff7d:6603 temp
dev ovirtmgmt port vnet1 grp ff02::1:ff7d:6604 temp
dev ovirtmgmt port bond0.86 grp ff02::2 temp

After the patch:

dev ovirtmgmt port vnet0 grp ff02::1:ff7d:6603 temp
dev ovirtmgmt port vnet1 grp ff02::1:ff7d:6604 temp
dev ovirtmgmt port bond0.86 grp ff02::fb temp
dev ovirtmgmt port bond0.86 grp ff02::2 temp
dev ovirtmgmt port bond0.86 grp ff02::d temp
dev ovirtmgmt port vnet0 grp ff02::1:ff00:76 temp
dev ovirtmgmt port bond0.86 grp ff02::16 temp
dev ovirtmgmt port vnet1 grp ff02::1:ff00:77 temp
dev ovirtmgmt port bond0.86 grp ff02::1:ff00:def temp
dev ovirtmgmt port bond0.86 grp ff02::1:ffa1:40bf temp

Fixes: 08b202b67264 ("bridge br_multicast: IPv6 MLD support.")
Reported-by: Rik Theys <Rik.Theys@esat.kuleuven.be>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Tested-by: Rik Theys <Rik.Theys@esat.kuleuven.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/bridge/br_multicast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 162d6c78ad05..b11736ad2e0b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1058,7 +1058,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
 
 		err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
 						 vid);
-		if (!err)
+		if (err)
 			break;
 	}
 
-- 
2.4.2


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

* [PATCH 3.12 092/111] net: dp83640: fix broken calibration routine.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (90 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 091/111] bridge: fix parsing of MLDv2 reports Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 093/111] unix/caif: sk_socket can disappear when state is unlocked Jiri Slaby
                   ` (20 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Richard Cochran, David S. Miller, Jiri Slaby

From: Richard Cochran <richardcochran@gmail.com>

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

===============

[ Upstream commit 397a253af5031de4a4612210055935309af4472c ]

Currently, the calibration function that corrects the initial offsets
among multiple devices only works the first time.  If the function is
called more than once, the calibration fails and bogus offsets will be
programmed into the devices.

In a well hidden spot, the device documentation tells that trigger indexes
0 and 1 are special in allowing the TRIG_IF_LATE flag to actually work.

This patch fixes the issue by using one of the special triggers during the
recalibration method.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/phy/dp83640.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 7490b6c866e6..d2907a6e3dab 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -45,7 +45,7 @@
 #define PSF_TX		0x1000
 #define EXT_EVENT	1
 #define CAL_EVENT	7
-#define CAL_TRIGGER	7
+#define CAL_TRIGGER	1
 #define PER_TRIGGER	6
 
 #define MII_DP83640_MICR 0x11
-- 
2.4.2


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

* [PATCH 3.12 093/111] unix/caif: sk_socket can disappear when state is unlocked
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (91 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 092/111] net: dp83640: fix broken calibration routine Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 094/111] net_sched: invoke ->attach() after setting dev->qdisc Jiri Slaby
                   ` (19 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mark Salyzyn, David S. Miller, Jiri Slaby

From: Mark Salyzyn <salyzyn@android.com>

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

===============

[ Upstream commit b48732e4a48d80ed4a14812f0bab09560846514e ]

got a rare NULL pointer dereference in clear_bit

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
----
v2: switch to sock_flag(sk, SOCK_DEAD) and added net/caif/caif_socket.c
v3: return -ECONNRESET in upstream caller of wait function for SOCK_DEAD
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/caif/caif_socket.c | 8 ++++++++
 net/unix/af_unix.c     | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 526bf56f4d31..afeb8e07ee41 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -332,6 +332,10 @@ static long caif_stream_data_wait(struct sock *sk, long timeo)
 		release_sock(sk);
 		timeo = schedule_timeout(timeo);
 		lock_sock(sk);
+
+		if (sock_flag(sk, SOCK_DEAD))
+			break;
+
 		clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
 	}
 
@@ -376,6 +380,10 @@ static int caif_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
 		struct sk_buff *skb;
 
 		lock_sock(sk);
+		if (sock_flag(sk, SOCK_DEAD)) {
+			err = -ECONNRESET;
+			goto unlock;
+		}
 		skb = skb_dequeue(&sk->sk_receive_queue);
 		caif_check_flow_release(sk);
 
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c3975bcf725f..9afa362d8a31 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1891,6 +1891,10 @@ static long unix_stream_data_wait(struct sock *sk, long timeo,
 		unix_state_unlock(sk);
 		timeo = freezable_schedule_timeout(timeo);
 		unix_state_lock(sk);
+
+		if (sock_flag(sk, SOCK_DEAD))
+			break;
+
 		clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
 	}
 
@@ -1955,6 +1959,10 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
 		struct sk_buff *skb, *last;
 
 		unix_state_lock(sk);
+		if (sock_flag(sk, SOCK_DEAD)) {
+			err = -ECONNRESET;
+			goto unlock;
+		}
 		last = skb = skb_peek(&sk->sk_receive_queue);
 again:
 		if (skb == NULL) {
-- 
2.4.2


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

* [PATCH 3.12 094/111] net_sched: invoke ->attach() after setting dev->qdisc
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (92 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 093/111] unix/caif: sk_socket can disappear when state is unlocked Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 095/111] udp: fix behavior of wrong checksums Jiri Slaby
                   ` (18 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, WANG Cong, Jamal Hadi Salim, David S. Miller, Jiri Slaby

From: WANG Cong <xiyou.wangcong@gmail.com>

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

===============

[ Upstream commit 86e363dc3b50bfd50a1f315934583fbda673ab8d ]

For mq qdisc, we add per tx queue qdisc to root qdisc
for display purpose, however, that happens too early,
before the new dev->qdisc is finally set, this causes
q->list points to an old root qdisc which is going to be
freed right before assigning with a new one.

Fix this by moving ->attach() after setting dev->qdisc.

For the record, this fixes the following crash:

 ------------[ cut here ]------------
 WARNING: CPU: 1 PID: 975 at lib/list_debug.c:59 __list_del_entry+0x5a/0x98()
 list_del corruption. prev->next should be ffff8800d1998ae8, but was 6b6b6b6b6b6b6b6b
 CPU: 1 PID: 975 Comm: tc Not tainted 4.1.0-rc4+ #1019
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000009 ffff8800d73fb928 ffffffff81a44e7f 0000000047574756
  ffff8800d73fb978 ffff8800d73fb968 ffffffff810790da ffff8800cfc4cd20
  ffffffff814e725b ffff8800d1998ae8 ffffffff82381250 0000000000000000
 Call Trace:
  [<ffffffff81a44e7f>] dump_stack+0x4c/0x65
  [<ffffffff810790da>] warn_slowpath_common+0x9c/0xb6
  [<ffffffff814e725b>] ? __list_del_entry+0x5a/0x98
  [<ffffffff81079162>] warn_slowpath_fmt+0x46/0x48
  [<ffffffff81820eb0>] ? dev_graft_qdisc+0x5e/0x6a
  [<ffffffff814e725b>] __list_del_entry+0x5a/0x98
  [<ffffffff814e72a7>] list_del+0xe/0x2d
  [<ffffffff81822f05>] qdisc_list_del+0x1e/0x20
  [<ffffffff81820cd1>] qdisc_destroy+0x30/0xd6
  [<ffffffff81822676>] qdisc_graft+0x11d/0x243
  [<ffffffff818233c1>] tc_get_qdisc+0x1a6/0x1d4
  [<ffffffff810b5eaf>] ? mark_lock+0x2e/0x226
  [<ffffffff817ff8f5>] rtnetlink_rcv_msg+0x181/0x194
  [<ffffffff817ff72e>] ? rtnl_lock+0x17/0x19
  [<ffffffff817ff72e>] ? rtnl_lock+0x17/0x19
  [<ffffffff817ff774>] ? __rtnl_unlock+0x17/0x17
  [<ffffffff81855dc6>] netlink_rcv_skb+0x4d/0x93
  [<ffffffff817ff756>] rtnetlink_rcv+0x26/0x2d
  [<ffffffff818544b2>] netlink_unicast+0xcb/0x150
  [<ffffffff81161db9>] ? might_fault+0x59/0xa9
  [<ffffffff81854f78>] netlink_sendmsg+0x4fa/0x51c
  [<ffffffff817d6e09>] sock_sendmsg_nosec+0x12/0x1d
  [<ffffffff817d8967>] sock_sendmsg+0x29/0x2e
  [<ffffffff817d8cf3>] ___sys_sendmsg+0x1b4/0x23a
  [<ffffffff8100a1b8>] ? native_sched_clock+0x35/0x37
  [<ffffffff810a1d83>] ? sched_clock_local+0x12/0x72
  [<ffffffff810a1fd4>] ? sched_clock_cpu+0x9e/0xb7
  [<ffffffff810def2a>] ? current_kernel_time+0xe/0x32
  [<ffffffff810b4bc5>] ? lock_release_holdtime.part.29+0x71/0x7f
  [<ffffffff810ddebf>] ? read_seqcount_begin.constprop.27+0x5f/0x76
  [<ffffffff810b6292>] ? trace_hardirqs_on_caller+0x17d/0x199
  [<ffffffff811b14d5>] ? __fget_light+0x50/0x78
  [<ffffffff817d9808>] __sys_sendmsg+0x42/0x60
  [<ffffffff817d9838>] SyS_sendmsg+0x12/0x1c
  [<ffffffff81a50e97>] system_call_fastpath+0x12/0x6f
 ---[ end trace ef29d3fb28e97ae7 ]---

For long term, we probably need to clean up the qdisc_graft() code
in case it hides other bugs like this.

Fixes: 95dc19299f74 ("pkt_sched: give visibility to mq slave qdiscs")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/sched/sch_api.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 3f5fe03fee72..1b693a8a6957 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -804,10 +804,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 		if (dev->flags & IFF_UP)
 			dev_deactivate(dev);
 
-		if (new && new->ops->attach) {
-			new->ops->attach(new);
-			num_q = 0;
-		}
+		if (new && new->ops->attach)
+			goto skip;
 
 		for (i = 0; i < num_q; i++) {
 			struct netdev_queue *dev_queue = dev_ingress_queue(dev);
@@ -823,12 +821,16 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 				qdisc_destroy(old);
 		}
 
+skip:
 		if (!ingress) {
 			notify_and_destroy(net, skb, n, classid,
 					   dev->qdisc, new);
 			if (new && !new->ops->attach)
 				atomic_inc(&new->refcnt);
 			dev->qdisc = new ? : &noop_qdisc;
+
+			if (new && new->ops->attach)
+				new->ops->attach(new);
 		} else {
 			notify_and_destroy(net, skb, n, classid, old, new);
 		}
-- 
2.4.2


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

* [PATCH 3.12 095/111] udp: fix behavior of wrong checksums
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (93 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 094/111] net_sched: invoke ->attach() after setting dev->qdisc Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 096/111] xen: netback: read hotplug script once at start of day Jiri Slaby
                   ` (17 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Eric Dumazet, Willem de Bruijn, David S. Miller,
	Jiri Slaby

From: Eric Dumazet <edumazet@google.com>

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

===============

[ Upstream commit beb39db59d14990e401e235faf66a6b9b31240b0 ]

We have two problems in UDP stack related to bogus checksums :

1) We return -EAGAIN to application even if receive queue is not empty.
   This breaks applications using edge trigger epoll()

2) Under UDP flood, we can loop forever without yielding to other
   processes, potentially hanging the host, especially on non SMP.

This patch is an attempt to make things better.

We might in the future add extra support for rt applications
wanting to better control time spent doing a recv() in a hostile
environment. For example we could validate checksums before queuing
packets in socket receive queue.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ipv4/udp.c | 6 ++----
 net/ipv6/udp.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 6ca990726d5b..268ed25f2d65 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1295,10 +1295,8 @@ csum_copy_err:
 	}
 	unlock_sock_fast(sk, slow);
 
-	if (noblock)
-		return -EAGAIN;
-
-	/* starting over for a new packet */
+	/* starting over for a new packet, but check if we need to yield */
+	cond_resched();
 	msg->msg_flags &= ~MSG_TRUNC;
 	goto try_again;
 }
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3d2758d4494e..e09ca285e8f5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -495,10 +495,8 @@ csum_copy_err:
 	}
 	unlock_sock_fast(sk, slow);
 
-	if (noblock)
-		return -EAGAIN;
-
-	/* starting over for a new packet */
+	/* starting over for a new packet, but check if we need to yield */
+	cond_resched();
 	msg->msg_flags &= ~MSG_TRUNC;
 	goto try_again;
 }
-- 
2.4.2


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

* [PATCH 3.12 096/111] xen: netback: read hotplug script once at start of day.
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (94 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 095/111] udp: fix behavior of wrong checksums Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 097/111] iommu/amd: Return the pte page-size in fetch_pte Jiri Slaby
                   ` (16 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Ian Campbell, Ian Campbell, David S. Miller, Jiri Slaby

From: Ian Campbell <Ian.Campbell@citrix.com>

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

===============

[ Upstream commit 31a418986a5852034d520a5bab546821ff1ccf3d ]

When we come to tear things down in netback_remove() and generate the
uevent it is possible that the xenstore directory has already been
removed (details below).

In such cases netback_uevent() won't be able to read the hotplug
script and will write a xenstore error node.

A recent change to the hypervisor exposed this race such that we now
sometimes lose it (where apparently we didn't ever before).

Instead read the hotplug script configuration during setup and use it
for the lifetime of the backend device.

The apparently more obvious fix of moving the transition to
state=Closed in netback_remove() to after the uevent does not work
because it is possible that we are already in state=Closed (in
reaction to the guest having disconnected as it shutdown). Being
already in Closed means the toolstack is at liberty to start tearing
down the xenstore directories. In principal it might be possible to
arrange to unregister the device sooner (e.g on transition to Closing)
such that xenstore would still be there but this state machine is
fragile and prone to anger...

A modern Xen system only relies on the hotplug uevent for driver
domains, when the backend is in the same domain as the toolstack it
will run the necessary setup/teardown directly in the correct sequence
wrt xenstore changes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/xen-netback/xenbus.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 1b08d8798372..659a6f2abb67 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -33,6 +33,8 @@ struct backend_info {
 	enum xenbus_state frontend_state;
 	struct xenbus_watch hotplug_status_watch;
 	u8 have_hotplug_status_watch:1;
+
+	const char *hotplug_script;
 };
 
 static int connect_rings(struct backend_info *);
@@ -55,6 +57,7 @@ static int netback_remove(struct xenbus_device *dev)
 		xenvif_free(be->vif);
 		be->vif = NULL;
 	}
+	kfree(be->hotplug_script);
 	kfree(be);
 	dev_set_drvdata(&dev->dev, NULL);
 	return 0;
@@ -72,6 +75,7 @@ static int netback_probe(struct xenbus_device *dev,
 	struct xenbus_transaction xbt;
 	int err;
 	int sg;
+	const char *script;
 	struct backend_info *be = kzalloc(sizeof(struct backend_info),
 					  GFP_KERNEL);
 	if (!be) {
@@ -142,6 +146,15 @@ static int netback_probe(struct xenbus_device *dev,
 	if (err)
 		pr_debug("Error writing feature-split-event-channels\n");
 
+	script = xenbus_read(XBT_NIL, dev->nodename, "script", NULL);
+	if (IS_ERR(script)) {
+		err = PTR_ERR(script);
+		xenbus_dev_fatal(dev, err, "reading script");
+		goto fail;
+	}
+
+	be->hotplug_script = script;
+
 	err = xenbus_switch_state(dev, XenbusStateInitWait);
 	if (err)
 		goto fail;
@@ -172,22 +185,14 @@ static int netback_uevent(struct xenbus_device *xdev,
 			  struct kobj_uevent_env *env)
 {
 	struct backend_info *be = dev_get_drvdata(&xdev->dev);
-	char *val;
 
-	val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
-	if (IS_ERR(val)) {
-		int err = PTR_ERR(val);
-		xenbus_dev_fatal(xdev, err, "reading script");
-		return err;
-	} else {
-		if (add_uevent_var(env, "script=%s", val)) {
-			kfree(val);
-			return -ENOMEM;
-		}
-		kfree(val);
-	}
+	if (!be)
+		return 0;
+
+	if (add_uevent_var(env, "script=%s", be->hotplug_script))
+		return -ENOMEM;
 
-	if (!be || !be->vif)
+	if (!be->vif)
 		return 0;
 
 	return add_uevent_var(env, "vif=%s", be->vif->dev->name);
-- 
2.4.2


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

* [PATCH 3.12 097/111] iommu/amd: Return the pte page-size in fetch_pte
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (95 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 096/111] xen: netback: read hotplug script once at start of day Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 098/111] iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface Jiri Slaby
                   ` (15 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby

From: Joerg Roedel <jroedel@suse.de>

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

===============

commit 3039ca1b1c37e61cc9239dbb3903db55141ecabd upstream.

Extend the fetch_pte function to also return the page-size
that is mapped by the returned pte.

Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c       | 52 ++++++++++++++++++++++++-----------------
 drivers/iommu/amd_iommu_types.h |  6 +++++
 2 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 67644e960592..976cf15744a9 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1376,7 +1376,9 @@ static u64 *alloc_pte(struct protection_domain *domain,
  * This function checks if there is a PTE for a given dma address. If
  * there is one, it returns the pointer to it.
  */
-static u64 *fetch_pte(struct protection_domain *domain, unsigned long address)
+static u64 *fetch_pte(struct protection_domain *domain,
+		      unsigned long address,
+		      unsigned long *page_size)
 {
 	int level;
 	u64 *pte;
@@ -1384,8 +1386,9 @@ static u64 *fetch_pte(struct protection_domain *domain, unsigned long address)
 	if (address > PM_LEVEL_SIZE(domain->mode))
 		return NULL;
 
-	level   =  domain->mode - 1;
-	pte     = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
+	level	   =  domain->mode - 1;
+	pte	   = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
+	*page_size =  PTE_LEVEL_PAGE_SIZE(level);
 
 	while (level > 0) {
 
@@ -1394,19 +1397,9 @@ static u64 *fetch_pte(struct protection_domain *domain, unsigned long address)
 			return NULL;
 
 		/* Large PTE */
-		if (PM_PTE_LEVEL(*pte) == 0x07) {
-			unsigned long pte_mask, __pte;
-
-			/*
-			 * If we have a series of large PTEs, make
-			 * sure to return a pointer to the first one.
-			 */
-			pte_mask = PTE_PAGE_SIZE(*pte);
-			pte_mask = ~((PAGE_SIZE_PTE_COUNT(pte_mask) << 3) - 1);
-			__pte    = ((unsigned long)pte) & pte_mask;
-
-			return (u64 *)__pte;
-		}
+		if (PM_PTE_LEVEL(*pte) == 7 ||
+		    PM_PTE_LEVEL(*pte) == 0)
+			break;
 
 		/* No level skipping support yet */
 		if (PM_PTE_LEVEL(*pte) != level)
@@ -1415,8 +1408,21 @@ static u64 *fetch_pte(struct protection_domain *domain, unsigned long address)
 		level -= 1;
 
 		/* Walk to the next level */
-		pte = IOMMU_PTE_PAGE(*pte);
-		pte = &pte[PM_LEVEL_INDEX(level, address)];
+		pte	   = IOMMU_PTE_PAGE(*pte);
+		pte	   = &pte[PM_LEVEL_INDEX(level, address)];
+		*page_size = PTE_LEVEL_PAGE_SIZE(level);
+	}
+
+	if (PM_PTE_LEVEL(*pte) == 0x07) {
+		unsigned long pte_mask;
+
+		/*
+		 * If we have a series of large PTEs, make
+		 * sure to return a pointer to the first one.
+		 */
+		*page_size = pte_mask = PTE_PAGE_SIZE(*pte);
+		pte_mask   = ~((PAGE_SIZE_PTE_COUNT(pte_mask) << 3) - 1);
+		pte        = (u64 *)(((unsigned long)pte) & pte_mask);
 	}
 
 	return pte;
@@ -1474,6 +1480,7 @@ static unsigned long iommu_unmap_page(struct protection_domain *dom,
 				      unsigned long page_size)
 {
 	unsigned long long unmap_size, unmapped;
+	unsigned long pte_pgsize;
 	u64 *pte;
 
 	BUG_ON(!is_power_of_2(page_size));
@@ -1482,7 +1489,7 @@ static unsigned long iommu_unmap_page(struct protection_domain *dom,
 
 	while (unmapped < page_size) {
 
-		pte = fetch_pte(dom, bus_addr);
+		pte = fetch_pte(dom, bus_addr, &pte_pgsize);
 
 		if (!pte) {
 			/*
@@ -1725,7 +1732,8 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom,
 	for (i = dma_dom->aperture[index]->offset;
 	     i < dma_dom->aperture_size;
 	     i += PAGE_SIZE) {
-		u64 *pte = fetch_pte(&dma_dom->domain, i);
+		unsigned long pte_pgsize;
+		u64 *pte = fetch_pte(&dma_dom->domain, i, &pte_pgsize);
 		if (!pte || !IOMMU_PTE_PRESENT(*pte))
 			continue;
 
@@ -3439,14 +3447,14 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
 					  dma_addr_t iova)
 {
 	struct protection_domain *domain = dom->priv;
-	unsigned long offset_mask;
+	unsigned long offset_mask, pte_pgsize;
 	phys_addr_t paddr;
 	u64 *pte, __pte;
 
 	if (domain->mode == PAGE_MODE_NONE)
 		return iova;
 
-	pte = fetch_pte(domain, iova);
+	pte = fetch_pte(domain, iova, &pte_pgsize);
 
 	if (!pte || !IOMMU_PTE_PRESENT(*pte))
 		return 0;
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index e400fbe411de..97e81fe5c330 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -276,6 +276,12 @@
 #define PTE_PAGE_SIZE(pte) \
 	(1ULL << (1 + ffz(((pte) | 0xfffULL))))
 
+/*
+ * Takes a page-table level and returns the default page-size for this level
+ */
+#define PTE_LEVEL_PAGE_SIZE(level)			\
+	(1ULL << (12 + (9 * (level))))
+
 #define IOMMU_PTE_P  (1ULL << 0)
 #define IOMMU_PTE_TV (1ULL << 1)
 #define IOMMU_PTE_U  (1ULL << 59)
-- 
2.4.2


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

* [PATCH 3.12 098/111] iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (96 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 097/111] iommu/amd: Return the pte page-size in fetch_pte Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 099/111] iommu/amd: Optimize alloc_new_range " Jiri Slaby
                   ` (14 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby

From: Joerg Roedel <jroedel@suse.de>

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

===============

commit 71b390e9bec5121d25c45326ff0b0b96a143f9a8 upstream.

Now that fetch_pte returns the page-size of the pte, this
function can be optimized a lot.

Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 976cf15744a9..8f6344df7c49 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1479,8 +1479,8 @@ static unsigned long iommu_unmap_page(struct protection_domain *dom,
 				      unsigned long bus_addr,
 				      unsigned long page_size)
 {
-	unsigned long long unmap_size, unmapped;
-	unsigned long pte_pgsize;
+	unsigned long long unmapped;
+	unsigned long unmap_size;
 	u64 *pte;
 
 	BUG_ON(!is_power_of_2(page_size));
@@ -1489,28 +1489,12 @@ static unsigned long iommu_unmap_page(struct protection_domain *dom,
 
 	while (unmapped < page_size) {
 
-		pte = fetch_pte(dom, bus_addr, &pte_pgsize);
-
-		if (!pte) {
-			/*
-			 * No PTE for this address
-			 * move forward in 4kb steps
-			 */
-			unmap_size = PAGE_SIZE;
-		} else if (PM_PTE_LEVEL(*pte) == 0) {
-			/* 4kb PTE found for this address */
-			unmap_size = PAGE_SIZE;
-			*pte       = 0ULL;
-		} else {
-			int count, i;
-
-			/* Large PTE found which maps this address */
-			unmap_size = PTE_PAGE_SIZE(*pte);
-
-			/* Only unmap from the first pte in the page */
-			if ((unmap_size - 1) & bus_addr)
-				break;
-			count      = PAGE_SIZE_PTE_COUNT(unmap_size);
+		pte = fetch_pte(dom, bus_addr, &unmap_size);
+
+		if (pte) {
+			int i, count;
+
+			count = PAGE_SIZE_PTE_COUNT(unmap_size);
 			for (i = 0; i < count; i++)
 				pte[i] = 0ULL;
 		}
-- 
2.4.2


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

* [PATCH 3.12 099/111] iommu/amd: Optimize alloc_new_range for new fetch_pte interface
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (97 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 098/111] iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 100/111] iommu/amd: Optimize amd_iommu_iova_to_phys " Jiri Slaby
                   ` (13 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby

From: Joerg Roedel <jroedel@suse.de>

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

===============

commit 5d7c94c3f4f20964b217d64ee44a9a08320c315a upstream.

Now that fetch_pte returns the page-size of the pte, the
call in this function can also be optimized a little bit.

Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8f6344df7c49..9e91d8c38a1e 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1642,7 +1642,7 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom,
 {
 	int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT;
 	struct amd_iommu *iommu;
-	unsigned long i, old_size;
+	unsigned long i, old_size, pte_pgsize;
 
 #ifdef CONFIG_IOMMU_STRESS
 	populate = false;
@@ -1715,13 +1715,13 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom,
 	 */
 	for (i = dma_dom->aperture[index]->offset;
 	     i < dma_dom->aperture_size;
-	     i += PAGE_SIZE) {
-		unsigned long pte_pgsize;
+	     i += pte_pgsize) {
 		u64 *pte = fetch_pte(&dma_dom->domain, i, &pte_pgsize);
 		if (!pte || !IOMMU_PTE_PRESENT(*pte))
 			continue;
 
-		dma_ops_reserve_addresses(dma_dom, i >> PAGE_SHIFT, 1);
+		dma_ops_reserve_addresses(dma_dom, i >> PAGE_SHIFT,
+					  pte_pgsize >> 12);
 	}
 
 	update_domain(&dma_dom->domain);
-- 
2.4.2


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

* [PATCH 3.12 100/111] iommu/amd: Optimize amd_iommu_iova_to_phys for new fetch_pte interface
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (98 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 099/111] iommu/amd: Optimize alloc_new_range " Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 101/111] iommu/amd: Correctly encode huge pages in iommu page tables Jiri Slaby
                   ` (12 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby

From: Joerg Roedel <jroedel@suse.de>

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

===============

commit b24b1b63a37d05d61601d643ef30f95dd2452048 upstream.

Now that fetch_pte returns the page-size of the pte, this
function can be optimized too.

Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 9e91d8c38a1e..db84a3c1254a 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3432,7 +3432,6 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
 {
 	struct protection_domain *domain = dom->priv;
 	unsigned long offset_mask, pte_pgsize;
-	phys_addr_t paddr;
 	u64 *pte, __pte;
 
 	if (domain->mode == PAGE_MODE_NONE)
@@ -3443,15 +3442,10 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
 	if (!pte || !IOMMU_PTE_PRESENT(*pte))
 		return 0;
 
-	if (PM_PTE_LEVEL(*pte) == 0)
-		offset_mask = PAGE_SIZE - 1;
-	else
-		offset_mask = PTE_PAGE_SIZE(*pte) - 1;
-
-	__pte = *pte & PM_ADDR_MASK;
-	paddr = (__pte & ~offset_mask) | (iova & offset_mask);
+	offset_mask = pte_pgsize - 1;
+	__pte	    = *pte & PM_ADDR_MASK;
 
-	return paddr;
+	return (__pte & ~offset_mask) | (iova & offset_mask);
 }
 
 static int amd_iommu_domain_has_cap(struct iommu_domain *domain,
-- 
2.4.2


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

* [PATCH 3.12 101/111] iommu/amd: Correctly encode huge pages in iommu page tables
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (99 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 100/111] iommu/amd: Optimize amd_iommu_iova_to_phys " Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 102/111] isdn: icn: use strlcpy() when parsing setup options Jiri Slaby
                   ` (11 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby

From: Joerg Roedel <jroedel@suse.de>

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

===============

commit d4b036648402bb4ef6d4a0df51375a2fb705b6cc upstream.

When a default page-size for given level should be mapped,
the level encoding must be 0 rather than 7. This fixes an
issue seen on IOMMUv2 hardware, where this encoding is
enforced.

Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index db84a3c1254a..27f9b8d433a3 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1444,19 +1444,20 @@ static int iommu_map_page(struct protection_domain *dom,
 	u64 __pte, *pte;
 	int i, count;
 
+	BUG_ON(!IS_ALIGNED(bus_addr, page_size));
+	BUG_ON(!IS_ALIGNED(phys_addr, page_size));
+
 	if (!(prot & IOMMU_PROT_MASK))
 		return -EINVAL;
 
-	bus_addr  = PAGE_ALIGN(bus_addr);
-	phys_addr = PAGE_ALIGN(phys_addr);
-	count     = PAGE_SIZE_PTE_COUNT(page_size);
-	pte       = alloc_pte(dom, bus_addr, page_size, NULL, GFP_KERNEL);
+	count = PAGE_SIZE_PTE_COUNT(page_size);
+	pte   = alloc_pte(dom, bus_addr, page_size, NULL, GFP_KERNEL);
 
 	for (i = 0; i < count; ++i)
 		if (IOMMU_PTE_PRESENT(pte[i]))
 			return -EBUSY;
 
-	if (page_size > PAGE_SIZE) {
+	if (count > 1) {
 		__pte = PAGE_SIZE_PTE(phys_addr, page_size);
 		__pte |= PM_LEVEL_ENC(7) | IOMMU_PTE_P | IOMMU_PTE_FC;
 	} else
-- 
2.4.2


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

* [PATCH 3.12 102/111] isdn: icn: use strlcpy() when parsing setup options
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (100 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 101/111] iommu/amd: Correctly encode huge pages in iommu page tables Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 103/111] EDAC: Properly unwind on failure path in edac_init() Jiri Slaby
                   ` (10 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Dan Carpenter, David S. Miller, Jiri Slaby

From: Dan Carpenter <dan.carpenter@oracle.com>

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

===============

commit 10640d34552ccd8fabe7b15b0c4e3a102247952d upstream.

If you pass an invalid string here then you probably deserve the memory
corruption, but it annoys static analysis tools so lets fix it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/isdn/icn/icn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index e74df7c4658f..af1577dd9825 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -1611,7 +1611,7 @@ icn_setup(char *line)
 	if (ints[0] > 1)
 		membase = (unsigned long)ints[2];
 	if (str && *str) {
-		strcpy(sid, str);
+		strlcpy(sid, str, sizeof(sid));
 		icn_id = sid;
 		if ((p = strchr(sid, ','))) {
 			*p++ = 0;
-- 
2.4.2


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

* [PATCH 3.12 103/111] EDAC: Properly unwind on failure path in edac_init()
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (101 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 102/111] isdn: icn: use strlcpy() when parsing setup options Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 104/111] NFC: pn533: fix error return code Jiri Slaby
                   ` (9 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alexey Khoroshilov, Borislav Petkov, Jiri Slaby

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

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

===============

commit c6b97bcf8e3ee6643a7f90a54d1ef3f9e12ec245 upstream.

edac_init() does not deallocate already allocated resources on failure
path.

Found by Linux Driver Verification project (linuxtesting.org).

 [ Boris: The unwind path functions have __exit annotation but are being
   used in an __init function, leading to section mismatches. Drop the
   section annotation and make them normal functions. ]

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Link: http://lkml.kernel.org/r/1423203162-26368-1-git-send-email-khoroshilov@ispras.ru
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/edac/edac_mc_sysfs.c |  4 ++--
 drivers/edac/edac_module.c   | 13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index e5bdf216effe..66f2ccfa5665 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -911,7 +911,7 @@ int __init edac_debugfs_init(void)
 	return 0;
 }
 
-void __exit edac_debugfs_exit(void)
+void edac_debugfs_exit(void)
 {
 	debugfs_remove(edac_debugfs);
 }
@@ -1165,7 +1165,7 @@ int __init edac_mc_sysfs_init(void)
 	return err;
 }
 
-void __exit edac_mc_sysfs_exit(void)
+void edac_mc_sysfs_exit(void)
 {
 	device_unregister(mci_pdev);
 	edac_put_sysfs_subsys();
diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
index a66941fea5a4..afda850b0b95 100644
--- a/drivers/edac/edac_module.c
+++ b/drivers/edac/edac_module.c
@@ -112,20 +112,23 @@ static int __init edac_init(void)
 
 	err = edac_mc_sysfs_init();
 	if (err)
-		goto error;
+		goto err_sysfs;
 
 	edac_debugfs_init();
 
-	/* Setup/Initialize the workq for this core */
 	err = edac_workqueue_setup();
 	if (err) {
-		edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n");
-		goto error;
+		edac_printk(KERN_ERR, EDAC_MC, "Failure initializing workqueue\n");
+		goto err_wq;
 	}
 
 	return 0;
 
-error:
+err_wq:
+	edac_debugfs_exit();
+	edac_mc_sysfs_exit();
+
+err_sysfs:
 	return err;
 }
 
-- 
2.4.2


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

* [PATCH 3.12 104/111] NFC: pn533: fix error return code
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (102 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 103/111] EDAC: Properly unwind on failure path in edac_init() Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 105/111] crypto: rng - RNGs must return 0 in success case Jiri Slaby
                   ` (8 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Julia Lawall, Samuel Ortiz, Jiri Slaby

From: Julia Lawall <Julia.Lawall@lip6.fr>

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

===============

commit 5df848f37b1d20e5dd64bea16ba9f69ed321e11b upstream.

Return a negative error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/nfc/pn533.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 5df730be88a3..30e50987b8df 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -2352,8 +2352,10 @@ static int pn533_data_exchange_complete(struct pn533 *dev, void *_arg,
 	}
 
 	skb = pn533_build_response(dev);
-	if (!skb)
+	if (!skb) {
+		rc = -ENOMEM;
 		goto error;
+	}
 
 	arg->cb(arg->cb_context, skb, 0);
 	kfree(arg);
-- 
2.4.2


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

* [PATCH 3.12 105/111] crypto: rng - RNGs must return 0 in success case
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (103 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 104/111] NFC: pn533: fix error return code Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 106/111] crypto: testmgr - fix RNG return code enforcement Jiri Slaby
                   ` (7 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Stephan Mueller, Herbert Xu, Jiri Slaby

From: Stephan Mueller <smueller@chronox.de>

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

===============

commit cde001e4c3c3625c60b68a83eb1f1c2572dee07a upstream.

Change the RNGs to always return 0 in success case.

This patch ensures that seqiv.c works with RNGs other than krng. seqiv
expects that any return code other than 0 is an error. Without the
patch, rfc4106(gcm(aes)) will not work when using a DRBG or an ANSI
X9.31 RNG.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 crypto/ansi_cprng.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c
index 6f5bebc9bf01..765fe7609348 100644
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -210,7 +210,11 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
 		byte_count = DEFAULT_BLK_SZ;
 	}
 
-	err = byte_count;
+	/*
+	 * Return 0 in case of success as mandated by the kernel
+	 * crypto API interface definition.
+	 */
+	err = 0;
 
 	dbgprint(KERN_CRIT "getting %d random bytes for context %p\n",
 		byte_count, ctx);
-- 
2.4.2


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

* [PATCH 3.12 106/111] crypto: testmgr - fix RNG return code enforcement
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (104 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 105/111] crypto: rng - RNGs must return 0 in success case Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 107/111] fork: report pid reservation failure properly Jiri Slaby
                   ` (6 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Stephan Mueller, Alexander Bergmann, Herbert Xu,
	Jiri Slaby

From: Stephan Mueller <smueller@chronox.de>

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

===============

commit 19e60e1392d110be03d794e2286dd6cfd779cbe3 upstream.

Due to the change to RNGs to always return zero in success case, the
invocation of the RNGs in the test manager must be updated as otherwise
the RNG self tests are not properly executed any more.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Alexander Bergmann <abergmann@suse.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 crypto/testmgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 93e508c39e3b..779a12dcb6a8 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1460,11 +1460,11 @@ static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template,
 		for (j = 0; j < template[i].loops; j++) {
 			err = crypto_rng_get_bytes(tfm, result,
 						   template[i].rlen);
-			if (err != template[i].rlen) {
+			if (err < 0) {
 				printk(KERN_ERR "alg: cprng: Failed to obtain "
 				       "the correct amount of random data for "
-				       "%s (requested %d, got %d)\n", algo,
-				       template[i].rlen, err);
+				       "%s (requested %d)\n", algo,
+				       template[i].rlen);
 				goto out;
 			}
 		}
-- 
2.4.2


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

* [PATCH 3.12 107/111] fork: report pid reservation failure properly
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (105 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 106/111] crypto: testmgr - fix RNG return code enforcement Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 108/111] MIPS: KVM: Do not sign extend on unsigned MMIO load Jiri Slaby
                   ` (5 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Michal Hocko, Oleg Nesterov, Eric W. Biederman,
	Michael Kerrisk, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Michal Hocko <mhocko@suse.cz>

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

===============

commit 35f71bc0a09a45924bed268d8ccd0d3407bc476f upstream.

copy_process will report any failure in alloc_pid as ENOMEM currently
which is misleading because the pid allocation might fail not only when
the memory is short but also when the pid space is consumed already.

The current man page even mentions this case:

: EAGAIN
:
:       A system-imposed limit on the number of threads was encountered.
:       There are a number of limits that may trigger this error: the
:       RLIMIT_NPROC soft resource limit (set via setrlimit(2)), which
:       limits the number of processes and threads for a real user ID, was
:       reached; the kernel's system-wide limit on the number of processes
:       and threads, /proc/sys/kernel/threads-max, was reached (see
:       proc(5)); or the maximum number of PIDs, /proc/sys/kernel/pid_max,
:       was reached (see proc(5)).

so the current behavior is also incorrect wrt.  documentation.  POSIX man
page also suggest returing EAGAIN when the process count limit is reached.

This patch simply propagates error code from alloc_pid and makes sure we
return -EAGAIN due to reservation failure.  This will make behavior of
fork closer to both our documentation and POSIX.

alloc_pid might alsoo fail when the reaper in the pid namespace is dead
(the namespace basically disallows all new processes) and there is no
good error code which would match documented ones. We have traditionally
returned ENOMEM for this case which is misleading as well but as per
Eric W. Biederman this behavior is documented in man pid_namespaces(7)

: If the "init" process of a PID namespace terminates, the kernel
: terminates all of the processes in the namespace via a SIGKILL signal.
: This behavior reflects the fact that the "init" process is essential for
: the correct operation of a PID namespace.  In this case, a subsequent
: fork(2) into this PID namespace will fail with the error ENOMEM; it is
: not possible to create a new processes in a PID namespace whose "init"
: process has terminated.

and introducing a new error code would be too risky so let's stick to
ENOMEM for this case.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/fork.c |  5 +++--
 kernel/pid.c  | 15 ++++++++-------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 5b486126147f..982a36db1593 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1362,10 +1362,11 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 		goto bad_fork_cleanup_io;
 
 	if (pid != &init_struct_pid) {
-		retval = -ENOMEM;
 		pid = alloc_pid(p->nsproxy->pid_ns_for_children);
-		if (!pid)
+		if (IS_ERR(pid)) {
+			retval = PTR_ERR(pid);
 			goto bad_fork_cleanup_io;
+		}
 	}
 
 	p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
diff --git a/kernel/pid.c b/kernel/pid.c
index 82430c858d69..bbb805ccd893 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -179,7 +179,7 @@ static int alloc_pidmap(struct pid_namespace *pid_ns)
 			spin_unlock_irq(&pidmap_lock);
 			kfree(page);
 			if (unlikely(!map->page))
-				break;
+				return -ENOMEM;
 		}
 		if (likely(atomic_read(&map->nr_free))) {
 			for ( ; ; ) {
@@ -207,7 +207,7 @@ static int alloc_pidmap(struct pid_namespace *pid_ns)
 		}
 		pid = mk_pid(pid_ns, map, offset);
 	}
-	return -1;
+	return -EAGAIN;
 }
 
 int next_pidmap(struct pid_namespace *pid_ns, unsigned int last)
@@ -298,17 +298,20 @@ struct pid *alloc_pid(struct pid_namespace *ns)
 	int i, nr;
 	struct pid_namespace *tmp;
 	struct upid *upid;
+	int retval = -ENOMEM;
 
 	pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL);
 	if (!pid)
-		goto out;
+		return ERR_PTR(retval);
 
 	tmp = ns;
 	pid->level = ns->level;
 	for (i = ns->level; i >= 0; i--) {
 		nr = alloc_pidmap(tmp);
-		if (nr < 0)
+		if (IS_ERR_VALUE(nr)) {
+			retval = nr;
 			goto out_free;
+		}
 
 		pid->numbers[i].nr = nr;
 		pid->numbers[i].ns = tmp;
@@ -336,7 +339,6 @@ struct pid *alloc_pid(struct pid_namespace *ns)
 	}
 	spin_unlock_irq(&pidmap_lock);
 
-out:
 	return pid;
 
 out_unlock:
@@ -348,8 +350,7 @@ out_free:
 		free_pidmap(pid->numbers + i);
 
 	kmem_cache_free(ns->pid_cachep, pid);
-	pid = NULL;
-	goto out;
+	return ERR_PTR(retval);
 }
 
 void disable_pid_allocation(struct pid_namespace *ns)
-- 
2.4.2


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

* [PATCH 3.12 108/111] MIPS: KVM: Do not sign extend on unsigned MMIO load
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (106 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 107/111] fork: report pid reservation failure properly Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 109/111] W1: ds2490: Increase timeout when waiting for status Jiri Slaby
                   ` (4 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Nicholas Mc Guire, Gleb Natapov, Paolo Bonzini,
	kvm, linux-mips, Ralf Baechle, Jiri Slaby

From: Nicholas Mc Guire <hofrat@osadl.org>

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

===============

commit ed9244e6c534612d2b5ae47feab2f55a0d4b4ced upstream.

Fix possible unintended sign extension in unsigned MMIO loads by casting
to uint16_t in the case of mmio_needed != 2.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9985/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/kvm/kvm_mips_emul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c
index e75ef8219caf..c76f297b7149 100644
--- a/arch/mips/kvm/kvm_mips_emul.c
+++ b/arch/mips/kvm/kvm_mips_emul.c
@@ -1626,7 +1626,7 @@ kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run)
 		if (vcpu->mmio_needed == 2)
 			*gpr = *(int16_t *) run->mmio.data;
 		else
-			*gpr = *(int16_t *) run->mmio.data;
+			*gpr = *(uint16_t *)run->mmio.data;
 
 		break;
 	case 1:
-- 
2.4.2


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

* [PATCH 3.12 109/111] W1: ds2490: Increase timeout when waiting for status
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (107 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 108/111] MIPS: KVM: Do not sign extend on unsigned MMIO load Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 110/111] lsm: copy comm before calling audit_log to avoid race in string printing Jiri Slaby
                   ` (3 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alexander Stein, Greg Kroah-Hartman, Jiri Slaby

From: Alexander Stein <alexanders83@web.de>

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

===============

commit d25221525e0e2cfd70e4ec7216549c06609a8bd2 upstream.

Adjust the bulk message timeout to the other ones (1000ms). Otherwise the
following dmesg errors can be seen on a Raspberry Pi:
[   31.492386] Failed to read 1-wire data from 0x81: err=-110.
[   31.504168] 0x81: count=-110, status:
[   31.613404] Failed to read 1-wire data from 0x81: err=-110.
[   31.621915] 0x81: count=-110, status:
[   43.260968] Failed to read 1-wire data from 0x81: err=-110.
[   43.270998] 0x81: count=-110, status:
[   43.379959] Failed to read 1-wire data from 0x81: err=-110.
[   43.388854] 0x81: count=-110, status:

Signed-off-by: Alexander Stein <alexanders83@web.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/w1/masters/ds2490.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 4f7e1d770f81..dd8b116803d6 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -246,7 +246,7 @@ static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st,
 	memset(st, 0, sizeof(*st));
 
 	count = 0;
-	err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_STATUS]), buf, size, &count, 100);
+	err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_STATUS]), buf, size, &count, 1000);
 	if (err < 0) {
 		printk(KERN_ERR "Failed to read 1-wire data from 0x%x: err=%d.\n", dev->ep[EP_STATUS], err);
 		return err;
-- 
2.4.2


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

* [PATCH 3.12 110/111] lsm: copy comm before calling audit_log to avoid race in string printing
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (108 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 109/111] W1: ds2490: Increase timeout when waiting for status Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 15:27 ` [PATCH 3.12 111/111] m68k/mac: Fix out-of-bounds array index in OSS IRQ source initialization Jiri Slaby
                   ` (2 subsequent siblings)
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Richard Guy Briggs, James Morris, Jiri Slaby

From: Richard Guy Briggs <rgb@redhat.com>

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

===============

commit 5deeb5cece3f9b30c8129786726b9d02c412c8ca upstream.

When task->comm is passed directly to audit_log_untrustedstring() without
getting a copy or using the task_lock, there is a race that could happen that
would output a NULL (\0) in the middle of the output string that would
effectively truncate the rest of the report text after the comm= field in the
audit log message, losing fields.

Using get_task_comm() to get a copy while acquiring the task_lock to prevent
this and to prevent the result from being a mixture of old and new values of
comm would incur potentially unacceptable overhead, considering that the value
can be influenced by userspace and therefore untrusted anyways.

Copy the value before passing it to audit_log_untrustedstring() ensures that a
local copy is used to calculate the length *and* subsequently printed.  Even if
this value contains a mix of old and new values, it will only calculate and
copy up to the first NULL, preventing the rest of the audit log message being
truncated.

Use a second local copy of comm to avoid a race between the first and second
calls to audit_log_untrustedstring() with comm.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 security/lsm_audit.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 8d8d97dbb389..7537013d4042 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -211,7 +211,7 @@ static inline void print_ipv4_addr(struct audit_buffer *ab, __be32 addr,
 static void dump_common_audit_data(struct audit_buffer *ab,
 				   struct common_audit_data *a)
 {
-	struct task_struct *tsk = current;
+	char comm[sizeof(current->comm)];
 
 	/*
 	 * To keep stack sizes in check force programers to notice if they
@@ -220,8 +220,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
 	 */
 	BUILD_BUG_ON(sizeof(a->u) > sizeof(void *)*2);
 
-	audit_log_format(ab, " pid=%d comm=", tsk->pid);
-	audit_log_untrustedstring(ab, tsk->comm);
+	audit_log_format(ab, " pid=%d comm=", current->pid);
+	audit_log_untrustedstring(ab, memcpy(comm, current->comm, sizeof(comm)));
 
 	switch (a->type) {
 	case LSM_AUDIT_DATA_NONE:
@@ -276,13 +276,16 @@ static void dump_common_audit_data(struct audit_buffer *ab,
 		audit_log_format(ab, " ino=%lu", inode->i_ino);
 		break;
 	}
-	case LSM_AUDIT_DATA_TASK:
-		tsk = a->u.tsk;
+	case LSM_AUDIT_DATA_TASK: {
+		struct task_struct *tsk = a->u.tsk;
 		if (tsk && tsk->pid) {
+			char comm[sizeof(tsk->comm)];
 			audit_log_format(ab, " pid=%d comm=", tsk->pid);
-			audit_log_untrustedstring(ab, tsk->comm);
+			audit_log_untrustedstring(ab,
+			    memcpy(comm, tsk->comm, sizeof(comm)));
 		}
 		break;
+	}
 	case LSM_AUDIT_DATA_NET:
 		if (a->u.net->sk) {
 			struct sock *sk = a->u.net->sk;
-- 
2.4.2


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

* [PATCH 3.12 111/111] m68k/mac: Fix out-of-bounds array index in OSS IRQ source initialization
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (109 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 110/111] lsm: copy comm before calling audit_log to avoid race in string printing Jiri Slaby
@ 2015-06-10 15:27 ` Jiri Slaby
  2015-06-10 17:02 ` [PATCH 3.12 000/111] 3.12.44-stable review Guenter Roeck
  2015-06-10 17:14 ` Shuah Khan
  112 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-10 15:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Finn Thain, Geert Uytterhoeven, Jiri Slaby

From: Finn Thain <fthain@telegraphics.com.au>

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

===============

commit b24f670b7f5b2058b95370caa9f104b3cefb9f1d upstream.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/m68k/mac/oss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 6c4c882c126e..f32a8817cc79 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -48,9 +48,8 @@ void __init oss_init(void)
 	/* Disable all interrupts. Unlike a VIA it looks like we    */
 	/* do this by setting the source's interrupt level to zero. */
 
-	for (i = 0; i <= OSS_NUM_SOURCES; i++) {
+	for (i = 0; i < OSS_NUM_SOURCES; i++)
 		oss->irq_level[i] = 0;
-	}
 }
 
 /*
-- 
2.4.2


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

* Re: [PATCH 3.12 000/111] 3.12.44-stable review
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (110 preceding siblings ...)
  2015-06-10 15:27 ` [PATCH 3.12 111/111] m68k/mac: Fix out-of-bounds array index in OSS IRQ source initialization Jiri Slaby
@ 2015-06-10 17:02 ` Guenter Roeck
  2015-06-15 13:20   ` Jiri Slaby
  2015-06-10 17:14 ` Shuah Khan
  112 siblings, 1 reply; 115+ messages in thread
From: Guenter Roeck @ 2015-06-10 17:02 UTC (permalink / raw)
  To: Jiri Slaby, stable; +Cc: shuah.kh, linux-kernel

On 06/10/2015 08:27 AM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.44 release.
> There are 111 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 Jun 12 15:30:52 CEST 2015.
> Anything received after that time might be too late.
>

Build results:
	total: 117 pass: 117 fail: 0
Qemu test results:
	total: 27 pass: 27 fail: 0

Details are available at http://server.roeck-us.net:8010/builders.

Guenter


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

* Re: [PATCH 3.12 000/111] 3.12.44-stable review
  2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
                   ` (111 preceding siblings ...)
  2015-06-10 17:02 ` [PATCH 3.12 000/111] 3.12.44-stable review Guenter Roeck
@ 2015-06-10 17:14 ` Shuah Khan
  112 siblings, 0 replies; 115+ messages in thread
From: Shuah Khan @ 2015-06-10 17:14 UTC (permalink / raw)
  To: Jiri Slaby, stable; +Cc: linux, shuah.kh, linux-kernel

On 06/10/2015 09:27 AM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.44 release.
> There are 111 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 Jun 12 15:30:52 CEST 2015.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.44-rc1.xz
> and the diffstat can be found below.
> 
> thanks,
> js
> 

Compiled and booted on my test system. No dmesg regressions.

-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH 3.12 000/111] 3.12.44-stable review
  2015-06-10 17:02 ` [PATCH 3.12 000/111] 3.12.44-stable review Guenter Roeck
@ 2015-06-15 13:20   ` Jiri Slaby
  0 siblings, 0 replies; 115+ messages in thread
From: Jiri Slaby @ 2015-06-15 13:20 UTC (permalink / raw)
  To: Guenter Roeck, shuah.kh; +Cc: stable, linux-kernel

On 06/10/2015, 07:02 PM, Guenter Roeck wrote:
> On 06/10/2015 08:27 AM, Jiri Slaby wrote:
>> This is the start of the stable review cycle for the 3.12.44 release.
>> There are 111 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 Jun 12 15:30:52 CEST 2015.
>> Anything received after that time might be too late.
>>
> 
> Build results:
>     total: 117 pass: 117 fail: 0
> Qemu test results:
>     total: 27 pass: 27 fail: 0
> 
> Details are available at http://server.roeck-us.net:8010/builders.

On 06/10/2015, 07:14 PM, Shuah Khan wrote:
> Compiled and booted on my test system. No dmesg regressions.

Thank you both!

-- 
js
suse labs

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

end of thread, other threads:[~2015-06-15 13:20 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 15:27 [PATCH 3.12 000/111] 3.12.44-stable review Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 001/111] netfilter: Zero the tuple in nfnl_cthelper_parse_tuple() Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 002/111] gpio: squelch a compiler warning Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 003/111] libata: Update Crucial/Micron blacklist Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 004/111] libata: Blacklist queued TRIM on all Samsung 800-series Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 005/111] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 006/111] hpsa: refine the pci enable/disable handling Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 007/111] hpsa: add missing pci_set_master in kdump path Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 008/111] hpsa: turn off interrupts when kdump starts Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 009/111] aio: change exit_aio() to load mm->ioctx_table once and avoid rcu_read_lock() Jiri Slaby
2015-06-10 15:25 ` [PATCH 3.12 010/111] aio: fix serial draining in exit_aio() Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 011/111] mnt: Fail collect_mounts when applied to unmounted mounts Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 012/111] cn: verify msg->len before making callback Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 013/111] HID: debug: fix error handling in hid_debug_events_read() Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 014/111] Input: usbtouchscreen - add new model from IRTOUCHSYSTEMS Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 015/111] Input: cros_ec_keyb - fix clearing keyboard state on wakeup Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 016/111] Input: xpad - add support for Xbox One controllers Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 017/111] Input: xpad - add Thrustmaster as Xbox 360 controller vendor Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 018/111] Input: xpad - add rumble support for Xbox One controller Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 019/111] usb: chipidea: debug: avoid out of bound read Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 020/111] Added another USB product ID for ELAN touchscreen quirks Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 021/111] staging: wlags49_h2: fix extern inline functions Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 022/111] staging, rtl8192e, LLVMLinux: Change extern inline to static inline Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 023/111] staging: rtl8712, rtl8712: avoid lots of build warnings Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 024/111] staging, rtl8192e, LLVMLinux: Remove unused inline prototype Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 025/111] kernel: use the gnu89 standard explicitly Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 026/111] qla2xxx: remove redundant declaration in 'qla_gbl.h' Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 027/111] amd64_edac: Add support for newer F16h models Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 028/111] hwmon: (k10temp) Add support for AMD F16 M30h processor Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 029/111] hwmon: (k10temp) Add support for F15h M60h Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 030/111] storvsc: Set the SRB flags correctly when no data transfer is needed Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 031/111] perf/x86/amd/ibs: Update IBS MSRs and feature definitions Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 032/111] powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 033/111] vhost/scsi: potential memory corruption Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 034/111] Fix corrupt SMB2 ioctl requests Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 035/111] rtlwifi: rtl8192cu: Fix kernel deadlock Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 036/111] ARM: fix missing syscall trace exit Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 037/111] mm: numa: initialise numa balancing after jump label initialisation Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 038/111] KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 039/111] net: socket: Fix the wrong returns for recvmsg and sendmsg Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 040/111] fs, omfs: add NULL terminator in the end up the token list Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 041/111] lguest: fix out-by-one error in address checking Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 042/111] libceph: request a new osdmap if lingering request maps to no osd Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 043/111] xen/events: don't bind non-percpu VIRQs with percpu chip Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 044/111] hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 045/111] hwmon: (nct6775) Add missing sysfs attribute initialization Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 046/111] lib: Fix strnlen_user() to not touch memory after specified maximum Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 047/111] d_walk() might skip too much Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 048/111] ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 049/111] ALSA: hda - Add headphone quirk for Lifebook E752 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 050/111] ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 051/111] ASoC: wm8960: fix "RINPUT3" audio route error Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 052/111] ASoC: wm8994: correct BCLK DIV 348 to 384 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 053/111] target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 054/111] xhci: fix isoc endpoint dequeue from advancing too far on transaction error Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 055/111] xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 056/111] xhci: gracefully handle xhci_irq dead device Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 057/111] USB: visor: Match I330 phone more precisely Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 058/111] USB: pl2303: Remove support for Samsung I330 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 059/111] USB: cp210x: add ID for KCF Technologies PRN device Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 060/111] usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 061/111] usb: gadget: configfs: Fix interfaces array NULL-termination Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 062/111] powerpc: Align TOC to 256 bytes Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 063/111] mmc: atmel-mci: fix bad variable type for clkdiv Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 064/111] ext4: fix NULL pointer dereference when journal restart fails Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 065/111] ext4: check for zero length extent explicitly Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 066/111] jbd2: fix r_count overflows leading to buffer overflow in journal recovery Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 067/111] libata: Add helper to determine when PHY events should be ignored Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 068/111] libata: Ignore spurious PHY event on LPM policy change Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 069/111] rt2x00: add new rt2800usb device DWA 130 Jiri Slaby
2015-06-10 15:26 ` [PATCH 3.12 070/111] gpio: gpio-kempld: Fix get_direction return value Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 071/111] crypto: s390/ghash - Fix incorrect ghash icv buffer handling Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 072/111] mac80211: move WEP tailroom size check Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 073/111] ARM: dts: imx27: only map 4 Kbyte for fec registers Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 074/111] mm, numa: really disable NUMA balancing by default on single node machines Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 075/111] svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 076/111] thermal: step_wise: Revert optimization Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 077/111] md/raid5: don't record new size if resize_stripes fails Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 078/111] Input: elantech - fix semi-mt protocol for v3 HW Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 079/111] sd: Disable support for 256 byte/sector disks Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 080/111] ACPI / init: Fix the ordering of acpi_reserve_resources() Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 081/111] drm/radeon: add new bonaire pci id Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 082/111] drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 083/111] drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling" Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 084/111] vfs: read file_handle only once in handle_to_path Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 085/111] fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 086/111] drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h" Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 087/111] drivers: staging: rtl8188eu: use 'ccflags-y' instead of EXTRA_CFLAGS in Makefile Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 088/111] dgnc: Move DG_PART definition from Makefile to dgnc_driver.h Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 089/111] x86: bpf_jit: fix compilation of large bpf programs Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 090/111] ipv4: Avoid crashing in ip_error Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 091/111] bridge: fix parsing of MLDv2 reports Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 092/111] net: dp83640: fix broken calibration routine Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 093/111] unix/caif: sk_socket can disappear when state is unlocked Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 094/111] net_sched: invoke ->attach() after setting dev->qdisc Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 095/111] udp: fix behavior of wrong checksums Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 096/111] xen: netback: read hotplug script once at start of day Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 097/111] iommu/amd: Return the pte page-size in fetch_pte Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 098/111] iommu/amd: Optimize iommu_unmap_page for new fetch_pte interface Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 099/111] iommu/amd: Optimize alloc_new_range " Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 100/111] iommu/amd: Optimize amd_iommu_iova_to_phys " Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 101/111] iommu/amd: Correctly encode huge pages in iommu page tables Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 102/111] isdn: icn: use strlcpy() when parsing setup options Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 103/111] EDAC: Properly unwind on failure path in edac_init() Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 104/111] NFC: pn533: fix error return code Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 105/111] crypto: rng - RNGs must return 0 in success case Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 106/111] crypto: testmgr - fix RNG return code enforcement Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 107/111] fork: report pid reservation failure properly Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 108/111] MIPS: KVM: Do not sign extend on unsigned MMIO load Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 109/111] W1: ds2490: Increase timeout when waiting for status Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 110/111] lsm: copy comm before calling audit_log to avoid race in string printing Jiri Slaby
2015-06-10 15:27 ` [PATCH 3.12 111/111] m68k/mac: Fix out-of-bounds array index in OSS IRQ source initialization Jiri Slaby
2015-06-10 17:02 ` [PATCH 3.12 000/111] 3.12.44-stable review Guenter Roeck
2015-06-15 13:20   ` Jiri Slaby
2015-06-10 17:14 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).