linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.12 01/56] bcache: Minor journal fix
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 02/56] usb: musb: cppi41: fire hrtimer according to programmed channel length Jiri Slaby
                   ` (56 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Kent Overstreet, Jiri Slaby

From: Kent Overstreet <kmo@daterainc.com>

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

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

commit b3fa7e77e67e647db3db2166b65083a427d84ed3 upstream.

The real fix is where we check the bytes we need against how much is
remaining - we also need to check for a journal entry bigger than our
buffer, we'll never write those and it would be bad if we tried to read
one.

Also improve the diagnostic messages.

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/bcache/journal.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index 8435f81e5d85..c4943793cb86 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -42,11 +42,11 @@ static int journal_read_bucket(struct cache *ca, struct list_head *list,
 	int ret = 0;
 	sector_t bucket = bucket_to_sector(ca->set, ca->sb.d[bucket_index]);
 
-	pr_debug("reading %llu", (uint64_t) bucket);
+	pr_debug("reading %u", bucket_index);
 
 	while (offset < ca->sb.bucket_size) {
 reread:		left = ca->sb.bucket_size - offset;
-		len = min_t(unsigned, left, PAGE_SECTORS * 8);
+		len = min_t(unsigned, left, PAGE_SECTORS << JSET_BITS);
 
 		bio_reset(bio);
 		bio->bi_sector	= bucket + offset;
@@ -72,17 +72,26 @@ reread:		left = ca->sb.bucket_size - offset;
 			struct list_head *where;
 			size_t blocks, bytes = set_bytes(j);
 
-			if (j->magic != jset_magic(ca->set))
+			if (j->magic != jset_magic(ca->set)) {
+				pr_debug("%u: bad magic", bucket_index);
 				return ret;
+			}
 
-			if (bytes > left << 9)
+			if (bytes > left << 9 ||
+			    bytes > PAGE_SIZE << JSET_BITS) {
+				pr_info("%u: too big, %zu bytes, offset %u",
+					bucket_index, bytes, offset);
 				return ret;
+			}
 
 			if (bytes > len << 9)
 				goto reread;
 
-			if (j->csum != csum_set(j))
+			if (j->csum != csum_set(j)) {
+				pr_info("%u: bad csum, %zu bytes, offset %u",
+					bucket_index, bytes, offset);
 				return ret;
+			}
 
 			blocks = set_blocks(j, ca->set);
 
-- 
2.1.0


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

* [PATCH 3.12 02/56] usb: musb: cppi41: fire hrtimer according to programmed channel length
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 01/56] bcache: Minor journal fix Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 03/56] USB: serial: cp210x: Removing unncessary `usb_reset_device` on startup Jiri Slaby
                   ` (55 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Daniel Mack, Felipe Balbi, Jiri Slaby

From: Daniel Mack <zonque@gmail.com>

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

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

commit 50aea6fca771d6daf3ec24f771da866f7fd836e4 upstream.

The musb/cppi41 code installs a hrtimer to work around DMA completion
interrupts that have fired too early on AM335x hardware. This timer
is currently programmed to first fire 140 microseconds after the DMA
completion callback. According to the commit which introduced it
(a655f481d83, "usb: musb: musb_cppi41: handle pre-mature TX complete
interrupt"), that value is is considered a 'rule of thumb' that worked
well with the test case described in the commit log.

Test show, however, that for USB audio devices and much smaller packet
sizes, the timer has to fire earlier in order to correctly handle the audio
stream. The original test case had output transfer sizes of 1514 bytes, and
a delay of 140 microseconds. For audio devices with 24 bytes channel size, 3
microseconds seem to work well.

Hence, let's assume that the time it takes to clear the bit correlates with
the number of bytes transferred. The referenced commit log mentions such a
suspicion as well. Let the timer fire in cppi41_channel->total_len/10
microseconds to correctly handle both cases.

Also, shorten the interval in which the timer fires again in case of
a non-empty early_tx list.

With these changes in place, both FS and HS audio devices appear to work
well on AM335x hardware.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Sebastian Reimers <sebastian.reimers@googlemail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/musb/musb_cppi41.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index cc319305c022..bd6cc0bea150 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -193,7 +193,7 @@ static enum hrtimer_restart cppi41_recheck_tx_req(struct hrtimer *timer)
 	if (!list_empty(&controller->early_tx_list)) {
 		ret = HRTIMER_RESTART;
 		hrtimer_forward_now(&controller->early_tx,
-				ktime_set(0, 150 * NSEC_PER_USEC));
+				ktime_set(0, 50 * NSEC_PER_USEC));
 	}
 
 	spin_unlock_irqrestore(&musb->lock, flags);
@@ -267,8 +267,10 @@ static void cppi41_dma_callback(void *private_data)
 		list_add_tail(&cppi41_channel->tx_check,
 				&controller->early_tx_list);
 		if (!hrtimer_is_queued(&controller->early_tx)) {
+			unsigned long usecs = cppi41_channel->total_len / 10;
+
 			hrtimer_start_range_ns(&controller->early_tx,
-				ktime_set(0, 140 * NSEC_PER_USEC),
+				ktime_set(0, usecs * NSEC_PER_USEC),
 				40 * NSEC_PER_USEC,
 				HRTIMER_MODE_REL);
 		}
-- 
2.1.0


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

* [PATCH 3.12 03/56] USB: serial: cp210x: Removing unncessary `usb_reset_device` on startup
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 01/56] bcache: Minor journal fix Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 02/56] usb: musb: cppi41: fire hrtimer according to programmed channel length Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 04/56] USB: add reset resume quirk for usb3503 Jiri Slaby
                   ` (54 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Preston Fick, Johan Hovold, Greg Kroah-Hartman, Jiri Slaby

From: Preston Fick <preston.fick@silabs.com>

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

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

commit 934ef5aca9daea10507eebcbd0fb8f6d57d55359 upstream.

This `usb_reset_device` command has been around since the driver was
originally reverse engineered. It doesn't cause much issue on single
interface CP210x devices, but on the CP2105 and CP2108 with 2 and 4
interfaces respectively it will cause instability on enumeration and
delays enumeration noticably. There should be no reason to reset a device
at startup, per the CP210x AN571 spec.

Signed-off-by: Preston Fick <preston.fick@silabs.com>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/cp210x.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 1db213a6e843..e5ac744ac73f 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -860,9 +860,6 @@ static int cp210x_startup(struct usb_serial *serial)
 	struct usb_host_interface *cur_altsetting;
 	struct cp210x_serial_private *spriv;
 
-	/* cp210x buffers behave strangely unless device is reset */
-	usb_reset_device(serial->dev);
-
 	spriv = kzalloc(sizeof(*spriv), GFP_KERNEL);
 	if (!spriv)
 		return -ENOMEM;
-- 
2.1.0


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

* [PATCH 3.12 04/56] USB: add reset resume quirk for usb3503
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (2 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 03/56] USB: serial: cp210x: Removing unncessary `usb_reset_device` on startup Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 05/56] usb-core bInterval quirk Jiri Slaby
                   ` (53 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Joonyoung Shim, Greg Kroah-Hartman, Jiri Slaby

From: Joonyoung Shim <jy0922.shim@samsung.com>

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

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

commit 526a4045c60fbaede88ec95a69a73059dff02160 upstream.

The usb device will autoresume from choose_wakeup() if it is
autosuspended with the wrong wakeup setting, but below errors occur
because usb3503 misc driver will switch to standby mode when suspended.

As add USB_QUIRK_RESET_RESUME, it can stop setting wrong wakeup from
autosuspend_check().

[    7.734717] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    7.854658] usb 1-3: device descriptor read/64, error -71
[    8.079657] usb 1-3: device descriptor read/64, error -71
[    8.294664] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    8.414658] usb 1-3: device descriptor read/64, error -71
[    8.639657] usb 1-3: device descriptor read/64, error -71
[    8.854667] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    9.264598] usb 1-3: device not accepting address 3, error -71
[    9.374655] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    9.784601] usb 1-3: device not accepting address 3, error -71
[    9.784838] usb usb1-port3: device 1-3 not suspended yet

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.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 1053eb651b2f..31f7ebf55868 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -154,6 +154,9 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* INTEL VALUE SSD */
 	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* USB3503 */
+	{ USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	{ }  /* terminating entry must be last */
 };
 
-- 
2.1.0


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

* [PATCH 3.12 05/56] usb-core bInterval quirk
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (3 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 04/56] USB: add reset resume quirk for usb3503 Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 06/56] USB: core: hcd-pci: free IRQ before disabling PCI device when shutting down Jiri Slaby
                   ` (52 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, James P Michels III, Greg Kroah-Hartman, Jiri Slaby

From: James P Michels III <james.p.michels@gmail.com>

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

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

commit cd83ce9e6195aa3ea15ab4db92892802c20df5d0 upstream.

This patch adds a usb quirk to support devices with interupt endpoints
and bInterval values expressed as microframes. The quirk causes the
parse endpoint function to modify the reported bInterval to a standards
conforming value.

There is currently code in the endpoint parser that checks for
bIntervals that are outside of the valid range (1-16 for USB 2+ high
speed and super speed interupt endpoints). In this case, the code assumes
the bInterval is being reported in 1ms frames. As well, the correction
is only applied if the original bInterval value is out of the 1-16 range.

With this quirk applied to the device, the bInterval will be
accurately adjusted from microframes to an exponent.

Signed-off-by: James P Michels III <james.p.michels@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/core/config.c  | 11 +++++++++++
 drivers/usb/core/quirks.c  |  4 ++++
 include/linux/usb/quirks.h | 11 +++++++++++
 3 files changed, 26 insertions(+)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 652438325197..98cb09617b20 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -201,6 +201,17 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
 			if (n == 0)
 				n = 9;	/* 32 ms = 2^(9-1) uframes */
 			j = 16;
+
+			/*
+			 * Adjust bInterval for quirked devices.
+			 * This quirk fixes bIntervals reported in
+			 * linear microframes.
+			 */
+			if (to_usb_device(ddev)->quirks &
+				USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL) {
+				n = clamp(fls(d->bInterval), i, j);
+				i = j = n;
+			}
 			break;
 		default:		/* USB_SPEED_FULL or _LOW */
 			/* For low-speed, 10 ms is the official minimum.
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 31f7ebf55868..6fd22252273c 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -147,6 +147,10 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* SKYMEDI USB_DRIVE */
 	{ USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* Razer - Razer Blade Keyboard */
+	{ USB_DEVICE(0x1532, 0x0116), .driver_info =
+			USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
+
 	/* BUILDWIN Photo Frame */
 	{ USB_DEVICE(0x1908, 0x1315), .driver_info =
 			USB_QUIRK_HONOR_BNUMINTERFACES },
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 52f944dfe2fd..55a17b188daa 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -30,4 +30,15 @@
    descriptor */
 #define USB_QUIRK_DELAY_INIT		0x00000040
 
+/*
+ * For high speed and super speed interupt endpoints, the USB 2.0 and
+ * USB 3.0 spec require the interval in microframes
+ * (1 microframe = 125 microseconds) to be calculated as
+ * interval = 2 ^ (bInterval-1).
+ *
+ * Devices with this quirk report their bInterval as the result of this
+ * calculation instead of the exponent variable used in the calculation.
+ */
+#define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL	0x00000080
+
 #endif /* __LINUX_USB_QUIRKS_H */
-- 
2.1.0


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

* [PATCH 3.12 06/56] USB: core: hcd-pci: free IRQ before disabling PCI device when shutting down
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (4 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 05/56] usb-core bInterval quirk Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 07/56] HID: add quirk for 0x04d9:0xa096 device Jiri Slaby
                   ` (51 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jiang Liu, Greg Kroah-Hartman, Jiri Slaby

From: Jiang Liu <jiang.liu@linux.intel.com>

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

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

commit c5946f9d286ad368329c79107fdf4d825d2091bd upstream.

The assigned IRQ should be freed before calling pci_disable_device()
when shutting down system, otherwise it will cause following warning.
[  568.879482] ------------[ cut here ]------------
[  568.884236] WARNING: CPU: 1 PID: 3300 at /home/konrad/ssd/konrad/xtt-i386/bootstrap/linux-usb/fs/proc/generic.c:521 remove_proc_entry+0x165/0x170()
[  568.897846] remove_proc_entry: removing non-empty directory 'irq/16', leaking at least 'ohci_hcd:usb4'
[  568.907430] Modules linked in: dm_multipath dm_mod iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c_generic sg sd_mod crct10dif_generic crc_t10dif crct10dif_common radeon fbcon tileblit ttm font bitblit softcursor ata_generic ahci libahci drm_kms_helper skge r8169 libata mii scsi_mod wmi acpi_cpufreq
[  568.938539] CPU: 1 PID: 3300 Comm: init Tainted: G        W     3.16.0-rc5upstream-01651-g03b9189 #1
[  568.947946] Hardware name: ECS A780GM-A Ultra/A780GM-A Ultra, BIOS 080015  04/01/2010
[  568.956008]  00000209 ed0f1cd0 c1617946 c175403c ed0f1d00 c1090c3f c1754084 ed0f1d2c
[  568.964068]  00000ce4 c175403c 00000209 c11f22a5 c11f22a5 f755e8c0 ed0f1d78 f755e90d
[  568.972128]  ed0f1d18 c1090cde 00000009 ed0f1d10 c1754084 ed0f1d2c ed0f1d60 c11f22a5
[  568.980194] Call Trace:
[  568.982715]  [<c1617946>] dump_stack+0x48/0x60
[  568.987294]  [<c1090c3f>] warn_slowpath_common+0x7f/0xa0
[  569.003887]  [<c1090cde>] warn_slowpath_fmt+0x2e/0x30
[  569.009092]  [<c11f22a5>] remove_proc_entry+0x165/0x170
[  569.014476]  [<c10da6ca>] unregister_irq_proc+0xaa/0xc0
[  569.019858]  [<c10d582f>] free_desc+0x1f/0x60
[  569.024346]  [<c10d58aa>] irq_free_descs+0x3a/0x80
[  569.029283]  [<c10d9e9d>] irq_dispose_mapping+0x2d/0x50
[  569.034666]  [<c1078fd3>] mp_unmap_irq+0x73/0xa0
[  569.039423]  [<c107196b>] acpi_unregister_gsi_ioapic+0x2b/0x40
[  569.045431]  [<c107180f>] acpi_unregister_gsi+0xf/0x20
[  569.050725]  [<c1339cad>] acpi_pci_irq_disable+0x4b/0x50
[  569.056196]  [<c14daa38>] pcibios_disable_device+0x18/0x20
[  569.061848]  [<c130123d>] do_pci_disable_device+0x4d/0x60
[  569.067410]  [<c13012b7>] pci_disable_device+0x47/0xb0
[  569.077814]  [<c14800b1>] usb_hcd_pci_shutdown+0x31/0x40
[  569.083285]  [<c1304b19>] pci_device_shutdown+0x19/0x50
[  569.088667]  [<c13fda64>] device_shutdown+0x14/0x120
[  569.093777]  [<c10ac29d>] kernel_restart_prepare+0x2d/0x30
[  569.099429]  [<c10ac41e>] kernel_restart+0xe/0x60
[  569.109028]  [<c10ac611>] SYSC_reboot+0x191/0x220
[  569.159269]  [<c10ac6ba>] SyS_reboot+0x1a/0x20
[  569.163843]  [<c161c718>] sysenter_do_call+0x12/0x16
[  569.168951] ---[ end trace ccc1ec4471c289c9 ]---

Tested-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/core/hcd-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 3f7ef6129874..5e1a1790c2f6 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -377,6 +377,8 @@ void usb_hcd_pci_shutdown(struct pci_dev *dev)
 	if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) &&
 			hcd->driver->shutdown) {
 		hcd->driver->shutdown(hcd);
+		if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0)
+			free_irq(hcd->irq, hcd);
 		pci_disable_device(dev);
 	}
 }
-- 
2.1.0


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

* [PATCH 3.12 07/56] HID: add quirk for 0x04d9:0xa096 device
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (5 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 06/56] USB: core: hcd-pci: free IRQ before disabling PCI device when shutting down Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 08/56] PM / hibernate: avoid unsafe pages in e820 reserved regions Jiri Slaby
                   ` (50 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Wangzhao Cai, Jiri Kosina, Jiri Slaby

From: Wangzhao Cai <microcaicai@gmail.com>

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

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

commit 30c6fd4277ebab2a32ae5635d34283354b1bc8f2 upstream.

I am using a USB keyborad that give me "usb_submit_urb(ctrl) failed: -1" error
when I plugin it.  and I need to wait for 10s for this device to be ready.

By adding this quirks, the usb keyborad is usable right after plugin

Signed-off-by: Wangzhao Cai <microcaicai@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hid/hid-ids.h           | 1 +
 drivers/hid/usbhid/hid-quirks.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ca275f47e860..b921bc55a19b 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -457,6 +457,7 @@
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067	0xa067
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072	0xa072
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081	0xa081
+#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096	0xa096
 
 #define USB_VENDOR_ID_IMATION		0x0718
 #define USB_DEVICE_ID_DISC_STAKKA	0xd000
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 8e4ddb369883..da22a5e0d86f 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -120,6 +120,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_HD, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_QUAD_HD, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP_V103, HID_QUIRK_NO_INIT_REPORTS },
+	{ USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096, HID_QUIRK_NO_INIT_INPUT_REPORTS },
 
 	{ 0, 0 }
 };
-- 
2.1.0


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

* [PATCH 3.12 08/56] PM / hibernate: avoid unsafe pages in e820 reserved regions
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (6 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 07/56] HID: add quirk for 0x04d9:0xa096 device Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 09/56] bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload Jiri Slaby
                   ` (49 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Lee, Chun-Yi, Lee, Chun-Yi, Rafael J. Wysocki, Jiri Slaby

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

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

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

commit 84c91b7ae07c62cf6dee7fde3277f4be21331f85 upstream.

When the machine doesn't well handle the e820 persistent when hibernate
resuming, then it may cause page fault when writing image to snapshot
buffer:

[   17.929495] BUG: unable to handle kernel paging request at ffff880069d4f000
[   17.933469] IP: [<ffffffff810a1cf0>] load_image_lzo+0x810/0xe40
[   17.933469] PGD 2194067 PUD 77ffff067 PMD 2197067 PTE 0
[   17.933469] Oops: 0002 [#1] SMP
...

The ffff880069d4f000 page is in e820 reserved region of resume boot
kernel:

[    0.000000] BIOS-e820: [mem 0x0000000069d4f000-0x0000000069e12fff] reserved
...
[    0.000000] PM: Registered nosave memory: [mem 0x69d4f000-0x69e12fff]

So snapshot.c mark the pfn to forbidden pages map. But, this
page is also in the memory bitmap in snapshot image because it's an
original page used by image kernel, so it will also mark as an
unsafe(free) page in prepare_image().

That means the page in e820 when resuming mark as "forbidden" and
"free", it causes get_buffer() treat it as an allocated unsafe page.
Then snapshot_write_next() return this page to load_image, load_image
writing content to this address, but this page didn't really allocated
. So, we got page fault.

Although the root cause is from BIOS, I think aggressive check and
significant message in kernel will better then a page fault for
issue tracking, especially when serial console unavailable.

This patch adds code in mark_unsafe_pages() for check does free pages in
nosave region. If so, then it print message and return fault to stop whole
S4 resume process:

[    8.166004] PM: Image loading progress:   0%
[    8.658717] PM: 0x6796c000 in e820 nosave region: [mem 0x6796c000-0x6796cfff]
[    8.918737] PM: Read 2511940 kbytes in 1.04 seconds (2415.32 MB/s)
[    8.926633] PM: Error -14 resuming
[    8.933534] PM: Failed to load hibernation image, recovering.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/power/snapshot.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index b38109e204af..5e2bde1adb7c 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -730,6 +730,25 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
 	}
 }
 
+static bool is_nosave_page(unsigned long pfn)
+{
+	struct nosave_region *region;
+
+	list_for_each_entry(region, &nosave_regions, list) {
+		if (pfn >= region->start_pfn && pfn < region->end_pfn) {
+			pr_err("PM: %#010llx in e820 nosave region: "
+			       "[mem %#010llx-%#010llx]\n",
+			       (unsigned long long) pfn << PAGE_SHIFT,
+			       (unsigned long long) region->start_pfn << PAGE_SHIFT,
+			       ((unsigned long long) region->end_pfn << PAGE_SHIFT)
+					- 1);
+			return true;
+		}
+	}
+
+	return false;
+}
+
 /**
  *	create_basic_memory_bitmaps - create bitmaps needed for marking page
  *	frames that should not be saved and free page frames.  The pointers
@@ -1774,7 +1793,7 @@ static int mark_unsafe_pages(struct memory_bitmap *bm)
 	do {
 		pfn = memory_bm_next_pfn(bm);
 		if (likely(pfn != BM_END_OF_MAP)) {
-			if (likely(pfn_valid(pfn)))
+			if (likely(pfn_valid(pfn)) && !is_nosave_page(pfn))
 				swsusp_set_page_free(pfn_to_page(pfn));
 			else
 				return -EFAULT;
-- 
2.1.0


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

* [PATCH 3.12 09/56] bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (7 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 08/56] PM / hibernate: avoid unsafe pages in e820 reserved regions Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 10/56] PCI: Add pci_upstream_bridge() Jiri Slaby
                   ` (48 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Gu Zheng, Martin K. Petersen, Kent Overstreet, Jens Axboe

From: Gu Zheng <guz.fnst@cn.fujitsu.com>

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

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

commit cbcd1054a1fd2aa980fc11ff28e436fc4aaa2d54 upstream.

Commit 08778795 ("block: Fix nr_vecs for inline integrity vectors") from
Martin introduces the function bip_integrity_vecs(get the useful vectors)
to fix the issue about nr_vecs for inline integrity vectors that reported
by David Milburn.

But it seems that bip_integrity_vecs() will return the wrong number if the
bio is not based on any bio_set for some reason(bio->bi_pool == NULL),
because in that case, the bip_inline_vecs[0] is malloced directly.  So
here we add the bip_max_vcnt to record the count of vector slots, and
cleanup the function bip_integrity_vecs().

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
---
 fs/bio-integrity.c  | 12 +++---------
 include/linux/bio.h |  1 +
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 76273c1d26a6..04a43c011a66 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -70,8 +70,10 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
 					  bs->bvec_integrity_pool);
 		if (!bip->bip_vec)
 			goto err;
+		bip->bip_max_vcnt = bvec_nr_vecs(idx);
 	} else {
 		bip->bip_vec = bip->bip_inline_vecs;
+		bip->bip_max_vcnt = inline_vecs;
 	}
 
 	bip->bip_slab = idx;
@@ -114,14 +116,6 @@ void bio_integrity_free(struct bio *bio)
 }
 EXPORT_SYMBOL(bio_integrity_free);
 
-static inline unsigned int bip_integrity_vecs(struct bio_integrity_payload *bip)
-{
-	if (bip->bip_slab == BIO_POOL_NONE)
-		return BIP_INLINE_VECS;
-
-	return bvec_nr_vecs(bip->bip_slab);
-}
-
 /**
  * bio_integrity_add_page - Attach integrity metadata
  * @bio:	bio to update
@@ -137,7 +131,7 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
 	struct bio_integrity_payload *bip = bio->bi_integrity;
 	struct bio_vec *iv;
 
-	if (bip->bip_vcnt >= bip_integrity_vecs(bip)) {
+	if (bip->bip_vcnt >= bip->bip_max_vcnt) {
 		printk(KERN_ERR "%s: bip_vec full\n", __func__);
 		return 0;
 	}
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ec48bac5b039..6c17ad5cc814 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -187,6 +187,7 @@ struct bio_integrity_payload {
 	unsigned short		bip_slab;	/* slab the bip came from */
 	unsigned short		bip_vcnt;	/* # of integrity bio_vecs */
 	unsigned short		bip_idx;	/* current bip_vec index */
+	unsigned short		bip_max_vcnt;	/* integrity bio_vec slots */
 	unsigned		bip_owns_buf:1;	/* should free bip_buf */
 
 	struct work_struct	bip_work;	/* I/O completion */
-- 
2.1.0


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

* [PATCH 3.12 10/56] PCI: Add pci_upstream_bridge()
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (8 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 09/56] bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 11/56] HID: logitech: perform bounds checking on device_id early enough Jiri Slaby
                   ` (47 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Bjorn Helgaas, Jiri Slaby

From: Bjorn Helgaas <bhelgaas@google.com>

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

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

commit c6bde215acfd637708142ae671843b6f0eadbc6d upstream.

This adds a pci_upstream_bridge() interface to find the PCI-to-PCI bridge
upstream from a device.  This is typically just "dev->bus->self", but in
the case of a VF on a virtual bus, we have to start from the corresponding
PF.  Returns NULL if there is no upstream PCI bridge, i.e., if the device
is on a root bus.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/linux/pci.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index da172f956ad6..db4ce115705e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -478,6 +478,15 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
 	return !(pbus->parent);
 }
 
+static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
+{
+	dev = pci_physfn(dev);
+	if (pci_is_root_bus(dev->bus))
+		return NULL;
+
+	return dev->bus->self;
+}
+
 #ifdef CONFIG_PCI_MSI
 static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev)
 {
-- 
2.1.0


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

* [PATCH 3.12 11/56] HID: logitech: perform bounds checking on device_id early enough
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (9 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 10/56] PCI: Add pci_upstream_bridge() Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 12/56] HID: fix a couple of off-by-ones Jiri Slaby
                   ` (46 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 ad3e14d7c5268c2e24477c6ef54bbdf88add5d36 upstream.

device_index is a char type and the size of paired_dj_deivces is 7
elements, therefore proper bounds checking has to be applied to
device_index before it is used.

We are currently performing the bounds checking in
logi_dj_recv_add_djhid_device(), which is too late, as malicious device
could send REPORT_TYPE_NOTIF_DEVICE_UNPAIRED early enough and trigger the
problem in one of the report forwarding functions called from
logi_dj_raw_event().

Fix this by performing the check at the earliest possible ocasion in
logi_dj_raw_event().

Reported-by: Ben Hawkes <hawkes@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hid/hid-logitech-dj.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 834cda2c25c7..9bf4c218cac8 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -237,13 +237,6 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
 		return;
 	}
 
-	if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
-	    (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
-		dev_err(&djrcv_hdev->dev, "%s: invalid device index:%d\n",
-			__func__, dj_report->device_index);
-		return;
-	}
-
 	if (djrcv_dev->paired_dj_devices[dj_report->device_index]) {
 		/* The device is already known. No need to reallocate it. */
 		dbg_hid("%s: device is already known\n", __func__);
@@ -721,6 +714,12 @@ static int logi_dj_raw_event(struct hid_device *hdev,
 	 * device (via hid_input_report() ) and return 1 so hid-core does not do
 	 * anything else with it.
 	 */
+	if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||
+	    (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {
+		dev_err(&hdev->dev, "%s: invalid device index:%d\n",
+				__func__, dj_report->device_index);
+		return false;
+	}
 
 	spin_lock_irqsave(&djrcv_dev->lock, flags);
 	if (dj_report->report_id == REPORT_ID_DJ_SHORT) {
-- 
2.1.0


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

* [PATCH 3.12 12/56] HID: fix a couple of off-by-ones
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (10 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 11/56] HID: logitech: perform bounds checking on device_id early enough Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 13/56] isofs: Fix unbounded recursion when processing relocated directories Jiri Slaby
                   ` (45 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 4ab25786c87eb20857bbb715c3ae34ec8fd6a214 upstream.

There are a few very theoretical off-by-one bugs in report descriptor size
checking when performing a pre-parsing fixup. Fix those.

Reported-by: Ben Hawkes <hawkes@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hid/hid-cherry.c   | 2 +-
 drivers/hid/hid-kye.c      | 2 +-
 drivers/hid/hid-lg.c       | 4 ++--
 drivers/hid/hid-monterey.c | 2 +-
 drivers/hid/hid-petalynx.c | 2 +-
 drivers/hid/hid-sunplus.c  | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-cherry.c b/drivers/hid/hid-cherry.c
index 1bdcccc54a1d..f745d2c1325e 100644
--- a/drivers/hid/hid-cherry.c
+++ b/drivers/hid/hid-cherry.c
@@ -28,7 +28,7 @@
 static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
-	if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
+	if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
 		hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n");
 		rdesc[11] = rdesc[16] = 0xff;
 		rdesc[12] = rdesc[17] = 0x03;
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
index d645caa690dd..8a3552cf3904 100644
--- a/drivers/hid/hid-kye.c
+++ b/drivers/hid/hid-kye.c
@@ -300,7 +300,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		 *   - change the button usage range to 4-7 for the extra
 		 *     buttons
 		 */
-		if (*rsize >= 74 &&
+		if (*rsize >= 75 &&
 			rdesc[61] == 0x05 && rdesc[62] == 0x08 &&
 			rdesc[63] == 0x19 && rdesc[64] == 0x08 &&
 			rdesc[65] == 0x29 && rdesc[66] == 0x0f &&
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 06eb45fa6331..12fc48c968e6 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -345,14 +345,14 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	struct usb_device_descriptor *udesc;
 	__u16 bcdDevice, rev_maj, rev_min;
 
-	if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&
+	if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&
 			rdesc[84] == 0x8c && rdesc[85] == 0x02) {
 		hid_info(hdev,
 			 "fixing up Logitech keyboard report descriptor\n");
 		rdesc[84] = rdesc[89] = 0x4d;
 		rdesc[85] = rdesc[90] = 0x10;
 	}
-	if ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 50 &&
+	if ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 51 &&
 			rdesc[32] == 0x81 && rdesc[33] == 0x06 &&
 			rdesc[49] == 0x81 && rdesc[50] == 0x06) {
 		hid_info(hdev,
diff --git a/drivers/hid/hid-monterey.c b/drivers/hid/hid-monterey.c
index 9e14c00eb1b6..25daf28b26bd 100644
--- a/drivers/hid/hid-monterey.c
+++ b/drivers/hid/hid-monterey.c
@@ -24,7 +24,7 @@
 static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
-	if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {
+	if (*rsize >= 31 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {
 		hid_info(hdev, "fixing up button/consumer in HID report descriptor\n");
 		rdesc[30] = 0x0c;
 	}
diff --git a/drivers/hid/hid-petalynx.c b/drivers/hid/hid-petalynx.c
index 736b2502df4f..6aca4f2554bf 100644
--- a/drivers/hid/hid-petalynx.c
+++ b/drivers/hid/hid-petalynx.c
@@ -25,7 +25,7 @@
 static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
-	if (*rsize >= 60 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
+	if (*rsize >= 62 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
 			rdesc[41] == 0x00 && rdesc[59] == 0x26 &&
 			rdesc[60] == 0xf9 && rdesc[61] == 0x00) {
 		hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n");
diff --git a/drivers/hid/hid-sunplus.c b/drivers/hid/hid-sunplus.c
index 87fc91e1c8de..91072fa54663 100644
--- a/drivers/hid/hid-sunplus.c
+++ b/drivers/hid/hid-sunplus.c
@@ -24,7 +24,7 @@
 static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		unsigned int *rsize)
 {
-	if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
+	if (*rsize >= 112 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
 			rdesc[106] == 0x03) {
 		hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n");
 		rdesc[105] = rdesc[110] = 0x03;
-- 
2.1.0


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

* [PATCH 3.12 13/56] isofs: Fix unbounded recursion when processing relocated directories
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (11 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 12/56] HID: fix a couple of off-by-ones Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 14/56] USB: OHCI: fix bugs in debug routines Jiri Slaby
                   ` (44 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jan Kara, Jiri Slaby

From: Jan Kara <jack@suse.cz>

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

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

commit 410dd3cf4c9b36f27ed4542ee18b1af5e68645a4 upstream.

We did not check relocated directory in any way when processing Rock
Ridge 'CL' tag. Thus a corrupted isofs image can possibly have a CL
entry pointing to another CL entry leading to possibly unbounded
recursion in kernel code and thus stack overflow or deadlocks (if there
is a loop created from CL entries).

Fix the problem by not allowing CL entry to point to a directory entry
with CL entry (such use makes no good sense anyway) and by checking
whether CL entry doesn't point to itself.

Reported-by: Chris Evans <cevans@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/isofs/inode.c | 15 ++++++++-------
 fs/isofs/isofs.h | 23 +++++++++++++++++++----
 fs/isofs/rock.c  | 39 ++++++++++++++++++++++++++++-----------
 3 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index e5d408a7ea4a..2e2af97df075 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -61,7 +61,7 @@ static void isofs_put_super(struct super_block *sb)
 	return;
 }
 
-static int isofs_read_inode(struct inode *);
+static int isofs_read_inode(struct inode *, int relocated);
 static int isofs_statfs (struct dentry *, struct kstatfs *);
 
 static struct kmem_cache *isofs_inode_cachep;
@@ -1258,7 +1258,7 @@ out_toomany:
 	goto out;
 }
 
-static int isofs_read_inode(struct inode *inode)
+static int isofs_read_inode(struct inode *inode, int relocated)
 {
 	struct super_block *sb = inode->i_sb;
 	struct isofs_sb_info *sbi = ISOFS_SB(sb);
@@ -1403,7 +1403,7 @@ static int isofs_read_inode(struct inode *inode)
 	 */
 
 	if (!high_sierra) {
-		parse_rock_ridge_inode(de, inode);
+		parse_rock_ridge_inode(de, inode, relocated);
 		/* if we want uid/gid set, override the rock ridge setting */
 		if (sbi->s_uid_set)
 			inode->i_uid = sbi->s_uid;
@@ -1482,9 +1482,10 @@ static int isofs_iget5_set(struct inode *ino, void *data)
  * offset that point to the underlying meta-data for the inode.  The
  * code below is otherwise similar to the iget() code in
  * include/linux/fs.h */
-struct inode *isofs_iget(struct super_block *sb,
-			 unsigned long block,
-			 unsigned long offset)
+struct inode *__isofs_iget(struct super_block *sb,
+			   unsigned long block,
+			   unsigned long offset,
+			   int relocated)
 {
 	unsigned long hashval;
 	struct inode *inode;
@@ -1506,7 +1507,7 @@ struct inode *isofs_iget(struct super_block *sb,
 		return ERR_PTR(-ENOMEM);
 
 	if (inode->i_state & I_NEW) {
-		ret = isofs_read_inode(inode);
+		ret = isofs_read_inode(inode, relocated);
 		if (ret < 0) {
 			iget_failed(inode);
 			inode = ERR_PTR(ret);
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index 99167238518d..0ac4c1f73fbd 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -107,7 +107,7 @@ extern int iso_date(char *, int);
 
 struct inode;		/* To make gcc happy */
 
-extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
+extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *, int relocated);
 extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
 extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *);
 
@@ -118,9 +118,24 @@ extern struct dentry *isofs_lookup(struct inode *, struct dentry *, unsigned int
 extern struct buffer_head *isofs_bread(struct inode *, sector_t);
 extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long);
 
-extern struct inode *isofs_iget(struct super_block *sb,
-                                unsigned long block,
-                                unsigned long offset);
+struct inode *__isofs_iget(struct super_block *sb,
+			   unsigned long block,
+			   unsigned long offset,
+			   int relocated);
+
+static inline struct inode *isofs_iget(struct super_block *sb,
+				       unsigned long block,
+				       unsigned long offset)
+{
+	return __isofs_iget(sb, block, offset, 0);
+}
+
+static inline struct inode *isofs_iget_reloc(struct super_block *sb,
+					     unsigned long block,
+					     unsigned long offset)
+{
+	return __isofs_iget(sb, block, offset, 1);
+}
 
 /* Because the inode number is no longer relevant to finding the
  * underlying meta-data for an inode, we are free to choose a more
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index c0bf42472e40..f488bbae541a 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -288,12 +288,16 @@ eio:
 	goto out;
 }
 
+#define RR_REGARD_XA 1
+#define RR_RELOC_DE 2
+
 static int
 parse_rock_ridge_inode_internal(struct iso_directory_record *de,
-				struct inode *inode, int regard_xa)
+				struct inode *inode, int flags)
 {
 	int symlink_len = 0;
 	int cnt, sig;
+	unsigned int reloc_block;
 	struct inode *reloc;
 	struct rock_ridge *rr;
 	int rootflag;
@@ -305,7 +309,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
 
 	init_rock_state(&rs, inode);
 	setup_rock_ridge(de, inode, &rs);
-	if (regard_xa) {
+	if (flags & RR_REGARD_XA) {
 		rs.chr += 14;
 		rs.len -= 14;
 		if (rs.len < 0)
@@ -485,12 +489,22 @@ repeat:
 					"relocated directory\n");
 			goto out;
 		case SIG('C', 'L'):
-			ISOFS_I(inode)->i_first_extent =
-			    isonum_733(rr->u.CL.location);
-			reloc =
-			    isofs_iget(inode->i_sb,
-				       ISOFS_I(inode)->i_first_extent,
-				       0);
+			if (flags & RR_RELOC_DE) {
+				printk(KERN_ERR
+				       "ISOFS: Recursive directory relocation "
+				       "is not supported\n");
+				goto eio;
+			}
+			reloc_block = isonum_733(rr->u.CL.location);
+			if (reloc_block == ISOFS_I(inode)->i_iget5_block &&
+			    ISOFS_I(inode)->i_iget5_offset == 0) {
+				printk(KERN_ERR
+				       "ISOFS: Directory relocation points to "
+				       "itself\n");
+				goto eio;
+			}
+			ISOFS_I(inode)->i_first_extent = reloc_block;
+			reloc = isofs_iget_reloc(inode->i_sb, reloc_block, 0);
 			if (IS_ERR(reloc)) {
 				ret = PTR_ERR(reloc);
 				goto out;
@@ -637,9 +651,11 @@ static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr, char *plimit)
 	return rpnt;
 }
 
-int parse_rock_ridge_inode(struct iso_directory_record *de, struct inode *inode)
+int parse_rock_ridge_inode(struct iso_directory_record *de, struct inode *inode,
+			   int relocated)
 {
-	int result = parse_rock_ridge_inode_internal(de, inode, 0);
+	int flags = relocated ? RR_RELOC_DE : 0;
+	int result = parse_rock_ridge_inode_internal(de, inode, flags);
 
 	/*
 	 * if rockridge flag was reset and we didn't look for attributes
@@ -647,7 +663,8 @@ int parse_rock_ridge_inode(struct iso_directory_record *de, struct inode *inode)
 	 */
 	if ((ISOFS_SB(inode->i_sb)->s_rock_offset == -1)
 	    && (ISOFS_SB(inode->i_sb)->s_rock == 2)) {
-		result = parse_rock_ridge_inode_internal(de, inode, 14);
+		result = parse_rock_ridge_inode_internal(de, inode,
+							 flags | RR_REGARD_XA);
 	}
 	return result;
 }
-- 
2.1.0


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

* [PATCH 3.12 14/56] USB: OHCI: fix bugs in debug routines
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (12 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 13/56] isofs: Fix unbounded recursion when processing relocated directories Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 15/56] USB: OHCI: don't lose track of EDs when a controller dies Jiri Slaby
                   ` (43 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alan Stern, Jiri Slaby

From: Alan Stern <stern@rowland.harvard.edu>

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

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

commit 256dbcd80f1ccf8abf421c1d72ba79a4e29941dd upstream.

The debug routine fill_async_buffer() in ohci-hcd is buggy: It never
produces any output because it forgets to initialize the output buffer
size.  Also, the debug routine ohci_dump() has an unused argument.

This patch adds the correct initialization and removes the unused
argument.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/ohci-dbg.c |  9 +++++----
 drivers/usb/host/ohci-hcd.c | 10 +++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 31b81f9eacdc..4a9238563409 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -289,7 +289,7 @@ ohci_dump_roothub (
 	}
 }
 
-static void ohci_dump (struct ohci_hcd *controller, int verbose)
+static void ohci_dump(struct ohci_hcd *controller)
 {
 	ohci_dbg (controller, "OHCI controller state\n");
 
@@ -531,15 +531,16 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
 static ssize_t fill_async_buffer(struct debug_buffer *buf)
 {
 	struct ohci_hcd		*ohci;
-	size_t			temp;
+	size_t			temp, size;
 	unsigned long		flags;
 
 	ohci = buf->ohci;
+	size = PAGE_SIZE;
 
 	/* display control and bulk lists together, for simplicity */
 	spin_lock_irqsave (&ohci->lock, flags);
-	temp = show_list(ohci, buf->page, buf->count, ohci->ed_controltail);
-	temp += show_list(ohci, buf->page + temp, buf->count - temp,
+	temp = show_list(ohci, buf->page, size, ohci->ed_controltail);
+	temp += show_list(ohci, buf->page + temp, size - temp,
 			  ohci->ed_bulktail);
 	spin_unlock_irqrestore (&ohci->lock, flags);
 
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 604cad1bcf9c..3770fcb55e28 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -78,8 +78,8 @@ static const char	hcd_name [] = "ohci_hcd";
 #include "ohci.h"
 #include "pci-quirks.h"
 
-static void ohci_dump (struct ohci_hcd *ohci, int verbose);
-static void ohci_stop (struct usb_hcd *hcd);
+static void ohci_dump(struct ohci_hcd *ohci);
+static void ohci_stop(struct usb_hcd *hcd);
 
 #include "ohci-hub.c"
 #include "ohci-dbg.c"
@@ -754,7 +754,7 @@ retry:
 		ohci->ed_to_check = NULL;
 	}
 
-	ohci_dump (ohci, 1);
+	ohci_dump(ohci);
 
 	return 0;
 }
@@ -835,7 +835,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
 			usb_hc_died(hcd);
 		}
 
-		ohci_dump (ohci, 1);
+		ohci_dump(ohci);
 		ohci_usb_reset (ohci);
 	}
 
@@ -935,7 +935,7 @@ static void ohci_stop (struct usb_hcd *hcd)
 {
 	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
 
-	ohci_dump (ohci, 1);
+	ohci_dump(ohci);
 
 	if (quirk_nec(ohci))
 		flush_work(&ohci->nec_work);
-- 
2.1.0


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

* [PATCH 3.12 15/56] USB: OHCI: don't lose track of EDs when a controller dies
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (13 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 14/56] USB: OHCI: fix bugs in debug routines Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 16/56] USB: devio: fix issue with log flooding Jiri Slaby
                   ` (42 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alan Stern, Jiri Slaby

From: Alan Stern <stern@rowland.harvard.edu>

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

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

commit 977dcfdc60311e7aa571cabf6f39c36dde13339e upstream.

This patch fixes a bug in ohci-hcd.  When an URB is unlinked, the
corresponding Endpoint Descriptor is added to the ed_rm_list and taken
off the hardware schedule.  Once the ED is no longer visible to the
hardware, finish_unlinks() handles the URBs that were unlinked or have
completed.  If any URBs remain attached to the ED, the ED is added
back to the hardware schedule -- but only if the controller is
running.

This fails when a controller dies.  A non-empty ED does not get added
back to the hardware schedule and does not remain on the ed_rm_list;
ohci-hcd loses track of it.  The remaining URBs cannot be unlinked,
which causes the USB stack to hang.

The patch changes finish_unlinks() so that non-empty EDs remain on
the ed_rm_list if the controller isn't running.  This requires moving
some of the existing code around, to avoid modifying the ED's hardware
fields more than once.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/ohci-q.c | 46 +++++++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index e7f577e63624..4e9f6a45f4e4 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -315,8 +315,7 @@ static void periodic_unlink (struct ohci_hcd *ohci, struct ed *ed)
  *  - ED_OPER: when there's any request queued, the ED gets rescheduled
  *    immediately.  HC should be working on them.
  *
- *  - ED_IDLE:  when there's no TD queue. there's no reason for the HC
- *    to care about this ED; safe to disable the endpoint.
+ *  - ED_IDLE: when there's no TD queue or the HC isn't running.
  *
  * When finish_unlinks() runs later, after SOF interrupt, it will often
  * complete one or more URB unlinks before making that state change.
@@ -930,6 +929,10 @@ rescan_all:
 		int			completed, modified;
 		__hc32			*prev;
 
+		/* Is this ED already invisible to the hardware? */
+		if (ed->state == ED_IDLE)
+			goto ed_idle;
+
 		/* only take off EDs that the HC isn't using, accounting for
 		 * frame counter wraps and EDs with partially retired TDs
 		 */
@@ -959,12 +962,20 @@ skip_ed:
 			}
 		}
 
+		/* ED's now officially unlinked, hc doesn't see */
+		ed->state = ED_IDLE;
+		if (quirk_zfmicro(ohci) && ed->type == PIPE_INTERRUPT)
+			ohci->eds_scheduled--;
+		ed->hwHeadP &= ~cpu_to_hc32(ohci, ED_H);
+		ed->hwNextED = 0;
+		wmb();
+		ed->hwINFO &= ~cpu_to_hc32(ohci, ED_SKIP | ED_DEQUEUE);
+ed_idle:
+
 		/* reentrancy:  if we drop the schedule lock, someone might
 		 * have modified this list.  normally it's just prepending
 		 * entries (which we'd ignore), but paranoia won't hurt.
 		 */
-		*last = ed->ed_next;
-		ed->ed_next = NULL;
 		modified = 0;
 
 		/* unlink urbs as requested, but rescan the list after
@@ -1022,19 +1033,20 @@ rescan_this:
 		if (completed && !list_empty (&ed->td_list))
 			goto rescan_this;
 
-		/* ED's now officially unlinked, hc doesn't see */
-		ed->state = ED_IDLE;
-		if (quirk_zfmicro(ohci) && ed->type == PIPE_INTERRUPT)
-			ohci->eds_scheduled--;
-		ed->hwHeadP &= ~cpu_to_hc32(ohci, ED_H);
-		ed->hwNextED = 0;
-		wmb ();
-		ed->hwINFO &= ~cpu_to_hc32 (ohci, ED_SKIP | ED_DEQUEUE);
-
-		/* but if there's work queued, reschedule */
-		if (!list_empty (&ed->td_list)) {
-			if (ohci->rh_state == OHCI_RH_RUNNING)
-				ed_schedule (ohci, ed);
+		/*
+		 * If no TDs are queued, take ED off the ed_rm_list.
+		 * Otherwise, if the HC is running, reschedule.
+		 * If not, leave it on the list for further dequeues.
+		 */
+		if (list_empty(&ed->td_list)) {
+			*last = ed->ed_next;
+			ed->ed_next = NULL;
+		} else if (ohci->rh_state == OHCI_RH_RUNNING) {
+			*last = ed->ed_next;
+			ed->ed_next = NULL;
+			ed_schedule(ohci, ed);
+		} else {
+			last = &ed->ed_next;
 		}
 
 		if (modified)
-- 
2.1.0


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

* [PATCH 3.12 16/56] USB: devio: fix issue with log flooding
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (14 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 15/56] USB: OHCI: don't lose track of EDs when a controller dies Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 17/56] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments Jiri Slaby
                   ` (41 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Oliver Neukum, Jiri Slaby

From: Oliver Neukum <oneukum@suse.de>

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

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

commit d310d05f1225d1f6f2bf505255fdf593bfbb3051 upstream.

usbfs allows user space to pass down an URB which sets URB_SHORT_NOT_OK
for output URBs. That causes usbcore to log messages without limit
for a nonsensical disallowed combination. The fix is to silently drop
the attribute in usbfs.
The problem is reported to exist since 3.14
https://www.virtualbox.org/ticket/13085

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/core/devio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 71dc5d768fa5..31ffd8459456 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1413,7 +1413,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
 	u = (is_in ? URB_DIR_IN : URB_DIR_OUT);
 	if (uurb->flags & USBDEVFS_URB_ISO_ASAP)
 		u |= URB_ISO_ASAP;
-	if (uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
+	if (uurb->flags & USBDEVFS_URB_SHORT_NOT_OK && is_in)
 		u |= URB_SHORT_NOT_OK;
 	if (uurb->flags & USBDEVFS_URB_NO_FSBR)
 		u |= URB_NO_FSBR;
-- 
2.1.0


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

* [PATCH 3.12 17/56] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (15 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 16/56] USB: devio: fix issue with log flooding Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 18/56] USB: serial: ftdi_sio: Add support for new Xsens devices Jiri Slaby
                   ` (40 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Patrick Riphagen, Frans Klaver, Johan Hovold, Jiri Slaby

From: Patrick Riphagen <patrick.riphagen@xsens.com>

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

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

commit 9273b8a270878906540349422ab24558b9d65716 upstream.

The converters are used in specific products. It can be useful to know
which they are exactly.

Signed-off-by: Patrick Riphagen <patrick.riphagen@xsens.com>
Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/ftdi_sio_ids.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index c4777bc6aee0..3fc789701e45 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -140,12 +140,12 @@
 /*
  * Xsens Technologies BV products (http://www.xsens.com).
  */
-#define XSENS_CONVERTER_0_PID	0xD388
-#define XSENS_CONVERTER_1_PID	0xD389
+#define XSENS_CONVERTER_0_PID	0xD388	/* Xsens USB converter */
+#define XSENS_CONVERTER_1_PID	0xD389	/* Xsens Wireless Receiver */
 #define XSENS_CONVERTER_2_PID	0xD38A
-#define XSENS_CONVERTER_3_PID	0xD38B
-#define XSENS_CONVERTER_4_PID	0xD38C
-#define XSENS_CONVERTER_5_PID	0xD38D
+#define XSENS_CONVERTER_3_PID	0xD38B	/* Xsens USB-serial converter */
+#define XSENS_CONVERTER_4_PID	0xD38C	/* Xsens Wireless Receiver */
+#define XSENS_CONVERTER_5_PID	0xD38D	/* Xsens Awinda Station */
 #define XSENS_CONVERTER_6_PID	0xD38E
 #define XSENS_CONVERTER_7_PID	0xD38F
 
-- 
2.1.0


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

* [PATCH 3.12 18/56] USB: serial: ftdi_sio: Add support for new Xsens devices
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (16 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 17/56] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 19/56] USB: ehci-pci: USB host controller support for Intel Quark X1000 Jiri Slaby
                   ` (39 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Patrick Riphagen, Frans Klaver, Johan Hovold, Jiri Slaby

From: Patrick Riphagen <patrick.riphagen@xsens.com>

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

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

commit 4bdcde358b4bda74e356841d351945ca3f2245dd upstream.

This adds support for new Xsens devices, using Xsens' own Vendor ID.

Signed-off-by: Patrick Riphagen <patrick.riphagen@xsens.com>
Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/ftdi_sio.c     | 2 ++
 drivers/usb/serial/ftdi_sio_ids.h | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e0bf8ee1f976..bac979402ce3 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -674,6 +674,8 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) },
 	{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) },
 	{ USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) },
+	{ USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },
+	{ USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
 	{ USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 3fc789701e45..1e58d90a0b6c 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -140,6 +140,9 @@
 /*
  * Xsens Technologies BV products (http://www.xsens.com).
  */
+#define XSENS_VID		0x2639
+#define XSENS_CONVERTER_PID	0xD00D	/* Xsens USB-serial converter */
+#define XSENS_MTW_PID		0x0200	/* Xsens MTw */
 #define XSENS_CONVERTER_0_PID	0xD388	/* Xsens USB converter */
 #define XSENS_CONVERTER_1_PID	0xD389	/* Xsens Wireless Receiver */
 #define XSENS_CONVERTER_2_PID	0xD38A
-- 
2.1.0


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

* [PATCH 3.12 19/56] USB: ehci-pci: USB host controller support for Intel Quark X1000
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (17 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 18/56] USB: serial: ftdi_sio: Add support for new Xsens devices Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 20/56] USB: Fix persist resume of some SS USB devices Jiri Slaby
                   ` (38 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Bryan O'Donoghue, Alvin (Weike) Chen, Jiri Slaby

From: Bryan O'Donoghue <bryan.odonoghue@intel.com>

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

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

commit 6e693739e9b603b3ca9ce0d4f4178f0633458465 upstream.

The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000
USB host controller, and the default value is 0x20 dwords. The in/out threshold
can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance,
but only when isochronous/interrupt transactions are not initiated by the USB
host controller. This patch is to reconfigure the packet buffer in/out
threshold as maximal as possible to maximize the performance, and 0x7F dwords
(508 Bytes) should be used because the USB host controller initiates
isochronous/interrupt transactions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@intel.com>
Signed-off-by: Alvin (Weike) Chen <alvin.chen@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/ehci-pci.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 3e86bf4371b3..ca7b964124af 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -35,6 +35,21 @@ static const char hcd_name[] = "ehci-pci";
 #define PCI_DEVICE_ID_INTEL_CE4100_USB	0x2e70
 
 /*-------------------------------------------------------------------------*/
+#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC		0x0939
+static inline bool is_intel_quark_x1000(struct pci_dev *pdev)
+{
+	return pdev->vendor == PCI_VENDOR_ID_INTEL &&
+		pdev->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC;
+}
+
+/*
+ * 0x84 is the offset of in/out threshold register,
+ * and it is the same offset as the register of 'hostpc'.
+ */
+#define	intel_quark_x1000_insnreg01	hostpc
+
+/* Maximum usable threshold value is 0x7f dwords for both IN and OUT */
+#define INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD	0x007f007f
 
 /* called after powerup, by probe or system-pm "wakeup" */
 static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
@@ -50,6 +65,16 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
 	if (!retval)
 		ehci_dbg(ehci, "MWI active\n");
 
+	/* Reset the threshold limit */
+	if (is_intel_quark_x1000(pdev)) {
+		/*
+		 * For the Intel QUARK X1000, raise the I/O threshold to the
+		 * maximum usable value in order to improve performance.
+		 */
+		ehci_writel(ehci, INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD,
+			ehci->regs->intel_quark_x1000_insnreg01);
+	}
+
 	return 0;
 }
 
-- 
2.1.0


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

* [PATCH 3.12 20/56] USB: Fix persist resume of some SS USB devices
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (18 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 19/56] USB: ehci-pci: USB host controller support for Intel Quark X1000 Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 21/56] ALSA: hda - fix an external mic jack problem on a HP machine Jiri Slaby
                   ` (37 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Pratyush Anand, Jiri Slaby

From: Pratyush Anand <pratyush.anand@st.com>

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

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

commit a40178b2fa6ad87670fb1e5fa4024db00c149629 upstream.

Problem Summary: Problem has been observed generally with PM states
where VBUS goes off during suspend. There are some SS USB devices which
take longer time for link training compared to many others.  Such
devices fail to reconnect with same old address which was associated
with it before suspend.

When system resumes, at some point of time (dpm_run_callback->
usb_dev_resume->usb_resume->usb_resume_both->usb_resume_device->
usb_port_resume) SW reads hub status. If device is present,
then it finishes port resume and re-enumerates device with same
address. If device is not present then, SW thinks that device was
removed during suspend and therefore does logical disconnection
and removes all the resource allocated for this device.

Now, if I put sufficient delay just before root hub status read in
usb_resume_device then, SW sees always that device is present. In normal
course(without any delay) SW sees that no device is present and then SW
removes all resource associated with the device at this port.  In the
latter case, after sometime, device says that hey I am here, now host
enumerates it, but with new address.

Problem had been reproduced when I connect verbatim USB3.0 hard disc
with my STiH407 XHCI host running with 3.10 kernel.

I see that similar problem has been reported here.
https://bugzilla.kernel.org/show_bug.cgi?id=53211
Reading above it seems that bug was not in 3.6.6 and was present in 3.8
and again it was not present for some in 3.12.6, while it was present
for few others. I tested with 3.13-FC19 running at i686 desktop, problem
was still there. However, I was failed to reproduce it with 3.16-RC4
running at same i686 machine. I would say it is just a random
observation. Problem for few devices is always there, as I am unable to
find a proper fix for the issue.

So, now question is what should be the amount of delay so that host is
always able to recognize suspended device after resume.

XHCI specs 4.19.4 says that when Link training is successful, port sets
CSC bit to 1. So if SW reads port status before successful link
training, then it will not find device to be present.  USB Analyzer log
with such buggy devices show that in some cases device switch on the
RX termination after long delay of host enabling the VBUS. In few other
cases it has been seen that device fails to negotiate link training in
first attempt. It has been reported till now that few devices take as
long as 2000 ms to train the link after host enabling its VBUS and
RX termination. This patch implements a 2000 ms timeout for CSC bit to set
ie for link training. If in a case link trains before timeout, loop will
exit earlier.

This patch implements above delay, but only for SS device and when
persist is enabled.

So, for the good device overhead is almost none. While for the bad
devices penalty could be the time which it take for link training.
But, If a device was connected before suspend, and was removed
while system was asleep, then the penalty would be the timeout ie
2000 ms.

Results:

Verbatim USB SS hard disk connected with STiH407 USB host running 3.10
Kernel resumes in 461 msecs without this patch, but hard disk is
assigned a new device address. Same system resumes in 790 msecs with
this patch, but with old device address.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/core/hub.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 9c63a76cfedd..557e8a9fe58a 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3168,6 +3168,43 @@ static int finish_port_resume(struct usb_device *udev)
 }
 
 /*
+ * There are some SS USB devices which take longer time for link training.
+ * XHCI specs 4.19.4 says that when Link training is successful, port
+ * sets CSC bit to 1. So if SW reads port status before successful link
+ * training, then it will not find device to be present.
+ * USB Analyzer log with such buggy devices show that in some cases
+ * device switch on the RX termination after long delay of host enabling
+ * the VBUS. In few other cases it has been seen that device fails to
+ * negotiate link training in first attempt. It has been
+ * reported till now that few devices take as long as 2000 ms to train
+ * the link after host enabling its VBUS and termination. Following
+ * routine implements a 2000 ms timeout for link training. If in a case
+ * link trains before timeout, loop will exit earlier.
+ *
+ * FIXME: If a device was connected before suspend, but was removed
+ * while system was asleep, then the loop in the following routine will
+ * only exit at timeout.
+ *
+ * This routine should only be called when persist is enabled for a SS
+ * device.
+ */
+static int wait_for_ss_port_enable(struct usb_device *udev,
+		struct usb_hub *hub, int *port1,
+		u16 *portchange, u16 *portstatus)
+{
+	int status = 0, delay_ms = 0;
+
+	while (delay_ms < 2000) {
+		if (status || *portstatus & USB_PORT_STAT_CONNECTION)
+			break;
+		msleep(20);
+		delay_ms += 20;
+		status = hub_port_status(hub, *port1, portstatus, portchange);
+	}
+	return status;
+}
+
+/*
  * usb_port_resume - re-activate a suspended usb device's upstream port
  * @udev: device to re-activate, not a root hub
  * Context: must be able to sleep; device not locked; pm locks held
@@ -3269,6 +3306,10 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
 
 	clear_bit(port1, hub->busy_bits);
 
+	if (udev->persist_enabled && hub_is_superspeed(hub->hdev))
+		status = wait_for_ss_port_enable(udev, hub, &port1, &portchange,
+				&portstatus);
+
 	status = check_port_resume_type(udev,
 			hub, port1, status, portchange, portstatus);
 	if (status == 0)
-- 
2.1.0


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

* [PATCH 3.12 21/56] ALSA: hda - fix an external mic jack problem on a HP machine
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (19 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 20/56] USB: Fix persist resume of some SS USB devices Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 22/56] ALSA: virtuoso: add Xonar Essence STX II support Jiri Slaby
                   ` (36 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hui Wang, Takashi Iwai, Jiri Slaby

From: Hui Wang <hui.wang@canonical.com>

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

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

commit 7440850c20b69658f322119d20a94dc914127cc7 upstream.

ON the machine, two pin complex (0xb and 0xe) are both routed to
the same external right-side mic jack, this makes the jack can't work.

To fix this problem, set the 0xe to "not connected".

BugLink: https://bugs.launchpad.net/bugs/1350148
Tested-by: Franz Hsieh <franz.hsieh@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_sigmatel.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 53e7c9bb99e8..3c90447c5810 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -84,6 +84,7 @@ enum {
 	STAC_DELL_EQ,
 	STAC_ALIENWARE_M17X,
 	STAC_92HD89XX_HP_FRONT_JACK,
+	STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK,
 	STAC_92HD73XX_MODELS
 };
 
@@ -1792,6 +1793,11 @@ static const struct hda_pintbl stac92hd89xx_hp_front_jack_pin_configs[] = {
 	{}
 };
 
+static const struct hda_pintbl stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs[] = {
+	{ 0x0e, 0x400000f0 },
+	{}
+};
+
 static void stac92hd73xx_fixup_ref(struct hda_codec *codec,
 				   const struct hda_fixup *fix, int action)
 {
@@ -1914,6 +1920,10 @@ static const struct hda_fixup stac92hd73xx_fixups[] = {
 	[STAC_92HD89XX_HP_FRONT_JACK] = {
 		.type = HDA_FIXUP_PINS,
 		.v.pins = stac92hd89xx_hp_front_jack_pin_configs,
+	},
+	[STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK] = {
+		.type = HDA_FIXUP_PINS,
+		.v.pins = stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs,
 	}
 };
 
@@ -1974,6 +1984,8 @@ static const struct snd_pci_quirk stac92hd73xx_fixup_tbl[] = {
 		      "Alienware M17x", STAC_ALIENWARE_M17X),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
 		      "Alienware M17x R3", STAC_DELL_EQ),
+	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1927,
+				"HP Z1 G2", STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK),
 	SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2b17,
 				"unknown HP", STAC_92HD89XX_HP_FRONT_JACK),
 	{} /* terminator */
-- 
2.1.0


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

* [PATCH 3.12 22/56] ALSA: virtuoso: add Xonar Essence STX II support
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (20 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 21/56] ALSA: hda - fix an external mic jack problem on a HP machine Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 23/56] ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed Jiri Slaby
                   ` (35 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Clemens Ladisch, Takashi Iwai, Jiri Slaby

From: Clemens Ladisch <clemens@ladisch.de>

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

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

commit f42bb22243d2ae264d721b055f836059fe35321f upstream.

Just add the PCI ID for the STX II.  It appears to work the same as the
STX, except for the addition of the not-yet-supported daughterboard.

Tested-by: Mario <fugazzi99@gmail.com>
Tested-by: corubba <corubba@gmx.de>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/sound/alsa/ALSA-Configuration.txt |  4 ++--
 sound/pci/Kconfig                               |  4 ++--
 sound/pci/oxygen/virtuoso.c                     |  1 +
 sound/pci/oxygen/xonar_pcm179x.c                | 12 ++++++++++--
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 95731a08f257..8f08b2a71791 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -2026,8 +2026,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
   -------------------
 
     Module for sound cards based on the Asus AV66/AV100/AV200 chips,
-    i.e., Xonar D1, DX, D2, D2X, DS, Essence ST (Deluxe), Essence STX,
-    HDAV1.3 (Deluxe), and HDAV1.3 Slim.
+    i.e., Xonar D1, DX, D2, D2X, DS, DSX, Essence ST (Deluxe),
+    Essence STX (II), HDAV1.3 (Deluxe), and HDAV1.3 Slim.
 
     This module supports autoprobe and multiple cards.
 
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index cc9fd67a50df..be6277ce272b 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -858,8 +858,8 @@ config SND_VIRTUOSO
 	select SND_JACK if INPUT=y || INPUT=SND
 	help
 	  Say Y here to include support for sound cards based on the
-	  Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS,
-	  Essence ST (Deluxe), and Essence STX.
+	  Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS, DSX,
+	  Essence ST (Deluxe), and Essence STX (II).
 	  Support for the HDAV1.3 (Deluxe) and HDAV1.3 Slim is experimental;
 	  for the Xense, missing.
 
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 64b9fda5f04a..dbbbacfd535e 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -53,6 +53,7 @@ static DEFINE_PCI_DEVICE_TABLE(xonar_ids) = {
 	{ OXYGEN_PCI_SUBID(0x1043, 0x835e) },
 	{ OXYGEN_PCI_SUBID(0x1043, 0x838e) },
 	{ OXYGEN_PCI_SUBID(0x1043, 0x8522) },
+	{ OXYGEN_PCI_SUBID(0x1043, 0x85f4) },
 	{ OXYGEN_PCI_SUBID_BROKEN_EEPROM },
 	{ }
 };
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c
index c8c7f2c9b355..e02605931669 100644
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -100,8 +100,8 @@
  */
 
 /*
- * Xonar Essence ST (Deluxe)/STX
- * -----------------------------
+ * Xonar Essence ST (Deluxe)/STX (II)
+ * ----------------------------------
  *
  * CMI8788:
  *
@@ -1138,6 +1138,14 @@ int get_xonar_pcm179x_model(struct oxygen *chip,
 		chip->model.resume = xonar_stx_resume;
 		chip->model.set_dac_params = set_pcm1796_params;
 		break;
+	case 0x85f4:
+		chip->model = model_xonar_st;
+		/* TODO: daughterboard support */
+		chip->model.shortname = "Xonar STX II";
+		chip->model.init = xonar_stx_init;
+		chip->model.resume = xonar_stx_resume;
+		chip->model.set_dac_params = set_pcm1796_params;
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.1.0


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

* [PATCH 3.12 23/56] ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (21 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 22/56] ALSA: virtuoso: add Xonar Essence STX II support Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 24/56] ALSA: usb-audio: fix BOSS ME-25 MIDI regression Jiri Slaby
                   ` (34 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 e24aa0a4c5ac92a171d9dd74a8d3dbf652990d36 upstream.

CA0132 driver tries to reload the firmware at resume.  Usually this
works since the firmware loader core caches the firmware contents by
itself.  However, if the driver failed to load the firmwares
(e.g. missing files), reloading the firmware at resume goes through
the actual file loading code path, and triggers a kernel WARNING like:

 WARNING: CPU: 10 PID:11371 at drivers/base/firmware_class.c:1105 _request_firmware+0x9ab/0x9d0()

For avoiding this situation, this patch makes CA0132 skipping the f/w
loading at resume when it failed at probe time.

Reported-and-tested-by: Janek Kozicki <cosurgi@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_ca0132.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index a91ad743fca4..8458b6e50efc 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -4379,6 +4379,9 @@ static void ca0132_download_dsp(struct hda_codec *codec)
 	return; /* NOP */
 #endif
 
+	if (spec->dsp_state == DSP_DOWNLOAD_FAILED)
+		return; /* don't retry failures */
+
 	chipio_enable_clocks(codec);
 	spec->dsp_state = DSP_DOWNLOADING;
 	if (!ca0132_download_dsp_images(codec))
@@ -4555,7 +4558,8 @@ static int ca0132_init(struct hda_codec *codec)
 	struct auto_pin_cfg *cfg = &spec->autocfg;
 	int i;
 
-	spec->dsp_state = DSP_DOWNLOAD_INIT;
+	if (spec->dsp_state != DSP_DOWNLOAD_FAILED)
+		spec->dsp_state = DSP_DOWNLOAD_INIT;
 	spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
 
 	snd_hda_power_up(codec);
@@ -4666,6 +4670,7 @@ static int patch_ca0132(struct hda_codec *codec)
 	codec->spec = spec;
 	spec->codec = codec;
 
+	spec->dsp_state = DSP_DOWNLOAD_INIT;
 	spec->num_mixers = 1;
 	spec->mixers[0] = ca0132_mixer;
 
-- 
2.1.0


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

* [PATCH 3.12 24/56] ALSA: usb-audio: fix BOSS ME-25 MIDI regression
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (22 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 23/56] ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 25/56] ALSA: hda - restore the gpio led after resume Jiri Slaby
                   ` (33 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Clemens Ladisch, Takashi Iwai, Jiri Slaby

From: Clemens Ladisch <clemens@ladisch.de>

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

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

commit 53da5ebfef66ea6e478ad9c6add3781472b79475 upstream.

The BOSS ME-25 turns out not to have any useful descriptors in its MIDI
interface, so its needs a quirk entry after all.

Reported-and-tested-by: Kees van Veen <kees.vanveen@gmail.com>
Fixes: 8e5ced83dd1c ("ALSA: usb-audio: remove superfluous Roland quirks")
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/usb/quirks-table.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index f5f0595ef9c7..0a81a51dd997 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -1582,6 +1582,35 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 	}
 },
 {
+	/* BOSS ME-25 */
+	USB_DEVICE(0x0582, 0x0113),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = & (const struct snd_usb_midi_endpoint_info) {
+					.out_cables = 0x0001,
+					.in_cables  = 0x0001
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+{
 	/* only 44.1 kHz works at the moment */
 	USB_DEVICE(0x0582, 0x0120),
 	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
-- 
2.1.0


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

* [PATCH 3.12 25/56] ALSA: hda - restore the gpio led after resume
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (23 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 24/56] ALSA: usb-audio: fix BOSS ME-25 MIDI regression Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 26/56] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co Jiri Slaby
                   ` (32 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hui Wang, Takashi Iwai, Jiri Slaby

From: Hui Wang <hui.wang@canonical.com>

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

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

commit f475371aa65de84fa483a998ab7594531026b9d9 upstream.

On some HP laptops, the mute led is controlled by codec gpio.

When some machine resume from s3/s4, the codec gpio data will be
cleared to 0 by BIOS:
Before suspend:
  IO[3]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
After resume:
  IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0

To skip the AFG node to enter D3 can't fix this problem.

A workaround is to restore the gpio data when the system resume
back from s3/s4. It is safe even on the machines without this
problem.

BugLink: https://bugs.launchpad.net/bugs/1358116
Tested-by: Franz Hsieh <franz.hsieh@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_realtek.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b8a5f1d02b18..a718b9939e17 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2902,6 +2902,15 @@ static int alc269_resume(struct hda_codec *codec)
 	snd_hda_codec_resume_cache(codec);
 	alc_inv_dmic_sync(codec, true);
 	hda_call_check_power_status(codec, 0x01);
+
+	/* on some machine, the BIOS will clear the codec gpio data when enter
+	 * suspend, and won't restore the data after resume, so we restore it
+	 * in the driver.
+	 */
+	if (spec->gpio_led)
+		snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_SET_GPIO_DATA,
+			    spec->gpio_led);
+
 	if (spec->has_alc5505_dsp)
 		alc5505_dsp_resume(codec);
 
-- 
2.1.0


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

* [PATCH 3.12 26/56] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (24 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 25/56] ALSA: hda - restore the gpio led after resume Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 27/56] mei: start disconnect request timer consistently Jiri Slaby
                   ` (31 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 f3ee07d8b6e061bf34a7167c3f564e8da4360a99 upstream.

ALC269 & co have many vendor-specific setups with COEF verbs.
However, some verbs seem specific to some codec versions and they
result in the codec stalling.  Typically, such a case can be avoided
by checking the return value from reading a COEF.  If the return value
is -1, it implies that the COEF is invalid, thus it shouldn't be
written.

This patch adds the invalid COEF checks in appropriate places
accessing ALC269 and its variants.  The patch actually fixes the
resume problem on Acer AO725 laptop.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
Tested-by: Francesco Muzio <muziofg@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_realtek.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a718b9939e17..e1f2c9a6d67d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -179,6 +179,8 @@ static void alc_fix_pll(struct hda_codec *codec)
 			    spec->pll_coef_idx);
 	val = snd_hda_codec_read(codec, spec->pll_nid, 0,
 				 AC_VERB_GET_PROC_COEF, 0);
+	if (val == -1)
+		return;
 	snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_COEF_INDEX,
 			    spec->pll_coef_idx);
 	snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_PROC_COEF,
@@ -2688,6 +2690,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
 {
 	int val = alc_read_coef_idx(codec, 0x04);
+	if (val == -1)
+		return;
 	if (power_up)
 		val |= 1 << 11;
 	else
@@ -4234,27 +4238,30 @@ static void alc269_fill_coef(struct hda_codec *codec)
 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
 		val = alc_read_coef_idx(codec, 0x04);
 		/* Power up output pin */
-		alc_write_coef_idx(codec, 0x04, val | (1<<11));
+		if (val != -1)
+			alc_write_coef_idx(codec, 0x04, val | (1<<11));
 	}
 
 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
 		val = alc_read_coef_idx(codec, 0xd);
-		if ((val & 0x0c00) >> 10 != 0x1) {
+		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
 			/* Capless ramp up clock control */
 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
 		}
 		val = alc_read_coef_idx(codec, 0x17);
-		if ((val & 0x01c0) >> 6 != 0x4) {
+		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
 			/* Class D power on reset */
 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
 		}
 	}
 
 	val = alc_read_coef_idx(codec, 0xd); /* Class D */
-	alc_write_coef_idx(codec, 0xd, val | (1<<14));
+	if (val != -1)
+		alc_write_coef_idx(codec, 0xd, val | (1<<14));
 
 	val = alc_read_coef_idx(codec, 0x4); /* HP */
-	alc_write_coef_idx(codec, 0x4, val | (1<<11));
+	if (val != -1)
+		alc_write_coef_idx(codec, 0x4, val | (1<<11));
 }
 
 /*
-- 
2.1.0


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

* [PATCH 3.12 27/56] mei: start disconnect request timer consistently
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (25 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 26/56] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 28/56] ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case Jiri Slaby
                   ` (30 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alexander Usyskin, Tomas Winkler, Jiri Slaby

From: Alexander Usyskin <alexander.usyskin@intel.com>

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

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

commit 22b987a325701223f9a37db700c6eb20b9924c6f upstream.

Link must be reset in case the fw doesn't
respond to client disconnect request.
We did charge the timer only in irq path
from mei_cl_irq_close and not in mei_cl_disconnect

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/misc/mei/client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 9abe5a4e3ef7..e9ea08dd8841 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -451,6 +451,7 @@ int mei_cl_disconnect(struct mei_cl *cl)
 			dev_err(&dev->pdev->dev, "failed to disconnect.\n");
 			goto free;
 		}
+		cl->timer_count = MEI_CONNECT_TIMEOUT;
 		mdelay(10); /* Wait for hardware disconnection ready */
 		list_add_tail(&cb->list, &dev->ctrl_rd_list.list);
 	} else {
-- 
2.1.0


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

* [PATCH 3.12 28/56] ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case.
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (26 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 27/56] mei: start disconnect request timer consistently Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 29/56] drm: omapdrm: fix compiler errors Jiri Slaby
                   ` (29 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jeremy Vial, Tony Lindgren, Jiri Slaby

From: Jeremy Vial <jvial@adeneo-embedded.com>

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

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

commit 9b5f7428f8b16bd8980213f2b70baf1dd0b9e36c upstream.

According to the comment “restore_es3: applies to 34xx >= ES3.0" in
"arch/arm/mach-omap2/sleep34xx.S”, omap3_restore_es3 should be used
if the revision of an OMAP34xx is ES3.1.2.

Signed-off-by: Jeremy Vial <jvial@adeneo-embedded.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/mach-omap2/control.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 31e0dfe4a4ea..62a392bd0b57 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -324,7 +324,8 @@ void omap3_save_scratchpad_contents(void)
 		scratchpad_contents.public_restore_ptr =
 			virt_to_phys(omap3_restore_3630);
 	else if (omap_rev() != OMAP3430_REV_ES3_0 &&
-					omap_rev() != OMAP3430_REV_ES3_1)
+					omap_rev() != OMAP3430_REV_ES3_1 &&
+					omap_rev() != OMAP3430_REV_ES3_1_2)
 		scratchpad_contents.public_restore_ptr =
 			virt_to_phys(omap3_restore);
 	else
-- 
2.1.0


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

* [PATCH 3.12 29/56] drm: omapdrm: fix compiler errors
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (27 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 28/56] ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 30/56] hwmon: (sis5595) Prevent overflow problem when writing large limits Jiri Slaby
                   ` (28 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Russell King, Dave Airlie, 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 2d31ca3ad7d5d44c8adc7f253c96ce33f3a2e931 upstream.

Regular randconfig nightly testing has detected problems with omapdrm.

omapdrm fails to build when the kernel is built to support 64-bit DMA
addresses and/or 64-bit physical addresses due to an assumption about
the width of these types.

Use %pad to print DMA addresses, rather than %x or %Zx (which is even
more wrong than %x).  Avoid passing a uint32_t pointer into a function
which expects dma_addr_t pointer.

drivers/gpu/drm/omapdrm/omap_plane.c: In function 'omap_plane_pre_apply':
drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Werror=format]
drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Werror=format]
make[5]: *** [drivers/gpu/drm/omapdrm/omap_plane.o] Error 1
drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_get_paddr':
drivers/gpu/drm/omapdrm/omap_gem.c:794:4: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t' [-Werror=format]
drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_describe':
drivers/gpu/drm/omapdrm/omap_gem.c:991:4: error: format '%Zx' expects argument of type 'size_t', but argument 7 has type 'dma_addr_t' [-Werror=format]
drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_init':
drivers/gpu/drm/omapdrm/omap_gem.c:1470:4: error: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Werror=format]
make[5]: *** [drivers/gpu/drm/omapdrm/omap_gem.o] Error 1
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c: In function 'dmm_txn_append':
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:226:2: error: passing argument 3 of 'alloc_dma' from incompatible pointer type [-Werror]
make[5]: *** [drivers/gpu/drm/omapdrm/omap_dmm_tiler.o] Error 1
make[5]: Target `__build' not remade because of errors.
make[4]: *** [drivers/gpu/drm/omapdrm] Error 2

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |  6 ++++--
 drivers/gpu/drm/omapdrm/omap_gem.c       | 10 +++++-----
 drivers/gpu/drm/omapdrm/omap_plane.c     |  4 ++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index acf667859cb6..9501728bf479 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -199,7 +199,7 @@ static struct dmm_txn *dmm_txn_init(struct dmm *dmm, struct tcm *tcm)
 static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area,
 		struct page **pages, uint32_t npages, uint32_t roll)
 {
-	dma_addr_t pat_pa = 0;
+	dma_addr_t pat_pa = 0, data_pa = 0;
 	uint32_t *data;
 	struct pat *pat;
 	struct refill_engine *engine = txn->engine_handle;
@@ -223,7 +223,9 @@ static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area,
 			.lut_id = engine->tcm->lut_id,
 		};
 
-	data = alloc_dma(txn, 4*i, &pat->data_pa);
+	data = alloc_dma(txn, 4*i, &data_pa);
+	/* FIXME: what if data_pa is more than 32-bit ? */
+	pat->data_pa = data_pa;
 
 	while (i--) {
 		int n = i + roll;
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 533f6ebec531..6b01276a7fe8 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -791,7 +791,7 @@ int omap_gem_get_paddr(struct drm_gem_object *obj,
 			omap_obj->paddr = tiler_ssptr(block);
 			omap_obj->block = block;
 
-			DBG("got paddr: %08x", omap_obj->paddr);
+			DBG("got paddr: %pad", &omap_obj->paddr);
 		}
 
 		omap_obj->paddr_cnt++;
@@ -988,9 +988,9 @@ void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m)
 
 	off = drm_vma_node_start(&obj->vma_node);
 
-	seq_printf(m, "%08x: %2d (%2d) %08llx %08Zx (%2d) %p %4d",
+	seq_printf(m, "%08x: %2d (%2d) %08llx %pad (%2d) %p %4d",
 			omap_obj->flags, obj->name, obj->refcount.refcount.counter,
-			off, omap_obj->paddr, omap_obj->paddr_cnt,
+			off, &omap_obj->paddr, omap_obj->paddr_cnt,
 			omap_obj->vaddr, omap_obj->roll);
 
 	if (omap_obj->flags & OMAP_BO_TILED) {
@@ -1473,8 +1473,8 @@ void omap_gem_init(struct drm_device *dev)
 			entry->paddr = tiler_ssptr(block);
 			entry->block = block;
 
-			DBG("%d:%d: %dx%d: paddr=%08x stride=%d", i, j, w, h,
-					entry->paddr,
+			DBG("%d:%d: %dx%d: paddr=%pad stride=%d", i, j, w, h,
+					&entry->paddr,
 					usergart[i].stride_pfn << PAGE_SHIFT);
 		}
 	}
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 046d5e660c04..5b62e212cbe5 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -142,8 +142,8 @@ static void omap_plane_pre_apply(struct omap_drm_apply *apply)
 	DBG("%dx%d -> %dx%d (%d)", info->width, info->height,
 			info->out_width, info->out_height,
 			info->screen_width);
-	DBG("%d,%d %08x %08x", info->pos_x, info->pos_y,
-			info->paddr, info->p_uv_addr);
+	DBG("%d,%d %pad %pad", info->pos_x, info->pos_y,
+			&info->paddr, &info->p_uv_addr);
 
 	/* TODO: */
 	ilace = false;
-- 
2.1.0


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

* [PATCH 3.12 30/56] hwmon: (sis5595) Prevent overflow problem when writing large limits
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (28 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 29/56] drm: omapdrm: fix compiler errors Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 31/56] hwmon: (amc6821) Fix possible race condition bug Jiri Slaby
                   ` (27 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit cc336546ddca8c22de83720632431c16a5f9fe9a upstream.

On platforms with sizeof(int) < sizeof(long), writing a temperature
limit larger than MAXINT will result in unpredictable limit values
written to the chip. Avoid auto-conversion from long to int to fix
the problem.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/sis5595.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 72a889702f0d..9ec7d2e2542c 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -159,7 +159,7 @@ static inline int TEMP_FROM_REG(s8 val)
 {
 	return val * 830 + 52120;
 }
-static inline s8 TEMP_TO_REG(int val)
+static inline s8 TEMP_TO_REG(long val)
 {
 	int nval = clamp_val(val, -54120, 157530) ;
 	return nval < 0 ? (nval - 5212 - 415) / 830 : (nval - 5212 + 415) / 830;
-- 
2.1.0


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

* [PATCH 3.12 31/56] hwmon: (amc6821) Fix possible race condition bug
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (29 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 30/56] hwmon: (sis5595) Prevent overflow problem when writing large limits Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 32/56] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits Jiri Slaby
                   ` (26 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit cf44819c98db11163f58f08b822d626c7a8f5188 upstream.

Ensure mutex lock protects the read-modify-write period to prevent possible
race condition bug.
In additional, update data->valid should also be protected by the mutex lock.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/amc6821.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c
index 9f2be3dd28f3..8a67ec6279a4 100644
--- a/drivers/hwmon/amc6821.c
+++ b/drivers/hwmon/amc6821.c
@@ -360,11 +360,13 @@ static ssize_t set_pwm1_enable(
 	if (config)
 		return config;
 
+	mutex_lock(&data->update_lock);
 	config = i2c_smbus_read_byte_data(client, AMC6821_REG_CONF1);
 	if (config < 0) {
 			dev_err(&client->dev,
 			"Error reading configuration register, aborting.\n");
-			return config;
+			count = config;
+			goto unlock;
 	}
 
 	switch (val) {
@@ -381,14 +383,15 @@ static ssize_t set_pwm1_enable(
 		config |= AMC6821_CONF1_FDRC1;
 		break;
 	default:
-		return -EINVAL;
+		count = -EINVAL;
+		goto unlock;
 	}
-	mutex_lock(&data->update_lock);
 	if (i2c_smbus_write_byte_data(client, AMC6821_REG_CONF1, config)) {
 			dev_err(&client->dev,
 			"Configuration register write error, aborting.\n");
 			count = -EIO;
 	}
+unlock:
 	mutex_unlock(&data->update_lock);
 	return count;
 }
@@ -493,8 +496,9 @@ static ssize_t set_temp_auto_point_temp(
 		return -EINVAL;
 	}
 
-	data->valid = 0;
 	mutex_lock(&data->update_lock);
+	data->valid = 0;
+
 	switch (ix) {
 	case 0:
 		ptemp[0] = clamp_val(val / 1000, 0,
@@ -658,13 +662,14 @@ static ssize_t set_fan1_div(
 	if (config)
 		return config;
 
+	mutex_lock(&data->update_lock);
 	config = i2c_smbus_read_byte_data(client, AMC6821_REG_CONF4);
 	if (config < 0) {
 		dev_err(&client->dev,
 			"Error reading configuration register, aborting.\n");
-		return config;
+		count = config;
+		goto EXIT;
 	}
-	mutex_lock(&data->update_lock);
 	switch (val) {
 	case 2:
 		config &= ~AMC6821_CONF4_PSPR;
-- 
2.1.0


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

* [PATCH 3.12 32/56] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (30 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 31/56] hwmon: (amc6821) Fix possible race condition bug Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 33/56] hwmon: (gpio-fan) Prevent overflow problem when writing large limits Jiri Slaby
                   ` (25 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Guenter Roeck, Axel Lin, Jiri Slaby

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

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

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

commit 1074d683a51f1aded3562add9ef313e75d557327 upstream.

On platforms with sizeof(int) < sizeof(long), writing a temperature
limit larger than MAXINT will result in unpredictable limit values
written to the chip. Avoid auto-conversion from long to int to fix
the problem.

Cc: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/lm78.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index a2f3b4a365e4..b879427e9a46 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -108,7 +108,7 @@ static inline int FAN_FROM_REG(u8 val, int div)
  * TEMP: mC (-128C to +127C)
  * REG: 1C/bit, two's complement
  */
-static inline s8 TEMP_TO_REG(int val)
+static inline s8 TEMP_TO_REG(long val)
 {
 	int nval = clamp_val(val, -128000, 127000) ;
 	return nval < 0 ? (nval - 500) / 1000 : (nval + 500) / 1000;
-- 
2.1.0


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

* [PATCH 3.12 33/56] hwmon: (gpio-fan) Prevent overflow problem when writing large limits
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (31 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 32/56] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 34/56] hwmon: (ads1015) Fix off-by-one for valid channel index checking Jiri Slaby
                   ` (24 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit 2565fb05d1e9fc0831f7b1c083bcfcb1cba1f020 upstream.

On platforms with sizeof(int) < sizeof(unsigned long), writing a rpm value
larger than MAXINT will result in unpredictable limit values written to the
chip. Avoid auto-conversion from unsigned long to int to fix the problem.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/gpio-fan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index b7d6a5704eb2..ee21bdd610ee 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -172,7 +172,7 @@ static int get_fan_speed_index(struct gpio_fan_data *fan_data)
 	return -EINVAL;
 }
 
-static int rpm_to_speed_index(struct gpio_fan_data *fan_data, int rpm)
+static int rpm_to_speed_index(struct gpio_fan_data *fan_data, unsigned long rpm)
 {
 	struct gpio_fan_speed *speed = fan_data->speed;
 	int i;
-- 
2.1.0


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

* [PATCH 3.12 34/56] hwmon: (ads1015) Fix off-by-one for valid channel index checking
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (32 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 33/56] hwmon: (gpio-fan) Prevent overflow problem when writing large limits Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 35/56] hwmon: (lm85) Fix various errors on attribute writes Jiri Slaby
                   ` (23 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit 56de1377ad92f72ee4e5cb0faf7a9b6048fdf0bf upstream.

Current code uses channel as array index, so the valid channel value is
0 .. ADS1015_CHANNELS - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/ads1015.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index 7f9dc2f86b63..22e0c926989d 100644
--- a/drivers/hwmon/ads1015.c
+++ b/drivers/hwmon/ads1015.c
@@ -198,7 +198,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
 		}
 
 		channel = be32_to_cpup(property);
-		if (channel > ADS1015_CHANNELS) {
+		if (channel >= ADS1015_CHANNELS) {
 			dev_err(&client->dev,
 				"invalid channel index %d on %s\n",
 				channel, node->full_name);
-- 
2.1.0


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

* [PATCH 3.12 00/56] 3.12.28-stable review
@ 2014-09-03  9:26 Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 01/56] bcache: Minor journal fix Jiri Slaby
                   ` (57 more replies)
  0 siblings, 58 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux, satoru.takeuchi, shuah.kh, linux-kernel, Jiri Slaby

This is the start of the stable review cycle for the 3.12.28 release.
There are 56 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 Sep  5 11:17:45 CEST 2014.
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.28-rc1.xz
and the diffstat can be found below.

thanks,
js

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


Alan Stern (2):
  USB: OHCI: fix bugs in debug routines
  USB: OHCI: don't lose track of EDs when a controller dies

Alex Deucher (3):
  drm/radeon: add new KV pci id
  drm/radeon: add new bonaire pci ids
  drm/radeon: add additional SI pci ids

Alexander Usyskin (1):
  mei: start disconnect request timer consistently

Andy Lutomirski (1):
  x86_64/vsyscall: Fix warn_bad_vsyscall log output

Arnd Bergmann (1):
  crypto: ux500 - make interrupt mode plausible

Axel Lin (6):
  hwmon: (sis5595) Prevent overflow problem when writing large limits
  hwmon: (amc6821) Fix possible race condition bug
  hwmon: (gpio-fan) Prevent overflow problem when writing large limits
  hwmon: (ads1015) Fix off-by-one for valid channel index checking
  hwmon: (ads1015) Fix out-of-bounds array access
  hwmon: (dme1737) Prevent overflow problem when writing large limits

Bjorn Helgaas (1):
  PCI: Add pci_upstream_bridge()

Bryan O'Donoghue (1):
  USB: ehci-pci: USB host controller support for Intel Quark X1000

Christoph Schulz (1):
  x86: don't exclude low BIOS area when allocating address space for
    non-PCI cards

Clemens Ladisch (2):
  ALSA: virtuoso: add Xonar Essence STX II support
  ALSA: usb-audio: fix BOSS ME-25 MIDI regression

Daniel Mack (1):
  usb: musb: cppi41: fire hrtimer according to programmed channel length

David Vrabel (1):
  x86/xen: resume timer irqs early

Gu Zheng (1):
  bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload

Guenter Roeck (2):
  hwmon: (lm78) Fix overflow problems seen when writing large
    temperature limits
  hwmon: (lm85) Fix various errors on attribute writes

Hui Wang (2):
  ALSA: hda - fix an external mic jack problem on a HP machine
  ALSA: hda - restore the gpio led after resume

James P Michels III (1):
  usb-core bInterval quirk

Jan Kara (1):
  isofs: Fix unbounded recursion when processing relocated directories

Jason Gunthorpe (1):
  tpm: Add missing tpm_do_selftest to ST33 I2C driver

Jeremy Vial (1):
  ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX
    rev3.1.2 case.

Jiang Liu (1):
  USB: core: hcd-pci: free IRQ before disabling PCI device when shutting
    down

Jiri Kosina (2):
  HID: logitech: perform bounds checking on device_id early enough
  HID: fix a couple of off-by-ones

Joonyoung Shim (1):
  USB: add reset resume quirk for usb3503

Kent Overstreet (1):
  bcache: Minor journal fix

Lee, Chun-Yi (1):
  PM / hibernate: avoid unsafe pages in e820 reserved regions

Matt Fleming (1):
  x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub

Michael S. Tsirkin (1):
  kvm: iommu: fix the third parameter of kvm_iommu_put_pages
    (CVE-2014-3601)

Nadav Amit (1):
  KVM: x86: Inter-privilege level ret emulation is not implemeneted

Oliver Neukum (1):
  USB: devio: fix issue with log flooding

Paolo Bonzini (2):
  KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC
    redir table
  Revert "KVM: x86: Increase the number of fixed MTRR regs to 10"

Patrick Riphagen (2):
  USB: serial: ftdi_sio: Annotate the current Xsens PID assignments
  USB: serial: ftdi_sio: Add support for new Xsens devices

Peter Hurley (1):
  serial: core: Preserve termios c_cflag for console resume

Pratyush Anand (1):
  USB: Fix persist resume of some SS USB devices

Preston Fick (1):
  USB: serial: cp210x: Removing unncessary `usb_reset_device` on startup

Russell King (1):
  drm: omapdrm: fix compiler errors

Stephen M. Cameron (1):
  hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl

Steven Rostedt (1):
  debugfs: Fix corrupted loop in debugfs_remove_recursive

Takashi Iwai (2):
  ALSA: hda/ca0132 - Don't try loading firmware at resume when already
    failed
  ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co

Theodore Ts'o (1):
  ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa
    struct

Vidya Sagar (1):
  PCI: Configure ASPM when enabling device

Wangzhao Cai (1):
  HID: add quirk for 0x04d9:0xa096 device

Wolfram Sang (1):
  drivers/i2c/busses: use correct type for dma_map/unmap

 Documentation/sound/alsa/ALSA-Configuration.txt |  4 +--
 arch/arm/mach-omap2/control.c                   |  3 +-
 arch/x86/Kconfig                                |  1 +
 arch/x86/include/asm/kvm_host.h                 |  2 +-
 arch/x86/kernel/resource.c                      |  8 +++--
 arch/x86/kernel/vsyscall_64.c                   |  8 ++---
 arch/x86/kvm/emulate.c                          |  4 +++
 arch/x86/pci/i386.c                             |  4 +++
 arch/x86/xen/time.c                             |  2 +-
 drivers/char/tpm/tpm_i2c_stm_st33.c             |  1 +
 drivers/crypto/ux500/cryp/cryp_core.c           | 25 +++++++-------
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c        |  6 ++--
 drivers/gpu/drm/omapdrm/omap_gem.c              | 10 +++---
 drivers/gpu/drm/omapdrm/omap_plane.c            |  4 +--
 drivers/gpu/drm/radeon/cik.c                    |  1 +
 drivers/hid/hid-cherry.c                        |  2 +-
 drivers/hid/hid-ids.h                           |  1 +
 drivers/hid/hid-kye.c                           |  2 +-
 drivers/hid/hid-lg.c                            |  4 +--
 drivers/hid/hid-logitech-dj.c                   | 13 ++++---
 drivers/hid/hid-monterey.c                      |  2 +-
 drivers/hid/hid-petalynx.c                      |  2 +-
 drivers/hid/hid-sunplus.c                       |  2 +-
 drivers/hid/usbhid/hid-quirks.c                 |  1 +
 drivers/hwmon/ads1015.c                         |  4 ++-
 drivers/hwmon/amc6821.c                         | 17 +++++----
 drivers/hwmon/dme1737.c                         | 33 ++++++++++--------
 drivers/hwmon/gpio-fan.c                        |  2 +-
 drivers/hwmon/lm78.c                            |  2 +-
 drivers/hwmon/lm85.c                            |  9 +++--
 drivers/hwmon/sis5595.c                         |  2 +-
 drivers/i2c/busses/i2c-at91.c                   |  4 +--
 drivers/md/bcache/journal.c                     | 19 +++++++---
 drivers/misc/mei/client.c                       |  1 +
 drivers/pci/pci.c                               | 12 +++----
 drivers/scsi/hpsa.c                             |  2 +-
 drivers/tty/serial/serial_core.c                |  3 ++
 drivers/usb/core/config.c                       | 11 ++++++
 drivers/usb/core/devio.c                        |  2 +-
 drivers/usb/core/hcd-pci.c                      |  2 ++
 drivers/usb/core/hub.c                          | 41 ++++++++++++++++++++++
 drivers/usb/core/quirks.c                       |  7 ++++
 drivers/usb/host/ehci-pci.c                     | 25 ++++++++++++++
 drivers/usb/host/ohci-dbg.c                     |  9 ++---
 drivers/usb/host/ohci-hcd.c                     | 10 +++---
 drivers/usb/host/ohci-q.c                       | 46 ++++++++++++++++---------
 drivers/usb/musb/musb_cppi41.c                  |  6 ++--
 drivers/usb/serial/cp210x.c                     |  3 --
 drivers/usb/serial/ftdi_sio.c                   |  2 ++
 drivers/usb/serial/ftdi_sio_ids.h               | 13 ++++---
 fs/bio-integrity.c                              | 12 ++-----
 fs/debugfs/inode.c                              | 34 +++++++++++++-----
 fs/ext4/mballoc.c                               | 21 ++++++++++-
 fs/isofs/inode.c                                | 15 ++++----
 fs/isofs/isofs.h                                | 23 ++++++++++---
 fs/isofs/rock.c                                 | 39 +++++++++++++++------
 include/drm/drm_pciids.h                        |  7 ++++
 include/linux/bio.h                             |  1 +
 include/linux/pci.h                             |  9 +++++
 include/linux/usb/quirks.h                      | 11 ++++++
 kernel/power/snapshot.c                         | 21 ++++++++++-
 sound/pci/Kconfig                               |  4 +--
 sound/pci/hda/patch_ca0132.c                    |  7 +++-
 sound/pci/hda/patch_realtek.c                   | 26 +++++++++++---
 sound/pci/hda/patch_sigmatel.c                  | 12 +++++++
 sound/pci/oxygen/virtuoso.c                     |  1 +
 sound/pci/oxygen/xonar_pcm179x.c                | 12 +++++--
 sound/usb/quirks-table.h                        | 29 ++++++++++++++++
 virt/kvm/ioapic.c                               |  7 ++--
 virt/kvm/iommu.c                                | 19 +++++-----
 70 files changed, 518 insertions(+), 191 deletions(-)

-- 
2.1.0


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

* [PATCH 3.12 35/56] hwmon: (lm85) Fix various errors on attribute writes
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (33 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 34/56] hwmon: (ads1015) Fix off-by-one for valid channel index checking Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 36/56] hwmon: (ads1015) Fix out-of-bounds array access Jiri Slaby
                   ` (22 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Guenter Roeck, Axel Lin, Jiri Slaby

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

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

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

commit 3248c3b771ddd9d31695da17ba350eb6e1b80a53 upstream.

Temperature limit register writes did not account for negative numbers.
As a result, writing -127000 resulted in -126000 written into the
temperature limit register. This problem affected temp[1-3]_min,
temp[1-3]_max, temp[1-3]_auto_temp_crit, and temp[1-3]_auto_temp_min.

When writing pwm[1-3]_freq, a long variable was auto-converted into an int
without range check. Wiring values larger than MAXINT resulted in unexpected
register values.

When writing temp[1-3]_auto_temp_max, an unsigned long variable was
auto-converted into an int without range check. Writing values larger than
MAXINT resulted in unexpected register values.

vrm is an u8, so the written value needs to be limited to [0, 255].

Cc: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/lm85.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index 3894c408fda3..b9d6e7d0ba37 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -158,7 +158,7 @@ static inline u16 FAN_TO_REG(unsigned long val)
 
 /* Temperature is reported in .001 degC increments */
 #define TEMP_TO_REG(val)	\
-		clamp_val(SCALE(val, 1000, 1), -127, 127)
+		DIV_ROUND_CLOSEST(clamp_val((val), -127000, 127000), 1000)
 #define TEMPEXT_FROM_REG(val, ext)	\
 		SCALE(((val) << 4) + (ext), 16, 1000)
 #define TEMP_FROM_REG(val)	((val) * 1000)
@@ -192,7 +192,7 @@ static const int lm85_range_map[] = {
 	13300, 16000, 20000, 26600, 32000, 40000, 53300, 80000
 };
 
-static int RANGE_TO_REG(int range)
+static int RANGE_TO_REG(long range)
 {
 	int i;
 
@@ -214,7 +214,7 @@ static const int adm1027_freq_map[8] = { /* 1 Hz */
 	11, 15, 22, 29, 35, 44, 59, 88
 };
 
-static int FREQ_TO_REG(const int *map, int freq)
+static int FREQ_TO_REG(const int *map, unsigned long freq)
 {
 	int i;
 
@@ -463,6 +463,9 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
 	if (err)
 		return err;
 
+	if (val > 255)
+		return -EINVAL;
+
 	data->vrm = val;
 	return count;
 }
-- 
2.1.0


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

* [PATCH 3.12 36/56] hwmon: (ads1015) Fix out-of-bounds array access
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (34 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 35/56] hwmon: (lm85) Fix various errors on attribute writes Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 37/56] hwmon: (dme1737) Prevent overflow problem when writing large limits Jiri Slaby
                   ` (21 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit e981429557cbe10c780fab1c1a237cb832757652 upstream.

Current code uses data_rate as array index in ads1015_read_adc() and uses pga
as array index in ads1015_reg_to_mv, so we must make sure both data_rate and
pga settings are in valid value range.
Return -EINVAL if the setting is out-of-range.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/ads1015.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index 22e0c926989d..126516414c11 100644
--- a/drivers/hwmon/ads1015.c
+++ b/drivers/hwmon/ads1015.c
@@ -212,6 +212,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
 				dev_err(&client->dev,
 					"invalid gain on %s\n",
 					node->full_name);
+				return -EINVAL;
 			}
 		}
 
@@ -222,6 +223,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
 				dev_err(&client->dev,
 					"invalid data_rate on %s\n",
 					node->full_name);
+				return -EINVAL;
 			}
 		}
 
-- 
2.1.0


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

* [PATCH 3.12 37/56] hwmon: (dme1737) Prevent overflow problem when writing large limits
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (35 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 36/56] hwmon: (ads1015) Fix out-of-bounds array access Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 38/56] tpm: Add missing tpm_do_selftest to ST33 I2C driver Jiri Slaby
                   ` (20 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Axel Lin, Guenter Roeck, Jiri Slaby

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

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

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

commit d58e47d787c09fe5c61af3c6ce7d784762f29c3d upstream.

On platforms with sizeof(int) < sizeof(long), writing a temperature
limit larger than MAXINT will result in unpredictable limit values
written to the chip. Avoid auto-conversion from long to int to fix
the problem.

Voltage limits, fan minimum speed, pwm frequency, pwm ramp rate, and
other attributes have the same problem, fix them as well.

Zone temperature limits are signed, but were cached as u8, causing
unepected values to be reported for negative temperatures. Cache as
s8 to fix the problem.

vrm is an u8, so the written value needs to be limited to [0, 255].

Signed-off-by: Axel Lin <axel.lin@ingics.com>
[Guenter Roeck: Fix zone temperature cache]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/dme1737.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index 4ae3fff13f44..bea0a344fab5 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -247,8 +247,8 @@ struct dme1737_data {
 	u8  pwm_acz[3];
 	u8  pwm_freq[6];
 	u8  pwm_rr[2];
-	u8  zone_low[3];
-	u8  zone_abs[3];
+	s8  zone_low[3];
+	s8  zone_abs[3];
 	u8  zone_hyst[2];
 	u32 alarms;
 };
@@ -277,7 +277,7 @@ static inline int IN_FROM_REG(int reg, int nominal, int res)
 	return (reg * nominal + (3 << (res - 3))) / (3 << (res - 2));
 }
 
-static inline int IN_TO_REG(int val, int nominal)
+static inline int IN_TO_REG(long val, int nominal)
 {
 	return clamp_val((val * 192 + nominal / 2) / nominal, 0, 255);
 }
@@ -293,7 +293,7 @@ static inline int TEMP_FROM_REG(int reg, int res)
 	return (reg * 1000) >> (res - 8);
 }
 
-static inline int TEMP_TO_REG(int val)
+static inline int TEMP_TO_REG(long val)
 {
 	return clamp_val((val < 0 ? val - 500 : val + 500) / 1000, -128, 127);
 }
@@ -308,7 +308,7 @@ static inline int TEMP_RANGE_FROM_REG(int reg)
 	return TEMP_RANGE[(reg >> 4) & 0x0f];
 }
 
-static int TEMP_RANGE_TO_REG(int val, int reg)
+static int TEMP_RANGE_TO_REG(long val, int reg)
 {
 	int i;
 
@@ -331,7 +331,7 @@ static inline int TEMP_HYST_FROM_REG(int reg, int ix)
 	return (((ix == 1) ? reg : reg >> 4) & 0x0f) * 1000;
 }
 
-static inline int TEMP_HYST_TO_REG(int val, int ix, int reg)
+static inline int TEMP_HYST_TO_REG(long val, int ix, int reg)
 {
 	int hyst = clamp_val((val + 500) / 1000, 0, 15);
 
@@ -347,7 +347,7 @@ static inline int FAN_FROM_REG(int reg, int tpc)
 		return (reg == 0 || reg == 0xffff) ? 0 : 90000 * 60 / reg;
 }
 
-static inline int FAN_TO_REG(int val, int tpc)
+static inline int FAN_TO_REG(long val, int tpc)
 {
 	if (tpc) {
 		return clamp_val(val / tpc, 0, 0xffff);
@@ -379,7 +379,7 @@ static inline int FAN_TYPE_FROM_REG(int reg)
 	return (edge > 0) ? 1 << (edge - 1) : 0;
 }
 
-static inline int FAN_TYPE_TO_REG(int val, int reg)
+static inline int FAN_TYPE_TO_REG(long val, int reg)
 {
 	int edge = (val == 4) ? 3 : val;
 
@@ -402,7 +402,7 @@ static int FAN_MAX_FROM_REG(int reg)
 	return 1000 + i * 500;
 }
 
-static int FAN_MAX_TO_REG(int val)
+static int FAN_MAX_TO_REG(long val)
 {
 	int i;
 
@@ -460,7 +460,7 @@ static inline int PWM_ACZ_FROM_REG(int reg)
 	return acz[(reg >> 5) & 0x07];
 }
 
-static inline int PWM_ACZ_TO_REG(int val, int reg)
+static inline int PWM_ACZ_TO_REG(long val, int reg)
 {
 	int acz = (val == 4) ? 2 : val - 1;
 
@@ -476,7 +476,7 @@ static inline int PWM_FREQ_FROM_REG(int reg)
 	return PWM_FREQ[reg & 0x0f];
 }
 
-static int PWM_FREQ_TO_REG(int val, int reg)
+static int PWM_FREQ_TO_REG(long val, int reg)
 {
 	int i;
 
@@ -510,7 +510,7 @@ static inline int PWM_RR_FROM_REG(int reg, int ix)
 	return (rr & 0x08) ? PWM_RR[rr & 0x07] : 0;
 }
 
-static int PWM_RR_TO_REG(int val, int ix, int reg)
+static int PWM_RR_TO_REG(long val, int ix, int reg)
 {
 	int i;
 
@@ -528,7 +528,7 @@ static inline int PWM_RR_EN_FROM_REG(int reg, int ix)
 	return PWM_RR_FROM_REG(reg, ix) ? 1 : 0;
 }
 
-static inline int PWM_RR_EN_TO_REG(int val, int ix, int reg)
+static inline int PWM_RR_EN_TO_REG(long val, int ix, int reg)
 {
 	int en = (ix == 1) ? 0x80 : 0x08;
 
@@ -1481,13 +1481,16 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr,
 		       const char *buf, size_t count)
 {
 	struct dme1737_data *data = dev_get_drvdata(dev);
-	long val;
+	unsigned long val;
 	int err;
 
-	err = kstrtol(buf, 10, &val);
+	err = kstrtoul(buf, 10, &val);
 	if (err)
 		return err;
 
+	if (val > 255)
+		return -EINVAL;
+
 	data->vrm = val;
 	return count;
 }
-- 
2.1.0


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

* [PATCH 3.12 38/56] tpm: Add missing tpm_do_selftest to ST33 I2C driver
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (36 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 37/56] hwmon: (dme1737) Prevent overflow problem when writing large limits Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 39/56] drivers/i2c/busses: use correct type for dma_map/unmap Jiri Slaby
                   ` (19 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jason Gunthorpe, Peter Huewe, Jiri Slaby

From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

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

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

commit f07a5e9a331045e976a3d317ba43d14859d9407c upstream.

Most device drivers do call 'tpm_do_selftest' which executes a
TPM_ContinueSelfTest. tpm_i2c_stm_st33 is just pointlessly different,
I think it is bug.

These days we have the general assumption that the TPM is usable by
the kernel immediately after the driver is finished, so we can no
longer defer the mandatory self test to userspace.

Reported-by: Richard Marciel <rmaciel@linux.vnet.ibm.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/char/tpm/tpm_i2c_stm_st33.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c
index 156bd3c72770..06af39ca901e 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -750,6 +750,7 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	}
 
 	tpm_get_timeouts(chip);
+	tpm_do_selftest(chip);
 
 	i2c_set_clientdata(client, chip);
 
-- 
2.1.0


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

* [PATCH 3.12 39/56] drivers/i2c/busses: use correct type for dma_map/unmap
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (37 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 38/56] tpm: Add missing tpm_do_selftest to ST33 I2C driver Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-03  9:26 ` [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct Jiri Slaby
                   ` (18 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Wolfram Sang, Jiri Slaby

From: Wolfram Sang <wsa@the-dreams.de>

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

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

commit 28772ac8711e4d7268c06e765887dd8cb6924f98 upstream.

dma_{un}map_* uses 'enum dma_data_direction' not 'enum dma_transfer_direction'.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/i2c/busses/i2c-at91.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index fd059308affa..9d3e846e0137 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -210,7 +210,7 @@ static void at91_twi_write_data_dma_callback(void *data)
 	struct at91_twi_dev *dev = (struct at91_twi_dev *)data;
 
 	dma_unmap_single(dev->dev, sg_dma_address(&dev->dma.sg),
-			 dev->buf_len, DMA_MEM_TO_DEV);
+			 dev->buf_len, DMA_TO_DEVICE);
 
 	at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
 }
@@ -289,7 +289,7 @@ static void at91_twi_read_data_dma_callback(void *data)
 	struct at91_twi_dev *dev = (struct at91_twi_dev *)data;
 
 	dma_unmap_single(dev->dev, sg_dma_address(&dev->dma.sg),
-			 dev->buf_len, DMA_DEV_TO_MEM);
+			 dev->buf_len, DMA_FROM_DEVICE);
 
 	/* The last two bytes have to be read without using dma */
 	dev->buf += dev->buf_len - 2;
-- 
2.1.0


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

* [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (38 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 39/56] drivers/i2c/busses: use correct type for dma_map/unmap Jiri Slaby
@ 2014-09-03  9:26 ` Jiri Slaby
  2014-09-15  2:46   ` Ben Hutchings
  2014-09-03  9:27 ` [PATCH 3.12 41/56] serial: core: Preserve termios c_cflag for console resume Jiri Slaby
                   ` (17 subsequent siblings)
  57 siblings, 1 reply; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:26 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Theodore Ts'o, Jiri Slaby

From: Theodore Ts'o <tytso@mit.edu>

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

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

commit 86f0afd463215fc3e58020493482faa4ac3a4d69 upstream.

If there is a failure while allocating the preallocation structure, a
number of blocks can end up getting marked in the in-memory buddy
bitmap, and then not getting released.  This can result in the
following corruption getting reported by the kernel:

EXT4-fs error (device sda3): ext4_mb_generate_buddy:758: group 1126,
12793 clusters in bitmap, 12729 in gd

In that case, we need to release the blocks using mb_free_blocks().

Tested: fs smoke test; also demonstrated that with injected errors,
	the file system is no longer getting corrupted

Google-Bug-Id: 16657874

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/ext4/mballoc.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 502f0fd71470..795d5afc1479 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3196,8 +3196,27 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac)
 static void ext4_discard_allocated_blocks(struct ext4_allocation_context *ac)
 {
 	struct ext4_prealloc_space *pa = ac->ac_pa;
+	struct ext4_buddy e4b;
+	int err;
 
-	if (pa && pa->pa_type == MB_INODE_PA)
+	if (pa == NULL) {
+		err = ext4_mb_load_buddy(ac->ac_sb, ac->ac_f_ex.fe_group, &e4b);
+		if (err) {
+			/*
+			 * This should never happen since we pin the
+			 * pages in the ext4_allocation_context so
+			 * ext4_mb_load_buddy() should never fail.
+			 */
+			WARN(1, "mb_load_buddy failed (%d)", err);
+			return;
+		}
+		ext4_lock_group(ac->ac_sb, ac->ac_f_ex.fe_group);
+		mb_free_blocks(ac->ac_inode, &e4b, ac->ac_f_ex.fe_start,
+			       ac->ac_f_ex.fe_len);
+		ext4_unlock_group(ac->ac_sb, ac->ac_f_ex.fe_group);
+		return;
+	}
+	if (pa->pa_type == MB_INODE_PA)
 		pa->pa_free += ac->ac_b_ex.fe_len;
 }
 
-- 
2.1.0


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

* [PATCH 3.12 41/56] serial: core: Preserve termios c_cflag for console resume
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (39 preceding siblings ...)
  2014-09-03  9:26 ` [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 42/56] crypto: ux500 - make interrupt mode plausible Jiri Slaby
                   ` (16 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Peter Hurley, Jiri Slaby

From: Peter Hurley <peter@hurleysoftware.com>

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

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

commit ae84db9661cafc63d179e1d985a2c5b841ff0ac4 upstream.

When a tty is opened for the serial console, the termios c_cflag
settings are inherited from the console line settings.
However, if the tty is subsequently closed, the termios settings
are lost. This results in a garbled console if the console is later
suspended and resumed.

Preserve the termios c_cflag for the serial console when the tty
is shutdown; this reflects the most recent line settings.

Fixes: Bugzilla #69751, 'serial console does not wake from S3'
Reported-by: Valerio Vanni <valerio.vanni@inwind.it>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/serial_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 0f02351c9239..b5180c10f71d 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -235,6 +235,9 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
 		/*
 		 * Turn off DTR and RTS early.
 		 */
+		if (uart_console(uport) && tty)
+			uport->cons->cflag = tty->termios.c_cflag;
+
 		if (!tty || (tty->termios.c_cflag & HUPCL))
 			uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
 
-- 
2.1.0


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

* [PATCH 3.12 42/56] crypto: ux500 - make interrupt mode plausible
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (40 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 41/56] serial: core: Preserve termios c_cflag for console resume Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 43/56] debugfs: Fix corrupted loop in debugfs_remove_recursive Jiri Slaby
                   ` (15 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Arnd Bergmann, linux-crypto, Fabio Baltieri,
	Linus Walleij, Herbert Xu, David S. Miller, Jiri Slaby

From: Arnd Bergmann <arnd@arndb.de>

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

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

commit e1f8859ee265fc89bd21b4dca79e8e983a044892 upstream.

The interrupt handler in the ux500 crypto driver has an obviously
incorrect way to access the data buffer, which for a while has
caused this build warning:

../ux500/cryp/cryp_core.c: In function 'cryp_interrupt_handler':
../ux500/cryp/cryp_core.c:234:5: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast [enabled by default]
     writel_relaxed(ctx->indata,
     ^
In file included from ../include/linux/swab.h:4:0,
                 from ../include/uapi/linux/byteorder/big_endian.h:12,
                 from ../include/linux/byteorder/big_endian.h:4,
                 from ../arch/arm/include/uapi/asm/byteorder.h:19,
                 from ../include/asm-generic/bitops/le.h:5,
                 from ../arch/arm/include/asm/bitops.h:340,
                 from ../include/linux/bitops.h:33,
                 from ../include/linux/kernel.h:10,
                 from ../include/linux/clk.h:16,
                 from ../drivers/crypto/ux500/cryp/cryp_core.c:12:
../include/uapi/linux/swab.h:57:119: note: expected '__u32' but argument is of type 'const u8 *'
 static inline __attribute_const__ __u32 __fswab32(__u32 val)

There are at least two, possibly three problems here:
a) when writing into the FIFO, we copy the pointer rather than the
   actual data we want to give to the hardware
b) the data pointer is an array of 8-bit values, while the FIFO
   is 32-bit wide, so both the read and write access fail to do
   a proper type conversion
c) This seems incorrect for big-endian kernels, on which we need to
   byte-swap any register access, but not normally FIFO accesses,
   at least the DMA case doesn't do it either.

This converts the bogus loop to use the same readsl/writesl pair
that we use for the two other modes (DMA and polling). This is
more efficient and consistent, and probably correct for endianess.

The bug has existed since the driver was first merged, and was
probably never detected because nobody tried to use interrupt mode.
It might make sense to backport this fix to stable kernels, depending
on how the crypto maintainers feel about that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-crypto@vger.kernel.org
Cc: Fabio Baltieri <fabio.baltieri@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/crypto/ux500/cryp/cryp_core.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c
index a999f537228f..92105f3dc8e0 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -190,7 +190,7 @@ static void add_session_id(struct cryp_ctx *ctx)
 static irqreturn_t cryp_interrupt_handler(int irq, void *param)
 {
 	struct cryp_ctx *ctx;
-	int i;
+	int count;
 	struct cryp_device_data *device_data;
 
 	if (param == NULL) {
@@ -215,12 +215,11 @@ static irqreturn_t cryp_interrupt_handler(int irq, void *param)
 	if (cryp_pending_irq_src(device_data,
 				 CRYP_IRQ_SRC_OUTPUT_FIFO)) {
 		if (ctx->outlen / ctx->blocksize > 0) {
-			for (i = 0; i < ctx->blocksize / 4; i++) {
-				*(ctx->outdata) = readl_relaxed(
-						&device_data->base->dout);
-				ctx->outdata += 4;
-				ctx->outlen -= 4;
-			}
+			count = ctx->blocksize / 4;
+
+			readsl(&device_data->base->dout, ctx->outdata, count);
+			ctx->outdata += count;
+			ctx->outlen -= count;
 
 			if (ctx->outlen == 0) {
 				cryp_disable_irq_src(device_data,
@@ -230,12 +229,12 @@ static irqreturn_t cryp_interrupt_handler(int irq, void *param)
 	} else if (cryp_pending_irq_src(device_data,
 					CRYP_IRQ_SRC_INPUT_FIFO)) {
 		if (ctx->datalen / ctx->blocksize > 0) {
-			for (i = 0 ; i < ctx->blocksize / 4; i++) {
-				writel_relaxed(ctx->indata,
-						&device_data->base->din);
-				ctx->indata += 4;
-				ctx->datalen -= 4;
-			}
+			count = ctx->blocksize / 4;
+
+			writesl(&device_data->base->din, ctx->indata, count);
+
+			ctx->indata += count;
+			ctx->datalen -= count;
 
 			if (ctx->datalen == 0)
 				cryp_disable_irq_src(device_data,
-- 
2.1.0


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

* [PATCH 3.12 43/56] debugfs: Fix corrupted loop in debugfs_remove_recursive
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (41 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 42/56] crypto: ux500 - make interrupt mode plausible Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 44/56] KVM: x86: Inter-privilege level ret emulation is not implemeneted Jiri Slaby
                   ` (14 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Steven Rostedt, Jiri Slaby

From: Steven Rostedt <rostedt@goodmis.org>

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

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

commit 485d44022a152c0254dd63445fdb81c4194cbf0e upstream.

[ I'm currently running my tests on it now, and so far, after a few
 hours it has yet to blow up. I'll run it for 24 hours which it never
 succeeded in the past. ]

The tracing code has a way to make directories within the debugfs file
system as well as deleting them using mkdir/rmdir in the instance
directory. This is very limited in functionality, such as there is
no renames, and the parent directory "instance" can not be modified.
The tracing code creates the instance directory from the debugfs code
and then replaces the dentry->d_inode->i_op with its own to allow
for mkdir/rmdir to work.

When these are called, the d_entry and inode locks need to be released
to call the instance creation and deletion code. That code has its own
accounting and locking to serialize everything to prevent multiple
users from causing harm. As the parent "instance" directory can not
be modified this simplifies things.

I created a stress test that creates several threads that randomly
creates and deletes directories thousands of times a second. The code
stood up to this test and I submitted it a while ago.

Recently I added a new test that adds readers to the mix. While the
instance directories were being added and deleted, readers would read
from these directories and even enable tracing within them. This test
was able to trigger a bug:

 general protection fault: 0000 [#1] PREEMPT SMP
 Modules linked in: ...
 CPU: 3 PID: 17789 Comm: rmdir Tainted: G        W     3.15.0-rc2-test+ #41
 Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS SDBLI944.86P 05/08/2007
 task: ffff88003786ca60 ti: ffff880077018000 task.ti: ffff880077018000
 RIP: 0010:[<ffffffff811ed5eb>]  [<ffffffff811ed5eb>] debugfs_remove_recursive+0x1bd/0x367
 RSP: 0018:ffff880077019df8  EFLAGS: 00010246
 RAX: 0000000000000002 RBX: ffff88006f0fe490 RCX: 0000000000000000
 RDX: dead000000100058 RSI: 0000000000000246 RDI: ffff88003786d454
 RBP: ffff88006f0fe640 R08: 0000000000000628 R09: 0000000000000000
 R10: 0000000000000628 R11: ffff8800795110a0 R12: ffff88006f0fe640
 R13: ffff88006f0fe640 R14: ffffffff81817d0b R15: ffffffff818188b7
 FS:  00007ff13ae24700(0000) GS:ffff88007d580000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000003054ec7be0 CR3: 0000000076d51000 CR4: 00000000000007e0
 Stack:
  ffff88007a41ebe0 dead000000100058 00000000fffffffe ffff88006f0fe640
  0000000000000000 ffff88006f0fe678 ffff88007a41ebe0 ffff88003793a000
  00000000fffffffe ffffffff810bde82 ffff88006f0fe640 ffff88007a41eb28
 Call Trace:
  [<ffffffff810bde82>] ? instance_rmdir+0x15b/0x1de
  [<ffffffff81132e2d>] ? vfs_rmdir+0x80/0xd3
  [<ffffffff81132f51>] ? do_rmdir+0xd1/0x139
  [<ffffffff8124ad9e>] ? trace_hardirqs_on_thunk+0x3a/0x3c
  [<ffffffff814fea62>] ? system_call_fastpath+0x16/0x1b
 Code: fe ff ff 48 8d 75 30 48 89 df e8 c9 fd ff ff 85 c0 75 13 48 c7 c6 b8 cc d2 81 48 c7 c7 b0 cc d2 81 e8 8c 7a f5 ff 48 8b 54 24 08 <48> 8b 82 a8 00 00 00 48 89 d3 48 2d a8 00 00 00 48 89 44 24 08
 RIP  [<ffffffff811ed5eb>] debugfs_remove_recursive+0x1bd/0x367
  RSP <ffff880077019df8>

It took a while, but every time it triggered, it was always in the
same place:

	list_for_each_entry_safe(child, next, &parent->d_subdirs, d_u.d_child) {

Where the child->d_u.d_child seemed to be corrupted.  I added lots of
trace_printk()s to see what was wrong, and sure enough, it was always
the child's d_u.d_child field. I looked around to see what touches
it and noticed that in __dentry_kill() which calls dentry_free():

static void dentry_free(struct dentry *dentry)
{
	/* if dentry was never visible to RCU, immediate free is OK */
	if (!(dentry->d_flags & DCACHE_RCUACCESS))
		__d_free(&dentry->d_u.d_rcu);
	else
		call_rcu(&dentry->d_u.d_rcu, __d_free);
}

I also noticed that __dentry_kill() unlinks the child->d_u.child
under the parent->d_lock spin_lock.

Looking back at the loop in debugfs_remove_recursive() it never takes the
parent->d_lock to do the list walk. Adding more tracing, I was able to
prove this was the issue:

 ftrace-t-15385   1.... 246662024us : dentry_kill <ffffffff81138b91>: free ffff88006d573600
    rmdir-15409   2.... 246662024us : debugfs_remove_recursive <ffffffff811ec7e5>: child=ffff88006d573600 next=dead000000100058

The dentry_kill freed ffff88006d573600 just as the remove recursive was walking
it.

In order to fix this, the list walk needs to be modified a bit to take
the parent->d_lock. The safe version is no longer necessary, as every
time we remove a child, the parent->d_lock must be released and the
list walk must start over. Each time a child is removed, even though it
may still be on the list, it should be skipped by the first check
in the loop:

		if (!debugfs_positive(child))
			continue;

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/debugfs/inode.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index c7c83ff0f752..15761957cc3f 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -533,7 +533,7 @@ EXPORT_SYMBOL_GPL(debugfs_remove);
  */
 void debugfs_remove_recursive(struct dentry *dentry)
 {
-	struct dentry *child, *next, *parent;
+	struct dentry *child, *parent;
 
 	if (IS_ERR_OR_NULL(dentry))
 		return;
@@ -545,31 +545,49 @@ void debugfs_remove_recursive(struct dentry *dentry)
 	parent = dentry;
  down:
 	mutex_lock(&parent->d_inode->i_mutex);
-	list_for_each_entry_safe(child, next, &parent->d_subdirs, d_u.d_child) {
+ loop:
+	/*
+	 * The parent->d_subdirs is protected by the d_lock. Outside that
+	 * lock, the child can be unlinked and set to be freed which can
+	 * use the d_u.d_child as the rcu head and corrupt this list.
+	 */
+	spin_lock(&parent->d_lock);
+	list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) {
 		if (!debugfs_positive(child))
 			continue;
 
 		/* perhaps simple_empty(child) makes more sense */
 		if (!list_empty(&child->d_subdirs)) {
+			spin_unlock(&parent->d_lock);
 			mutex_unlock(&parent->d_inode->i_mutex);
 			parent = child;
 			goto down;
 		}
- up:
+
+		spin_unlock(&parent->d_lock);
+
 		if (!__debugfs_remove(child, parent))
 			simple_release_fs(&debugfs_mount, &debugfs_mount_count);
+
+		/*
+		 * The parent->d_lock protects agaist child from unlinking
+		 * from d_subdirs. When releasing the parent->d_lock we can
+		 * no longer trust that the next pointer is valid.
+		 * Restart the loop. We'll skip this one with the
+		 * debugfs_positive() check.
+		 */
+		goto loop;
 	}
+	spin_unlock(&parent->d_lock);
 
 	mutex_unlock(&parent->d_inode->i_mutex);
 	child = parent;
 	parent = parent->d_parent;
 	mutex_lock(&parent->d_inode->i_mutex);
 
-	if (child != dentry) {
-		next = list_entry(child->d_u.d_child.next, struct dentry,
-					d_u.d_child);
-		goto up;
-	}
+	if (child != dentry)
+		/* go up */
+		goto loop;
 
 	if (!__debugfs_remove(child, parent))
 		simple_release_fs(&debugfs_mount, &debugfs_mount_count);
-- 
2.1.0


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

* [PATCH 3.12 44/56] KVM: x86: Inter-privilege level ret emulation is not implemeneted
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (42 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 43/56] debugfs: Fix corrupted loop in debugfs_remove_recursive Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 45/56] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table Jiri Slaby
                   ` (13 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Nadav Amit, Paolo Bonzini, Jiri Slaby

From: Nadav Amit <namit@cs.technion.ac.il>

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

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

commit 9e8919ae793f4edfaa29694a70f71a515ae9942a upstream.

Return unhandlable error on inter-privilege level ret instruction.  This is
since the current emulation does not check the privilege level correctly when
loading the CS, and does not pop RSP/SS as needed.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kvm/emulate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 92e6f4a8ba0e..3ee4472cef19 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2012,6 +2012,7 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
 {
 	int rc;
 	unsigned long cs;
+	int cpl = ctxt->ops->cpl(ctxt);
 
 	rc = emulate_pop(ctxt, &ctxt->_eip, ctxt->op_bytes);
 	if (rc != X86EMUL_CONTINUE)
@@ -2021,6 +2022,9 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
 	rc = emulate_pop(ctxt, &cs, ctxt->op_bytes);
 	if (rc != X86EMUL_CONTINUE)
 		return rc;
+	/* Outer-privilege level return is not implemented */
+	if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl)
+		return X86EMUL_UNHANDLEABLE;
 	rc = load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS);
 	return rc;
 }
-- 
2.1.0


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

* [PATCH 3.12 45/56] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (43 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 44/56] KVM: x86: Inter-privilege level ret emulation is not implemeneted Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 46/56] Revert "KVM: x86: Increase the number of fixed MTRR regs to 10" Jiri Slaby
                   ` (12 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 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 0f6c0a740b7d3e1f3697395922d674000f83d060 upstream.

Currently, the EOI exit bitmap (used for APICv) does not include
interrupts that are masked.  However, this can cause a bug that manifests
as an interrupt storm inside the guest.  Alex Williamson reported the
bug and is the one who really debugged this; I only wrote the patch. :)

The scenario involves a multi-function PCI device with OHCI and EHCI
USB functions and an audio function, all assigned to the guest, where
both USB functions use legacy INTx interrupts.

As soon as the guest boots, interrupts for these devices turn into an
interrupt storm in the guest; the host does not see the interrupt storm.
Basically the EOI path does not work, and the guest continues to see the
interrupt over and over, even after it attempts to mask it at the APIC.
The bug is only visible with older kernels (RHEL6.5, based on 2.6.32
with not many changes in the area of APIC/IOAPIC handling).

Alex then tried forcing bit 59 (corresponding to the USB functions' IRQ)
on in the eoi_exit_bitmap and TMR, and things then work.  What happens
is that VFIO asserts IRQ11, then KVM recomputes the EOI exit bitmap.
It does not have set bit 59 because the RTE was masked, so the IOAPIC
never sees the EOI and the interrupt continues to fire in the guest.

My guess was that the guest is masking the interrupt in the redirection
table in the interrupt routine, i.e. while the interrupt is set in a
LAPIC's ISR, The simplest fix is to ignore the masking state, we would
rather have an unnecessary exit rather than a missed IRQ ACK and anyway
IOAPIC interrupts are not as performance-sensitive as for example MSIs.
Alex tested this patch and it fixed his bug.

[Thanks to Alex for his precise description of the problem
 and initial debugging effort.  A lot of the text above is
 based on emails exchanged with him.]

Reported-by: Alex Williamson <alex.williamson@redhat.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 virt/kvm/ioapic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 39dc5bc742e0..5eaf18f90e83 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -203,10 +203,9 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap,
 	spin_lock(&ioapic->lock);
 	for (index = 0; index < IOAPIC_NUM_PINS; index++) {
 		e = &ioapic->redirtbl[index];
-		if (!e->fields.mask &&
-			(e->fields.trig_mode == IOAPIC_LEVEL_TRIG ||
-			 kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC,
-				 index) || index == RTC_GSI)) {
+		if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG ||
+		    kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, index) ||
+		    index == RTC_GSI) {
 			if (kvm_apic_match_dest(vcpu, NULL, 0,
 				e->fields.dest_id, e->fields.dest_mode)) {
 				__set_bit(e->fields.vector,
-- 
2.1.0


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

* [PATCH 3.12 46/56] Revert "KVM: x86: Increase the number of fixed MTRR regs to 10"
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (44 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 45/56] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 47/56] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) Jiri Slaby
                   ` (11 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 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 0d234daf7e0a3290a3a20c8087eefbd6335a5bd4 upstream.

This reverts commit 682367c494869008eb89ef733f196e99415ae862,
which causes 32-bit SMP Windows 7 guests to panic.

SeaBIOS has a limit on the number of MTRRs that it can handle,
and this patch exceeded the limit.  Better revert it.
Thanks to Nadav Amit for debugging the cause.

Reported-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/include/asm/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 694851592399..ec6c0395b512 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -92,7 +92,7 @@
 #define KVM_REFILL_PAGES 25
 #define KVM_MAX_CPUID_ENTRIES 80
 #define KVM_NR_FIXED_MTRR_REGION 88
-#define KVM_NR_VAR_MTRR 10
+#define KVM_NR_VAR_MTRR 8
 
 #define ASYNC_PF_PER_VCPU 64
 
-- 
2.1.0


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

* [PATCH 3.12 47/56] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (45 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 46/56] Revert "KVM: x86: Increase the number of fixed MTRR regs to 10" Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 48/56] drm/radeon: add new KV pci id Jiri Slaby
                   ` (10 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Michael S. Tsirkin, Paolo Bonzini, Jiri Slaby

From: "Michael S. Tsirkin" <mst@redhat.com>

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

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

commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream.

The third parameter of kvm_iommu_put_pages is wrong,
It should be 'gfn - slot->base_gfn'.

By making gfn very large, malicious guest or userspace can cause kvm to
go to this error path, and subsequently to pass a huge value as size.
Alternatively if gfn is small, then pages would be pinned but never
unpinned, causing host memory leak and local DOS.

Passing a reasonable but large value could be the most dangerous case,
because it would unpin a page that should have stayed pinned, and thus
allow the device to DMA into arbitrary memory.  However, this cannot
happen because of the condition that can trigger the error:

- out of memory (where you can't allocate even a single page)
  should not be possible for the attacker to trigger

- when exceeding the iommu's address space, guest pages after gfn
  will also exceed the iommu's address space, and inside
  kvm_iommu_put_pages() the iommu_iova_to_phys() will fail.  The
  page thus would not be unpinned at all.

Reported-by: Jack Morgenstein <jackm@mellanox.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 virt/kvm/iommu.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index c329c8fc57f4..dec997188dfb 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -61,6 +61,14 @@ static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn,
 	return pfn;
 }
 
+static void kvm_unpin_pages(struct kvm *kvm, pfn_t pfn, unsigned long npages)
+{
+	unsigned long i;
+
+	for (i = 0; i < npages; ++i)
+		kvm_release_pfn_clean(pfn + i);
+}
+
 int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
 {
 	gfn_t gfn, end_gfn;
@@ -123,6 +131,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
 		if (r) {
 			printk(KERN_ERR "kvm_iommu_map_address:"
 			       "iommu failed to map pfn=%llx\n", pfn);
+			kvm_unpin_pages(kvm, pfn, page_size);
 			goto unmap_pages;
 		}
 
@@ -134,7 +143,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
 	return 0;
 
 unmap_pages:
-	kvm_iommu_put_pages(kvm, slot->base_gfn, gfn);
+	kvm_iommu_put_pages(kvm, slot->base_gfn, gfn - slot->base_gfn);
 	return r;
 }
 
@@ -272,14 +281,6 @@ out_unlock:
 	return r;
 }
 
-static void kvm_unpin_pages(struct kvm *kvm, pfn_t pfn, unsigned long npages)
-{
-	unsigned long i;
-
-	for (i = 0; i < npages; ++i)
-		kvm_release_pfn_clean(pfn + i);
-}
-
 static void kvm_iommu_put_pages(struct kvm *kvm,
 				gfn_t base_gfn, unsigned long npages)
 {
-- 
2.1.0


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

* [PATCH 3.12 48/56] drm/radeon: add new KV pci id
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (46 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 47/56] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 49/56] drm/radeon: add new bonaire pci ids Jiri Slaby
                   ` (9 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 6dc14baf4ced769017c7a7045019c7a19f373865 upstream.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=82912

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/cik.c | 1 +
 include/drm/drm_pciids.h     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 14836dfd04e7..85ef9ff42aa6 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -2745,6 +2745,7 @@ static void cik_gpu_init(struct radeon_device *rdev)
 			   (rdev->pdev->device == 0x130B) ||
 			   (rdev->pdev->device == 0x130E) ||
 			   (rdev->pdev->device == 0x1315) ||
+			   (rdev->pdev->device == 0x1318) ||
 			   (rdev->pdev->device == 0x131B)) {
 			rdev->config.cik.max_cu_per_sh = 4;
 			rdev->config.cik.max_backends_per_se = 1;
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 0bd7a2ec8a45..8d32672681af 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -17,6 +17,7 @@
 	{0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x1316, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x1317, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+	{0x1002, 0x1318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
 	{0x1002, 0x131D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
-- 
2.1.0


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

* [PATCH 3.12 49/56] drm/radeon: add new bonaire pci ids
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (47 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 48/56] drm/radeon: add new KV pci id Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 50/56] drm/radeon: add additional SI " Jiri Slaby
                   ` (8 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 5fc540edc8ea1297c76685f74bc82a2107fe6731 upstream.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/drm/drm_pciids.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 8d32672681af..bd1118f3a812 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -176,6 +176,8 @@
 	{0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6650, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
-- 
2.1.0


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

* [PATCH 3.12 50/56] drm/radeon: add additional SI pci ids
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (48 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 49/56] drm/radeon: add new bonaire pci ids Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 51/56] PCI: Configure ASPM when enabling device Jiri Slaby
                   ` (7 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9: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 37dbeab788a8f23fd946c0be083e5484d6f929a1 upstream.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/drm/drm_pciids.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index bd1118f3a812..0c5e50e319be 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -165,8 +165,11 @@
 	{0x1002, 0x6601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6602, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6603, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6604, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6605, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6606, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6607, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x6608, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
@@ -288,6 +291,7 @@
 	{0x1002, 0x6829, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x682A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x682B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+	{0x1002, 0x682C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x682D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x682F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
 	{0x1002, 0x6830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VERDE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-- 
2.1.0


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

* [PATCH 3.12 51/56] PCI: Configure ASPM when enabling device
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (49 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 50/56] drm/radeon: add additional SI " Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 52/56] x86: don't exclude low BIOS area when allocating address space for non-PCI cards Jiri Slaby
                   ` (6 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Vidya Sagar, Bjorn Helgaas, Jiri Slaby

From: Vidya Sagar <sagar.tv@gmail.com>

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

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

commit 1f6ae47ecff7f23da73417e068018b311f3b5583 upstream.

We can't do ASPM configuration at enumeration-time because enabling it
makes some defective hardware unresponsive, even if ASPM is disabled later
(see 41cd766b0659 ("PCI: Don't enable aspm before drivers have had a chance
to veto it").  Therefore, we have to do it after a driver claims the
device.

We previously configured ASPM in pci_set_power_state(), but that's not a
very good place because it's not really related to setting the PCI device
power state, and doing it there means:

  - We incorrectly skipped ASPM config when setting a device that's
    already in D0 to D0.

  - We unnecessarily configured ASPM when setting a device to a low-power
    state (the ASPM feature only applies when the device is in D0).

  - We unnecessarily configured ASPM when called from a .resume() method
    (ASPM configuration needs to be restored during resume, but
    pci_restore_pcie_state() should already do this).

Move ASPM configuration from pci_set_power_state() to
do_pci_enable_device() so we do it when a driver enables a device.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=79621
Fixes: db288c9c5f9d ("PCI / PM: restore the original behavior of pci_set_power_state()")
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Vidya Sagar <sagar.tv@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/pci/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4108166ffdf4..2d163544fa51 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -782,12 +782,6 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
 	if (!__pci_complete_power_transition(dev, state))
 		error = 0;
-	/*
-	 * When aspm_policy is "powersave" this call ensures
-	 * that ASPM is configured.
-	 */
-	if (!error && dev->bus->self)
-		pcie_aspm_powersave_config_link(dev->bus->self);
 
 	return error;
 }
@@ -1120,12 +1114,18 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state);
 static int do_pci_enable_device(struct pci_dev *dev, int bars)
 {
 	int err;
+	struct pci_dev *bridge;
 	u16 cmd;
 	u8 pin;
 
 	err = pci_set_power_state(dev, PCI_D0);
 	if (err < 0 && err != -EIO)
 		return err;
+
+	bridge = pci_upstream_bridge(dev);
+	if (bridge)
+		pcie_aspm_powersave_config_link(bridge);
+
 	err = pcibios_enable_device(dev, bars);
 	if (err < 0)
 		return err;
-- 
2.1.0


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

* [PATCH 3.12 52/56] x86: don't exclude low BIOS area when allocating address space for non-PCI cards
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (50 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 51/56] PCI: Configure ASPM when enabling device Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 53/56] x86_64/vsyscall: Fix warn_bad_vsyscall log output Jiri Slaby
                   ` (5 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christoph Schulz, Bjorn Helgaas, Jiri Slaby

From: Christoph Schulz <develop@kristov.de>

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

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

commit cbace46a9710a480cae51e4611697df5de41713e upstream.

Commit 30919b0bf356 ("x86: avoid low BIOS area when allocating address
space") moved the test for resource allocations that fall within the first
1MB of address space from the PCI-specific path to a generic path, such
that all resource allocations will avoid this area.  However, this breaks
ISA cards which need to allocate a memory region within the first 1MB.  An
example is the i82365 PCMCIA controller and derivatives like the Ricoh
RF5C296/396 which map part of the PCMCIA socket memory address space into
the first 1MB of system memory address space.  They do not work anymore as
no usable memory region exists due to this change:

  Intel ISA PCIC probe: Ricoh RF5C296/396 ISA-to-PCMCIA at port 0x3e0 ofs 0x00, 2 sockets
  host opts [0]: none
  host opts [1]: none
  ISA irqs (scanned) = 3,4,5,9,10 status change on irq 10
  pcmcia_socket pcmcia_socket1: pccard: PCMCIA card inserted into slot 1
  pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcff: excluding 0xcf8-0xcff
  pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
  pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3ff: excluding 0x170-0x177 0x1f0-0x1f7 0x2f8-0x2ff 0x370-0x37f 0x3c0-0x3e7 0x3f0-0x3ff
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x0a0000-0x0affff: excluding 0xa0000-0xaffff
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x0b0000-0x0bffff: excluding 0xb0000-0xbffff
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0cffff: excluding 0xc0000-0xcbfff
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x0d0000-0x0dffff: clean.
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x0e0000-0x0effff: clean.
  pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: clean.
  pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: clean.
  pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcff: excluding 0xcf8-0xcff
  pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
  pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3ff: excluding 0x170-0x177 0x1f0-0x1f7 0x2f8-0x2ff 0x370-0x37f 0x3c0-0x3e7 0x3f0-0x3ff
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0a0000-0x0affff: excluding 0xa0000-0xaffff
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0b0000-0x0bffff: excluding 0xb0000-0xbffff
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0cffff: excluding 0xc0000-0xcbfff
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0d0000-0x0dffff: clean.
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0e0000-0x0effff: clean.
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: clean.
  pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: clean.
  pcmcia_socket pcmcia_socket1: cs: memory probe 0x0cc000-0x0effff: excluding 0xe0000-0xeffff
  pcmcia_socket pcmcia_socket1: cs: unable to map card memory!

If filtering out the first 1MB is reverted, everything works as expected.

Tested-by: Robert Resch <fli4l@robert.reschpara.de>
Signed-off-by: Christoph Schulz <develop@kristov.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kernel/resource.c | 8 +++++---
 arch/x86/pci/i386.c        | 4 ++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/resource.c b/arch/x86/kernel/resource.c
index 2a26819bb6a8..80eab01c1a68 100644
--- a/arch/x86/kernel/resource.c
+++ b/arch/x86/kernel/resource.c
@@ -37,10 +37,12 @@ static void remove_e820_regions(struct resource *avail)
 
 void arch_remove_reservations(struct resource *avail)
 {
-	/* Trim out BIOS areas (low 1MB and high 2MB) and E820 regions */
+	/*
+	 * Trim out BIOS area (high 2MB) and E820 regions. We do not remove
+	 * the low 1MB unconditionally, as this area is needed for some ISA
+	 * cards requiring a memory range, e.g. the i82365 PCMCIA controller.
+	 */
 	if (avail->flags & IORESOURCE_MEM) {
-		if (avail->start < BIOS_END)
-			avail->start = BIOS_END;
 		resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);
 
 		remove_e820_regions(avail);
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index db6b1ab43255..96a159afe3c6 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -162,6 +162,10 @@ pcibios_align_resource(void *data, const struct resource *res,
 			return start;
 		if (start & 0x300)
 			start = (start + 0x3ff) & ~0x3ff;
+	} else if (res->flags & IORESOURCE_MEM) {
+		/* The low 1MB range is reserved for ISA cards */
+		if (start < BIOS_END)
+			start = BIOS_END;
 	}
 	return start;
 }
-- 
2.1.0


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

* [PATCH 3.12 53/56] x86_64/vsyscall: Fix warn_bad_vsyscall log output
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (51 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 52/56] x86: don't exclude low BIOS area when allocating address space for non-PCI cards Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 54/56] x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub Jiri Slaby
                   ` (4 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Andy Lutomirski, H. Peter Anvin, Jiri Slaby

From: Andy Lutomirski <luto@amacapital.net>

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

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

commit 53b884ac3745353de220d92ef792515c3ae692f0 upstream.

This commit in Linux 3.6:

    commit c767a54ba0657e52e6edaa97cbe0b0a8bf1c1655
    Author: Joe Perches <joe@perches.com>
    Date:   Mon May 21 19:50:07 2012 -0700

        x86/debug: Add KERN_<LEVEL> to bare printks, convert printks to pr_<level>

caused warn_bad_vsyscall to output garbage in the middle of the
line.  Revert the bad part of it.

The printk in question isn't actually bare; the level is "%s".

The bug this fixes is purely cosmetic; backports are optional.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/03eac1f24110bbe496ecc12a4df467e0d88466d4.1406330947.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kernel/vsyscall_64.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 1f96f9347ed9..09ce23ae370c 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -125,10 +125,10 @@ static void warn_bad_vsyscall(const char *level, struct pt_regs *regs,
 	if (!show_unhandled_signals)
 		return;
 
-	pr_notice_ratelimited("%s%s[%d] %s ip:%lx cs:%lx sp:%lx ax:%lx si:%lx di:%lx\n",
-			      level, current->comm, task_pid_nr(current),
-			      message, regs->ip, regs->cs,
-			      regs->sp, regs->ax, regs->si, regs->di);
+	printk_ratelimited("%s%s[%d] %s ip:%lx cs:%lx sp:%lx ax:%lx si:%lx di:%lx\n",
+			   level, current->comm, task_pid_nr(current),
+			   message, regs->ip, regs->cs,
+			   regs->sp, regs->ax, regs->si, regs->di);
 }
 
 static int addr_to_vsyscall_nr(unsigned long addr)
-- 
2.1.0


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

* [PATCH 3.12 54/56] x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (52 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 53/56] x86_64/vsyscall: Fix warn_bad_vsyscall log output Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 55/56] x86/xen: resume timer irqs early Jiri Slaby
                   ` (3 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Matt Fleming, H. Peter Anvin, Jiri Slaby

From: Matt Fleming <matt.fleming@intel.com>

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

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

commit 7b2a583afb4ab894f78bc0f8bd136e96b6499a7e upstream.

Without CONFIG_RELOCATABLE the early boot code will decompress the
kernel to LOAD_PHYSICAL_ADDR. While this may have been fine in the BIOS
days, that isn't going to fly with UEFI since parts of the firmware
code/data may be located at LOAD_PHYSICAL_ADDR.

Straying outside of the bounds of the regions we've explicitly requested
from the firmware will cause all sorts of trouble. Bruno reports that
his machine resets while trying to decompress the kernel image.

We already go to great pains to ensure the kernel is loaded into a
suitably aligned buffer, it's just that the address isn't necessarily
LOAD_PHYSICAL_ADDR, because we can't guarantee that address isn't in-use
by the firmware.

Explicitly enforce CONFIG_RELOCATABLE for the EFI boot stub, so that we
can load the kernel at any address with the correct alignment.

Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9b6f78f57d86..f968d8527190 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1608,6 +1608,7 @@ config EFI
 config EFI_STUB
        bool "EFI stub support"
        depends on EFI
+       select RELOCATABLE
        ---help---
           This kernel feature allows a bzImage to be loaded directly
 	  by EFI firmware without the use of a bootloader.
-- 
2.1.0


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

* [PATCH 3.12 55/56] x86/xen: resume timer irqs early
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (53 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 54/56] x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03  9:27 ` [PATCH 3.12 56/56] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl Jiri Slaby
                   ` (2 subsequent siblings)
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 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 8d5999df35314607c38fbd6bdd709e25c3a4eeab upstream.

If the timer irqs are resumed during device resume it is possible in
certain circumstances for the resume to hang early on, before device
interrupts are resumed.  For an Ubuntu 14.04 PVHVM guest this would
occur in ~0.5% of resume attempts.

It is not entirely clear what is occuring the point of the hang but I
think a task necessary for the resume calls schedule_timeout(),
waiting for a timer interrupt (which never arrives).  This failure may
require specific tasks to be running on the other VCPUs to trigger
(processes are not frozen during a suspend/resume if PREEMPT is
disabled).

Add IRQF_EARLY_RESUME to the timer interrupts so they are resumed in
syscore_resume().

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/xen/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index ee365895b06b..90bfa524b11c 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -445,7 +445,7 @@ void xen_setup_timer(int cpu)
 	irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, xen_timer_interrupt,
 				      IRQF_DISABLED|IRQF_PERCPU|
 				      IRQF_NOBALANCING|IRQF_TIMER|
-				      IRQF_FORCE_RESUME,
+				      IRQF_FORCE_RESUME|IRQF_EARLY_RESUME,
 				      name, NULL);
 
 	memcpy(evt, xen_clockevent, sizeof(*evt));
-- 
2.1.0


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

* [PATCH 3.12 56/56] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (54 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 55/56] x86/xen: resume timer irqs early Jiri Slaby
@ 2014-09-03  9:27 ` Jiri Slaby
  2014-09-03 13:26 ` [PATCH 3.12 00/56] 3.12.28-stable review Guenter Roeck
  2014-09-04 13:33 ` Shuah Khan
  57 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03  9:27 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Stephen M. Cameron, Christoph Hellwig, Jiri Slaby

From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>

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

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

commit 0758f4f732b08b6ef07f2e5f735655cf69fea477 upstream.

When copy_from_user fails, return -EFAULT, not -ENOMEM

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
Reviewed-by: Scott Teel <scott.teel@hp.com>
Reviewed by: Mike MIller <michael.miller@canonical.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 0eb09403680c..d535e7504ea0 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3140,7 +3140,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
 		}
 		if (ioc->Request.Type.Direction == XFER_WRITE) {
 			if (copy_from_user(buff[sg_used], data_ptr, sz)) {
-				status = -ENOMEM;
+				status = -EFAULT;
 				goto cleanup1;
 			}
 		} else
-- 
2.1.0


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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (55 preceding siblings ...)
  2014-09-03  9:27 ` [PATCH 3.12 56/56] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl Jiri Slaby
@ 2014-09-03 13:26 ` Guenter Roeck
  2014-09-03 19:32   ` Jiri Slaby
  2014-09-04 13:33 ` Shuah Khan
  57 siblings, 1 reply; 65+ messages in thread
From: Guenter Roeck @ 2014-09-03 13:26 UTC (permalink / raw)
  To: Jiri Slaby, stable; +Cc: satoru.takeuchi, shuah.kh, linux-kernel

On 09/03/2014 02:26 AM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.28 release.
> There are 56 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 Sep  5 11:17:45 CEST 2014.
> Anything received after that time might be too late.
>

Jiri,

I get a large number of build failures.

total: 135 pass: 104 fail: 31
Failed builds:
arm:s3c2410_defconfig
arm:ixp4xx_defconfig
arm:mini2440_defconfig
arm:at91_dt_defconfig
arm:s3c6400_defconfig
arm:lpc32xx_defconfig
arm:sama5_defconfig
arm:cm_x2xx_defconfig
arm:at91rm9200_defconfig
ia64:defconfig
mips:bcm47xx_defconfig
mips:bcm63xx_defconfig
mips:ath79_defconfig
mips:fuloong2e_defconfig
mips:powertv_defconfig
parisc:defconfig
powerpc:defconfig
powerpc:ppc64e_defconfig
powerpc:cell_defconfig
powerpc:maple_defconfig
powerpc:mpc85xx_defconfig
powerpc:mpc85xx_smp_defconfig
powerpc:defconfig
powerpc:ppc64e_defconfig
powerpc:cell_defconfig
powerpc:maple_defconfig
powerpc:mpc85xx_defconfig
powerpc:mpc85xx_smp_defconfig
sparc32:defconfig
sparc64:defconfig
tile:tilegx_defconfig

In file included from drivers/usb/host/ohci-hcd.c:85:0:
drivers/usb/host/ohci-dbg.c:411:20: error: conflicting types for 'ohci_dump'
drivers/usb/host/ohci-hcd.c:81:13: note: previous declaration of 'ohci_dump' was here
drivers/usb/host/ohci-hcd.c: In function 'ohci_run':
drivers/usb/host/ohci-hcd.c:757:2: error: too few arguments to function 'ohci_dump'

Guenter


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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03 13:26 ` [PATCH 3.12 00/56] 3.12.28-stable review Guenter Roeck
@ 2014-09-03 19:32   ` Jiri Slaby
  2014-09-03 19:55     ` Guenter Roeck
  2014-09-03 21:08     ` Guenter Roeck
  0 siblings, 2 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-03 19:32 UTC (permalink / raw)
  To: Guenter Roeck, stable; +Cc: satoru.takeuchi, shuah.kh, linux-kernel

On 09/03/2014, 03:26 PM, Guenter Roeck wrote:
> On 09/03/2014 02:26 AM, Jiri Slaby wrote:
>> This is the start of the stable review cycle for the 3.12.28 release.
>> There are 56 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 Sep  5 11:17:45 CEST 2014.
>> Anything received after that time might be too late.
>>
> 
> Jiri,
> 
> I get a large number of build failures.
...
> In file included from drivers/usb/host/ohci-hcd.c:85:0:
> drivers/usb/host/ohci-dbg.c:411:20: error: conflicting types for
> 'ohci_dump'
> drivers/usb/host/ohci-hcd.c:81:13: note: previous declaration of
> 'ohci_dump' was here
> drivers/usb/host/ohci-hcd.c: In function 'ohci_run':
> drivers/usb/host/ohci-hcd.c:757:2: error: too few arguments to function
> 'ohci_dump'

Oh, !USB_DEBUG. It should be fixed, could you retry?

thanks,
-- 
js
suse labs

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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03 19:32   ` Jiri Slaby
@ 2014-09-03 19:55     ` Guenter Roeck
  2014-09-03 21:08     ` Guenter Roeck
  1 sibling, 0 replies; 65+ messages in thread
From: Guenter Roeck @ 2014-09-03 19:55 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, satoru.takeuchi, shuah.kh, linux-kernel

On Wed, Sep 03, 2014 at 09:32:02PM +0200, Jiri Slaby wrote:
> On 09/03/2014, 03:26 PM, Guenter Roeck wrote:
> > On 09/03/2014 02:26 AM, Jiri Slaby wrote:
> >> This is the start of the stable review cycle for the 3.12.28 release.
> >> There are 56 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 Sep  5 11:17:45 CEST 2014.
> >> Anything received after that time might be too late.
> >>
> > 
> > Jiri,
> > 
> > I get a large number of build failures.
> ...
> > In file included from drivers/usb/host/ohci-hcd.c:85:0:
> > drivers/usb/host/ohci-dbg.c:411:20: error: conflicting types for
> > 'ohci_dump'
> > drivers/usb/host/ohci-hcd.c:81:13: note: previous declaration of
> > 'ohci_dump' was here
> > drivers/usb/host/ohci-hcd.c: In function 'ohci_run':
> > drivers/usb/host/ohci-hcd.c:757:2: error: too few arguments to function
> > 'ohci_dump'
> 
> Oh, !USB_DEBUG. It should be fixed, could you retry?
> 
I triggered a rebuild. I'll let you know after it is complete.

Guenter

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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03 19:32   ` Jiri Slaby
  2014-09-03 19:55     ` Guenter Roeck
@ 2014-09-03 21:08     ` Guenter Roeck
  2014-09-05  7:28       ` Jiri Slaby
  1 sibling, 1 reply; 65+ messages in thread
From: Guenter Roeck @ 2014-09-03 21:08 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, satoru.takeuchi, shuah.kh, linux-kernel

On Wed, Sep 03, 2014 at 09:32:02PM +0200, Jiri Slaby wrote:
> On 09/03/2014, 03:26 PM, Guenter Roeck wrote:
> > On 09/03/2014 02:26 AM, Jiri Slaby wrote:
> >> This is the start of the stable review cycle for the 3.12.28 release.
> >> There are 56 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 Sep  5 11:17:45 CEST 2014.
> >> Anything received after that time might be too late.
> >>
> > 
> > Jiri,
> > 
> > I get a large number of build failures.
> ...
> > In file included from drivers/usb/host/ohci-hcd.c:85:0:
> > drivers/usb/host/ohci-dbg.c:411:20: error: conflicting types for
> > 'ohci_dump'
> > drivers/usb/host/ohci-hcd.c:81:13: note: previous declaration of
> > 'ohci_dump' was here
> > drivers/usb/host/ohci-hcd.c: In function 'ohci_run':
> > drivers/usb/host/ohci-hcd.c:757:2: error: too few arguments to function
> > 'ohci_dump'
> 
> Oh, !USB_DEBUG. It should be fixed, could you retry?
> 
Much better.

Build results:
	total: 135 pass: 135 fail: 0

Qemu tests all passed.

Details are available at http://server.roeck-us.net:8010/builders.

Guenter

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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
                   ` (56 preceding siblings ...)
  2014-09-03 13:26 ` [PATCH 3.12 00/56] 3.12.28-stable review Guenter Roeck
@ 2014-09-04 13:33 ` Shuah Khan
  57 siblings, 0 replies; 65+ messages in thread
From: Shuah Khan @ 2014-09-04 13:33 UTC (permalink / raw)
  To: Jiri Slaby, stable
  Cc: linux, satoru.takeuchi, shuah.kh, linux-kernel, Shuah Khan

On 09/03/2014 03:26 AM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.28 release.
> There are 56 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 Sep  5 11:17:45 CEST 2014.
> 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.28-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
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

* Re: [PATCH 3.12 00/56] 3.12.28-stable review
  2014-09-03 21:08     ` Guenter Roeck
@ 2014-09-05  7:28       ` Jiri Slaby
  0 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-05  7:28 UTC (permalink / raw)
  To: Guenter Roeck, shuah.kh; +Cc: stable, satoru.takeuchi, linux-kernel

On 09/03/2014, 11:08 PM, Guenter Roeck wrote:
> Build results:
> 	total: 135 pass: 135 fail: 0
> 
> Qemu tests all passed.

On 09/04/2014, 03:33 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] 65+ messages in thread

* Re: [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct
  2014-09-03  9:26 ` [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct Jiri Slaby
@ 2014-09-15  2:46   ` Ben Hutchings
  2014-09-15  7:40     ` Jiri Slaby
  0 siblings, 1 reply; 65+ messages in thread
From: Ben Hutchings @ 2014-09-15  2:46 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, linux-kernel, Theodore Ts'o

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

On Wed, 2014-09-03 at 11:26 +0200, Jiri Slaby wrote:
> From: Theodore Ts'o <tytso@mit.edu>
> 
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===============
> 
> commit 86f0afd463215fc3e58020493482faa4ac3a4d69 upstream.
> 
> If there is a failure while allocating the preallocation structure, a
> number of blocks can end up getting marked in the in-memory buddy
> bitmap, and then not getting released.  This can result in the
> following corruption getting reported by the kernel:
> 
> EXT4-fs error (device sda3): ext4_mb_generate_buddy:758: group 1126,
> 12793 clusters in bitmap, 12729 in gd
> 
> In that case, we need to release the blocks using mb_free_blocks().
> 
> Tested: fs smoke test; also demonstrated that with injected errors,
> 	the file system is no longer getting corrupted
> 
> Google-Bug-Id: 16657874
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
[...]

It's a bit late now, but Ted said this introduced a regression that's
fixed by commit c99d1e6e83b0 ("ext4: fix BUG_ON in mb_free_blocks()").

(I just made the same mistake in 3.2.63.)

Ben.

-- 
Ben Hutchings
Make three consecutive correct guesses and you will be considered an expert.

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

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

* Re: [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct
  2014-09-15  2:46   ` Ben Hutchings
@ 2014-09-15  7:40     ` Jiri Slaby
  0 siblings, 0 replies; 65+ messages in thread
From: Jiri Slaby @ 2014-09-15  7:40 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable, linux-kernel, Theodore Ts'o

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/15/2014, 04:46 AM, Ben Hutchings wrote:
> On Wed, 2014-09-03 at 11:26 +0200, Jiri Slaby wrote:
>> From: Theodore Ts'o <tytso@mit.edu>
>> 
>> 3.12-stable review patch.  If anyone has any objections, please
>> let me know.
>> 
>> ===============
>> 
>> commit 86f0afd463215fc3e58020493482faa4ac3a4d69 upstream.
>> 
>> If there is a failure while allocating the preallocation
>> structure, a number of blocks can end up getting marked in the
>> in-memory buddy bitmap, and then not getting released.  This can
>> result in the following corruption getting reported by the
>> kernel:
>> 
>> EXT4-fs error (device sda3): ext4_mb_generate_buddy:758: group
>> 1126, 12793 clusters in bitmap, 12729 in gd
>> 
>> In that case, we need to release the blocks using
>> mb_free_blocks().
>> 
>> Tested: fs smoke test; also demonstrated that with injected
>> errors, the file system is no longer getting corrupted
>> 
>> Google-Bug-Id: 16657874
>> 
>> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by:
>> Jiri Slaby <jslaby@suse.cz>
> [...]
> 
> It's a bit late now, but Ted said this introduced a regression
> that's fixed by commit c99d1e6e83b0 ("ext4: fix BUG_ON in
> mb_free_blocks()").

Oh, now queued for 3.12. Thanks!

- -- 
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUFpfqAAoJEL0lsQQGtHBJOBsP/2sJ9vMgzDwOLpA5VTxJLUUP
9D4Jn6F4Z2TVR+l0pwaHIKgWjnMA1WEEr/FL5WxOSyGq0Rx10pqeOmI8U6wFq/K8
dhmFQfV5WZxYzCzB9ozae3fwzt7ap0V7yINXq7AkLIfZA1uhB/L5xuX7ZMuqM7ec
h4/+ylkLuhQg8LrF43+S8PQNRvgLcn/4XsiCLwR1fvJYFgcz6/i2uiBlG8eS5F0k
WKL/Rg/B66DrLD+RloJnvpshGJY8XGEqu2wx+a/QNiDV2n9aKWzDNcjX0Y+YEsdd
8Or9J5h018BgB3ktNJB4sd85mkrjhrzTkCyNQoKBc3NjqeJv2Eei1rB4Ds1oLiaH
wjgWRXNhYC3h5ifDBazEtAu7fH2fWuMeaAtX+t/4r1DitW9H0FpRNy28lYbYzoV/
HMKAhUCePdWe96TWcbiL7GovbagdcD8HqOqQpYLX9SWb8uEQFKzYCCFNvgFe489o
R89uARU49K6EQRFr9rj36YyQm/OkPpiJByrEGcbEMTYiQb6FiNkKsV2iznXHJ75y
kfTje9K6RpKRl0RSaQUK7F7+rP+IH+ajtJD5Umw1eWQ4y+kGQg9RT9Z12SCBpHjF
s0hkIZp71loIWqlS45+EPCez/Yr0szmqyvZthz87hGL1BlXmwN8tyzhdSkpe1bFy
cBVtTov4saNk84Z72Foe
=egHB
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2014-09-15  7:48 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03  9:26 [PATCH 3.12 00/56] 3.12.28-stable review Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 01/56] bcache: Minor journal fix Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 02/56] usb: musb: cppi41: fire hrtimer according to programmed channel length Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 03/56] USB: serial: cp210x: Removing unncessary `usb_reset_device` on startup Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 04/56] USB: add reset resume quirk for usb3503 Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 05/56] usb-core bInterval quirk Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 06/56] USB: core: hcd-pci: free IRQ before disabling PCI device when shutting down Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 07/56] HID: add quirk for 0x04d9:0xa096 device Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 08/56] PM / hibernate: avoid unsafe pages in e820 reserved regions Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 09/56] bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 10/56] PCI: Add pci_upstream_bridge() Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 11/56] HID: logitech: perform bounds checking on device_id early enough Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 12/56] HID: fix a couple of off-by-ones Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 13/56] isofs: Fix unbounded recursion when processing relocated directories Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 14/56] USB: OHCI: fix bugs in debug routines Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 15/56] USB: OHCI: don't lose track of EDs when a controller dies Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 16/56] USB: devio: fix issue with log flooding Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 17/56] USB: serial: ftdi_sio: Annotate the current Xsens PID assignments Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 18/56] USB: serial: ftdi_sio: Add support for new Xsens devices Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 19/56] USB: ehci-pci: USB host controller support for Intel Quark X1000 Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 20/56] USB: Fix persist resume of some SS USB devices Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 21/56] ALSA: hda - fix an external mic jack problem on a HP machine Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 22/56] ALSA: virtuoso: add Xonar Essence STX II support Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 23/56] ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 24/56] ALSA: usb-audio: fix BOSS ME-25 MIDI regression Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 25/56] ALSA: hda - restore the gpio led after resume Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 26/56] ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 27/56] mei: start disconnect request timer consistently Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 28/56] ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 29/56] drm: omapdrm: fix compiler errors Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 30/56] hwmon: (sis5595) Prevent overflow problem when writing large limits Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 31/56] hwmon: (amc6821) Fix possible race condition bug Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 32/56] hwmon: (lm78) Fix overflow problems seen when writing large temperature limits Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 33/56] hwmon: (gpio-fan) Prevent overflow problem when writing large limits Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 34/56] hwmon: (ads1015) Fix off-by-one for valid channel index checking Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 35/56] hwmon: (lm85) Fix various errors on attribute writes Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 36/56] hwmon: (ads1015) Fix out-of-bounds array access Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 37/56] hwmon: (dme1737) Prevent overflow problem when writing large limits Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 38/56] tpm: Add missing tpm_do_selftest to ST33 I2C driver Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 39/56] drivers/i2c/busses: use correct type for dma_map/unmap Jiri Slaby
2014-09-03  9:26 ` [PATCH 3.12 40/56] ext4: fix ext4_discard_allocated_blocks() if we can't allocate the pa struct Jiri Slaby
2014-09-15  2:46   ` Ben Hutchings
2014-09-15  7:40     ` Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 41/56] serial: core: Preserve termios c_cflag for console resume Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 42/56] crypto: ux500 - make interrupt mode plausible Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 43/56] debugfs: Fix corrupted loop in debugfs_remove_recursive Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 44/56] KVM: x86: Inter-privilege level ret emulation is not implemeneted Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 45/56] KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 46/56] Revert "KVM: x86: Increase the number of fixed MTRR regs to 10" Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 47/56] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601) Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 48/56] drm/radeon: add new KV pci id Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 49/56] drm/radeon: add new bonaire pci ids Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 50/56] drm/radeon: add additional SI " Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 51/56] PCI: Configure ASPM when enabling device Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 52/56] x86: don't exclude low BIOS area when allocating address space for non-PCI cards Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 53/56] x86_64/vsyscall: Fix warn_bad_vsyscall log output Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 54/56] x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 55/56] x86/xen: resume timer irqs early Jiri Slaby
2014-09-03  9:27 ` [PATCH 3.12 56/56] hpsa: fix bad -ENOMEM return value in hpsa_big_passthru_ioctl Jiri Slaby
2014-09-03 13:26 ` [PATCH 3.12 00/56] 3.12.28-stable review Guenter Roeck
2014-09-03 19:32   ` Jiri Slaby
2014-09-03 19:55     ` Guenter Roeck
2014-09-03 21:08     ` Guenter Roeck
2014-09-05  7:28       ` Jiri Slaby
2014-09-04 13:33 ` 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).