linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:28 [ 000/108] 3.5.4-stable review Greg KH
@ 2012-09-12 23:27 ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 002/108] USB: emi62: " Greg Kroah-Hartman
                     ` (106 more replies)
  0 siblings, 107 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:27 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Forest Bond,
	Marcos Paulo de Souza, David S. Miller, Jesper Juhl, Jiri Pirko

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 4d088876f24887cd15a29db923f5f37db6a99f21 upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Forest Bond <forest@alittletooquiet.net>
CC: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jesper Juhl <jj@chaosbits.net>
CC: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/main_usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -222,7 +222,7 @@ DEVICE_PARAM(b80211hEnable, "802.11h mod
 // Static vars definitions
 //
 
-static struct usb_device_id vt6656_table[] __devinitdata = {
+static struct usb_device_id vt6656_table[] = {
 	{USB_DEVICE(VNT_USB_VENDOR_ID, VNT_USB_PRODUCT_ID)},
 	{}
 };



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

* [ 002/108] USB: emi62: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 003/108] ALSA: hda - fix Copyright debug message Greg Kroah-Hartman
                     ` (105 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Paul Gortmaker,
	Andrew Morton, Felipe Balbi

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 83957df21dd94655d2b026e0944a69ff37b83988 upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/misc/emi62.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -232,7 +232,7 @@ wraperr:
 	return err;
 }
 
-static const struct usb_device_id id_table[] __devinitconst = {
+static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(EMI62_VENDOR_ID, EMI62_PRODUCT_ID) },
 	{ }                                             /* Terminating entry */
 };



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

* [ 003/108] ALSA: hda - fix Copyright debug message
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 002/108] USB: emi62: " Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 004/108] ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_VFPv3 is enabled Greg Kroah-Hartman
                     ` (104 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Wang Xingchao, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Wang Xingchao <xingchao.wang@intel.com>

commit 088c820b732dbfd515fc66d459d5f5777f79b406 upstream.

As spec said, 1 indicates no copyright is asserted.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -412,7 +412,7 @@ static void print_digital_conv(struct sn
 	if (digi1 & AC_DIG1_EMPHASIS)
 		snd_iprintf(buffer, " Preemphasis");
 	if (digi1 & AC_DIG1_COPYRIGHT)
-		snd_iprintf(buffer, " Copyright");
+		snd_iprintf(buffer, " Non-Copyright");
 	if (digi1 & AC_DIG1_NONAUDIO)
 		snd_iprintf(buffer, " Non-Audio");
 	if (digi1 & AC_DIG1_PROFESSIONAL)



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

* [ 004/108] ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_VFPv3 is enabled
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 002/108] USB: emi62: " Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 003/108] ALSA: hda - fix Copyright debug message Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 005/108] ARM: 7487/1: mm: avoid setting nG bit for user mappings that arent present Greg Kroah-Hartman
                     ` (103 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Will Deacon, Russell King

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Will Deacon <will.deacon@arm.com>

commit 3d9fb0038a9b02febb01efc79a4a5d97f1822a90 upstream.

VFPv4 support depends on the VFPv3 context save/restore code, so only
advertise support in the hwcaps if the kernel can actually handle it.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/vfp/vfpmodule.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -719,8 +719,10 @@ static int __init vfp_init(void)
 			if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
 				elf_hwcap |= HWCAP_NEON;
 #endif
+#ifdef CONFIG_VFPv3
 			if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
 				elf_hwcap |= HWCAP_VFPv4;
+#endif
 		}
 	}
 	return 0;



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

* [ 005/108] ARM: 7487/1: mm: avoid setting nG bit for user mappings that arent present
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (2 preceding siblings ...)
  2012-09-12 23:28   ` [ 004/108] ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_VFPv3 is enabled Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 006/108] ARM: 7488/1: mm: use 5 bits for swapfile type encoding Greg Kroah-Hartman
                     ` (102 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Catalin Marinas, Will Deacon, Russell King

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Will Deacon <will.deacon@arm.com>

commit 47f1204329237a0f8655f5a9f14a38ac81946ca1 upstream.

Swap entries are encoding in ptes such that !pte_present(pte) and
pte_file(pte). The remaining bits of the descriptor are used to identify
the swapfile and offset within it to the swap entry.

When writing such a pte for a user virtual address, set_pte_at
unconditionally sets the nG bit, which (in the case of LPAE) will
corrupt the swapfile offset and lead to a BUG:

[  140.494067] swap_free: Unused swap offset entry 000763b4
[  140.509989] BUG: Bad page map in process rs:main Q:Reg  pte:0ec76800 pmd:8f92e003

This patch fixes the problem by only setting the nG bit for user
mappings that are actually present.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/include/asm/pgtable.h |   34 ++++++++++++++++++----------------
 arch/arm/mm/flush.c            |    2 --
 2 files changed, 18 insertions(+), 18 deletions(-)

--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -195,6 +195,18 @@ static inline pte_t *pmd_page_vaddr(pmd_
 
 #define pte_clear(mm,addr,ptep)	set_pte_ext(ptep, __pte(0), 0)
 
+#define pte_none(pte)		(!pte_val(pte))
+#define pte_present(pte)	(pte_val(pte) & L_PTE_PRESENT)
+#define pte_write(pte)		(!(pte_val(pte) & L_PTE_RDONLY))
+#define pte_dirty(pte)		(pte_val(pte) & L_PTE_DIRTY)
+#define pte_young(pte)		(pte_val(pte) & L_PTE_YOUNG)
+#define pte_exec(pte)		(!(pte_val(pte) & L_PTE_XN))
+#define pte_special(pte)	(0)
+
+#define pte_present_user(pte) \
+	((pte_val(pte) & (L_PTE_PRESENT | L_PTE_USER)) == \
+	 (L_PTE_PRESENT | L_PTE_USER))
+
 #if __LINUX_ARM_ARCH__ < 6
 static inline void __sync_icache_dcache(pte_t pteval)
 {
@@ -206,25 +218,15 @@ extern void __sync_icache_dcache(pte_t p
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
 			      pte_t *ptep, pte_t pteval)
 {
-	if (addr >= TASK_SIZE)
-		set_pte_ext(ptep, pteval, 0);
-	else {
+	unsigned long ext = 0;
+
+	if (addr < TASK_SIZE && pte_present_user(pteval)) {
 		__sync_icache_dcache(pteval);
-		set_pte_ext(ptep, pteval, PTE_EXT_NG);
+		ext |= PTE_EXT_NG;
 	}
-}
 
-#define pte_none(pte)		(!pte_val(pte))
-#define pte_present(pte)	(pte_val(pte) & L_PTE_PRESENT)
-#define pte_write(pte)		(!(pte_val(pte) & L_PTE_RDONLY))
-#define pte_dirty(pte)		(pte_val(pte) & L_PTE_DIRTY)
-#define pte_young(pte)		(pte_val(pte) & L_PTE_YOUNG)
-#define pte_exec(pte)		(!(pte_val(pte) & L_PTE_XN))
-#define pte_special(pte)	(0)
-
-#define pte_present_user(pte) \
-	((pte_val(pte) & (L_PTE_PRESENT | L_PTE_USER)) == \
-	 (L_PTE_PRESENT | L_PTE_USER))
+	set_pte_ext(ptep, pteval, ext);
+}
 
 #define PTE_BIT_FUNC(fn,op) \
 static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -231,8 +231,6 @@ void __sync_icache_dcache(pte_t pteval)
 	struct page *page;
 	struct address_space *mapping;
 
-	if (!pte_present_user(pteval))
-		return;
 	if (cache_is_vipt_nonaliasing() && !pte_exec(pteval))
 		/* only flush non-aliasing VIPT caches for exec mappings */
 		return;



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

* [ 006/108] ARM: 7488/1: mm: use 5 bits for swapfile type encoding
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (3 preceding siblings ...)
  2012-09-12 23:28   ` [ 005/108] ARM: 7487/1: mm: avoid setting nG bit for user mappings that arent present Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 007/108] ARM: 7489/1: errata: fix workaround for erratum #720789 on UP systems Greg Kroah-Hartman
                     ` (101 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Catalin Marinas, Will Deacon, Russell King

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Will Deacon <will.deacon@arm.com>

commit f5f2025ef3e2cdb593707cbf87378761f17befbe upstream.

Page migration encodes the pfn in the offset field of a swp_entry_t.
For LPAE, we support physical addresses of up to 36 bits (due to
sparsemem limitations with the size of page flags), requiring 24 bits
to represent a pfn. A further 3 bits are used to encode a swp_entry into
a pte, leaving 5 bits for the type field. Furthermore, the core code
defines MAX_SWAPFILES_SHIFT as 5, so the additional type bit does not
get used.

This patch reduces the width of the type field to 5 bits, allowing us
to create up to 31 swapfiles of 64GB each.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/include/asm/pgtable.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -253,13 +253,13 @@ static inline pte_t pte_modify(pte_t pte
  *
  *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- *   <--------------- offset --------------------> <- type --> 0 0 0
+ *   <--------------- offset ----------------------> < type -> 0 0 0
  *
- * This gives us up to 63 swap files and 32GB per swap file.  Note that
+ * This gives us up to 31 swap files and 64GB per swap file.  Note that
  * the offset field is always non-zero.
  */
 #define __SWP_TYPE_SHIFT	3
-#define __SWP_TYPE_BITS		6
+#define __SWP_TYPE_BITS		5
 #define __SWP_TYPE_MASK		((1 << __SWP_TYPE_BITS) - 1)
 #define __SWP_OFFSET_SHIFT	(__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
 



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

* [ 007/108] ARM: 7489/1: errata: fix workaround for erratum #720789 on UP systems
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (4 preceding siblings ...)
  2012-09-12 23:28   ` [ 006/108] ARM: 7488/1: mm: use 5 bits for swapfile type encoding Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 008/108] ARM: OMAP2+: Fix dmtimer set source clock failure Greg Kroah-Hartman
                     ` (100 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Will Deacon, Russell King

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Will Deacon <will.deacon@arm.com>

commit 730a8128cd8978467eb1cf546b11014acb57d433 upstream.

Commit 5a783cbc4836 ("ARM: 7478/1: errata: extend workaround for erratum
 #720789") added workarounds for erratum #720789 to the range TLB
invalidation functions with the observation that the erratum only
affects SMP platforms. However, when running an SMP_ON_UP kernel on a
uniprocessor platform we must take care to preserve the ASID as the
workaround is not required.

This patch ensures that we don't set the ASID to 0 when flushing the TLB
on such a system, preserving the original behaviour with the workaround
disabled.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mm/tlb-v7.S |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -38,10 +38,10 @@ ENTRY(v7wbi_flush_user_tlb_range)
 	dsb
 	mov	r0, r0, lsr #PAGE_SHIFT		@ align address
 	mov	r1, r1, lsr #PAGE_SHIFT
-#ifdef CONFIG_ARM_ERRATA_720789
-	mov	r3, #0
-#else
 	asid	r3, r3				@ mask ASID
+#ifdef CONFIG_ARM_ERRATA_720789
+	ALT_SMP(W(mov)	r3, #0	)
+	ALT_UP(W(nop)		)
 #endif
 	orr	r0, r3, r0, lsl #PAGE_SHIFT	@ Create initial MVA
 	mov	r1, r1, lsl #PAGE_SHIFT



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

* [ 008/108] ARM: OMAP2+: Fix dmtimer set source clock failure
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (5 preceding siblings ...)
  2012-09-12 23:28   ` [ 007/108] ARM: 7489/1: errata: fix workaround for erratum #720789 on UP systems Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 009/108] ARM: S3C24XX: Add missing DMACH_DT_PROP Greg Kroah-Hartman
                     ` (99 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Jon Hunter, Kevin Hilman, Tony Lindgren

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jon Hunter <jon-hunter@ti.com>

commit 54f32a35f4d3a653a18a2c8c239f19ae060bd803 upstream.

Calling the dmtimer function omap_dm_timer_set_source() fails if following a
call to pm_runtime_put() to disable the timer. For example the following
sequence would fail to set the parent clock ...

	omap_dm_timer_stop(gptimer);
	omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);

The following error message would be seen ...

omap_dm_timer_set_source: failed to set timer_32k_ck as parent

The problem is that, by design, pm_runtime_put() simply decrements the usage
count and returns before the timer has actually been disabled. Therefore,
setting the parent clock failed because the timer was still active when the
trying to set the parent clock. Setting a parent clock will fail if the clock
you are setting the parent of has a non-zero usage count. To ensure that this
does not fail use pm_runtime_put_sync() when disabling the timer.

Note that this will not be seen on OMAP1 devices, because these devices do
not use the clock framework for dmtimers.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/plat-omap/dmtimer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -236,7 +236,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
 
 void omap_dm_timer_disable(struct omap_dm_timer *timer)
 {
-	pm_runtime_put(&timer->pdev->dev);
+	pm_runtime_put_sync(&timer->pdev->dev);
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
 



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

* [ 009/108] ARM: S3C24XX: Add missing DMACH_DT_PROP
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (6 preceding siblings ...)
  2012-09-12 23:28   ` [ 008/108] ARM: OMAP2+: Fix dmtimer set source clock failure Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 010/108] ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters Greg Kroah-Hartman
                     ` (98 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Heiko Stuebner, Kukjin Kim

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Heiko Stuebner <heiko@sntech.de>

commit e1267371eacf2cbcf580e41f9e64a986cdaf5c1d upstream.

Commit 2b90807549 (spi: s3c64xx: add device tree support) requires
the DMACH_DT_PROP element in the dma_ch enum. It's not used on non-DT
platforms but has to be present nevertheless.

So mimic the dummy-add of DMACH_DT_PROP on s3c64xx for s3c24xx
machines, to correct the build breakage for the s3c24xx variants
using the s3c64xx-spi-driver.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mach-s3c24xx/include/mach/dma.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/arm/mach-s3c24xx/include/mach/dma.h
+++ b/arch/arm/mach-s3c24xx/include/mach/dma.h
@@ -24,7 +24,8 @@
 */
 
 enum dma_ch {
-	DMACH_XD0,
+	DMACH_DT_PROP = -1,	/* not yet supported, do not use */
+	DMACH_XD0 = 0,
 	DMACH_XD1,
 	DMACH_SDI,
 	DMACH_SPI0,



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

* [ 010/108] ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (7 preceding siblings ...)
  2012-09-12 23:28   ` [ 009/108] ARM: S3C24XX: Add missing DMACH_DT_PROP Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 011/108] xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID Greg Kroah-Hartman
                     ` (97 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Heiko Stuebner, Kukjin Kim

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Heiko Stuebner <heiko@sntech.de>

commit b01858c7806e7e6f6121da2e51c9222fc4d21dc6 upstream.

Commit d670ac019f60 (ARM: SAMSUNG: DMA Cleanup as per sparse) changed the
prototype of the s3c2410_dma_* functions to use the enum dma_ch instead
of an generic unsigned int.

In the s3c24xx dma.c s3c2410_dma_enqueue seems to have been forgotten,
the other functions there were changed correctly.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/plat-s3c24xx/dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -430,7 +430,7 @@ s3c2410_dma_canload(struct s3c2410_dma_c
  * when necessary.
 */
 
-int s3c2410_dma_enqueue(unsigned int channel, void *id,
+int s3c2410_dma_enqueue(enum dma_ch channel, void *id,
 			dma_addr_t data, int size)
 {
 	struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);



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

* [ 011/108] xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (8 preceding siblings ...)
  2012-09-12 23:28   ` [ 010/108] ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 012/108] xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M Greg Kroah-Hartman
                     ` (96 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Konrad Rzeszutek Wilk

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 250a41e0ecc433cdd553a364d0fc74c766425209 upstream.

If P2M leaf is completly packed with INVALID_P2M_ENTRY or with
1:1 PFNs (so IDENTITY_FRAME type PFNs), we can swap the P2M leaf
with either a p2m_missing or p2m_identity respectively. The old
page (which was created via extend_brk or was grafted on from the
mfn_list) can be re-used for setting new PFNs.

This also means we can remove git commit:
5bc6f9888db5739abfa0cae279b4b442e4db8049
xen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back
which tried to fix this.

and make the amount that is required to be reserved much smaller.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/p2m.c |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 92 insertions(+), 3 deletions(-)

--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -196,9 +196,11 @@ RESERVE_BRK(p2m_mid_identity, PAGE_SIZE
 
 /* When we populate back during bootup, the amount of pages can vary. The
  * max we have is seen is 395979, but that does not mean it can't be more.
- * But some machines can have 3GB I/O holes even. So lets reserve enough
- * for 4GB of I/O and E820 holes. */
-RESERVE_BRK(p2m_populated, PMD_SIZE * 4);
+ * Some machines can have 3GB I/O holes even. With early_can_reuse_p2m_middle
+ * it can re-use Xen provided mfn_list array, so we only need to allocate at
+ * most three P2M top nodes. */
+RESERVE_BRK(p2m_populated, PAGE_SIZE * 3);
+
 static inline unsigned p2m_top_index(unsigned long pfn)
 {
 	BUG_ON(pfn >= MAX_P2M_PFN);
@@ -575,12 +577,99 @@ static bool __init early_alloc_p2m(unsig
 	}
 	return true;
 }
+
+/*
+ * Skim over the P2M tree looking at pages that are either filled with
+ * INVALID_P2M_ENTRY or with 1:1 PFNs. If found, re-use that page and
+ * replace the P2M leaf with a p2m_missing or p2m_identity.
+ * Stick the old page in the new P2M tree location.
+ */
+bool __init early_can_reuse_p2m_middle(unsigned long set_pfn, unsigned long set_mfn)
+{
+	unsigned topidx;
+	unsigned mididx;
+	unsigned ident_pfns;
+	unsigned inv_pfns;
+	unsigned long *p2m;
+	unsigned long *mid_mfn_p;
+	unsigned idx;
+	unsigned long pfn;
+
+	/* We only look when this entails a P2M middle layer */
+	if (p2m_index(set_pfn))
+		return false;
+
+	for (pfn = 0; pfn <= MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) {
+		topidx = p2m_top_index(pfn);
+
+		if (!p2m_top[topidx])
+			continue;
+
+		if (p2m_top[topidx] == p2m_mid_missing)
+			continue;
+
+		mididx = p2m_mid_index(pfn);
+		p2m = p2m_top[topidx][mididx];
+		if (!p2m)
+			continue;
+
+		if ((p2m == p2m_missing) || (p2m == p2m_identity))
+			continue;
+
+		if ((unsigned long)p2m == INVALID_P2M_ENTRY)
+			continue;
+
+		ident_pfns = 0;
+		inv_pfns = 0;
+		for (idx = 0; idx < P2M_PER_PAGE; idx++) {
+			/* IDENTITY_PFNs are 1:1 */
+			if (p2m[idx] == IDENTITY_FRAME(pfn + idx))
+				ident_pfns++;
+			else if (p2m[idx] == INVALID_P2M_ENTRY)
+				inv_pfns++;
+			else
+				break;
+		}
+		if ((ident_pfns == P2M_PER_PAGE) || (inv_pfns == P2M_PER_PAGE))
+			goto found;
+	}
+	return false;
+found:
+	/* Found one, replace old with p2m_identity or p2m_missing */
+	p2m_top[topidx][mididx] = (ident_pfns ? p2m_identity : p2m_missing);
+	/* And the other for save/restore.. */
+	mid_mfn_p = p2m_top_mfn_p[topidx];
+	/* NOTE: Even if it is a p2m_identity it should still be point to
+	 * a page filled with INVALID_P2M_ENTRY entries. */
+	mid_mfn_p[mididx] = virt_to_mfn(p2m_missing);
+
+	/* Reset where we want to stick the old page in. */
+	topidx = p2m_top_index(set_pfn);
+	mididx = p2m_mid_index(set_pfn);
+
+	/* This shouldn't happen */
+	if (WARN_ON(p2m_top[topidx] == p2m_mid_missing))
+		early_alloc_p2m(set_pfn);
+
+	if (WARN_ON(p2m_top[topidx][mididx] != p2m_missing))
+		return false;
+
+	p2m_init(p2m);
+	p2m_top[topidx][mididx] = p2m;
+	mid_mfn_p = p2m_top_mfn_p[topidx];
+	mid_mfn_p[mididx] = virt_to_mfn(p2m);
+
+	return true;
+}
 bool __init early_set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 {
 	if (unlikely(!__set_phys_to_machine(pfn, mfn)))  {
 		if (!early_alloc_p2m(pfn))
 			return false;
 
+		if (early_can_reuse_p2m_middle(pfn, mfn))
+			return __set_phys_to_machine(pfn, mfn);
+
 		if (!early_alloc_p2m_middle(pfn, false /* boundary crossover OK!*/))
 			return false;
 



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

* [ 012/108] xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (9 preceding siblings ...)
  2012-09-12 23:28   ` [ 011/108] xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 013/108] ARM: imx6: spin the cpu until hardware takes it down Greg Kroah-Hartman
                     ` (95 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Konrad Rzeszutek Wilk

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit c96aae1f7f393387d160211f60398d58463a7e65 upstream.

When we are finished with return PFNs to the hypervisor, then
populate it back, and also mark the E820 MMIO and E820 gaps
as IDENTITY_FRAMEs, we then call P2M to set areas that can
be used for ballooning. We were off by one, and ended up
over-writting a P2M entry that most likely was an IDENTITY_FRAME.
For example:

1-1 mapping on 40000->40200
1-1 mapping on bc558->bc5ac
1-1 mapping on bc5b4->bc8c5
1-1 mapping on bc8c6->bcb7c
1-1 mapping on bcd00->100000
Released 614 pages of unused memory
Set 277889 page(s) to 1-1 mapping
Populating 40200-40466 pfn range: 614 pages added

=> here we set from 40466 up to bc559 P2M tree to be
INVALID_P2M_ENTRY. We should have done it up to bc558.

The end result is that if anybody is trying to construct
a PTE for PFN bc558 they end up with ~PAGE_PRESENT.

Reported-by-and-Tested-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/setup.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -78,9 +78,16 @@ static void __init xen_add_extra_mem(u64
 	memblock_reserve(start, size);
 
 	xen_max_p2m_pfn = PFN_DOWN(start + size);
+	for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) {
+		unsigned long mfn = pfn_to_mfn(pfn);
+
+		if (WARN(mfn == pfn, "Trying to over-write 1-1 mapping (pfn: %lx)\n", pfn))
+			continue;
+		WARN(mfn != INVALID_P2M_ENTRY, "Trying to remove %lx which has %lx mfn!\n",
+			pfn, mfn);
 
-	for (pfn = PFN_DOWN(start); pfn <= xen_max_p2m_pfn; pfn++)
 		__set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
+	}
 }
 
 static unsigned long __init xen_do_chunk(unsigned long start,



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

* [ 013/108] ARM: imx6: spin the cpu until hardware takes it down
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (10 preceding siblings ...)
  2012-09-12 23:28   ` [ 012/108] xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 014/108] ARM: imx: build pm-imx5 code only when PM is enabled Greg Kroah-Hartman
                     ` (94 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Shawn Guo

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Shawn Guo <shawn.guo@linaro.org>

commit c944b0b9354ea06ffb0c8a7178949f1185f9f499 upstream.

Though commit 602bf40 (ARM: imx6: exit coherency when shutting down
a cpu) improves the stability of imx6q cpu hotplug a lot, there are
still hangs seen with a more stressful hotplug testing.

It's expected that once imx_enable_cpu(cpu, false) is called, the cpu
will be taken down by hardware immediately, and the code after that
will not get any chance to execute.  However, this is not always the
case from the testing.  The cpu could possibly be alive for a few
cycles before hardware actually takes it down.  So rather than letting
cpu execute some code that could cause a hang in these cycles, let's
make the cpu spin there and wait for hardware to take it down.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mach-imx/hotplug.c |   23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -42,22 +42,6 @@ static inline void cpu_enter_lowpower(vo
 	  : "cc");
 }
 
-static inline void cpu_leave_lowpower(void)
-{
-	unsigned int v;
-
-	asm volatile(
-		"mrc	p15, 0, %0, c1, c0, 0\n"
-	"	orr	%0, %0, %1\n"
-	"	mcr	p15, 0, %0, c1, c0, 0\n"
-	"	mrc	p15, 0, %0, c1, c0, 1\n"
-	"	orr	%0, %0, %2\n"
-	"	mcr	p15, 0, %0, c1, c0, 1\n"
-	  : "=&r" (v)
-	  : "Ir" (CR_C), "Ir" (0x40)
-	  : "cc");
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
@@ -67,11 +51,10 @@ void platform_cpu_die(unsigned int cpu)
 {
 	cpu_enter_lowpower();
 	imx_enable_cpu(cpu, false);
-	cpu_do_idle();
-	cpu_leave_lowpower();
 
-	/* We should never return from idle */
-	panic("cpu %d unexpectedly exit from shutdown\n", cpu);
+	/* spin here until hardware takes it down */
+	while (1)
+		;
 }
 
 int platform_cpu_disable(unsigned int cpu)



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

* [ 014/108] ARM: imx: build pm-imx5 code only when PM is enabled
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (11 preceding siblings ...)
  2012-09-12 23:28   ` [ 013/108] ARM: imx6: spin the cpu until hardware takes it down Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 015/108] ARM: imx: select CPU_FREQ_TABLE when needed Greg Kroah-Hartman
                     ` (93 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Arnd Bergmann, Shawn Guo, Sascha Hauer

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit a28eecef8ac2671dce7d892165bf374eeaa04e15 upstream.

This moves the imx5 pm code out of the list of unconditionally
compiled files for imx5, mirroring what we already do for imx6
and how it was done before the code was move from mach-mx5 to
mach-imx in v3.3.

Without this patch, building with CONFIG_PM disabled results in:

arch/arm/mach-imx/pm-imx5.c:202:116: error: redefinition of 'imx51_pm_init'
arch/arm/mach-imx/include/mach-imx/common.h:154:91: note: previous definition of 'imx51_pm_init' was here
arch/arm/mach-imx/pm-imx5.c:209:116: error: redefinition of 'imx53_pm_init'
arch/arm/mach-imx/include/mach-imx/common.h:155:91: note: previous definition of 'imx53_pm_init' was here

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mach-imx/Makefile |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -9,7 +9,8 @@ obj-$(CONFIG_SOC_IMX27) += clk-imx27.o m
 obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clk-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o
 obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o
 
-obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o pm-imx5.o cpu_op-mx51.o
+imx5-pm-$(CONFIG_PM) += pm-imx5.o
+obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o
 
 obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
 			    clk-pfd.o clk-busy.o



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

* [ 015/108] ARM: imx: select CPU_FREQ_TABLE when needed
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (12 preceding siblings ...)
  2012-09-12 23:28   ` [ 014/108] ARM: imx: build pm-imx5 code only when PM is enabled Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 016/108] ARM: imx: build i.MX6 functions only " Greg Kroah-Hartman
                     ` (92 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Arnd Bergmann, Shawn Guo, Sascha Hauer, Yong Shen

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit f637c4c9405e21f44cf0045eaf77eddd3a79ca5a upstream.

The i.MX cpufreq implementation uses the CPU_FREQ_TABLE helpers,
so it needs to select that code to be built. This problem has
apparently existed since the i.MX cpufreq code was first merged
in v2.6.37.

Building IMX without CPU_FREQ_TABLE results in:

arch/arm/plat-mxc/built-in.o: In function `mxc_cpufreq_exit':
arch/arm/plat-mxc/cpufreq.c:173: undefined reference to `cpufreq_frequency_table_put_attr'
arch/arm/plat-mxc/built-in.o: In function `mxc_set_target':
arch/arm/plat-mxc/cpufreq.c:84: undefined reference to `cpufreq_frequency_table_target'
arch/arm/plat-mxc/built-in.o: In function `mxc_verify_speed':
arch/arm/plat-mxc/cpufreq.c:65: undefined reference to `cpufreq_frequency_table_verify'
arch/arm/plat-mxc/built-in.o: In function `mxc_cpufreq_init':
arch/arm/plat-mxc/cpufreq.c:154: undefined reference to `cpufreq_frequency_table_cpuinfo'
arch/arm/plat-mxc/cpufreq.c:162: undefined reference to `cpufreq_frequency_table_get_attr'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Yong Shen <yong.shen@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2083,6 +2083,7 @@ source "drivers/cpufreq/Kconfig"
 config CPU_FREQ_IMX
 	tristate "CPUfreq driver for i.MX CPUs"
 	depends on ARCH_MXC && CPU_FREQ
+	select CPU_FREQ_TABLE
 	help
 	  This enables the CPUfreq driver for i.MX CPUs.
 



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

* [ 016/108] ARM: imx: build i.MX6 functions only when needed
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (13 preceding siblings ...)
  2012-09-12 23:28   ` [ 015/108] ARM: imx: select CPU_FREQ_TABLE when needed Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 017/108] MIPS: pci-ar724x: avoid data bus error due to a missing PCIe module Greg Kroah-Hartman
                     ` (91 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Arnd Bergmann, Shawn Guo, Eric Miao

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 1fc593feaf8e440511f381f4cdff483b55bbf546 upstream.

The head-v7.S contains a call to the generic cpu_suspend function,
which is only available when selected by the i.MX6 code. As
pointed out by Shawn Guo, i.MX5 does not actually use any
functions defined in head-v7.S. It is also needed only for
the i.MX6 power management code and for the SMP code, so
we can restrict building this file to situations in which
at least one of those two is present.

Finally, other platforms with a similar file call it headsmp.S,
so we can rename it to the same for consistency.

Without this patch, building imx5 standalone results in:

arch/arm/mach-imx/built-in.o: In function `v7_cpu_resume':
arch/arm/mach-imx/head-v7.S:104: undefined reference to `cpu_resume'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Eric Miao <eric.miao@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/mach-imx/Makefile  |    7 +-
 arch/arm/mach-imx/head-v7.S |  106 --------------------------------------------
 arch/arm/mach-imx/headsmp.S |  106 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 110 deletions(-)

--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -70,14 +70,13 @@ obj-$(CONFIG_DEBUG_LL) += lluart.o
 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
 obj-$(CONFIG_HAVE_IMX_SRC) += src.o
-obj-$(CONFIG_CPU_V7) += head-v7.o
-AFLAGS_head-v7.o :=-Wa,-march=armv7-a
-obj-$(CONFIG_SMP) += platsmp.o
+AFLAGS_headsmp.o :=-Wa,-march=armv7-a
+obj-$(CONFIG_SMP) += headsmp.o platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
 
 ifeq ($(CONFIG_PM),y)
-obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o
+obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
 endif
 
 # i.MX5 based machines
--- a/arch/arm/mach-imx/head-v7.S
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc.
- * Copyright 2011 Linaro Ltd.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/linkage.h>
-#include <linux/init.h>
-#include <asm/asm-offsets.h>
-#include <asm/hardware/cache-l2x0.h>
-
-	.section ".text.head", "ax"
-
-/*
- * The secondary kernel init calls v7_flush_dcache_all before it enables
- * the L1; however, the L1 comes out of reset in an undefined state, so
- * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
- * of cache lines with uninitialized data and uninitialized tags to get
- * written out to memory, which does really unpleasant things to the main
- * processor.  We fix this by performing an invalidate, rather than a
- * clean + invalidate, before jumping into the kernel.
- *
- * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
- * to be called for both secondary cores startup and primary core resume
- * procedures.  Ideally, it should be moved into arch/arm/mm/cache-v7.S.
- */
-ENTRY(v7_invalidate_l1)
-	mov	r0, #0
-	mcr	p15, 0, r0, c7, c5, 0	@ invalidate I cache
-	mcr	p15, 2, r0, c0, c0, 0
-	mrc	p15, 1, r0, c0, c0, 0
-
-	ldr	r1, =0x7fff
-	and	r2, r1, r0, lsr #13
-
-	ldr	r1, =0x3ff
-
-	and	r3, r1, r0, lsr #3	@ NumWays - 1
-	add	r2, r2, #1		@ NumSets
-
-	and	r0, r0, #0x7
-	add	r0, r0, #4	@ SetShift
-
-	clz	r1, r3		@ WayShift
-	add	r4, r3, #1	@ NumWays
-1:	sub	r2, r2, #1	@ NumSets--
-	mov	r3, r4		@ Temp = NumWays
-2:	subs	r3, r3, #1	@ Temp--
-	mov	r5, r3, lsl r1
-	mov	r6, r2, lsl r0
-	orr	r5, r5, r6	@ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
-	mcr	p15, 0, r5, c7, c6, 2
-	bgt	2b
-	cmp	r2, #0
-	bgt	1b
-	dsb
-	isb
-	mov	pc, lr
-ENDPROC(v7_invalidate_l1)
-
-#ifdef CONFIG_SMP
-ENTRY(v7_secondary_startup)
-	bl	v7_invalidate_l1
-	b	secondary_startup
-ENDPROC(v7_secondary_startup)
-#endif
-
-#ifdef CONFIG_PM
-/*
- * The following code is located into the .data section.  This is to
- * allow phys_l2x0_saved_regs to be accessed with a relative load
- * as we are running on physical address here.
- */
-	.data
-	.align
-
-#ifdef CONFIG_CACHE_L2X0
-	.macro	pl310_resume
-	ldr	r2, phys_l2x0_saved_regs
-	ldr	r0, [r2, #L2X0_R_PHY_BASE]	@ get physical base of l2x0
-	ldr	r1, [r2, #L2X0_R_AUX_CTRL]	@ get aux_ctrl value
-	str	r1, [r0, #L2X0_AUX_CTRL]	@ restore aux_ctrl
-	mov	r1, #0x1
-	str	r1, [r0, #L2X0_CTRL]		@ re-enable L2
-	.endm
-
-	.globl	phys_l2x0_saved_regs
-phys_l2x0_saved_regs:
-        .long   0
-#else
-	.macro	pl310_resume
-	.endm
-#endif
-
-ENTRY(v7_cpu_resume)
-	bl	v7_invalidate_l1
-	pl310_resume
-	b	cpu_resume
-ENDPROC(v7_cpu_resume)
-#endif
--- /dev/null
+++ b/arch/arm/mach-imx/headsmp.S
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+#include <asm/asm-offsets.h>
+#include <asm/hardware/cache-l2x0.h>
+
+	.section ".text.head", "ax"
+
+/*
+ * The secondary kernel init calls v7_flush_dcache_all before it enables
+ * the L1; however, the L1 comes out of reset in an undefined state, so
+ * the clean + invalidate performed by v7_flush_dcache_all causes a bunch
+ * of cache lines with uninitialized data and uninitialized tags to get
+ * written out to memory, which does really unpleasant things to the main
+ * processor.  We fix this by performing an invalidate, rather than a
+ * clean + invalidate, before jumping into the kernel.
+ *
+ * This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
+ * to be called for both secondary cores startup and primary core resume
+ * procedures.  Ideally, it should be moved into arch/arm/mm/cache-v7.S.
+ */
+ENTRY(v7_invalidate_l1)
+	mov	r0, #0
+	mcr	p15, 0, r0, c7, c5, 0	@ invalidate I cache
+	mcr	p15, 2, r0, c0, c0, 0
+	mrc	p15, 1, r0, c0, c0, 0
+
+	ldr	r1, =0x7fff
+	and	r2, r1, r0, lsr #13
+
+	ldr	r1, =0x3ff
+
+	and	r3, r1, r0, lsr #3	@ NumWays - 1
+	add	r2, r2, #1		@ NumSets
+
+	and	r0, r0, #0x7
+	add	r0, r0, #4	@ SetShift
+
+	clz	r1, r3		@ WayShift
+	add	r4, r3, #1	@ NumWays
+1:	sub	r2, r2, #1	@ NumSets--
+	mov	r3, r4		@ Temp = NumWays
+2:	subs	r3, r3, #1	@ Temp--
+	mov	r5, r3, lsl r1
+	mov	r6, r2, lsl r0
+	orr	r5, r5, r6	@ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
+	mcr	p15, 0, r5, c7, c6, 2
+	bgt	2b
+	cmp	r2, #0
+	bgt	1b
+	dsb
+	isb
+	mov	pc, lr
+ENDPROC(v7_invalidate_l1)
+
+#ifdef CONFIG_SMP
+ENTRY(v7_secondary_startup)
+	bl	v7_invalidate_l1
+	b	secondary_startup
+ENDPROC(v7_secondary_startup)
+#endif
+
+#ifdef CONFIG_PM
+/*
+ * The following code is located into the .data section.  This is to
+ * allow phys_l2x0_saved_regs to be accessed with a relative load
+ * as we are running on physical address here.
+ */
+	.data
+	.align
+
+#ifdef CONFIG_CACHE_L2X0
+	.macro	pl310_resume
+	ldr	r2, phys_l2x0_saved_regs
+	ldr	r0, [r2, #L2X0_R_PHY_BASE]	@ get physical base of l2x0
+	ldr	r1, [r2, #L2X0_R_AUX_CTRL]	@ get aux_ctrl value
+	str	r1, [r0, #L2X0_AUX_CTRL]	@ restore aux_ctrl
+	mov	r1, #0x1
+	str	r1, [r0, #L2X0_CTRL]		@ re-enable L2
+	.endm
+
+	.globl	phys_l2x0_saved_regs
+phys_l2x0_saved_regs:
+        .long   0
+#else
+	.macro	pl310_resume
+	.endm
+#endif
+
+ENTRY(v7_cpu_resume)
+	bl	v7_invalidate_l1
+	pl310_resume
+	b	cpu_resume
+ENDPROC(v7_cpu_resume)
+#endif



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

* [ 017/108] MIPS: pci-ar724x: avoid data bus error due to a missing PCIe module
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (14 preceding siblings ...)
  2012-09-12 23:28   ` [ 016/108] ARM: imx: build i.MX6 functions only " Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 018/108] ASoC: wm9712: Fix microphone source selection Greg Kroah-Hartman
                     ` (90 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Gabor Juhos, Ralf Baechle, linux-mips

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Gabor Juhos <juhosg@openwrt.org>

commit a1dca315ce3f78347bca8ce8befe3cc71ae63b7e upstream.

If the controller has no PCIe module attached, accessing of the device
configuration space causes a data bus error. Avoid this by checking the
status of the PCIe link in advance, and indicate an error if the link
is down.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/4293/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/pci/pci-ar724x.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

--- a/arch/mips/pci/pci-ar724x.c
+++ b/arch/mips/pci/pci-ar724x.c
@@ -23,9 +23,12 @@
 #define AR724X_PCI_MEM_BASE	0x10000000
 #define AR724X_PCI_MEM_SIZE	0x08000000
 
+#define AR724X_PCI_REG_RESET		0x18
 #define AR724X_PCI_REG_INT_STATUS	0x4c
 #define AR724X_PCI_REG_INT_MASK		0x50
 
+#define AR724X_PCI_RESET_LINK_UP	BIT(0)
+
 #define AR724X_PCI_INT_DEV0		BIT(14)
 
 #define AR724X_PCI_IRQ_COUNT		1
@@ -38,6 +41,15 @@ static void __iomem *ar724x_pci_ctrl_bas
 
 static u32 ar724x_pci_bar0_value;
 static bool ar724x_pci_bar0_is_cached;
+static bool ar724x_pci_link_up;
+
+static inline bool ar724x_pci_check_link(void)
+{
+	u32 reset;
+
+	reset = __raw_readl(ar724x_pci_ctrl_base + AR724X_PCI_REG_RESET);
+	return reset & AR724X_PCI_RESET_LINK_UP;
+}
 
 static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where,
 			    int size, uint32_t *value)
@@ -46,6 +58,9 @@ static int ar724x_pci_read(struct pci_bu
 	void __iomem *base;
 	u32 data;
 
+	if (!ar724x_pci_link_up)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
 	if (devfn)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
@@ -96,6 +111,9 @@ static int ar724x_pci_write(struct pci_b
 	u32 data;
 	int s;
 
+	if (!ar724x_pci_link_up)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
 	if (devfn)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
@@ -280,6 +298,10 @@ int __init ar724x_pcibios_init(int irq)
 	if (ar724x_pci_ctrl_base == NULL)
 		goto err_unmap_devcfg;
 
+	ar724x_pci_link_up = ar724x_pci_check_link();
+	if (!ar724x_pci_link_up)
+		pr_warn("ar724x: PCIe link is down\n");
+
 	ar724x_pci_irq_init(irq);
 	register_pci_controller(&ar724x_pci_controller);
 



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

* [ 000/108] 3.5.4-stable review
@ 2012-09-12 23:28 Greg KH
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
  0 siblings, 1 reply; 112+ messages in thread
From: Greg KH @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

[NOTE 1:
 Linus, Alan, Andrew, I've taken you off of every individual patch in
 the stable review cycle, based on feedback from Linus.  Below I
 summarize the patches in this release, with the original git commit id
 and who wrote them.  Hopefully this is in a format that is
 understandable.  If there's anything else you want in the summary
 email, just let me know.

 Alan and Andrew, if you want back on every email in the series, just
 let me know and I'll do so.]

[NOTE 2:
 I know there are still pending patches for this release that have been
 sent to me.  Due to vacation, and the kernel summit, I'm behind on
 them, and I figured it was best to get the outstanding patch queue out
 now, instead of waiting until next week for the whole batch.  I should
 be caught up soon, thanks for your understanding.]

This is the start of the stable review cycle for the 3.5.4 release.
There are 108 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 14 23:24:47 UTC 2012.
Anything received after that time might be too late.

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

thanks,

greg k-h

-------------
Shortlog of commits:

Patch Name                                                  	Original Commit ID	Author
USB: vt6656: remove __devinit* from the struct usb_device_id	4d088876f24887cd15a2	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: emi62: remove __devinit* from the struct usb_device_id 	83957df21dd94655d2b0	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ALSA: hda - fix Copyright debug message                     	088c820b732dbfd515fc	Wang Xingchao <xingchao.wang@intel.com>
ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_V	3d9fb0038a9b02febb01	Will Deacon <will.deacon@arm.com>
ARM: 7487/1: mm: avoid setting nG bit for user mappings that	47f1204329237a0f8655	Will Deacon <will.deacon@arm.com>
ARM: 7488/1: mm: use 5 bits for swapfile type encoding      	f5f2025ef3e2cdb59370	Will Deacon <will.deacon@arm.com>
ARM: 7489/1: errata: fix workaround for erratum #720789 on U	730a8128cd8978467eb1	Will Deacon <will.deacon@arm.com>
ARM: OMAP2+: Fix dmtimer set source clock failure           	54f32a35f4d3a653a18a	Jon Hunter <jon-hunter@ti.com>
ARM: S3C24XX: Add missing DMACH_DT_PROP                     	e1267371eacf2cbcf580	Heiko Stuebner <heiko@sntech.de>
ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters            	b01858c7806e7e6f6121	Heiko Stuebner <heiko@sntech.de>
xen/p2m: Reuse existing P2M leafs if they are filled with 1:	250a41e0ecc433cdd553	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/setup: Fix one-off error when adding for-balloon PFNs to	c96aae1f7f393387d160	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
ARM: imx6: spin the cpu until hardware takes it down        	c944b0b9354ea06ffb0c	Shawn Guo <shawn.guo@linaro.org>
ARM: imx: build pm-imx5 code only when PM is enabled        	a28eecef8ac2671dce7d	Arnd Bergmann <arnd@arndb.de>
ARM: imx: select CPU_FREQ_TABLE when needed                 	f637c4c9405e21f44cf0	Arnd Bergmann <arnd@arndb.de>
ARM: imx: build i.MX6 functions only when needed            	1fc593feaf8e440511f3	Arnd Bergmann <arnd@arndb.de>
MIPS: pci-ar724x: avoid data bus error due to a missing PCIe	a1dca315ce3f78347bca	Gabor Juhos <juhosg@openwrt.org>
ASoC: wm9712: Fix microphone source selection               	ccf795847a38235ee4a5	Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: omap-mcbsp: Fix 6pin mux configuration                	d0db84e713eaaccea2a4	Peter Ujfalusi <peter.ujfalusi@ti.com>
vfs: missed source of ->f_pos races                         	0e665d5d1125f9f4ccff	Al Viro <viro@ZenIV.linux.org.uk>
vfs: canonicalize create mode in build_open_flags()         	e68726ff72cf7ba5e7d7	Miklos Szeredi <mszeredi@suse.cz>
alpha: fix fpu.h usage in userspace                         	0be421862b857e619644	Mike Frysinger <vapier@gentoo.org>
alpha: Don't export SOCK_NONBLOCK to user space.            	a2fa3ccd7b43665fe14c	Michael Cree <mcree@orcon.net.nz>
USB: winbond: remove __devinit* from the struct usb_device_i	43a34695d9cd79c6659f	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm: hugetlbfs: correctly populate shared pmd                	eb48c071464757414538	Michal Hocko <mhocko@suse.cz>
ALSA: hda - don't create dysfunctional mixer controls for ca	c41999a23929f30808ba	David Henningsson <david.henningsson@canonical.com>
ALSA: hda - Fix leftover codec->power_transition            	535b6c51fe8293c88ce9	Takashi Iwai <tiwai@suse.de>
target: fix NULL pointer dereference bug alloc_page() fails 	d0e27c88d795fb964715	Yi Zou <yi.zou@intel.com>
NFSv3: Ensure that do_proc_get_root() reports errors correct	086600430493e04b802b	Trond Myklebust <Trond.Myklebust@netapp.com>
pnfs: defer release of pages in layoutget                   	8554116e17eef055d9dd	Idan Kedar <idank@tonian.com>
nfs: tear down caches in nfs_init_writepagecache when alloca	3dd4765fce04c0b4af1e	Jeff Layton <jlayton@redhat.com>
NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done  	47fbf7976e0b7d9dcdd7	Trond Myklebust <Trond.Myklebust@netapp.com>
NFS: Clear key construction data if the idmap upcall fails  	c5066945b7ea346a1142	Bryan Schumaker <bjschuma@netapp.com>
NFS: return -ENOKEY when the upcall fails to map the name   	12dfd080556124088ed6	Bryan Schumaker <bjschuma@netapp.com>
nfsd4: fix security flavor of NFSv4.0 callback              	39307655a1effa8d913b	"J. Bruce Fields" <bfields@redhat.com>
UBIFS: fix crash on error path                              	11e3be0be2a1314e0861	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
UBIFS: fix complaints about too small debug buffer size     	65b455b123c7e2b835a0	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Bluetooth: Fix using NULL inquiry entry                     	c810089c27e48b816181	Ram Malovany <ramm@ti.com>
Bluetooth: Fix using a NULL inquiry cache entry             	7cc8380eb10347016d95	Ram Malovany <ramm@ti.com>
Bluetooth: Set name_state to unknown when entry name is empt	c3e7c0d90b14a3e7ac09	Ram Malovany <ramm@ti.com>
Bluetooth: Fix legacy pairing with some devices             	a9ea3ed9b71cc3271dd5	Szymon Janc <szymon.janc@tieto.com>
NFS: Alias the nfs module to nfs4                           	425e776d93a7a5070b77	"bjschuma@gmail.com" <bjschuma@gmail.com>
audit: don't free_chunk() after fsnotify_add_mark()         	0fe33aae0e94b4097dd4	Miklos Szeredi <mszeredi@suse.cz>
audit: fix refcounting in audit-tree                        	a2140fc0cb0325bb6384	Miklos Szeredi <mszeredi@suse.cz>
drm: stop vmgfx driver explosion                            	f5869a8308f77e3dfdc2	Alan Cox <alan@linux.intel.com>
Revert "drm/radeon: fix bo creation retry path"             	676bc2e1e4f9072f7a64	Alex Deucher <alexander.deucher@amd.com>
Btrfs: revert checksum error statistic which can cause a BUG	5ee0844d6427e7338e0a	Stefan Behrens <sbehrens@giantdisaster.de>
svcrpc: fix BUG() in svc_tcp_clear_pages                    	be1e44441a560c43c136	"J. Bruce Fields" <bfields@redhat.com>
svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping          	d10f27a750312ed5638c	"J. Bruce Fields" <bfields@redhat.com>
svcrpc: sends on closed socket should stop immediately      	f06f00a24d76e168ecb3	"J. Bruce Fields" <bfields@redhat.com>
cciss: fix incorrect scsi status reporting                  	b0cf0b118c90477d1a68	"Stephen M. Cameron" <scameron@beardog.cce.hp.com>
ACPI: export symbol acpi_get_table_with_size                	4f81f986761a7663db7d	Alex Deucher <alexander.deucher@amd.com>
ath9k: stop btcoex on device suspend                        	e19f15ac6437624b6214	Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
ath9k: fix decrypt_error initialization in ath_rx_tasklet() 	e1352fde5682ab1bdd2a	Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
PCI: EHCI: Fix crash during hibernation on ASUS computers   	0b68c8e2c3afaf9807eb	"Rafael J. Wysocki" <rjw@sisk.pl>
gma500: Consider CRTC initially active.                     	4a68a74ba04e7ccf798d	Forest Bond <forest.bond@rapidrollout.com>
block: replace __getblk_slow misfix by grow_dev_page fix    	676ce6d5ca3098339c02	Hugh Dickins <hughd@google.com>
jbd: don't write superblock when unmounting an ro filesystem	2e84f2641ea91a730642	Jan Kara <jack@suse.cz>
ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capt	e9ba389c5ffc4dd29dfe	Takashi Iwai <tiwai@suse.de>
sched,cgroup: Fix up task_groups list                       	35cf4e50b16331def6cf	Mike Galbraith <efault@gmx.de>
sched: fix divide by zero at {thread_group,task}_times      	bea6832cc8c4a0a9a65d	Stanislaw Gruszka <sgruszka@redhat.com>
[media] uvcvideo: Reset the bytesused field when recycling a	8a3f0ede2b3f54771220	Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
rapidio/tsi721: fix inbound doorbell interrupt handling     	3670e7e12e582c6d6776	Alexandre Bounine <alexandre.bounine@idt.com>
rapidio/tsi721: fix unused variable compiler warning        	9a9a9a7adafe62a34de8	Alexandre Bounine <alexandre.bounine@idt.com>
regulator: twl-regulator: fix up VINTANA1/VINTANA2          	908d6d52928a7f2a4b31	Aaro Koskinen <aaro.koskinen@iki.fi>
x32: Use compat shims for {g,s}etsockopt                    	515c7af85ed92696c311	Mike Frysinger <vapier@gentoo.org>
USB: spca506: remove __devinit* from the struct usb_device_i	e694d518886c7afedcdd	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: jl2005bcd: remove __devinit* from the struct usb_device	ec063351684298e295dc	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: p54usb: remove __devinit* from the struct usb_device_id	b9c4167cbbafddac3462	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: rtl8187: remove __devinit* from the struct usb_device_i	a3433179d0822ccfa8e8	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: smsusb: remove __devinit* from the struct usb_device_id	d04dbd1c0ec17a13326c	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: CDC ACM: Fix NULL pointer dereference                  	99f347caa4568cb80386	Sven Schnelle <svens@stackframe.org>
ALSA: snd-usb: Fix URB cancellation at stream start         	015618b902ae8e28705b	Daniel Mack <zonque@gmail.com>
ALSA: snd-usb: use list_for_each_safe for endpoint resources	03d2f44e967b3c2cf79a	Pavel Roskin <proski@gnu.org>
ALSA: snd-usb: restore delay information                    	fbcfbf5f673847657ccd	Daniel Mack <zonque@gmail.com>
ALSA: snd-usb: fix calls to next_packet_size                	245baf983cc39524cce3	Daniel Mack <zonque@gmail.com>
ALSA: snd-usb: fix cross-interface streaming devices        	2e4a263ca80a203ac610	Daniel Mack <zonque@gmail.com>
powerpc: Update DSCR on all CPUs when writing sysfs dscr_def	1b6ca2a6fe56e7697d57	Anton Blanchard <anton@samba.org>
powerpc: Keep thread.dscr and thread.dscr_inherit in sync   	00ca0de02f80924dfff6	Anton Blanchard <anton@samba.org>
powerpc: Fix DSCR inheritance in copy_thread()              	1021cb268b3025573c48	Anton Blanchard <anton@samba.org>
powerpc: Restore correct DSCR in context switch             	714332858bfd40dcf8f7	Anton Blanchard <anton@samba.org>
powerpc: Make sure IPI handlers see data written by IPI send	9fb1b36ca1234e64a5d1	Paul Mackerras <paulus@samba.org>
Remove user-triggerable BUG from mpol_to_str                	80de7c3138ee9fd86a98	Dave Jones <davej@redhat.com>
Fix order of arguments to compat_put_time[spec|val]         	ed6fe9d614fc1bca95eb	Mikulas Patocka <mpatocka@redhat.com>
usbnet: fix deadlock in resume                              	ab6f148de28261682d30	Oliver Neukum <oliver@neukum.org>
SCSI: megaraid_sas: Move poll_aen_lock initializer          	bd8d6dd43a77bfd2b8fe	Kashyap Desai <Kashyap.Desai@lsi.com>
SCSI: scsi_lib: fix scsi_io_completion's SG_IO error propaga	27c419739b67decced46	Mike Snitzer <snitzer@redhat.com>
SCSI: mpt2sas: Fix for Driver oops, when loading driver with	338b131a3269881c7431	"sreekanth.reddy@lsi.com" <sreekanth.reddy@lsi.com>
SCSI: Fix 'Device not ready' issue on mpt2sas               	14216561e164671ce147	James Bottomley <JBottomley@Parallels.com>
udf: Fix data corruption for files in ICB                   	9c2fc0de1a6e638fe58c	Jan Kara <jack@suse.cz>
ext3: Fix fdatasync() for files with only i_size changes    	156bddd8e505b295540f	Jan Kara <jack@suse.cz>
fuse: fix retrieve length                                   	c9e67d483776d8d2a5f3	Miklos Szeredi <mszeredi@suse.cz>
i2c-designware: Fix build error if CONFIG_I2C_DESIGNWARE_PLA	e68bb91baa0bb9817567	Axel Lin <axel.lin@gmail.com>
i2c-i801: Add Device IDs for Intel Lynx Point-LP PCH        	4a8f1ddde942e232387e	James Ralston <james.d.ralston@intel.com>
HID: add NOGET quirk for Eaton Ellipse MAX UPS              	67ddbb3e6568fb1820b2	Alan Stern <stern@rowland.harvard.edu>
Input: i8042 - add Gigabyte T1005 series netbooks to noloop 	7b125b94ca16b7e618c6	Dmitry Torokhov <dmitry.torokhov@gmail.com>
UBI: fix a horrible memory deallocation bug                 	78b495c39add820ab66a	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drm/vmwgfx: add MODULE_DEVICE_TABLE so vmwgfx loads at boot 	c4903429a92be60e6fe5	Dave Airlie <airlied@redhat.com>
OMAPFB: fix framebuffer console colors                      	c1c52848cef52e157468	Grazvydas Ignotas <notasas@gmail.com>
e1000e: DoS while TSO enabled caused by link partner with sm	d821a4c4d11ad160925d	Bruce Allan <bruce.w.allan@intel.com>
PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the c	bba3d8c3b3c0f2123be5	Mel Gorman <mgorman@suse.de>
xen: Use correct masking in xen_swiotlb_alloc_coherent.     	b5031ed1be0aa4192505	Ronny Hegewald <ronny.hegewald@online.de>
xen/p2m: Fix one-off error in checking the P2M tree director	50e900417b8096939d12	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/pciback: Fix proper FLR steps.                          	80ba77dfbce85f2d1be5	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
uprobes: Fix mmap_region()'s mm->mm_rb corruption if uprobe_	c7a3a88c938fbe3d70c2	Oleg Nesterov <oleg@redhat.com>
x86, microcode, AMD: Fix broken ucode patch size check      	36bf50d7697be18c6bfd	Andreas Herrmann <andreas.herrmann3@amd.com>
dccp: check ccid before dereferencing                       	276bdb82dedb29051146	Mathias Krause <minipli@googlemail.com>
hwmon: (asus_atk0110) Add quirk for Asus M5A78L             	43ca6cb28c871f2fbad1	Luca Tettamanti <kronos.it@gmail.com>

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

Diffstat:

 Documentation/i2c/busses/i2c-i801          |    1 +
 Makefile                                   |    4 ++--
 arch/alpha/include/asm/fpu.h               |    2 ++
 arch/alpha/include/asm/socket.h            |    2 ++
 arch/arm/Kconfig                           |    1 +
 arch/arm/include/asm/pgtable.h             |   40 +++++++++++++++++++++-------------------
 arch/arm/mach-imx/Makefile                 |   10 +++++-----
 arch/arm/mach-imx/head-v7.S                |  106 ----------------------------------------------------------------------------------------------------------
 arch/arm/mach-imx/headsmp.S                |  106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-imx/hotplug.c                |   23 +++--------------------
 arch/arm/mach-s3c24xx/include/mach/dma.h   |    3 ++-
 arch/arm/mm/flush.c                        |    2 --
 arch/arm/mm/tlb-v7.S                       |    6 +++---
 arch/arm/plat-omap/dmtimer.c               |    2 +-
 arch/arm/plat-s3c24xx/dma.c                |    2 +-
 arch/arm/vfp/vfpmodule.c                   |    2 ++
 arch/mips/pci/pci-ar724x.c                 |   22 ++++++++++++++++++++++
 arch/parisc/include/asm/atomic.h           |    4 ++--
 arch/powerpc/kernel/asm-offsets.c          |    1 +
 arch/powerpc/kernel/dbell.c                |    2 ++
 arch/powerpc/kernel/entry_64.S             |   23 +++++++++++++++++------
 arch/powerpc/kernel/process.c              |   12 ++----------
 arch/powerpc/kernel/smp.c                  |   11 +++++++++--
 arch/powerpc/kernel/sysfs.c                |   10 ++++++++++
 arch/powerpc/kernel/traps.c                |    3 ++-
 arch/powerpc/sysdev/xics/icp-hv.c          |    6 +++++-
 arch/x86/kernel/microcode_amd.c            |    7 ++++---
 arch/x86/mm/hugetlbpage.c                  |   21 ++++++++++++++++-----
 arch/x86/syscalls/syscall_64.tbl           |    6 ++++--
 arch/x86/xen/p2m.c                         |   95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 arch/x86/xen/setup.c                       |    9 ++++++++-
 drivers/acpi/acpica/tbxface.c              |    1 +
 drivers/block/cciss_scsi.c                 |   11 +----------
 drivers/gpu/drm/gma500/psb_intel_display.c |    3 +++
 drivers/gpu/drm/radeon/radeon_object.c     |    3 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c        |    1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c        |    6 +++++-
 drivers/hid/usbhid/hid-quirks.c            |    1 +
 drivers/hwmon/asus_atk0110.c               |    6 ++++++
 drivers/i2c/busses/Kconfig                 |    6 ++++++
 drivers/i2c/busses/Makefile                |    5 +++--
 drivers/i2c/busses/i2c-designware-core.c   |   11 +++++++++++
 drivers/i2c/busses/i2c-i801.c              |    3 +++
 drivers/input/serio/i8042-x86ia64io.h      |   14 ++++++++++++++
 drivers/media/dvb/siano/smsusb.c           |    2 +-
 drivers/media/video/gspca/jl2005bcd.c      |    2 +-
 drivers/media/video/gspca/spca506.c        |    2 +-
 drivers/media/video/uvc/uvc_queue.c        |    1 +
 drivers/mtd/ubi/vtbl.c                     |    4 ++--
 drivers/net/ethernet/intel/e1000e/e1000.h  |    1 +
 drivers/net/ethernet/intel/e1000e/netdev.c |   48 +++++++++++++++++++++++-------------------------
 drivers/net/usb/usbnet.c                   |    2 +-
 drivers/net/wireless/ath/ath9k/pci.c       |    1 +
 drivers/net/wireless/ath/ath9k/recv.c      |    2 +-
 drivers/net/wireless/p54/p54usb.c          |    2 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c |    2 +-
 drivers/pci/pci-driver.c                   |    7 +++++++
 drivers/rapidio/devices/tsi721.c           |   12 +++++++++++-
 drivers/regulator/twl-regulator.c          |    4 ++--
 drivers/scsi/megaraid/megaraid_sas_base.c  |    3 ++-
 drivers/scsi/mpt2sas/mpt2sas_base.c        |   13 ++++++++-----
 drivers/scsi/scsi_error.c                  |   10 ++++++++++
 drivers/scsi/scsi_lib.c                    |    5 ++++-
 drivers/scsi/scsi_scan.c                   |   10 ++++++++++
 drivers/staging/vt6656/main_usb.c          |    2 +-
 drivers/staging/winbond/wbusb.c            |    2 +-
 drivers/target/target_core_transport.c     |    4 ++--
 drivers/usb/class/cdc-acm.c                |    3 ++-
 drivers/usb/misc/emi62.c                   |    2 +-
 drivers/video/omap2/omapfb/omapfb-main.c   |    2 +-
 drivers/xen/swiotlb-xen.c                  |    2 +-
 drivers/xen/xen-pciback/pci_stub.c         |    8 ++++----
 fs/btrfs/extent_io.c                       |   17 ++---------------
 fs/btrfs/volumes.c                         |   22 ----------------------
 fs/btrfs/volumes.h                         |    2 --
 fs/buffer.c                                |   66 ++++++++++++++++++++++++++++++------------------------------------
 fs/compat.c                                |   10 ++++++++--
 fs/ext3/inode.c                            |   17 ++++++++++++++---
 fs/fuse/dev.c                              |    1 +
 fs/jbd/journal.c                           |    5 +++++
 fs/nfs/idmap.c                             |   62 ++++++++++++++++++++++++++++++++++++++++++++------------------
 fs/nfs/nfs3proc.c                          |    2 +-
 fs/nfs/nfs4proc.c                          |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 fs/nfs/pnfs.c                              |   39 +--------------------------------------
 fs/nfs/pnfs.h                              |    2 +-
 fs/nfs/super.c                             |    2 ++
 fs/nfs/write.c                             |   15 ++++++++++++---
 fs/nfsd/nfs4callback.c                     |    4 ++--
 fs/nfsd/state.h                            |    1 -
 fs/open.c                                  |    7 ++++---
 fs/ubifs/debug.h                           |    2 +-
 fs/ubifs/lpt.c                             |    5 ++++-
 fs/udf/file.c                              |   35 +++++++++++++++++++++++++++++------
 kernel/audit_tree.c                        |   11 +++++------
 kernel/fork.c                              |    4 ++--
 kernel/sched/core.c                        |   35 +++++++++++++++++++++--------------
 kernel/sched/sched.h                       |    2 +-
 mm/mempolicy.c                             |    2 +-
 mm/mmap.c                                  |    5 ++---
 net/bluetooth/hci_event.c                  |   28 ++++++++++++++++++++++------
 net/bluetooth/l2cap_core.c                 |    1 +
 net/dccp/ccid.h                            |    4 ++--
 net/socket.c                               |    4 ++--
 net/sunrpc/svc_xprt.c                      |   10 ++++------
 net/sunrpc/svcsock.c                       |    2 +-
 sound/pci/hda/hda_codec.c                  |    2 ++
 sound/pci/hda/hda_proc.c                   |    2 +-
 sound/pci/hda/patch_ca0132.c               |    8 ++++++++
 sound/soc/codecs/wm9712.c                  |   19 +++++++++++++++++--
 sound/soc/omap/mcbsp.c                     |    2 +-
 sound/usb/card.c                           |    4 ++--
 sound/usb/endpoint.c                       |   24 ++++++++----------------
 sound/usb/endpoint.h                       |    3 ++-
 sound/usb/pcm.c                            |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 114 files changed, 882 insertions(+), 505 deletions(-)


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

* [ 018/108] ASoC: wm9712: Fix microphone source selection
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (15 preceding siblings ...)
  2012-09-12 23:28   ` [ 017/108] MIPS: pci-ar724x: avoid data bus error due to a missing PCIe module Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 019/108] ASoC: omap-mcbsp: Fix 6pin mux configuration Greg Kroah-Hartman
                     ` (89 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Christop Fritz, Mark Brown

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit ccf795847a38235ee4a56a24129ce75147d6ba8f upstream.

Currently the microphone input source is not selectable as while there is
a DAPM widget it's not connected to anything so it won't be properly
instantiated. Add something more correct for the input structure to get
things going, even though it's not hooked into the rest of the routing
map and so won't actually achieve anything except allowing the relevant
register bits to be written.

Reported-by: Christop Fritz <chf.fritz@googlemail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/wm9712.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -272,7 +272,7 @@ SOC_DAPM_ENUM("Route", wm9712_enum[9]);
 
 /* Mic select */
 static const struct snd_kcontrol_new wm9712_mic_src_controls =
-SOC_DAPM_ENUM("Route", wm9712_enum[7]);
+SOC_DAPM_ENUM("Mic Source Select", wm9712_enum[7]);
 
 /* diff select */
 static const struct snd_kcontrol_new wm9712_diff_sel_controls =
@@ -291,7 +291,9 @@ SND_SOC_DAPM_MUX("Left Capture Select",
 	&wm9712_capture_selectl_controls),
 SND_SOC_DAPM_MUX("Right Capture Select", SND_SOC_NOPM, 0, 0,
 	&wm9712_capture_selectr_controls),
-SND_SOC_DAPM_MUX("Mic Select Source", SND_SOC_NOPM, 0, 0,
+SND_SOC_DAPM_MUX("Left Mic Select Source", SND_SOC_NOPM, 0, 0,
+	&wm9712_mic_src_controls),
+SND_SOC_DAPM_MUX("Right Mic Select Source", SND_SOC_NOPM, 0, 0,
 	&wm9712_mic_src_controls),
 SND_SOC_DAPM_MUX("Differential Source", SND_SOC_NOPM, 0, 0,
 	&wm9712_diff_sel_controls),
@@ -319,6 +321,7 @@ SND_SOC_DAPM_PGA("Out 3 PGA", AC97_INT_P
 SND_SOC_DAPM_PGA("Line PGA", AC97_INT_PAGING, 2, 1, NULL, 0),
 SND_SOC_DAPM_PGA("Phone PGA", AC97_INT_PAGING, 1, 1, NULL, 0),
 SND_SOC_DAPM_PGA("Mic PGA", AC97_INT_PAGING, 0, 1, NULL, 0),
+SND_SOC_DAPM_PGA("Differential Mic", SND_SOC_NOPM, 0, 0, NULL, 0),
 SND_SOC_DAPM_MICBIAS("Mic Bias", AC97_INT_PAGING, 10, 1),
 SND_SOC_DAPM_OUTPUT("MONOOUT"),
 SND_SOC_DAPM_OUTPUT("HPOUTL"),
@@ -379,6 +382,18 @@ static const struct snd_soc_dapm_route w
 	{"Mic PGA", NULL, "MIC1"},
 	{"Mic PGA", NULL, "MIC2"},
 
+	/* microphones */
+	{"Differential Mic", NULL, "MIC1"},
+	{"Differential Mic", NULL, "MIC2"},
+	{"Left Mic Select Source", "Mic 1", "MIC1"},
+	{"Left Mic Select Source", "Mic 2", "MIC2"},
+	{"Left Mic Select Source", "Stereo", "MIC1"},
+	{"Left Mic Select Source", "Differential", "Differential Mic"},
+	{"Right Mic Select Source", "Mic 1", "MIC1"},
+	{"Right Mic Select Source", "Mic 2", "MIC2"},
+	{"Right Mic Select Source", "Stereo", "MIC2"},
+	{"Right Mic Select Source", "Differential", "Differential Mic"},
+
 	/* left capture selector */
 	{"Left Capture Select", "Mic", "MIC1"},
 	{"Left Capture Select", "Speaker Mixer", "Speaker Mixer"},



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

* [ 019/108] ASoC: omap-mcbsp: Fix 6pin mux configuration
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (16 preceding siblings ...)
  2012-09-12 23:28   ` [ 018/108] ASoC: wm9712: Fix microphone source selection Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 020/108] vfs: missed source of ->f_pos races Greg Kroah-Hartman
                     ` (88 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, CF Adad, Peter Ujfalusi, Jarkko Nikula, Mark Brown

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Peter Ujfalusi <peter.ujfalusi@ti.com>

commit d0db84e713eaaccea2a435e1625fb3150b335f4a upstream.

The check for the mux_signal callback was wrong which prevents us to
configure the 6pin port's FSR/CLKR signal mux.

Reported-by: CF Adad <cfadad@rocketmail.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -745,7 +745,7 @@ int omap_mcbsp_6pin_src_mux(struct omap_
 {
 	const char *signal, *src;
 
-	if (mcbsp->pdata->mux_signal)
+	if (!mcbsp->pdata->mux_signal)
 		return -EINVAL;
 
 	switch (mux) {



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

* [ 020/108] vfs: missed source of ->f_pos races
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (17 preceding siblings ...)
  2012-09-12 23:28   ` [ 019/108] ASoC: omap-mcbsp: Fix 6pin mux configuration Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 021/108] vfs: canonicalize create mode in build_open_flags() Greg Kroah-Hartman
                     ` (87 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Al Viro, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 0e665d5d1125f9f4ccff56a75e814f10f88861a2 upstream.

compat_sys_{read,write}v() need the same "pass a copy of file->f_pos" thing
as sys_{read,write}{,v}().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/compat.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1155,11 +1155,14 @@ compat_sys_readv(unsigned long fd, const
 	struct file *file;
 	int fput_needed;
 	ssize_t ret;
+	loff_t pos;
 
 	file = fget_light(fd, &fput_needed);
 	if (!file)
 		return -EBADF;
-	ret = compat_readv(file, vec, vlen, &file->f_pos);
+	pos = file->f_pos;
+	ret = compat_readv(file, vec, vlen, &pos);
+	file->f_pos = pos;
 	fput_light(file, fput_needed);
 	return ret;
 }
@@ -1221,11 +1224,14 @@ compat_sys_writev(unsigned long fd, cons
 	struct file *file;
 	int fput_needed;
 	ssize_t ret;
+	loff_t pos;
 
 	file = fget_light(fd, &fput_needed);
 	if (!file)
 		return -EBADF;
-	ret = compat_writev(file, vec, vlen, &file->f_pos);
+	pos = file->f_pos;
+	ret = compat_writev(file, vec, vlen, &pos);
+	file->f_pos = pos;
 	fput_light(file, fput_needed);
 	return ret;
 }



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

* [ 021/108] vfs: canonicalize create mode in build_open_flags()
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (18 preceding siblings ...)
  2012-09-12 23:28   ` [ 020/108] vfs: missed source of ->f_pos races Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 022/108] alpha: fix fpu.h usage in userspace Greg Kroah-Hartman
                     ` (86 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Miklos Szeredi, Richard W.M. Jones

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit e68726ff72cf7ba5e7d789857fcd9a75ca573f03 upstream.

Userspace can pass weird create mode in open(2) that we canonicalize to
"(mode & S_IALLUGO) | S_IFREG" in vfs_create().

The problem is that we use the uncanonicalized mode before calling vfs_create()
with unforseen consequences.

So do the canonicalization early in build_open_flags().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/open.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/fs/open.c
+++ b/fs/open.c
@@ -930,9 +930,10 @@ static inline int build_open_flags(int f
 	int lookup_flags = 0;
 	int acc_mode;
 
-	if (!(flags & O_CREAT))
-		mode = 0;
-	op->mode = mode;
+	if (flags & O_CREAT)
+		op->mode = (mode & S_IALLUGO) | S_IFREG;
+	else
+		op->mode = 0;
 
 	/* Must never be set by userspace */
 	flags &= ~FMODE_NONOTIFY;



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

* [ 022/108] alpha: fix fpu.h usage in userspace
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (19 preceding siblings ...)
  2012-09-12 23:28   ` [ 021/108] vfs: canonicalize create mode in build_open_flags() Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 023/108] alpha: Dont export SOCK_NONBLOCK to user space Greg Kroah-Hartman
                     ` (85 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Matt Turner, Mike Frysinger, Michael Cree, Matt Turner,
	Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mike Frysinger <vapier@gentoo.org>

commit 0be421862b857e61964435ffcaa7499cf77a5e5a upstream.

After commit ec2212088c42 ("Disintegrate asm/system.h for Alpha"), the
fpu.h header which we install for userland started depending on
special_insns.h which is not installed.

However, fpu.h only uses that for __KERNEL__ code, so protect the
inclusion the same way to avoid build breakage in glibc:

  /usr/include/asm/fpu.h:4:31: fatal error: asm/special_insns.h: No such file or directory

Reported-by: Matt Turner <mattst88@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/alpha/include/asm/fpu.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/alpha/include/asm/fpu.h
+++ b/arch/alpha/include/asm/fpu.h
@@ -1,7 +1,9 @@
 #ifndef __ASM_ALPHA_FPU_H
 #define __ASM_ALPHA_FPU_H
 
+#ifdef __KERNEL__
 #include <asm/special_insns.h>
+#endif
 
 /*
  * Alpha floating-point control register defines:



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

* [ 023/108] alpha: Dont export SOCK_NONBLOCK to user space.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (20 preceding siblings ...)
  2012-09-12 23:28   ` [ 022/108] alpha: fix fpu.h usage in userspace Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 024/108] USB: winbond: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (84 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Michael Cree, Matt Turner, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Michael Cree <mcree@orcon.net.nz>

commit a2fa3ccd7b43665fe14cb562761a6c3d26a1d13f upstream.

Currently we export SOCK_NONBLOCK to user space but that conflicts with
the definition from glibc leading to compilation errors in user programs
(e.g.  see Debian bug #658460).

The generic socket.h restricts the definition of SOCK_NONBLOCK to the
kernel, as does the MIPS specific socket.h, so let's do the same on
Alpha.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/alpha/include/asm/socket.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -76,9 +76,11 @@
 /* Instruct lower device to use last 4-bytes of skb data as FCS */
 #define SO_NOFCS		43
 
+#ifdef __KERNEL__
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * have to define SOCK_NONBLOCK to a different value here.
  */
 #define SOCK_NONBLOCK	0x40000000
+#endif /* __KERNEL__ */
 
 #endif /* _ASM_SOCKET_H */



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

* [ 024/108] USB: winbond: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (21 preceding siblings ...)
  2012-09-12 23:28   ` [ 023/108] alpha: Dont export SOCK_NONBLOCK to user space Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 025/108] mm: hugetlbfs: correctly populate shared pmd Greg Kroah-Hartman
                     ` (83 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Pavel Machek,
	Paul Gortmaker, John W. Linville, Eliad Peller, Devendra Naga

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 43a34695d9cd79c6659f09da6d3b0624f3dd169f upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Pavel Machek <pavel@ucw.cz>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: "John W. Linville" <linville@tuxdriver.com>
CC: Eliad Peller <eliad@wizery.com>
CC: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/winbond/wbusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -25,7 +25,7 @@ MODULE_DESCRIPTION("IS89C35 802.11bg WLA
 MODULE_LICENSE("GPL");
 MODULE_VERSION("0.1");
 
-static const struct usb_device_id wb35_table[] __devinitconst = {
+static const struct usb_device_id wb35_table[] = {
 	{ USB_DEVICE(0x0416, 0x0035) },
 	{ USB_DEVICE(0x18E8, 0x6201) },
 	{ USB_DEVICE(0x18E8, 0x6206) },



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

* [ 025/108] mm: hugetlbfs: correctly populate shared pmd
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (22 preceding siblings ...)
  2012-09-12 23:28   ` [ 024/108] USB: winbond: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 026/108] ALSA: hda - dont create dysfunctional mixer controls for ca0132 Greg Kroah-Hartman
                     ` (82 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Larry Woodman, Mel Gorman, Michal Hocko, Rik van Riel,
	David Gibson, Ken Chen, Cong Wang, Hillf Danton, Andrew Morton,
	Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Michal Hocko <mhocko@suse.cz>

commit eb48c071464757414538c68a6033c8f8c15196f8 upstream.

Each page mapped in a process's address space must be correctly
accounted for in _mapcount.  Normally the rules for this are
straightforward but hugetlbfs page table sharing is different.  The page
table pages at the PMD level are reference counted while the mapcount
remains the same.

If this accounting is wrong, it causes bugs like this one reported by
Larry Woodman:

  kernel BUG at mm/filemap.c:135!
  invalid opcode: 0000 [#1] SMP
  CPU 22
  Modules linked in: bridge stp llc sunrpc binfmt_misc dcdbas microcode pcspkr acpi_pad acpi]
  Pid: 18001, comm: mpitest Tainted: G        W    3.3.0+ #4 Dell Inc. PowerEdge R620/07NDJ2
  RIP: 0010:[<ffffffff8112cfed>]  [<ffffffff8112cfed>] __delete_from_page_cache+0x15d/0x170
  Process mpitest (pid: 18001, threadinfo ffff880428972000, task ffff880428b5cc20)
  Call Trace:
    delete_from_page_cache+0x40/0x80
    truncate_hugepages+0x115/0x1f0
    hugetlbfs_evict_inode+0x18/0x30
    evict+0x9f/0x1b0
    iput_final+0xe3/0x1e0
    iput+0x3e/0x50
    d_kill+0xf8/0x110
    dput+0xe2/0x1b0
    __fput+0x162/0x240

During fork(), copy_hugetlb_page_range() detects if huge_pte_alloc()
shared page tables with the check dst_pte == src_pte.  The logic is if
the PMD page is the same, they must be shared.  This assumes that the
sharing is between the parent and child.  However, if the sharing is
with a different process entirely then this check fails as in this
diagram:

  parent
    |
    ------------>pmd
                 src_pte----------> data page
                                        ^
  other--------->pmd--------------------|
                  ^
  child-----------|
                 dst_pte

For this situation to occur, it must be possible for Parent and Other to
have faulted and failed to share page tables with each other.  This is
possible due to the following style of race.

  PROC A                                          PROC B
  copy_hugetlb_page_range                         copy_hugetlb_page_range
    src_pte == huge_pte_offset                      src_pte == huge_pte_offset
    !src_pte so no sharing                          !src_pte so no sharing

  (time passes)

  hugetlb_fault                                   hugetlb_fault
    huge_pte_alloc                                  huge_pte_alloc
      huge_pmd_share                                 huge_pmd_share
        LOCK(i_mmap_mutex)
        find nothing, no sharing
        UNLOCK(i_mmap_mutex)
                                                      LOCK(i_mmap_mutex)
                                                      find nothing, no sharing
                                                      UNLOCK(i_mmap_mutex)
      pmd_alloc                                       pmd_alloc
      LOCK(instantiation_mutex)
      fault
      UNLOCK(instantiation_mutex)
                                                  LOCK(instantiation_mutex)
                                                  fault
                                                  UNLOCK(instantiation_mutex)

These two processes are not poing to the same data page but are not
sharing page tables because the opportunity was missed.  When either
process later forks, the src_pte == dst pte is potentially insufficient.
As the check falls through, the wrong PTE information is copied in
(harmless but wrong) and the mapcount is bumped for a page mapped by a
shared page table leading to the BUG_ON.

This patch addresses the issue by moving pmd_alloc into huge_pmd_share
which guarantees that the shared pud is populated in the same critical
section as pmd.  This also means that huge_pte_offset test in
huge_pmd_share is serialized correctly now which in turn means that the
success of the sharing will be higher as the racing tasks see the pud
and pmd populated together.

Race identified and changelog written mostly by Mel Gorman.

{akpm@linux-foundation.org: attempt to make the huge_pmd_share() comment comprehensible, clean up coding style]
Reported-by: Larry Woodman <lwoodman@redhat.com>
Tested-by: Larry Woodman <lwoodman@redhat.com>
Reviewed-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Ken Chen <kenchen@google.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/mm/hugetlbpage.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -56,9 +56,16 @@ static int vma_shareable(struct vm_area_
 }
 
 /*
- * search for a shareable pmd page for hugetlb.
+ * Search for a shareable pmd page for hugetlb. In any case calls pmd_alloc()
+ * and returns the corresponding pte. While this is not necessary for the
+ * !shared pmd case because we can allocate the pmd later as well, it makes the
+ * code much cleaner. pmd allocation is essential for the shared case because
+ * pud has to be populated inside the same i_mmap_mutex section - otherwise
+ * racing tasks could either miss the sharing (see huge_pte_offset) or select a
+ * bad pmd for sharing.
  */
-static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
+static pte_t *
+huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
 {
 	struct vm_area_struct *vma = find_vma(mm, addr);
 	struct address_space *mapping = vma->vm_file->f_mapping;
@@ -68,9 +75,10 @@ static void huge_pmd_share(struct mm_str
 	struct vm_area_struct *svma;
 	unsigned long saddr;
 	pte_t *spte = NULL;
+	pte_t *pte;
 
 	if (!vma_shareable(vma, addr))
-		return;
+		return (pte_t *)pmd_alloc(mm, pud, addr);
 
 	mutex_lock(&mapping->i_mmap_mutex);
 	vma_prio_tree_foreach(svma, &iter, &mapping->i_mmap, idx, idx) {
@@ -97,7 +105,9 @@ static void huge_pmd_share(struct mm_str
 		put_page(virt_to_page(spte));
 	spin_unlock(&mm->page_table_lock);
 out:
+	pte = (pte_t *)pmd_alloc(mm, pud, addr);
 	mutex_unlock(&mapping->i_mmap_mutex);
+	return pte;
 }
 
 /*
@@ -142,8 +152,9 @@ pte_t *huge_pte_alloc(struct mm_struct *
 		} else {
 			BUG_ON(sz != PMD_SIZE);
 			if (pud_none(*pud))
-				huge_pmd_share(mm, addr, pud);
-			pte = (pte_t *) pmd_alloc(mm, pud, addr);
+				pte = huge_pmd_share(mm, addr, pud);
+			else
+				pte = (pte_t *)pmd_alloc(mm, pud, addr);
 		}
 	}
 	BUG_ON(pte && !pte_none(*pte) && !pte_huge(*pte));



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

* [ 026/108] ALSA: hda - dont create dysfunctional mixer controls for ca0132
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (23 preceding siblings ...)
  2012-09-12 23:28   ` [ 025/108] mm: hugetlbfs: correctly populate shared pmd Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 027/108] ALSA: hda - Fix leftover codec->power_transition Greg Kroah-Hartman
                     ` (81 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, David Henningsson, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit c41999a23929f30808bae6009d8065052d4d73fd upstream.

It's possible that these amps are settable somehow, e g through
secret codec verbs, but for now, don't create the controls (as
they won't be working anyway, and cause errors in amixer).

BugLink: https://bugs.launchpad.net/bugs/1038651
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/patch_ca0132.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -275,6 +275,10 @@ static int _add_switch(struct hda_codec
 	int type = dir ? HDA_INPUT : HDA_OUTPUT;
 	struct snd_kcontrol_new knew =
 		HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type);
+	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_MUTE) == 0) {
+		snd_printdd("Skipping '%s %s Switch' (no mute on node 0x%x)\n", pfx, dirstr[dir], nid);
+		return 0;
+	}
 	sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]);
 	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
 }
@@ -286,6 +290,10 @@ static int _add_volume(struct hda_codec
 	int type = dir ? HDA_INPUT : HDA_OUTPUT;
 	struct snd_kcontrol_new knew =
 		HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type);
+	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_NUM_STEPS) == 0) {
+		snd_printdd("Skipping '%s %s Volume' (no amp on node 0x%x)\n", pfx, dirstr[dir], nid);
+		return 0;
+	}
 	sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]);
 	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
 }



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

* [ 027/108] ALSA: hda - Fix leftover codec->power_transition
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (24 preceding siblings ...)
  2012-09-12 23:28   ` [ 026/108] ALSA: hda - dont create dysfunctional mixer controls for ca0132 Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 028/108] target: fix NULL pointer dereference bug alloc_page() fails to get memory Greg Kroah-Hartman
                     ` (80 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 535b6c51fe8293c88ce919cdfc4390c67a1cb6d1 upstream.

When the codec turn-on operation is canceled by the immediate
power-on, the driver left the power_transition flag as is.
This caused the persistent avoidance of power-save behavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/hda_codec.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4422,6 +4422,8 @@ static void __snd_hda_power_up(struct hd
 	 * then there is no need to go through power up here.
 	 */
 	if (codec->power_on) {
+		if (codec->power_transition < 0)
+			codec->power_transition = 0;
 		spin_unlock(&codec->power_lock);
 		return;
 	}



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

* [ 028/108] target: fix NULL pointer dereference bug alloc_page() fails to get memory
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (25 preceding siblings ...)
  2012-09-12 23:28   ` [ 027/108] ALSA: hda - Fix leftover codec->power_transition Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 029/108] NFSv3: Ensure that do_proc_get_root() reports errors correctly Greg Kroah-Hartman
                     ` (79 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Yi Zou, Andy Grover, Nicholas Bellinger, Open-FCoE.org

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Yi Zou <yi.zou@intel.com>

commit d0e27c88d795fb9647153063ec48051fd84e1731 upstream.

I am hitting this bug when the target is low in memory that fails the
alloc_page() for the newly submitted command. This is a sort of off-by-one
bug causing NULL pointer dereference in __free_page() since 'i' here is
really the counter of total pages that have been successfully allocated here.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Open-FCoE.org <devel@open-fcoe.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -3477,9 +3477,9 @@ transport_generic_get_mem(struct se_cmd
 	return 0;
 
 out:
-	while (i >= 0) {
-		__free_page(sg_page(&cmd->t_data_sg[i]));
+	while (i > 0) {
 		i--;
+		__free_page(sg_page(&cmd->t_data_sg[i]));
 	}
 	kfree(cmd->t_data_sg);
 	cmd->t_data_sg = NULL;



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

* [ 029/108] NFSv3: Ensure that do_proc_get_root() reports errors correctly
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (26 preceding siblings ...)
  2012-09-12 23:28   ` [ 028/108] target: fix NULL pointer dereference bug alloc_page() fails to get memory Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 030/108] pnfs: defer release of pages in layoutget Greg Kroah-Hartman
                     ` (78 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Yuanming Chen, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 086600430493e04b802bee6e5b3ce0458e4eb77f upstream.

If the rpc call to NFS3PROC_FSINFO fails, then we need to report that
error so that the mount fails. Otherwise we can end up with a
superblock with completely unusable values for block sizes, maxfilesize,
etc.

Reported-by: Yuanming Chen <hikvision_linux@163.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -69,7 +69,7 @@ do_proc_get_root(struct rpc_clnt *client
 	nfs_fattr_init(info->fattr);
 	status = rpc_call_sync(client, &msg, 0);
 	dprintk("%s: reply fsinfo: %d\n", __func__, status);
-	if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
+	if (status == 0 && !(info->fattr->valid & NFS_ATTR_FATTR)) {
 		msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
 		msg.rpc_resp = info->fattr;
 		status = rpc_call_sync(client, &msg, 0);



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

* [ 030/108] pnfs: defer release of pages in layoutget
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (27 preceding siblings ...)
  2012-09-12 23:28   ` [ 029/108] NFSv3: Ensure that do_proc_get_root() reports errors correctly Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 031/108] nfs: tear down caches in nfs_init_writepagecache when allocation fails Greg Kroah-Hartman
                     ` (77 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Idan Kedar, Benny Halevy, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Idan Kedar <idank@tonian.com>

commit 8554116e17eef055d9dd58a94b3427cb2ad1c317 upstream.

we have encountered a bug whereby reading a lot of files (copying
fedora's /bin) from a pNFS mount and hitting Ctrl+C in the middle caused
a general protection fault in xdr_shrink_bufhead. this function is
called when decoding the response from LAYOUTGET. the decoding is done
by a worker thread, and the caller of LAYOUTGET waits for the worker
thread to complete.

hitting Ctrl+C caused the synchronous wait to end and the next thing the
caller does is to free the pages, so when the worker thread calls
xdr_shrink_bufhead, the pages are gone. therefore, the cleanup of these
pages has been moved to nfs4_layoutget_release.

Signed-off-by: Idan Kedar <idank@tonian.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/nfs4proc.c |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 fs/nfs/pnfs.c     |   39 ------------------------------------
 fs/nfs/pnfs.h     |    2 -
 3 files changed, 58 insertions(+), 40 deletions(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6164,11 +6164,58 @@ static void nfs4_layoutget_done(struct r
 	dprintk("<-- %s\n", __func__);
 }
 
+static size_t max_response_pages(struct nfs_server *server)
+{
+	u32 max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
+	return nfs_page_array_len(0, max_resp_sz);
+}
+
+static void nfs4_free_pages(struct page **pages, size_t size)
+{
+	int i;
+
+	if (!pages)
+		return;
+
+	for (i = 0; i < size; i++) {
+		if (!pages[i])
+			break;
+		__free_page(pages[i]);
+	}
+	kfree(pages);
+}
+
+static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags)
+{
+	struct page **pages;
+	int i;
+
+	pages = kcalloc(size, sizeof(struct page *), gfp_flags);
+	if (!pages) {
+		dprintk("%s: can't alloc array of %zu pages\n", __func__, size);
+		return NULL;
+	}
+
+	for (i = 0; i < size; i++) {
+		pages[i] = alloc_page(gfp_flags);
+		if (!pages[i]) {
+			dprintk("%s: failed to allocate page\n", __func__);
+			nfs4_free_pages(pages, size);
+			return NULL;
+		}
+	}
+
+	return pages;
+}
+
 static void nfs4_layoutget_release(void *calldata)
 {
 	struct nfs4_layoutget *lgp = calldata;
+	struct nfs_server *server = NFS_SERVER(lgp->args.inode);
+	size_t max_pages = max_response_pages(server);
 
 	dprintk("--> %s\n", __func__);
+	nfs4_free_pages(lgp->args.layout.pages, max_pages);
 	put_nfs_open_context(lgp->args.ctx);
 	kfree(calldata);
 	dprintk("<-- %s\n", __func__);
@@ -6180,9 +6227,10 @@ static const struct rpc_call_ops nfs4_la
 	.rpc_release = nfs4_layoutget_release,
 };
 
-int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
+int nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags)
 {
 	struct nfs_server *server = NFS_SERVER(lgp->args.inode);
+	size_t max_pages = max_response_pages(server);
 	struct rpc_task *task;
 	struct rpc_message msg = {
 		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
@@ -6200,6 +6248,13 @@ int nfs4_proc_layoutget(struct nfs4_layo
 
 	dprintk("--> %s\n", __func__);
 
+	lgp->args.layout.pages = nfs4_alloc_pages(max_pages, gfp_flags);
+	if (!lgp->args.layout.pages) {
+		nfs4_layoutget_release(lgp);
+		return -ENOMEM;
+	}
+	lgp->args.layout.pglen = max_pages * PAGE_SIZE;
+
 	lgp->res.layoutp = &lgp->args.layout;
 	lgp->res.seq_res.sr_slot = NULL;
 	nfs41_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0);
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -583,9 +583,6 @@ send_layoutget(struct pnfs_layout_hdr *l
 	struct nfs_server *server = NFS_SERVER(ino);
 	struct nfs4_layoutget *lgp;
 	struct pnfs_layout_segment *lseg = NULL;
-	struct page **pages = NULL;
-	int i;
-	u32 max_resp_sz, max_pages;
 
 	dprintk("--> %s\n", __func__);
 
@@ -594,20 +591,6 @@ send_layoutget(struct pnfs_layout_hdr *l
 	if (lgp == NULL)
 		return NULL;
 
-	/* allocate pages for xdr post processing */
-	max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
-	max_pages = nfs_page_array_len(0, max_resp_sz);
-
-	pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags);
-	if (!pages)
-		goto out_err_free;
-
-	for (i = 0; i < max_pages; i++) {
-		pages[i] = alloc_page(gfp_flags);
-		if (!pages[i])
-			goto out_err_free;
-	}
-
 	lgp->args.minlength = PAGE_CACHE_SIZE;
 	if (lgp->args.minlength > range->length)
 		lgp->args.minlength = range->length;
@@ -616,39 +599,19 @@ send_layoutget(struct pnfs_layout_hdr *l
 	lgp->args.type = server->pnfs_curr_ld->id;
 	lgp->args.inode = ino;
 	lgp->args.ctx = get_nfs_open_context(ctx);
-	lgp->args.layout.pages = pages;
-	lgp->args.layout.pglen = max_pages * PAGE_SIZE;
 	lgp->lsegpp = &lseg;
 	lgp->gfp_flags = gfp_flags;
 
 	/* Synchronously retrieve layout information from server and
 	 * store in lseg.
 	 */
-	nfs4_proc_layoutget(lgp);
+	nfs4_proc_layoutget(lgp, gfp_flags);
 	if (!lseg) {
 		/* remember that LAYOUTGET failed and suspend trying */
 		set_bit(lo_fail_bit(range->iomode), &lo->plh_flags);
 	}
 
-	/* free xdr pages */
-	for (i = 0; i < max_pages; i++)
-		__free_page(pages[i]);
-	kfree(pages);
-
 	return lseg;
-
-out_err_free:
-	/* free any allocated xdr pages, lgp as it's not used */
-	if (pages) {
-		for (i = 0; i < max_pages; i++) {
-			if (!pages[i])
-				break;
-			__free_page(pages[i]);
-		}
-		kfree(pages);
-	}
-	kfree(lgp);
-	return NULL;
 }
 
 /* Initiates a LAYOUTRETURN(FILE) */
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -171,7 +171,7 @@ extern int nfs4_proc_getdevicelist(struc
 				   struct pnfs_devicelist *devlist);
 extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,
 				   struct pnfs_device *dev);
-extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);
+extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags);
 extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp);
 
 /* pnfs.c */



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

* [ 031/108] nfs: tear down caches in nfs_init_writepagecache when allocation fails
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (28 preceding siblings ...)
  2012-09-12 23:28   ` [ 030/108] pnfs: defer release of pages in layoutget Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 032/108] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done Greg Kroah-Hartman
                     ` (76 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Bryan Schumaker, Jeff Layton, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jeff Layton <jlayton@redhat.com>

commit 3dd4765fce04c0b4af1e0bc4c0b10f906f95fabc upstream.

...and ensure that we tear down the nfs_commit_data cache too when
unloading the module.

Cc: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/write.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1806,19 +1806,19 @@ int __init nfs_init_writepagecache(void)
 	nfs_wdata_mempool = mempool_create_slab_pool(MIN_POOL_WRITE,
 						     nfs_wdata_cachep);
 	if (nfs_wdata_mempool == NULL)
-		return -ENOMEM;
+		goto out_destroy_write_cache;
 
 	nfs_cdata_cachep = kmem_cache_create("nfs_commit_data",
 					     sizeof(struct nfs_commit_data),
 					     0, SLAB_HWCACHE_ALIGN,
 					     NULL);
 	if (nfs_cdata_cachep == NULL)
-		return -ENOMEM;
+		goto out_destroy_write_mempool;
 
 	nfs_commit_mempool = mempool_create_slab_pool(MIN_POOL_COMMIT,
 						      nfs_wdata_cachep);
 	if (nfs_commit_mempool == NULL)
-		return -ENOMEM;
+		goto out_destroy_commit_cache;
 
 	/*
 	 * NFS congestion size, scale with available memory.
@@ -1841,11 +1841,20 @@ int __init nfs_init_writepagecache(void)
 		nfs_congestion_kb = 256*1024;
 
 	return 0;
+
+out_destroy_commit_cache:
+	kmem_cache_destroy(nfs_cdata_cachep);
+out_destroy_write_mempool:
+	mempool_destroy(nfs_wdata_mempool);
+out_destroy_write_cache:
+	kmem_cache_destroy(nfs_wdata_cachep);
+	return -ENOMEM;
 }
 
 void nfs_destroy_writepagecache(void)
 {
 	mempool_destroy(nfs_commit_mempool);
+	kmem_cache_destroy(nfs_cdata_cachep);
 	mempool_destroy(nfs_wdata_mempool);
 	kmem_cache_destroy(nfs_wdata_cachep);
 }



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

* [ 032/108] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (29 preceding siblings ...)
  2012-09-12 23:28   ` [ 031/108] nfs: tear down caches in nfs_init_writepagecache when allocation fails Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 033/108] NFS: Clear key construction data if the idmap upcall fails Greg Kroah-Hartman
                     ` (75 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Boaz Harrosh, Tigran Mkrtchyan, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit 47fbf7976e0b7d9dcdd799e2a1baba19064d9631 upstream.

Ever since commit 0a57cdac3f (NFSv4.1 send layoutreturn to fence
disconnected data server) we've been sending layoutreturn calls
while there is potentially still outstanding I/O to the data
servers. The reason we do this is to avoid races between replayed
writes to the MDS and the original writes to the DS.

When this happens, the BUG_ON() in nfs4_layoutreturn_done can
be triggered because it assumes that we would never call
layoutreturn without knowing that all I/O to the DS is
finished. The fix is to remove the BUG_ON() now that the
assumptions behind the test are obsolete.

Reported-by: Boaz Harrosh <bharrosh@panasas.com>
Reported-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/nfs4proc.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6300,12 +6300,8 @@ static void nfs4_layoutreturn_done(struc
 		return;
 	}
 	spin_lock(&lo->plh_inode->i_lock);
-	if (task->tk_status == 0) {
-		if (lrp->res.lrs_present) {
-			pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
-		} else
-			BUG_ON(!list_empty(&lo->plh_segs));
-	}
+	if (task->tk_status == 0 && lrp->res.lrs_present)
+		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
 	lo->plh_block_lgets--;
 	spin_unlock(&lo->plh_inode->i_lock);
 	dprintk("<-- %s\n", __func__);



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

* [ 033/108] NFS: Clear key construction data if the idmap upcall fails
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (30 preceding siblings ...)
  2012-09-12 23:28   ` [ 032/108] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 034/108] NFS: return -ENOKEY when the upcall fails to map the name Greg Kroah-Hartman
                     ` (74 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Bryan Schumaker, William Dauchy, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Bryan Schumaker <bjschuma@netapp.com>

commit c5066945b7ea346a11424dbeb7830b7d7d00c206 upstream.

idmap_pipe_downcall already clears this field if the upcall succeeds,
but if it fails (rpc.idmapd isn't running) the field will still be set
on the next call triggering a BUG_ON().  This patch tries to handle all
possible ways that the upcall could fail and clear the idmap key data
for each one.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Tested-by: William Dauchy <wdauchy@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/idmap.c |   56 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 14 deletions(-)

--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -63,6 +63,12 @@ struct idmap {
 	struct mutex		idmap_mutex;
 };
 
+struct idmap_legacy_upcalldata {
+	struct rpc_pipe_msg pipe_msg;
+	struct idmap_msg idmap_msg;
+	struct idmap *idmap;
+};
+
 /**
  * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
  * @fattr: fully initialised struct nfs_fattr
@@ -326,6 +332,7 @@ static ssize_t nfs_idmap_get_key(const c
 		ret = nfs_idmap_request_key(&key_type_id_resolver_legacy,
 					    name, namelen, type, data,
 					    data_size, idmap);
+		idmap->idmap_key_cons = NULL;
 		mutex_unlock(&idmap->idmap_mutex);
 	}
 	return ret;
@@ -383,11 +390,13 @@ static const match_table_t nfs_idmap_tok
 static int nfs_idmap_legacy_upcall(struct key_construction *, const char *, void *);
 static ssize_t idmap_pipe_downcall(struct file *, const char __user *,
 				   size_t);
+static void idmap_release_pipe(struct inode *);
 static void idmap_pipe_destroy_msg(struct rpc_pipe_msg *);
 
 static const struct rpc_pipe_ops idmap_upcall_ops = {
 	.upcall		= rpc_pipe_generic_upcall,
 	.downcall	= idmap_pipe_downcall,
+	.release_pipe	= idmap_release_pipe,
 	.destroy_msg	= idmap_pipe_destroy_msg,
 };
 
@@ -619,7 +628,8 @@ void nfs_idmap_quit(void)
 	nfs_idmap_quit_keyring();
 }
 
-static int nfs_idmap_prepare_message(char *desc, struct idmap_msg *im,
+static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
+				     struct idmap_msg *im,
 				     struct rpc_pipe_msg *msg)
 {
 	substring_t substr;
@@ -662,6 +672,7 @@ static int nfs_idmap_legacy_upcall(struc
 				   const char *op,
 				   void *aux)
 {
+	struct idmap_legacy_upcalldata *data;
 	struct rpc_pipe_msg *msg;
 	struct idmap_msg *im;
 	struct idmap *idmap = (struct idmap *)aux;
@@ -669,15 +680,15 @@ static int nfs_idmap_legacy_upcall(struc
 	int ret = -ENOMEM;
 
 	/* msg and im are freed in idmap_pipe_destroy_msg */
-	msg = kmalloc(sizeof(*msg), GFP_KERNEL);
-	if (!msg)
-		goto out0;
-
-	im = kmalloc(sizeof(*im), GFP_KERNEL);
-	if (!im)
+	data = kmalloc(sizeof(*data), GFP_KERNEL);
+	if (!data)
 		goto out1;
 
-	ret = nfs_idmap_prepare_message(key->description, im, msg);
+	msg = &data->pipe_msg;
+	im = &data->idmap_msg;
+	data->idmap = idmap;
+
+	ret = nfs_idmap_prepare_message(key->description, idmap, im, msg);
 	if (ret < 0)
 		goto out2;
 
@@ -686,15 +697,15 @@ static int nfs_idmap_legacy_upcall(struc
 
 	ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
 	if (ret < 0)
-		goto out2;
+		goto out3;
 
 	return ret;
 
+out3:
+	idmap->idmap_key_cons = NULL;
 out2:
-	kfree(im);
+	kfree(data);
 out1:
-	kfree(msg);
-out0:
 	complete_request_key(cons, ret);
 	return ret;
 }
@@ -778,9 +789,26 @@ out_incomplete:
 static void
 idmap_pipe_destroy_msg(struct rpc_pipe_msg *msg)
 {
+	struct idmap_legacy_upcalldata *data = container_of(msg,
+			struct idmap_legacy_upcalldata,
+			pipe_msg);
+	struct idmap *idmap = data->idmap;
+	struct key_construction *cons;
+	if (msg->errno) {
+		cons = ACCESS_ONCE(idmap->idmap_key_cons);
+		idmap->idmap_key_cons = NULL;
+		complete_request_key(cons, msg->errno);
+	}
 	/* Free memory allocated in nfs_idmap_legacy_upcall() */
-	kfree(msg->data);
-	kfree(msg);
+	kfree(data);
+}
+
+static void
+idmap_release_pipe(struct inode *inode)
+{
+	struct rpc_inode *rpci = RPC_I(inode);
+	struct idmap *idmap = (struct idmap *)rpci->private;
+	idmap->idmap_key_cons = NULL;
 }
 
 int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)



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

* [ 034/108] NFS: return -ENOKEY when the upcall fails to map the name
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (31 preceding siblings ...)
  2012-09-12 23:28   ` [ 033/108] NFS: Clear key construction data if the idmap upcall fails Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 035/108] nfsd4: fix security flavor of NFSv4.0 callback Greg Kroah-Hartman
                     ` (73 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Bryan Schumaker, William Dauchy, Trond Myklebust

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Bryan Schumaker <bjschuma@netapp.com>

commit 12dfd080556124088ed61a292184947711b46cbe upstream.

This allows the normal error-paths to handle the error, rather than
making a special call to complete_request_key() just for this instance.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Tested-by: William Dauchy <wdauchy@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/idmap.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -763,9 +763,8 @@ idmap_pipe_downcall(struct file *filp, c
 	}
 
 	if (!(im.im_status & IDMAP_STATUS_SUCCESS)) {
-		ret = mlen;
-		complete_request_key(cons, -ENOKEY);
-		goto out_incomplete;
+		ret = -ENOKEY;
+		goto out;
 	}
 
 	namelen_in = strnlen(im.im_name, IDMAP_NAMESZ);
@@ -782,7 +781,6 @@ idmap_pipe_downcall(struct file *filp, c
 
 out:
 	complete_request_key(cons, ret);
-out_incomplete:
 	return ret;
 }
 



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

* [ 035/108] nfsd4: fix security flavor of NFSv4.0 callback
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (32 preceding siblings ...)
  2012-09-12 23:28   ` [ 034/108] NFS: return -ENOKEY when the upcall fails to map the name Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 036/108] UBIFS: fix crash on error path Greg Kroah-Hartman
                     ` (72 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Jamie Heilman, J. Bruce Fields

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit 39307655a1effa8d913bba054c0e985bfaca808c upstream.

Commit d5497fc693a446ce9100fcf4117c3f795ddfd0d2 "nfsd4: move rq_flavor
into svc_cred" forgot to remove cl_flavor from the client, leaving two
places (cl_flavor and cl_cred.cr_flavor) for the flavor to be stored.
After that patch, the latter was the one that was updated, but the
former was the one that the callback used.

Symptoms were a long delay on utime().  This is because the utime()
generated a setattr which recalled a delegation, but the cb_recall was
ignored by the client because it had the wrong security flavor.

Tested-by: Jamie Heilman <jamie@audible.transient.net>
Reported-by: Jamie Heilman <jamie@audible.transient.net>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfsd/nfs4callback.c |    4 ++--
 fs/nfsd/state.h        |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -651,12 +651,12 @@ static int setup_callback_client(struct
 
 	if (clp->cl_minorversion == 0) {
 		if (!clp->cl_cred.cr_principal &&
-				(clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
+				(clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5))
 			return -EINVAL;
 		args.client_name = clp->cl_cred.cr_principal;
 		args.prognumber	= conn->cb_prog,
 		args.protocol = XPRT_TRANSPORT_TCP;
-		args.authflavor = clp->cl_flavor;
+		args.authflavor = clp->cl_cred.cr_flavor;
 		clp->cl_cb_ident = conn->cb_ident;
 	} else {
 		if (!conn->cb_xprt)
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -231,7 +231,6 @@ struct nfs4_client {
 	nfs4_verifier		cl_verifier; 	/* generated by client */
 	time_t                  cl_time;        /* time of last lease renewal */
 	struct sockaddr_storage	cl_addr; 	/* client ipaddress */
-	u32			cl_flavor;	/* setclientid pseudoflavor */
 	struct svc_cred		cl_cred; 	/* setclientid principal */
 	clientid_t		cl_clientid;	/* generated by server */
 	nfs4_verifier		cl_confirm;	/* generated by server */



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

* [ 036/108] UBIFS: fix crash on error path
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (33 preceding siblings ...)
  2012-09-12 23:28   ` [ 035/108] nfsd4: fix security flavor of NFSv4.0 callback Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 037/108] UBIFS: fix complaints about too small debug buffer size Greg Kroah-Hartman
                     ` (71 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Artem Bityutskiy

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 11e3be0be2a1314e0861304857e7efcaed5d3e54 upstream.

This patch fixes a regression introduced by
"4994297 UBIFS: make ubifs_lpt_init clean-up in case of failure" which
I've hit while running the 'integck -p' test. When remount the file-system
from R/O mode to R/W mode and 'lpt_init_wr()' fails, we free _all_ LPT
resources by calling 'ubifs_lpt_free(c, 0)', even those needed for R/O
mode. This leads to subsequent crashes, e.g., if we try to unmount
the file-system.

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

---
 fs/ubifs/lpt.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -1749,7 +1749,10 @@ int ubifs_lpt_init(struct ubifs_info *c,
 	return 0;
 
 out_err:
-	ubifs_lpt_free(c, 0);
+	if (wr)
+		ubifs_lpt_free(c, 1);
+	if (rd)
+		ubifs_lpt_free(c, 0);
 	return err;
 }
 



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

* [ 037/108] UBIFS: fix complaints about too small debug buffer size
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (34 preceding siblings ...)
  2012-09-12 23:28   ` [ 036/108] UBIFS: fix crash on error path Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 038/108] Bluetooth: Fix using NULL inquiry entry Greg Kroah-Hartman
                     ` (70 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Michael Hench, Artem Bityutskiy

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 65b455b123c7e2b835a0b7148f9bae584f95000e upstream.

When debugging is enabled, we use a temporary on-stack buffer for formatting
the key strings like "(11368871, direntry, 0xcd0750)". The buffer size is
32 bytes and sometimes it is not enough to fit the key string - e.g., when
inode numbers are high. This is not fatal, but the key strings are incomplete
and UBIFS complains like this:

	UBIFS assert failed in dbg_snprintf_key at 137 (pid 1)

This is a regression caused by "515315a UBIFS: fix key printing".

Fix the issue by increasing the buffer to 48 bytes.

Reported-by: Michael Hench <michaelhench@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Michael Hench <michaelhench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ubifs/debug.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -162,7 +162,7 @@ struct ubifs_global_debug_info {
 #define ubifs_dbg_msg(type, fmt, ...) \
 	pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
 
-#define DBG_KEY_BUF_LEN 32
+#define DBG_KEY_BUF_LEN 48
 #define ubifs_dbg_msg_key(type, key, fmt, ...) do {                            \
 	char __tmp_key_buf[DBG_KEY_BUF_LEN];                                   \
 	pr_debug("UBIFS DBG " type ": " fmt "%s\n", ##__VA_ARGS__,             \



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

* [ 038/108] Bluetooth: Fix using NULL inquiry entry
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (35 preceding siblings ...)
  2012-09-12 23:28   ` [ 037/108] UBIFS: fix complaints about too small debug buffer size Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 039/108] Bluetooth: Fix using a NULL inquiry cache entry Greg Kroah-Hartman
                     ` (69 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Ram Malovany, Gustavo Padovan

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Ram Malovany <ramm@ti.com>

commit c810089c27e48b816181b454fcc493d19fdbc2ba upstream.

If entry wasn't found in the hci_inquiry_cache_lookup_resolve do not
resolve the name.This will fix a kernel crash when trying to use NULL
pointer.

Signed-off-by: Ram Malovany <ramm@ti.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/bluetooth/hci_event.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1375,6 +1375,9 @@ static bool hci_resolve_next_name(struct
 		return false;
 
 	e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED);
+	if (!e)
+		return false;
+
 	if (hci_resolve_name(hdev, e) == 0) {
 		e->name_state = NAME_PENDING;
 		return true;



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

* [ 039/108] Bluetooth: Fix using a NULL inquiry cache entry
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (36 preceding siblings ...)
  2012-09-12 23:28   ` [ 038/108] Bluetooth: Fix using NULL inquiry entry Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 040/108] Bluetooth: Set name_state to unknown when entry name is empty Greg Kroah-Hartman
                     ` (68 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Ram Malovany, Gustavo Padovan

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Ram Malovany <ramm@ti.com>

commit 7cc8380eb10347016d95bf6f9d842c2ae6d12932 upstream.

If the device was not found in a list of found devices names of which
are pending.This may happen in a case when HCI Remote Name Request
was sent as a part of incoming connection establishment procedure.
Hence there is no need to continue resolving a next name as it will
be done upon receiving another Remote Name Request Complete Event.
This will fix a kernel crash when trying to use this entry to resolve
the next name.

Signed-off-by: Ram Malovany <ramm@ti.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/bluetooth/hci_event.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1406,12 +1406,18 @@ static void hci_check_pending_name(struc
 		return;
 
 	e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING);
-	if (e) {
+	/* If the device was not found in a list of found devices names of which
+	 * are pending. there is no need to continue resolving a next name as it
+	 * will be done upon receiving another Remote Name Request Complete
+	 * Event */
+	if (!e)
+		return;
+
+	list_del(&e->list);
+	if (name) {
 		e->name_state = NAME_KNOWN;
-		list_del(&e->list);
-		if (name)
-			mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00,
-					 e->data.rssi, name, name_len);
+		mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00,
+				 e->data.rssi, name, name_len);
 	}
 
 	if (hci_resolve_next_name(hdev))



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

* [ 040/108] Bluetooth: Set name_state to unknown when entry name is empty
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (37 preceding siblings ...)
  2012-09-12 23:28   ` [ 039/108] Bluetooth: Fix using a NULL inquiry cache entry Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 041/108] Bluetooth: Fix legacy pairing with some devices Greg Kroah-Hartman
                     ` (67 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Ram Malovany, Gustavo Padovan

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Ram Malovany <ramm@ti.com>

commit c3e7c0d90b14a3e7ac091d24cef09efb516d587b upstream.

When the name of the given entry is empty , the state needs to be
updated accordingly.

Signed-off-by: Ram Malovany <ramm@ti.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/bluetooth/hci_event.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1418,6 +1418,8 @@ static void hci_check_pending_name(struc
 		e->name_state = NAME_KNOWN;
 		mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00,
 				 e->data.rssi, name, name_len);
+	} else {
+		e->name_state = NAME_NOT_KNOWN;
 	}
 
 	if (hci_resolve_next_name(hdev))



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

* [ 041/108] Bluetooth: Fix legacy pairing with some devices
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (38 preceding siblings ...)
  2012-09-12 23:28   ` [ 040/108] Bluetooth: Set name_state to unknown when entry name is empty Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 042/108] NFS: Alias the nfs module to nfs4 Greg Kroah-Hartman
                     ` (66 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Szymon Janc, Johan Hedberg, Gustavo Padovan

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Szymon Janc <szymon.janc@tieto.com>

commit a9ea3ed9b71cc3271dd59e76f65748adcaa76422 upstream.

Some devices e.g. some Android based phones don't do SDP search before
pairing and cancel legacy pairing when ACL is disconnected.

PIN Code Request event which changes ACL timeout to HCI_PAIRING_TIMEOUT
is only received after remote user entered PIN.

In that case no L2CAP is connected so default HCI_DISCONN_TIMEOUT
(2 seconds) is being used to timeout ACL connection. This results in
problems with legacy pairing as remote user has only few seconds to
enter PIN before ACL is disconnected.

Increase disconnect timeout for incomming connection to
HCI_PAIRING_TIMEOUT if SSP is disabled and no linkey exists.

To avoid keeping ACL alive for too long after SDP search set ACL
timeout back to HCI_DISCONN_TIMEOUT when L2CAP is connected.

2012-07-19 13:24:43.413521 < HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:02:72:D6:6A:3F ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
2012-07-19 13:24:43.425224 > HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
2012-07-19 13:24:43.885222 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:02:72:D6:6A:3F role 0x01
    Role: Slave
2012-07-19 13:24:44.054221 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 42 bdaddr 00:02:72:D6:6A:3F type ACL encrypt 0x00
2012-07-19 13:24:44.054313 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 42
2012-07-19 13:24:44.055176 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:02:72:D6:6A:3F mode 0
2012-07-19 13:24:44.056217 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 42 slots 5
2012-07-19 13:24:44.059218 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
2012-07-19 13:24:44.062192 > HCI Event: Command Status (0x0f) plen 4
    Unknown (0x00|0x0000) status 0x00 ncmd 1
2012-07-19 13:24:44.067219 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 42
    Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
2012-07-19 13:24:44.067248 < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 42 page 1
2012-07-19 13:24:44.071217 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
2012-07-19 13:24:44.076218 > HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 42 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
2012-07-19 13:24:44.076249 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:02:72:D6:6A:3F mode 2 clkoffset 0x0000
2012-07-19 13:24:44.081218 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2012-07-19 13:24:44.105214 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:02:72:D6:6A:3F name 'uw000951-0'
2012-07-19 13:24:44.105284 < HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 42
2012-07-19 13:24:44.111207 > HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
2012-07-19 13:24:44.112220 > HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:02:72:D6:6A:3F
2012-07-19 13:24:44.112249 < HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
    bdaddr 00:02:72:D6:6A:3F
2012-07-19 13:24:44.115215 > HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Negative Reply (0x01|0x000c) ncmd 1
    status 0x00 bdaddr 00:02:72:D6:6A:3F
2012-07-19 13:24:44.116215 > HCI Event: PIN Code Request (0x16) plen 6
    bdaddr 00:02:72:D6:6A:3F
2012-07-19 13:24:48.099184 > HCI Event: Auth Complete (0x06) plen 3
    status 0x13 handle 42
    Error: Remote User Terminated Connection
2012-07-19 13:24:48.179182 > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 42 reason 0x13
    Reason: Remote User Terminated Connection

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/bluetooth/hci_event.c  |    7 ++++++-
 net/bluetooth/l2cap_core.c |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1783,7 +1783,12 @@ static inline void hci_conn_complete_evt
 		if (conn->type == ACL_LINK) {
 			conn->state = BT_CONFIG;
 			hci_conn_hold(conn);
-			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+
+			if (!conn->out && !hci_conn_ssp_enabled(conn) &&
+			    !hci_find_link_key(hdev, &ev->bdaddr))
+				conn->disc_timeout = HCI_PAIRING_TIMEOUT;
+			else
+				conn->disc_timeout = HCI_DISCONN_TIMEOUT;
 		} else
 			conn->state = BT_CONNECTED;
 
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1163,6 +1163,7 @@ static void l2cap_le_conn_ready(struct l
 	sk = chan->sk;
 
 	hci_conn_hold(conn->hcon);
+	conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
 
 	bacpy(&bt_sk(sk)->src, conn->src);
 	bacpy(&bt_sk(sk)->dst, conn->dst);



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

* [ 042/108] NFS: Alias the nfs module to nfs4
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (39 preceding siblings ...)
  2012-09-12 23:28   ` [ 041/108] Bluetooth: Fix legacy pairing with some devices Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-13  1:08     ` Josh Boyer
  2012-09-12 23:28   ` [ 043/108] audit: dont free_chunk() after fsnotify_add_mark() Greg Kroah-Hartman
                     ` (65 subsequent siblings)
  106 siblings, 1 reply; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Bryan Schumaker, Trond Myklebust, Ben Hutchings

From: Greg KH <gregkh@linuxfoundation.org>

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

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

commit 425e776d93a7a5070b77d4f458a5bab0f924652c upstream.

This allows distros to remove the line from their modprobe
configuration.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/nfs/super.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2961,4 +2961,6 @@ static struct dentry *nfs4_referral_moun
 	return res;
 }
 
+MODULE_ALIAS("nfs4");
+
 #endif /* CONFIG_NFS_V4 */



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

* [ 043/108] audit: dont free_chunk() after fsnotify_add_mark()
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (40 preceding siblings ...)
  2012-09-12 23:28   ` [ 042/108] NFS: Alias the nfs module to nfs4 Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 044/108] audit: fix refcounting in audit-tree Greg Kroah-Hartman
                     ` (64 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Miklos Szeredi, Eric Paris

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit 0fe33aae0e94b4097dd433c9399e16e17d638cd8 upstream.

Don't do free_chunk() after fsnotify_add_mark().  That one does a delayed unref
via the destroy list and this results in use-after-free.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/audit_tree.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -259,7 +259,7 @@ static void untag_chunk(struct node *p)
 
 	fsnotify_duplicate_mark(&new->mark, entry);
 	if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, NULL, 1)) {
-		free_chunk(new);
+		fsnotify_put_mark(&new->mark);
 		goto Fallback;
 	}
 
@@ -322,7 +322,7 @@ static int create_chunk(struct inode *in
 
 	entry = &chunk->mark;
 	if (fsnotify_add_mark(entry, audit_tree_group, inode, NULL, 0)) {
-		free_chunk(chunk);
+		fsnotify_put_mark(entry);
 		return -ENOSPC;
 	}
 
@@ -396,7 +396,7 @@ static int tag_chunk(struct inode *inode
 	fsnotify_duplicate_mark(chunk_entry, old_entry);
 	if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->i.inode, NULL, 1)) {
 		spin_unlock(&old_entry->lock);
-		free_chunk(chunk);
+		fsnotify_put_mark(chunk_entry);
 		fsnotify_put_mark(old_entry);
 		return -ENOSPC;
 	}



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

* [ 044/108] audit: fix refcounting in audit-tree
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (41 preceding siblings ...)
  2012-09-12 23:28   ` [ 043/108] audit: dont free_chunk() after fsnotify_add_mark() Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 045/108] drm: stop vmgfx driver explosion Greg Kroah-Hartman
                     ` (63 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Miklos Szeredi, Valentin Avram, Peter Moody, Eric Paris

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit a2140fc0cb0325bb6384e788edd27b9a568714e2 upstream.

Refcounting of fsnotify_mark in audit tree is broken.  E.g:

                              refcount
create_chunk
  alloc_chunk                 1
  fsnotify_add_mark           2

untag_chunk
  fsnotify_get_mark           3
  fsnotify_destroy_mark
    audit_tree_freeing_mark   2
  fsnotify_put_mark           1
  fsnotify_put_mark           0
  via destroy_list
    fsnotify_mark_destroy    -1

This was reported by various people as triggering Oops when stopping auditd.

We could just remove the put_mark from audit_tree_freeing_mark() but that would
break freeing via inode destruction.  So this patch simply omits a put_mark
after calling destroy_mark or adds a get_mark before.

The additional get_mark is necessary where there's no other put_mark after
fsnotify_destroy_mark() since it assumes that the caller is holding a reference
(or the inode is keeping the mark pinned, not the case here AFAICS).

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reported-by: Valentin Avram <aval13@gmail.com>
Reported-by: Peter Moody <pmoody@google.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/audit_tree.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -250,7 +250,6 @@ static void untag_chunk(struct node *p)
 		spin_unlock(&hash_lock);
 		spin_unlock(&entry->lock);
 		fsnotify_destroy_mark(entry);
-		fsnotify_put_mark(entry);
 		goto out;
 	}
 
@@ -293,7 +292,6 @@ static void untag_chunk(struct node *p)
 	spin_unlock(&hash_lock);
 	spin_unlock(&entry->lock);
 	fsnotify_destroy_mark(entry);
-	fsnotify_put_mark(entry);
 	goto out;
 
 Fallback:
@@ -332,6 +330,7 @@ static int create_chunk(struct inode *in
 		spin_unlock(&hash_lock);
 		chunk->dead = 1;
 		spin_unlock(&entry->lock);
+		fsnotify_get_mark(entry);
 		fsnotify_destroy_mark(entry);
 		fsnotify_put_mark(entry);
 		return 0;
@@ -412,6 +411,7 @@ static int tag_chunk(struct inode *inode
 		spin_unlock(&chunk_entry->lock);
 		spin_unlock(&old_entry->lock);
 
+		fsnotify_get_mark(chunk_entry);
 		fsnotify_destroy_mark(chunk_entry);
 
 		fsnotify_put_mark(chunk_entry);
@@ -445,7 +445,6 @@ static int tag_chunk(struct inode *inode
 	spin_unlock(&old_entry->lock);
 	fsnotify_destroy_mark(old_entry);
 	fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */
-	fsnotify_put_mark(old_entry); /* and kill it */
 	return 0;
 }
 



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

* [ 045/108] drm: stop vmgfx driver explosion
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (42 preceding siblings ...)
  2012-09-12 23:28   ` [ 044/108] audit: fix refcounting in audit-tree Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 046/108] Revert "drm/radeon: fix bo creation retry path" Greg Kroah-Hartman
                     ` (62 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Alan Cox, Jakob Bornecrantz, Dave Airlie

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Alan Cox <alan@linux.intel.com>

commit f5869a8308f77e3dfdc2e3640842b285aa788ff8 upstream.

If you do a page flip with no flags set then event is NULL. If event is
NULL then the vmw_gfx driver likes to go digging into NULL and extracts
NULL->base.file_priv.

On a modern kernel with NULL mapping protection it's just another oops,
without it there are some "intriguing" possibilities.

What it should do is an open question but that for the driver owners to
sort out.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1688,15 +1688,19 @@ int vmw_du_page_flip(struct drm_crtc *cr
 	struct vmw_private *dev_priv = vmw_priv(crtc->dev);
 	struct drm_framebuffer *old_fb = crtc->fb;
 	struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(fb);
-	struct drm_file *file_priv = event->base.file_priv;
+	struct drm_file *file_priv ;
 	struct vmw_fence_obj *fence = NULL;
 	struct drm_clip_rect clips;
 	int ret;
 
+	if (event == NULL)
+		return -EINVAL;
+
 	/* require ScreenObject support for page flipping */
 	if (!dev_priv->sou_priv)
 		return -ENOSYS;
 
+	file_priv = event->base.file_priv;
 	if (!vmw_kms_screen_object_flippable(dev_priv, crtc))
 		return -EINVAL;
 



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

* [ 046/108] Revert "drm/radeon: fix bo creation retry path"
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (43 preceding siblings ...)
  2012-09-12 23:28   ` [ 045/108] drm: stop vmgfx driver explosion Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 047/108] Btrfs: revert checksum error statistic which can cause a BUG() Greg Kroah-Hartman
                     ` (61 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Alex Deucher

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 676bc2e1e4f9072f7a640d5b7c99ffdf9709a6e7 upstream.

This reverts commit d1c7871ddb1f588b8eb35affd9ee1a3d5e11cd0c.

ttm_bo_init() destroys the BO on failure. So this patch makes
the retry path work with freed memory.  This ends up causing
kernel panics when this path is hit.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/radeon/radeon_object.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -138,6 +138,7 @@ int radeon_bo_create(struct radeon_devic
 	acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size,
 				       sizeof(struct radeon_bo));
 
+retry:
 	bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
 	if (bo == NULL)
 		return -ENOMEM;
@@ -151,8 +152,6 @@ int radeon_bo_create(struct radeon_devic
 	bo->surface_reg = -1;
 	INIT_LIST_HEAD(&bo->list);
 	INIT_LIST_HEAD(&bo->va);
-
-retry:
 	radeon_ttm_placement_from_domain(bo, domain);
 	/* Kernel allocation are uninterruptible */
 	mutex_lock(&rdev->vram_mutex);



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

* [ 047/108] Btrfs: revert checksum error statistic which can cause a BUG()
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (44 preceding siblings ...)
  2012-09-12 23:28   ` [ 046/108] Revert "drm/radeon: fix bo creation retry path" Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 048/108] svcrpc: fix BUG() in svc_tcp_clear_pages Greg Kroah-Hartman
                     ` (60 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Stefan Behrens, Chris Mason

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Stefan Behrens <sbehrens@giantdisaster.de>

commit 5ee0844d6427e7338e0aba748f62b62d07ea2ed0 upstream.

Commit 442a4f6308e694e0fa6025708bd5e4e424bbf51c added btrfs device
statistic counters for detected IO and checksum errors to Linux 3.5.
The statistic part that counts checksum errors in
end_bio_extent_readpage() can cause a BUG() in a subfunction:
"kernel BUG at fs/btrfs/volumes.c:3762!"
That part is reverted with the current patch.
However, the counting of checksum errors in the scrub context remains
active, and the counting of detected IO errors (read, write or flush
errors) in all contexts remains active.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/btrfs/extent_io.c |   17 ++---------------
 fs/btrfs/volumes.c   |   22 ----------------------
 fs/btrfs/volumes.h   |    2 --
 3 files changed, 2 insertions(+), 39 deletions(-)

--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2329,23 +2329,10 @@ static void end_bio_extent_readpage(stru
 		if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) {
 			ret = tree->ops->readpage_end_io_hook(page, start, end,
 							      state, mirror);
-			if (ret) {
-				/* no IO indicated but software detected errors
-				 * in the block, either checksum errors or
-				 * issues with the contents */
-				struct btrfs_root *root =
-					BTRFS_I(page->mapping->host)->root;
-				struct btrfs_device *device;
-
+			if (ret)
 				uptodate = 0;
-				device = btrfs_find_device_for_logical(
-						root, start, mirror);
-				if (device)
-					btrfs_dev_stat_inc_and_print(device,
-						BTRFS_DEV_STAT_CORRUPTION_ERRS);
-			} else {
+			else
 				clean_io_failure(start, page);
-			}
 		}
 
 		if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) {
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4602,28 +4602,6 @@ int btrfs_read_sys_array(struct btrfs_ro
 	return ret;
 }
 
-struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
-						   u64 logical, int mirror_num)
-{
-	struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree;
-	int ret;
-	u64 map_length = 0;
-	struct btrfs_bio *bbio = NULL;
-	struct btrfs_device *device;
-
-	BUG_ON(mirror_num == 0);
-	ret = btrfs_map_block(map_tree, WRITE, logical, &map_length, &bbio,
-			      mirror_num);
-	if (ret) {
-		BUG_ON(bbio != NULL);
-		return NULL;
-	}
-	BUG_ON(mirror_num != bbio->mirror_num);
-	device = bbio->stripes[mirror_num - 1].dev;
-	kfree(bbio);
-	return device;
-}
-
 int btrfs_read_chunk_tree(struct btrfs_root *root)
 {
 	struct btrfs_path *path;
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -288,8 +288,6 @@ int btrfs_cancel_balance(struct btrfs_fs
 int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
 int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
 			 u64 *start, u64 *max_avail);
-struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
-						   u64 logical, int mirror_num);
 void btrfs_dev_stat_print_on_error(struct btrfs_device *device);
 void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index);
 int btrfs_get_dev_stats(struct btrfs_root *root,



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

* [ 048/108] svcrpc: fix BUG() in svc_tcp_clear_pages
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (45 preceding siblings ...)
  2012-09-12 23:28   ` [ 047/108] Btrfs: revert checksum error statistic which can cause a BUG() Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 049/108] svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping Greg Kroah-Hartman
                     ` (59 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, J. Bruce Fields

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit be1e44441a560c43c136a562d49a1c9623c91197 upstream.

Examination of svc_tcp_clear_pages shows that it assumes sk_tcplen is
consistent with sk_pages[] (in particular, sk_pages[n] can't be NULL if
sk_tcplen would lead us to expect n pages of data).

svc_tcp_restore_pages zeroes out sk_pages[] while leaving sk_tcplen.
This is OK, since both functions are serialized by XPT_BUSY.  However,
that means the inconsistency must be repaired before dropping XPT_BUSY.

Therefore we should be ensuring that svc_tcp_save_pages repairs the
problem before exiting svc_tcp_recv_record on error.

Symptoms were a BUG() in svc_tcp_clear_pages.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/svcsock.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1129,9 +1129,9 @@ static int svc_tcp_recvfrom(struct svc_r
 	if (len >= 0)
 		svsk->sk_tcplen += len;
 	if (len != want) {
+		svc_tcp_save_pages(svsk, rqstp);
 		if (len < 0 && len != -EAGAIN)
 			goto err_other;
-		svc_tcp_save_pages(svsk, rqstp);
 		dprintk("svc: incomplete TCP record (%d of %d)\n",
 			svsk->sk_tcplen, svsk->sk_reclen);
 		goto err_noclose;



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

* [ 049/108] svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (46 preceding siblings ...)
  2012-09-12 23:28   ` [ 048/108] svcrpc: fix BUG() in svc_tcp_clear_pages Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 050/108] svcrpc: sends on closed socket should stop immediately Greg Kroah-Hartman
                     ` (58 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Michael Tokarev, J. Bruce Fields

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit d10f27a750312ed5638c876e4bd6aa83664cccd8 upstream.

The rpc server tries to ensure that there will be room to send a reply
before it receives a request.

It does this by tracking, in xpt_reserved, an upper bound on the total
size of the replies that is has already committed to for the socket.

Currently it is adding in the estimate for a new reply *before* it
checks whether there is space available.  If it finds that there is not
space, it then subtracts the estimate back out.

This may lead the subsequent svc_xprt_enqueue to decide that there is
space after all.

The results is a svc_recv() that will repeatedly return -EAGAIN, causing
server threads to loop without doing any actual work.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/svc_xprt.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -316,7 +316,6 @@ static bool svc_xprt_has_something_to_do
  */
 void svc_xprt_enqueue(struct svc_xprt *xprt)
 {
-	struct svc_serv	*serv = xprt->xpt_server;
 	struct svc_pool *pool;
 	struct svc_rqst	*rqstp;
 	int cpu;
@@ -362,8 +361,6 @@ void svc_xprt_enqueue(struct svc_xprt *x
 				rqstp, rqstp->rq_xprt);
 		rqstp->rq_xprt = xprt;
 		svc_xprt_get(xprt);
-		rqstp->rq_reserved = serv->sv_max_mesg;
-		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 		pool->sp_stats.threads_woken++;
 		wake_up(&rqstp->rq_wait);
 	} else {
@@ -640,8 +637,6 @@ int svc_recv(struct svc_rqst *rqstp, lon
 	if (xprt) {
 		rqstp->rq_xprt = xprt;
 		svc_xprt_get(xprt);
-		rqstp->rq_reserved = serv->sv_max_mesg;
-		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 
 		/* As there is a shortage of threads and this request
 		 * had to be queued, don't allow the thread to wait so
@@ -738,6 +733,8 @@ int svc_recv(struct svc_rqst *rqstp, lon
 		else
 			len = xprt->xpt_ops->xpo_recvfrom(rqstp);
 		dprintk("svc: got len=%d\n", len);
+		rqstp->rq_reserved = serv->sv_max_mesg;
+		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 	}
 	svc_xprt_received(xprt);
 



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

* [ 050/108] svcrpc: sends on closed socket should stop immediately
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (47 preceding siblings ...)
  2012-09-12 23:28   ` [ 049/108] svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 051/108] cciss: fix incorrect scsi status reporting Greg Kroah-Hartman
                     ` (57 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Malahal Naineni, J. Bruce Fields

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit f06f00a24d76e168ecb38d352126fd203937b601 upstream.

svc_tcp_sendto sets XPT_CLOSE if we fail to transmit the entire reply.
However, the XPT_CLOSE won't be acted on immediately.  Meanwhile other
threads could send further replies before the socket is really shut
down.  This can manifest as data corruption: for example, if a truncated
read reply is followed by another rpc reply, that second reply will look
to the client like further read data.

Symptoms were data corruption preceded by svc_tcp_sendto logging
something like

	kernel: rpc-srv/tcp: nfsd: sent only 963696 when sending 1048708 bytes - shutting down socket

Reported-by: Malahal Naineni <malahal@us.ibm.com>
Tested-by: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/svc_xprt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -791,7 +791,8 @@ int svc_send(struct svc_rqst *rqstp)
 
 	/* Grab mutex to serialize outgoing data. */
 	mutex_lock(&xprt->xpt_mutex);
-	if (test_bit(XPT_DEAD, &xprt->xpt_flags))
+	if (test_bit(XPT_DEAD, &xprt->xpt_flags)
+			|| test_bit(XPT_CLOSE, &xprt->xpt_flags))
 		len = -ENOTCONN;
 	else
 		len = xprt->xpt_ops->xpo_sendto(rqstp);



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

* [ 051/108] cciss: fix incorrect scsi status reporting
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (48 preceding siblings ...)
  2012-09-12 23:28   ` [ 050/108] svcrpc: sends on closed socket should stop immediately Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 052/108] ACPI: export symbol acpi_get_table_with_size Greg Kroah-Hartman
                     ` (56 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Stephen M. Cameron, Roel van Meer, Jens Axboe,
	Andrew Morton, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit b0cf0b118c90477d1a6811f2cd2307f6a5578362 upstream.

Delete code which sets SCSI status incorrectly as it's already been set
correctly above this incorrect code.  The bug was introduced in 2009 by
commit b0e15f6db111 ("cciss: fix typo that causes scsi status to be
lost.")

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Roel van Meer <roel.vanmeer@bokxing.nl>
Tested-by: Roel van Meer <roel.vanmeer@bokxing.nl>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/cciss_scsi.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -763,16 +763,7 @@ static void complete_scsi_command(Comman
 		{
 			case CMD_TARGET_STATUS:
 				/* Pass it up to the upper layers... */
-				if( ei->ScsiStatus)
-                		{
-#if 0
-                    			printk(KERN_WARNING "cciss: cmd %p "
-						"has SCSI Status = %x\n",
-						c, ei->ScsiStatus);
-#endif
-					cmd->result |= (ei->ScsiStatus << 1);
-                		}
-				else {  /* scsi status is zero??? How??? */
+				if (!ei->ScsiStatus) {
 					
 	/* Ordinarily, this case should never happen, but there is a bug
 	   in some released firmware revisions that allows it to happen



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

* [ 052/108] ACPI: export symbol acpi_get_table_with_size
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (49 preceding siblings ...)
  2012-09-12 23:28   ` [ 051/108] cciss: fix incorrect scsi status reporting Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 053/108] ath9k: stop btcoex on device suspend Greg Kroah-Hartman
                     ` (55 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Alex Deucher

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 4f81f986761a7663db7d24d24cd6ae68008f1fc2 upstream.

We need it in the radeon drm module to fetch
and verify the vbios image on UEFI systems.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/acpica/tbxface.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -436,6 +436,7 @@ acpi_get_table_with_size(char *signature
 
 	return (AE_NOT_FOUND);
 }
+ACPI_EXPORT_SYMBOL(acpi_get_table_with_size)
 
 acpi_status
 acpi_get_table(char *signature,



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

* [ 053/108] ath9k: stop btcoex on device suspend
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (50 preceding siblings ...)
  2012-09-12 23:28   ` [ 052/108] ACPI: export symbol acpi_get_table_with_size Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 054/108] ath9k: fix decrypt_error initialization in ath_rx_tasklet() Greg Kroah-Hartman
                     ` (54 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Rajkumar Manoharan, John W. Linville

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

commit e19f15ac6437624b6214b2f0ec0d69fb7eb205fa upstream.

During suspend, the device will be moved to FULLSLEEP state.
As btcoex is never been stopped, the btcoex timer is running
and tries to access hw on fullsleep state. Fix that.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/pci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -313,6 +313,7 @@ static int ath_pci_suspend(struct device
 	 * Otherwise the chip never moved to full sleep,
 	 * when no interface is up.
 	 */
+	ath9k_stop_btcoex(sc);
 	ath9k_hw_disable(sc->sc_ah);
 	ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
 



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

* [ 054/108] ath9k: fix decrypt_error initialization in ath_rx_tasklet()
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (51 preceding siblings ...)
  2012-09-12 23:28   ` [ 053/108] ath9k: stop btcoex on device suspend Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 055/108] PCI: EHCI: Fix crash during hibernation on ASUS computers Greg Kroah-Hartman
                     ` (53 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Lorenzo Bianconi, John W. Linville

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

commit e1352fde5682ab1bdd2a9e5d75c22d1fe210ef77 upstream.

ath_rx_tasklet() calls ath9k_rx_skb_preprocess() and ath9k_rx_skb_postprocess()
in a loop over the received frames. The decrypt_error flag is
initialized to false
just outside ath_rx_tasklet() loop. ath9k_rx_accept(), called by
ath9k_rx_skb_preprocess(),
only sets decrypt_error to true and never to false.
Then ath_rx_tasklet() calls ath9k_rx_skb_postprocess() and passes
decrypt_error to it.
So, after a decryption error, in ath9k_rx_skb_postprocess(), we can
have a leftover value
from another processed frame. In that case, the frame will not be marked with
RX_FLAG_DECRYPTED even if it is decrypted correctly.
When using CCMP encryption this issue can lead to connection stuck
because of CCMP
PN corruption and a waste of CPU time since mac80211 tries to decrypt an already
deciphered frame with ieee80211_aes_ccm_decrypt.
Fix the issue initializing decrypt_error flag at the begging of the
ath_rx_tasklet() loop.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath9k/recv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1781,7 +1781,6 @@ int ath_rx_tasklet(struct ath_softc *sc,
 	struct ieee80211_hw *hw = sc->hw;
 	struct ieee80211_hdr *hdr;
 	int retval;
-	bool decrypt_error = false;
 	struct ath_rx_status rs;
 	enum ath9k_rx_qtype qtype;
 	bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
@@ -1803,6 +1802,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
 	tsf_lower = tsf & 0xffffffff;
 
 	do {
+		bool decrypt_error = false;
 		/* If handling rx interrupt and flush is in progress => exit */
 		if ((sc->sc_flags & SC_OP_RXFLUSH) && (flush == 0))
 			break;



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

* [ 055/108] PCI: EHCI: Fix crash during hibernation on ASUS computers
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (52 preceding siblings ...)
  2012-09-12 23:28   ` [ 054/108] ath9k: fix decrypt_error initialization in ath_rx_tasklet() Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 056/108] gma500: Consider CRTC initially active Greg Kroah-Hartman
                     ` (52 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Rafael J. Wysocki, Bjorn Helgaas

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "Rafael J. Wysocki" <rjw@sisk.pl>

commit 0b68c8e2c3afaf9807eb1ebe0ccfb3b809570aa4 upstream.

Commit dbf0e4c (PCI: EHCI: fix crash during suspend on ASUS
computers) added a workaround for an ASUS suspend issue related to
USB EHCI and a bug in a number of ASUS BIOSes that attempt to shut
down the EHCI controller during system suspend if its PCI command
register doesn't contain 0 at that time.

It turns out that the same workaround is necessary in the analogous
hibernation code path, so add it.

References: https://bugzilla.kernel.org/show_bug.cgi?id=45811
Reported-and-tested-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pci/pci-driver.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -958,6 +958,13 @@ static int pci_pm_poweroff_noirq(struct
 	if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
 		pci_prepare_to_sleep(pci_dev);
 
+	/*
+	 * The reason for doing this here is the same as for the analogous code
+	 * in pci_pm_suspend_noirq().
+	 */
+	if (pci_dev->class == PCI_CLASS_SERIAL_USB_EHCI)
+		pci_write_config_word(pci_dev, PCI_COMMAND, 0);
+
 	return 0;
 }
 



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

* [ 056/108] gma500: Consider CRTC initially active.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (53 preceding siblings ...)
  2012-09-12 23:28   ` [ 055/108] PCI: EHCI: Fix crash during hibernation on ASUS computers Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 057/108] block: replace __getblk_slow misfix by grow_dev_page fix Greg Kroah-Hartman
                     ` (51 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Forest Bond, Alan Cox, Dave Airlie

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Forest Bond <forest.bond@rapidrollout.com>

commit 4a68a74ba04e7ccf798d45988f4f2d2131fb5063 upstream.

[this one ideally should make 3.6 - it fixes the very annoying mode setting bug]

This causes the pipe to be forced off prior to initial mode set, which
roughly mirrors the behavior of the i915 driver.  It fixes initial mode
setting on my Intel DN2800MT (Cedarview) board.  Without it, mode
setting triggers an out-of-range error from the monitor for most modes,
but only on initial configuration (i.e. they can be configured
successfully from userspace after that).

Signed-off-by: Forest Bond <forest.bond@rapidrollout.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/gma500/psb_intel_display.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/gpu/drm/gma500/psb_intel_display.c
+++ b/drivers/gpu/drm/gma500/psb_intel_display.c
@@ -1362,6 +1362,9 @@ void psb_intel_crtc_init(struct drm_devi
 	    (struct drm_connector **) (psb_intel_crtc + 1);
 	psb_intel_crtc->mode_set.num_connectors = 0;
 	psb_intel_cursor_init(dev, psb_intel_crtc);
+
+	/* Set to true so that the pipe is forced off on initial config. */
+	psb_intel_crtc->active = true;
 }
 
 int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,



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

* [ 057/108] block: replace __getblk_slow misfix by grow_dev_page fix
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (54 preceding siblings ...)
  2012-09-12 23:28   ` [ 056/108] gma500: Consider CRTC initially active Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 058/108] jbd: dont write superblock when unmounting an ro filesystem Greg Kroah-Hartman
                     ` (50 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Hugh Dickins, Jens Axboe

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Hugh Dickins <hughd@google.com>

commit 676ce6d5ca3098339c028d44fe0427d1566a4d2d upstream.

Commit 91f68c89d8f3 ("block: fix infinite loop in __getblk_slow")
is not good: a successful call to grow_buffers() cannot guarantee
that the page won't be reclaimed before the immediate next call to
__find_get_block(), which is why there was always a loop there.

Yesterday I got "EXT4-fs error (device loop0): __ext4_get_inode_loc:3595:
inode #19278: block 664: comm cc1: unable to read itable block" on console,
which pointed to this commit.

I've been trying to bisect for weeks, why kbuild-on-ext4-on-loop-on-tmpfs
sometimes fails from a missing header file, under memory pressure on
ppc G5.  I've never seen this on x86, and I've never seen it on 3.5-rc7
itself, despite that commit being in there: bisection pointed to an
irrelevant pinctrl merge, but hard to tell when failure takes between
18 minutes and 38 hours (but so far it's happened quicker on 3.6-rc2).

(I've since found such __ext4_get_inode_loc errors in /var/log/messages
from previous weeks: why the message never appeared on console until
yesterday morning is a mystery for another day.)

Revert 91f68c89d8f3, restoring __getblk_slow() to how it was (plus
a checkpatch nitfix).  Simplify the interface between grow_buffers()
and grow_dev_page(), and avoid the infinite loop beyond end of device
by instead checking init_page_buffers()'s end_block there (I presume
that's more efficient than a repeated call to blkdev_max_block()),
returning -ENXIO to __getblk_slow() in that case.

And remove akpm's ten-year-old "__getblk() cannot fail ... weird"
comment, but that is worrying: are all users of __getblk() really
now prepared for a NULL bh beyond end of device, or will some oops??

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/buffer.c |   66 +++++++++++++++++++++++++++---------------------------------
 1 file changed, 30 insertions(+), 36 deletions(-)

--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -914,7 +914,7 @@ link_dev_buffers(struct page *page, stru
 /*
  * Initialise the state of a blockdev page's buffers.
  */ 
-static void
+static sector_t
 init_page_buffers(struct page *page, struct block_device *bdev,
 			sector_t block, int size)
 {
@@ -936,33 +936,41 @@ init_page_buffers(struct page *page, str
 		block++;
 		bh = bh->b_this_page;
 	} while (bh != head);
+
+	/*
+	 * Caller needs to validate requested block against end of device.
+	 */
+	return end_block;
 }
 
 /*
  * Create the page-cache page that contains the requested block.
  *
- * This is user purely for blockdev mappings.
+ * This is used purely for blockdev mappings.
  */
-static struct page *
+static int
 grow_dev_page(struct block_device *bdev, sector_t block,
-		pgoff_t index, int size)
+		pgoff_t index, int size, int sizebits)
 {
 	struct inode *inode = bdev->bd_inode;
 	struct page *page;
 	struct buffer_head *bh;
+	sector_t end_block;
+	int ret = 0;		/* Will call free_more_memory() */
 
 	page = find_or_create_page(inode->i_mapping, index,
 		(mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
 	if (!page)
-		return NULL;
+		return ret;
 
 	BUG_ON(!PageLocked(page));
 
 	if (page_has_buffers(page)) {
 		bh = page_buffers(page);
 		if (bh->b_size == size) {
-			init_page_buffers(page, bdev, block, size);
-			return page;
+			end_block = init_page_buffers(page, bdev,
+						index << sizebits, size);
+			goto done;
 		}
 		if (!try_to_free_buffers(page))
 			goto failed;
@@ -982,14 +990,14 @@ grow_dev_page(struct block_device *bdev,
 	 */
 	spin_lock(&inode->i_mapping->private_lock);
 	link_dev_buffers(page, bh);
-	init_page_buffers(page, bdev, block, size);
+	end_block = init_page_buffers(page, bdev, index << sizebits, size);
 	spin_unlock(&inode->i_mapping->private_lock);
-	return page;
-
+done:
+	ret = (block < end_block) ? 1 : -ENXIO;
 failed:
 	unlock_page(page);
 	page_cache_release(page);
-	return NULL;
+	return ret;
 }
 
 /*
@@ -999,7 +1007,6 @@ failed:
 static int
 grow_buffers(struct block_device *bdev, sector_t block, int size)
 {
-	struct page *page;
 	pgoff_t index;
 	int sizebits;
 
@@ -1023,22 +1030,14 @@ grow_buffers(struct block_device *bdev,
 			bdevname(bdev, b));
 		return -EIO;
 	}
-	block = index << sizebits;
+
 	/* Create a page with the proper size buffers.. */
-	page = grow_dev_page(bdev, block, index, size);
-	if (!page)
-		return 0;
-	unlock_page(page);
-	page_cache_release(page);
-	return 1;
+	return grow_dev_page(bdev, block, index, size, sizebits);
 }
 
 static struct buffer_head *
 __getblk_slow(struct block_device *bdev, sector_t block, int size)
 {
-	int ret;
-	struct buffer_head *bh;
-
 	/* Size must be multiple of hard sectorsize */
 	if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
 			(size < 512 || size > PAGE_SIZE))) {
@@ -1051,21 +1050,20 @@ __getblk_slow(struct block_device *bdev,
 		return NULL;
 	}
 
-retry:
-	bh = __find_get_block(bdev, block, size);
-	if (bh)
-		return bh;
+	for (;;) {
+		struct buffer_head *bh;
+		int ret;
 
-	ret = grow_buffers(bdev, block, size);
-	if (ret == 0) {
-		free_more_memory();
-		goto retry;
-	} else if (ret > 0) {
 		bh = __find_get_block(bdev, block, size);
 		if (bh)
 			return bh;
+
+		ret = grow_buffers(bdev, block, size);
+		if (ret < 0)
+			return NULL;
+		if (ret == 0)
+			free_more_memory();
 	}
-	return NULL;
 }
 
 /*
@@ -1321,10 +1319,6 @@ EXPORT_SYMBOL(__find_get_block);
  * which corresponds to the passed block_device, block and size. The
  * returned buffer has its reference count incremented.
  *
- * __getblk() cannot fail - it just keeps trying.  If you pass it an
- * illegal block number, __getblk() will happily return a buffer_head
- * which represents the non-existent block.  Very weird.
- *
  * __getblk() will lock up the machine if grow_dev_page's try_to_free_buffers()
  * attempt is failing.  FIXME, perhaps?
  */



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

* [ 058/108] jbd: dont write superblock when unmounting an ro filesystem
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (55 preceding siblings ...)
  2012-09-12 23:28   ` [ 057/108] block: replace __getblk_slow misfix by grow_dev_page fix Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 059/108] ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream Greg Kroah-Hartman
                     ` (49 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Jan Kara

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jan Kara <jack@suse.cz>

commit 2e84f2641ea91a730642ead558a4ee3bd52310c9 upstream.

This sequence:

results in an IO error when unmounting the RO filesystem. The bug was
introduced by:

commit 9754e39c7bc51328f145e933bfb0df47cd67b6e9
Author: Jan Kara <jack@suse.cz>
Date:   Sat Apr 7 12:33:03 2012 +0200

    jbd: Split updating of journal superblock and marking journal empty

which lost some of the magic in journal_update_superblock() which
used to test for a journal with no outstanding transactions.

This is a port of a jbd2 fix by Eric Sandeen.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/jbd/journal.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t
 
 	BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
 	spin_lock(&journal->j_state_lock);
+	/* Is it already empty? */
+	if (sb->s_start == 0) {
+		spin_unlock(&journal->j_state_lock);
+		return;
+	}
 	jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n",
         	  journal->j_tail_sequence);
 



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

* [ 059/108] ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (56 preceding siblings ...)
  2012-09-12 23:28   ` [ 058/108] jbd: dont write superblock when unmounting an ro filesystem Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 060/108] sched,cgroup: Fix up task_groups list Greg Kroah-Hartman
                     ` (48 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Takashi Iwai <tiwai@suse.de>

commit e9ba389c5ffc4dd29dfe17e00e48877302111135 upstream.

A PCM capture stream on usb-audio causes a scheduling-while-atomic
BUG, as reported in the bugzilla entry below.  It's because
snd_usb_endpoint_start() is called at first at trigger START for a
capture stream, and this function contains the left-over EP
deactivation codes.  The problem doesn't happen for a playback stream
because the function is called at PCM prepare time, which can sleep.

This patch fixes the BUG by moving the EP deactivation code into the
PCM prepare callback.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46011
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/endpoint.c |    4 ----
 sound/usb/pcm.c      |    3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -821,10 +821,6 @@ int snd_usb_endpoint_start(struct snd_us
 	if (++ep->use_count != 1)
 		return 0;
 
-	/* just to be sure */
-	deactivate_urbs(ep, 0, 1);
-	wait_clear_urbs(ep);
-
 	ep->active_mask = 0;
 	ep->unlink_mask = 0;
 	ep->phase = 0;
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -544,6 +544,9 @@ static int snd_usb_pcm_prepare(struct sn
 	subs->last_frame_number = 0;
 	runtime->delay = 0;
 
+	/* clear the pending deactivation on the target EPs */
+	deactivate_endpoints(subs);
+
 	/* for playback, submit the URBs now; otherwise, the first hwptr_done
 	 * updates for all URBs would happen at the same time when starting */
 	if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK)



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

* [ 060/108] sched,cgroup: Fix up task_groups list
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (57 preceding siblings ...)
  2012-09-12 23:28   ` [ 059/108] ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:28   ` [ 061/108] sched: fix divide by zero at {thread_group,task}_times Greg Kroah-Hartman
                     ` (47 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Mike Galbraith, Peter Zijlstra, Thomas Gleixner

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mike Galbraith <efault@gmx.de>

commit 35cf4e50b16331def6cfcbee11e49270b6db07f5 upstream.

With multiple instances of task_groups, for_each_rt_rq() is a noop,
no task groups having been added to the rt.c list instance.  This
renders __enable/disable_runtime() and print_rt_stats() noop, the
user (non) visible effect being that rt task groups are missing in
/proc/sched_debug.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1344308413.6846.7.camel@marge.simpson.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/sched/core.c  |    1 +
 kernel/sched/sched.h |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7179,6 +7179,7 @@ int in_sched_functions(unsigned long add
 
 #ifdef CONFIG_CGROUP_SCHED
 struct task_group root_task_group;
+LIST_HEAD(task_groups);
 #endif
 
 DECLARE_PER_CPU(cpumask_var_t, load_balance_tmpmask);
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -80,7 +80,7 @@ extern struct mutex sched_domains_mutex;
 struct cfs_rq;
 struct rt_rq;
 
-static LIST_HEAD(task_groups);
+extern struct list_head task_groups;
 
 struct cfs_bandwidth {
 #ifdef CONFIG_CFS_BANDWIDTH



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

* [ 061/108] sched: fix divide by zero at {thread_group,task}_times
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (58 preceding siblings ...)
  2012-09-12 23:28   ` [ 060/108] sched,cgroup: Fix up task_groups list Greg Kroah-Hartman
@ 2012-09-12 23:28   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 062/108] [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer Greg Kroah-Hartman
                     ` (46 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Stanislaw Gruszka, Peter Zijlstra, Thomas Gleixner

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit bea6832cc8c4a0a9a65dd17da6aaa657fe27bc3e upstream.

On architectures where cputime_t is 64 bit type, is possible to trigger
divide by zero on do_div(temp, (__force u32) total) line, if total is a
non zero number but has lower 32 bit's zeroed. Removing casting is not
a good solution since some do_div() implementations do cast to u32
internally.

This problem can be triggered in practice on very long lived processes:

  PID: 2331   TASK: ffff880472814b00  CPU: 2   COMMAND: "oraagent.bin"
   #0 [ffff880472a51b70] machine_kexec at ffffffff8103214b
   #1 [ffff880472a51bd0] crash_kexec at ffffffff810b91c2
   #2 [ffff880472a51ca0] oops_end at ffffffff814f0b00
   #3 [ffff880472a51cd0] die at ffffffff8100f26b
   #4 [ffff880472a51d00] do_trap at ffffffff814f03f4
   #5 [ffff880472a51d60] do_divide_error at ffffffff8100cfff
   #6 [ffff880472a51e00] divide_error at ffffffff8100be7b
      [exception RIP: thread_group_times+0x56]
      RIP: ffffffff81056a16  RSP: ffff880472a51eb8  RFLAGS: 00010046
      RAX: bc3572c9fe12d194  RBX: ffff880874150800  RCX: 0000000110266fad
      RDX: 0000000000000000  RSI: ffff880472a51eb8  RDI: 001038ae7d9633dc
      RBP: ffff880472a51ef8   R8: 00000000b10a3a64   R9: ffff880874150800
      R10: 00007fcba27ab680  R11: 0000000000000202  R12: ffff880472a51f08
      R13: ffff880472a51f10  R14: 0000000000000000  R15: 0000000000000007
      ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
   #7 [ffff880472a51f00] do_sys_times at ffffffff8108845d
   #8 [ffff880472a51f40] sys_times at ffffffff81088524
   #9 [ffff880472a51f80] system_call_fastpath at ffffffff8100b0f2
      RIP: 0000003808caac3a  RSP: 00007fcba27ab6d8  RFLAGS: 00000202
      RAX: 0000000000000064  RBX: ffffffff8100b0f2  RCX: 0000000000000000
      RDX: 00007fcba27ab6e0  RSI: 000000000076d58e  RDI: 00007fcba27ab6e0
      RBP: 00007fcba27ab700   R8: 0000000000000020   R9: 000000000000091b
      R10: 00007fcba27ab680  R11: 0000000000000202  R12: 00007fff9ca41940
      R13: 0000000000000000  R14: 00007fcba27ac9c0  R15: 00007fff9ca41940
      ORIG_RAX: 0000000000000064  CS: 0033  SS: 002b

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20120808092714.GA3580@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/sched/core.c |   34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3142,6 +3142,20 @@ void thread_group_times(struct task_stru
 # define nsecs_to_cputime(__nsecs)	nsecs_to_jiffies(__nsecs)
 #endif
 
+static cputime_t scale_utime(cputime_t utime, cputime_t rtime, cputime_t total)
+{
+	u64 temp = (__force u64) rtime;
+
+	temp *= (__force u64) utime;
+
+	if (sizeof(cputime_t) == 4)
+		temp = div_u64(temp, (__force u32) total);
+	else
+		temp = div64_u64(temp, (__force u64) total);
+
+	return (__force cputime_t) temp;
+}
+
 void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
 {
 	cputime_t rtime, utime = p->utime, total = utime + p->stime;
@@ -3151,13 +3165,9 @@ void task_times(struct task_struct *p, c
 	 */
 	rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
 
-	if (total) {
-		u64 temp = (__force u64) rtime;
-
-		temp *= (__force u64) utime;
-		do_div(temp, (__force u32) total);
-		utime = (__force cputime_t) temp;
-	} else
+	if (total)
+		utime = scale_utime(utime, rtime, total);
+	else
 		utime = rtime;
 
 	/*
@@ -3184,13 +3194,9 @@ void thread_group_times(struct task_stru
 	total = cputime.utime + cputime.stime;
 	rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
 
-	if (total) {
-		u64 temp = (__force u64) rtime;
-
-		temp *= (__force u64) cputime.utime;
-		do_div(temp, (__force u32) total);
-		utime = (__force cputime_t) temp;
-	} else
+	if (total)
+		utime = scale_utime(cputime.utime, rtime, total);
+	else
 		utime = rtime;
 
 	sig->prev_utime = max(sig->prev_utime, utime);



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

* [ 062/108] [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (59 preceding siblings ...)
  2012-09-12 23:28   ` [ 061/108] sched: fix divide by zero at {thread_group,task}_times Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 063/108] rapidio/tsi721: fix inbound doorbell interrupt handling Greg Kroah-Hartman
                     ` (45 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Jayakrishnan Memana, Laurent Pinchart, Mauro Carvalho Chehab

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>

commit 8a3f0ede2b3f5477122060af1a816c6bbf09fcd2 upstream.

Buffers marked as erroneous are recycled immediately by the driver if
the nodrop module parameter isn't set. The buffer payload size is reset
to 0, but the buffer bytesused field isn't. This results in the buffer
being immediately considered as complete, leading to an infinite loop in
interrupt context.

Fix the problem by resetting the bytesused field when recycling the
buffer.

Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/video/uvc/uvc_queue.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/media/video/uvc/uvc_queue.c
+++ b/drivers/media/video/uvc/uvc_queue.c
@@ -338,6 +338,7 @@ struct uvc_buffer *uvc_queue_next_buffer
 	if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) {
 		buf->error = 0;
 		buf->state = UVC_BUF_STATE_QUEUED;
+		buf->bytesused = 0;
 		vb2_set_plane_payload(&buf->buf, 0, 0);
 		return buf;
 	}



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

* [ 063/108] rapidio/tsi721: fix inbound doorbell interrupt handling
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (60 preceding siblings ...)
  2012-09-12 23:29   ` [ 062/108] [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 064/108] rapidio/tsi721: fix unused variable compiler warning Greg Kroah-Hartman
                     ` (44 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Alexandre Bounine, Matt Porter, Andrew Morton, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Alexandre Bounine <alexandre.bounine@idt.com>

commit 3670e7e12e582c6d67761275d148171feb7a9004 upstream.

Make sure that there is no doorbell messages left behind due to disabled
interrupts during inbound doorbell processing.

The most common case for this bug is loss of rionet JOIN messages in
systems with three or more rionet participants and MSI or MSI-X enabled.
As result, requests for packet transfers may finish with "destination
unreachable" error message.

This patch is applicable to kernel versions starting from v3.2.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/rapidio/devices/tsi721.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -435,6 +435,9 @@ static void tsi721_db_dpc(struct work_st
 				" info %4.4x\n", DBELL_SID(idb.bytes),
 				DBELL_TID(idb.bytes), DBELL_INF(idb.bytes));
 		}
+
+		wr_ptr = ioread32(priv->regs +
+				  TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
 	}
 
 	iowrite32(rd_ptr & (IDB_QSIZE - 1),
@@ -445,6 +448,10 @@ static void tsi721_db_dpc(struct work_st
 	regval |= TSI721_SR_CHINT_IDBQRCV;
 	iowrite32(regval,
 		priv->regs + TSI721_SR_CHINTE(IDB_QUEUE));
+
+	wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
+	if (wr_ptr != rd_ptr)
+		schedule_work(&priv->idb_work);
 }
 
 /**



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

* [ 064/108] rapidio/tsi721: fix unused variable compiler warning
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (61 preceding siblings ...)
  2012-09-12 23:29   ` [ 063/108] rapidio/tsi721: fix inbound doorbell interrupt handling Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 065/108] regulator: twl-regulator: fix up VINTANA1/VINTANA2 Greg Kroah-Hartman
                     ` (43 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Alexandre Bounine, Matt Porter, Andrew Morton, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Alexandre Bounine <alexandre.bounine@idt.com>

commit 9a9a9a7adafe62a34de8b4fb48936c1c5f9bafa5 upstream.

Fix unused variable compiler warning when built with CONFIG_RAPIDIO_DEBUG
option off.

This patch is applicable to kernel versions starting from v3.2

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/rapidio/devices/tsi721.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2219,7 +2219,7 @@ static int __devinit tsi721_probe(struct
 				  const struct pci_device_id *id)
 {
 	struct tsi721_device *priv;
-	int i, cap;
+	int cap;
 	int err;
 	u32 regval;
 
@@ -2239,12 +2239,15 @@ static int __devinit tsi721_probe(struct
 	priv->pdev = pdev;
 
 #ifdef DEBUG
+	{
+	int i;
 	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
 		dev_dbg(&pdev->dev, "res[%d] @ 0x%llx (0x%lx, 0x%lx)\n",
 			i, (unsigned long long)pci_resource_start(pdev, i),
 			(unsigned long)pci_resource_len(pdev, i),
 			pci_resource_flags(pdev, i));
 	}
+	}
 #endif
 	/*
 	 * Verify BAR configuration



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

* [ 065/108] regulator: twl-regulator: fix up VINTANA1/VINTANA2
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (62 preceding siblings ...)
  2012-09-12 23:29   ` [ 064/108] rapidio/tsi721: fix unused variable compiler warning Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 066/108] x32: Use compat shims for {g,s}etsockopt Greg Kroah-Hartman
                     ` (42 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Aaro Koskinen, Mark Brown

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Aaro Koskinen <aaro.koskinen@iki.fi>

commit 908d6d52928a7f2a4b317aac47542c5fbef43d88 upstream.

It seems commit 2098e95ce9bb039ff2e7bf836df358d18a176139 (regulator: twl:
adapt twl-regulator driver to dt) accidentally deleted VINTANA1. Also
the same commit defines VINTANA2 twice with TWL4030_ADJUSTABLE_LDO and
TWL4030_FIXED_LDO. This patch changes the fixed one to be VINTANA1.

I noticed this when auditing my N900 boot logs. I could not notice any
change in device behaviour, though, except that the boot logs are now
like before:

	...
	[    0.282928] VDAC: 1800 mV normal standby
	[    0.284027] VCSI: 1800 mV normal standby
	[    0.285400] VINTANA1: 1500 mV normal standby
	[    0.286865] VINTANA2: 2750 mV normal standby
	[    0.288208] VINTDIG: 1500 mV normal standby
	[    0.289978] VSDI_CSI: 1800 mV normal standby
	...

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/regulator/twl-regulator.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1065,7 +1065,7 @@ TWL6025_ADJUSTABLE_LDO(LDO7, 0x74, 1000,
 TWL6025_ADJUSTABLE_LDO(LDO6, 0x60, 1000, 3300);
 TWL6025_ADJUSTABLE_LDO(LDOLN, 0x64, 1000, 3300);
 TWL6025_ADJUSTABLE_LDO(LDOUSB, 0x70, 1000, 3300);
-TWL4030_FIXED_LDO(VINTANA2, 0x3f, 1500, 11, 100, 0x08);
+TWL4030_FIXED_LDO(VINTANA1, 0x3f, 1500, 11, 100, 0x08);
 TWL4030_FIXED_LDO(VINTDIG, 0x47, 1500, 13, 100, 0x08);
 TWL4030_FIXED_LDO(VUSB1V5, 0x71, 1500, 17, 100, 0x08);
 TWL4030_FIXED_LDO(VUSB1V8, 0x74, 1800, 18, 100, 0x08);
@@ -1146,7 +1146,7 @@ static const struct of_device_id twl_of_
 	TWL6025_OF_MATCH("ti,twl6025-ldo6", LDO6),
 	TWL6025_OF_MATCH("ti,twl6025-ldoln", LDOLN),
 	TWL6025_OF_MATCH("ti,twl6025-ldousb", LDOUSB),
-	TWLFIXED_OF_MATCH("ti,twl4030-vintana2", VINTANA2),
+	TWLFIXED_OF_MATCH("ti,twl4030-vintana1", VINTANA1),
 	TWLFIXED_OF_MATCH("ti,twl4030-vintdig", VINTDIG),
 	TWLFIXED_OF_MATCH("ti,twl4030-vusb1v5", VUSB1V5),
 	TWLFIXED_OF_MATCH("ti,twl4030-vusb1v8", VUSB1V8),



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

* [ 066/108] x32: Use compat shims for {g,s}etsockopt
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (63 preceding siblings ...)
  2012-09-12 23:29   ` [ 065/108] regulator: twl-regulator: fix up VINTANA1/VINTANA2 Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 067/108] USB: spca506: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (41 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Mads, Mike Frysinger, H. J. Lu, H. Peter Anvin

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mike Frysinger <vapier@gentoo.org>

commit 515c7af85ed92696c311c53d53cb4898ff32d784 upstream.

Some of the arguments to {g,s}etsockopt are passed in userland pointers.
If we try to use the 64bit entry point, we end up sometimes failing.

For example, dhcpcd doesn't run in x32:
	# dhcpcd eth0
	dhcpcd[1979]: version 5.5.6 starting
	dhcpcd[1979]: eth0: broadcasting for a lease
	dhcpcd[1979]: eth0: open_socket: Invalid argument
	dhcpcd[1979]: eth0: send_raw_packet: Bad file descriptor

The code in particular is getting back EINVAL when doing:
	struct sock_fprog pf;
	setsockopt(s, SOL_SOCKET, SO_ATTACH_FILTER, &pf, sizeof(pf));

Diving into the kernel code, we can see:
include/linux/filter.h:
	struct sock_fprog {
		unsigned short len;
		struct sock_filter __user *filter;
	};

net/core/sock.c:
	case SO_ATTACH_FILTER:
		ret = -EINVAL;
		if (optlen == sizeof(struct sock_fprog)) {
			struct sock_fprog fprog;

			ret = -EFAULT;
			if (copy_from_user(&fprog, optval, sizeof(fprog)))
				break;

			ret = sk_attach_filter(&fprog, sk);
		}
		break;

arch/x86/syscalls/syscall_64.tbl:
	54 common setsockopt sys_setsockopt
	55 common getsockopt sys_getsockopt

So for x64, sizeof(sock_fprog) is 16 bytes.  For x86/x32, it's 8 bytes.
This comes down to the pointer being 32bit for x32, which means we need
to do structure size translation.  But since x32 comes in directly to
sys_setsockopt, it doesn't get translated like x86.

After changing the syscall table and rebuilding glibc with the new kernel
headers, dhcp runs fine in an x32 userland.

Oddly, it seems like Linus noted the same thing during the initial port,
but I guess that was missed/lost along the way:
	https://lkml.org/lkml/2011/8/26/452

[ hpa: tagging for -stable since this is an ABI fix. ]

Bugzilla: https://bugs.gentoo.org/423649
Reported-by: Mads <mads@ab3.no>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Link: http://lkml.kernel.org/r/1345320697-15713-1-git-send-email-vapier@gentoo.org
Cc: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/syscalls/syscall_64.tbl |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -60,8 +60,8 @@
 51	common	getsockname		sys_getsockname
 52	common	getpeername		sys_getpeername
 53	common	socketpair		sys_socketpair
-54	common	setsockopt		sys_setsockopt
-55	common	getsockopt		sys_getsockopt
+54	64	setsockopt		sys_setsockopt
+55	64	getsockopt		sys_getsockopt
 56	common	clone			stub_clone
 57	common	fork			stub_fork
 58	common	vfork			stub_vfork
@@ -353,3 +353,5 @@
 538	x32	sendmmsg		compat_sys_sendmmsg
 539	x32	process_vm_readv	compat_sys_process_vm_readv
 540	x32	process_vm_writev	compat_sys_process_vm_writev
+541	x32	setsockopt		compat_sys_setsockopt
+542	x32	getsockopt		compat_sys_getsockopt



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

* [ 067/108] USB: spca506: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (64 preceding siblings ...)
  2012-09-12 23:29   ` [ 066/108] x32: Use compat shims for {g,s}etsockopt Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 068/108] USB: jl2005bcd: " Greg Kroah-Hartman
                     ` (40 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Hans de Goede,
	Mauro Carvalho Chehab

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit e694d518886c7afedcdd1732477832b2e32744e4 upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/video/gspca/spca506.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/video/gspca/spca506.c
+++ b/drivers/media/video/gspca/spca506.c
@@ -685,7 +685,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
 	{USB_DEVICE(0x06e1, 0xa190)},
 /*fixme: may be IntelPCCameraPro BRIDGE_SPCA505
 	{USB_DEVICE(0x0733, 0x0430)}, */



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

* [ 068/108] USB: jl2005bcd: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (65 preceding siblings ...)
  2012-09-12 23:29   ` [ 067/108] USB: spca506: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 069/108] USB: p54usb: " Greg Kroah-Hartman
                     ` (39 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Hans de Goede,
	Mauro Carvalho Chehab

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit ec063351684298e295dc9444d143ddfd6ab02df8 upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/video/gspca/jl2005bcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/video/gspca/jl2005bcd.c
+++ b/drivers/media/video/gspca/jl2005bcd.c
@@ -514,7 +514,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
 	{USB_DEVICE(0x0979, 0x0227)},
 	{}
 };



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

* [ 069/108] USB: p54usb: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (66 preceding siblings ...)
  2012-09-12 23:29   ` [ 068/108] USB: jl2005bcd: " Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 070/108] USB: rtl8187: " Greg Kroah-Hartman
                     ` (38 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Christian Lamparter,
	John W. Linville

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit b9c4167cbbafddac3462134013bc15e63e4c53ef upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Christian Lamparter <chunkeey@googlemail.com>
CC: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/p54/p54usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -42,7 +42,7 @@ MODULE_FIRMWARE("isl3887usb");
  * whenever you add a new device.
  */
 
-static struct usb_device_id p54u_table[] __devinitdata = {
+static struct usb_device_id p54u_table[] = {
 	/* Version 1 devices (pci chip + net2280) */
 	{USB_DEVICE(0x0411, 0x0050)},	/* Buffalo WLI2-USB2-G54 */
 	{USB_DEVICE(0x045e, 0x00c2)},	/* Microsoft MN-710 */



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

* [ 070/108] USB: rtl8187: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (67 preceding siblings ...)
  2012-09-12 23:29   ` [ 069/108] USB: p54usb: " Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 071/108] USB: smsusb: " Greg Kroah-Hartman
                     ` (37 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork,
	Herton Ronaldo Krzesinski, Hin-Tak Leung, Larry Finger,
	John W. Linville

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit a3433179d0822ccfa8e80aa4d1d52843bd2dcc63 upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Herton Ronaldo Krzesinski <herton@canonical.com>
CC: Hin-Tak Leung <htl10@users.sourceforge.net>
CC: Larry Finger <Larry.Finger@lwfinger.net>
CC: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/rtl818x/rtl8187/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -44,7 +44,7 @@ MODULE_AUTHOR("Larry Finger <Larry.Finge
 MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver");
 MODULE_LICENSE("GPL");
 
-static struct usb_device_id rtl8187_table[] __devinitdata = {
+static struct usb_device_id rtl8187_table[] = {
 	/* Asus */
 	{USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187},
 	/* Belkin */



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

* [ 071/108] USB: smsusb: remove __devinit* from the struct usb_device_id table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (68 preceding siblings ...)
  2012-09-12 23:29   ` [ 070/108] USB: rtl8187: " Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 072/108] USB: CDC ACM: Fix NULL pointer dereference Greg Kroah-Hartman
                     ` (36 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Fengguang Wu, Bjørn Mork, Mauro Carvalho Chehab,
	Michael Krufky, Paul Gortmaker, Doron Cohen

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit d04dbd1c0ec17a13326c8f2279399c225836a79f upstream.

This structure needs to always stick around, even if CONFIG_HOTPLUG
is disabled, otherwise we can oops when trying to probe a device that
was added after the structure is thrown away.

Thanks to Fengguang Wu and Bjørn Mork for tracking this issue down.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Bjørn Mork <bjorn@mork.no>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
CC: Michael Krufky <mkrufky@linuxtv.org>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Doron Cohen <doronc@siano-ms.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/dvb/siano/smsusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -481,7 +481,7 @@ static int smsusb_resume(struct usb_inte
 	return 0;
 }
 
-static const struct usb_device_id smsusb_id_table[] __devinitconst = {
+static const struct usb_device_id smsusb_id_table[] = {
 	{ USB_DEVICE(0x187f, 0x0010),
 		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
 	{ USB_DEVICE(0x187f, 0x0100),



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

* [ 072/108] USB: CDC ACM: Fix NULL pointer dereference
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (69 preceding siblings ...)
  2012-09-12 23:29   ` [ 071/108] USB: smsusb: " Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 073/108] ALSA: snd-usb: Fix URB cancellation at stream start Greg Kroah-Hartman
                     ` (35 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Sven Schnelle

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Sven Schnelle <svens@stackframe.org>

commit 99f347caa4568cb803862730b3b1f1942639523f upstream.

If a device specifies zero endpoints in its interface descriptor,
the kernel oopses in acm_probe(). Even though that's clearly an
invalid descriptor, we should test wether we have all endpoints.
This is especially bad as this oops can be triggered by just
plugging a USB device in.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/class/cdc-acm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1104,7 +1104,8 @@ skip_normal_probe:
 	}
 
 
-	if (data_interface->cur_altsetting->desc.bNumEndpoints < 2)
+	if (data_interface->cur_altsetting->desc.bNumEndpoints < 2 ||
+	    control_interface->cur_altsetting->desc.bNumEndpoints == 0)
 		return -EINVAL;
 
 	epctrl = &control_interface->cur_altsetting->endpoint[0].desc;



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

* [ 073/108] ALSA: snd-usb: Fix URB cancellation at stream start
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (70 preceding siblings ...)
  2012-09-12 23:29   ` [ 072/108] USB: CDC ACM: Fix NULL pointer dereference Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 074/108] ALSA: snd-usb: use list_for_each_safe for endpoint resources Greg Kroah-Hartman
                     ` (34 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Daniel Mack, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Daniel Mack <zonque@gmail.com>

commit 015618b902ae8e28705b7af9b4668615fea48ddd upstream.

Commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in
PCM capture stream") fixed a scheduling-while-atomic bug that happened
when snd_usb_endpoint_start was called from the trigger callback, which
is an atmic context. However, the patch breaks the idea of the endpoints
reference counting, which is the reason why the driver has been
refactored lately.

Revert that commit and let snd_usb_endpoint_start() take care of the URB
cancellation again. As this function is called from both atomic and
non-atomic context, add a flag to denote whether the function may sleep.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/endpoint.c |   11 +++++++++--
 sound/usb/endpoint.h |    2 +-
 sound/usb/pcm.c      |   13 +++++--------
 3 files changed, 15 insertions(+), 11 deletions(-)

--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -799,7 +799,9 @@ int snd_usb_endpoint_set_params(struct s
 /**
  * snd_usb_endpoint_start: start an snd_usb_endpoint
  *
- * @ep: the endpoint to start
+ * @ep:		the endpoint to start
+ * @can_sleep:	flag indicating whether the operation is executed in
+ * 		non-atomic context
  *
  * A call to this function will increment the use count of the endpoint.
  * In case it is not already running, the URBs for this endpoint will be
@@ -809,7 +811,7 @@ int snd_usb_endpoint_set_params(struct s
  *
  * Returns an error if the URB submission failed, 0 in all other cases.
  */
-int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
+int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep)
 {
 	int err;
 	unsigned int i;
@@ -821,6 +823,11 @@ int snd_usb_endpoint_start(struct snd_us
 	if (++ep->use_count != 1)
 		return 0;
 
+	/* just to be sure */
+	deactivate_urbs(ep, 0, can_sleep);
+	if (can_sleep)
+		wait_clear_urbs(ep);
+
 	ep->active_mask = 0;
 	ep->unlink_mask = 0;
 	ep->phase = 0;
--- a/sound/usb/endpoint.h
+++ b/sound/usb/endpoint.h
@@ -13,7 +13,7 @@ int snd_usb_endpoint_set_params(struct s
 				struct audioformat *fmt,
 				struct snd_usb_endpoint *sync_ep);
 
-int  snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
+int  snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep);
 void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep,
 			   int force, int can_sleep, int wait);
 int  snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -212,7 +212,7 @@ int snd_usb_init_pitch(struct snd_usb_au
 	}
 }
 
-static int start_endpoints(struct snd_usb_substream *subs)
+static int start_endpoints(struct snd_usb_substream *subs, int can_sleep)
 {
 	int err;
 
@@ -225,7 +225,7 @@ static int start_endpoints(struct snd_us
 		snd_printdd(KERN_DEBUG "Starting data EP @%p\n", ep);
 
 		ep->data_subs = subs;
-		err = snd_usb_endpoint_start(ep);
+		err = snd_usb_endpoint_start(ep, can_sleep);
 		if (err < 0) {
 			clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags);
 			return err;
@@ -239,7 +239,7 @@ static int start_endpoints(struct snd_us
 		snd_printdd(KERN_DEBUG "Starting sync EP @%p\n", ep);
 
 		ep->sync_slave = subs->data_endpoint;
-		err = snd_usb_endpoint_start(ep);
+		err = snd_usb_endpoint_start(ep, can_sleep);
 		if (err < 0) {
 			clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags);
 			return err;
@@ -544,13 +544,10 @@ static int snd_usb_pcm_prepare(struct sn
 	subs->last_frame_number = 0;
 	runtime->delay = 0;
 
-	/* clear the pending deactivation on the target EPs */
-	deactivate_endpoints(subs);
-
 	/* for playback, submit the URBs now; otherwise, the first hwptr_done
 	 * updates for all URBs would happen at the same time when starting */
 	if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK)
-		return start_endpoints(subs);
+		return start_endpoints(subs, 1);
 
 	return 0;
 }
@@ -1175,7 +1172,7 @@ static int snd_usb_substream_capture_tri
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
-		err = start_endpoints(subs);
+		err = start_endpoints(subs, 0);
 		if (err < 0)
 			return err;
 



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

* [ 074/108] ALSA: snd-usb: use list_for_each_safe for endpoint resources
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (71 preceding siblings ...)
  2012-09-12 23:29   ` [ 073/108] ALSA: snd-usb: Fix URB cancellation at stream start Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 075/108] ALSA: snd-usb: restore delay information Greg Kroah-Hartman
                     ` (33 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Pavel Roskin, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Pavel Roskin <proski@gnu.org>

commit 03d2f44e967b3c2cf79a6dfb904c8880616c7f83 upstream.

snd_usb_endpoint_free() frees the structure that contains its argument.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/card.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -553,7 +553,7 @@ static void snd_usb_audio_disconnect(str
 				     struct snd_usb_audio *chip)
 {
 	struct snd_card *card;
-	struct list_head *p;
+	struct list_head *p, *n;
 
 	if (chip == (void *)-1L)
 		return;
@@ -570,7 +570,7 @@ static void snd_usb_audio_disconnect(str
 			snd_usb_stream_disconnect(p);
 		}
 		/* release the endpoint resources */
-		list_for_each(p, &chip->ep_list) {
+		list_for_each_safe(p, n, &chip->ep_list) {
 			snd_usb_endpoint_free(p);
 		}
 		/* release the midi resources */



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

* [ 075/108] ALSA: snd-usb: restore delay information
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (72 preceding siblings ...)
  2012-09-12 23:29   ` [ 074/108] ALSA: snd-usb: use list_for_each_safe for endpoint resources Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 076/108] ALSA: snd-usb: fix calls to next_packet_size Greg Kroah-Hartman
                     ` (32 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Daniel Mack, Pierre-Louis Bossart, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Daniel Mack <zonque@gmail.com>

commit fbcfbf5f673847657ccd98afb4d8e13af7fdc372 upstream.

Parts of commit 294c4fb8 ("ALSA: usb: refine delay information with USB
frame counter") were unfortunately lost during the refactoring of the
snd-usb driver in 3.5.

This patch adds them back, restoring the correct delay information
behaviour.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/pcm.c |   29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1091,7 +1091,16 @@ static void prepare_playback_urb(struct
 	subs->hwptr_done += bytes;
 	if (subs->hwptr_done >= runtime->buffer_size * stride)
 		subs->hwptr_done -= runtime->buffer_size * stride;
+
+	/* update delay with exact number of samples queued */
+	runtime->delay = subs->last_delay;
 	runtime->delay += frames;
+	subs->last_delay = runtime->delay;
+
+	/* realign last_frame_number */
+	subs->last_frame_number = usb_get_current_frame_number(subs->dev);
+	subs->last_frame_number &= 0xFF; /* keep 8 LSBs */
+
 	spin_unlock_irqrestore(&subs->lock, flags);
 	urb->transfer_buffer_length = bytes;
 	if (period_elapsed)
@@ -1109,12 +1118,26 @@ static void retire_playback_urb(struct s
 	struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
 	int stride = runtime->frame_bits >> 3;
 	int processed = urb->transfer_buffer_length / stride;
+	int est_delay;
 
 	spin_lock_irqsave(&subs->lock, flags);
-	if (processed > runtime->delay)
-		runtime->delay = 0;
+	est_delay = snd_usb_pcm_delay(subs, runtime->rate);
+	/* update delay with exact number of samples played */
+	if (processed > subs->last_delay)
+		subs->last_delay = 0;
 	else
-		runtime->delay -= processed;
+		subs->last_delay -= processed;
+	runtime->delay = subs->last_delay;
+
+	/*
+	 * Report when delay estimate is off by more than 2ms.
+	 * The error should be lower than 2ms since the estimate relies
+	 * on two reads of a counter updated every ms.
+	 */
+	if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2)
+		snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n",
+			est_delay, subs->last_delay);
+
 	spin_unlock_irqrestore(&subs->lock, flags);
 }
 



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

* [ 076/108] ALSA: snd-usb: fix calls to next_packet_size
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (73 preceding siblings ...)
  2012-09-12 23:29   ` [ 075/108] ALSA: snd-usb: restore delay information Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 077/108] ALSA: snd-usb: fix cross-interface streaming devices Greg Kroah-Hartman
                     ` (31 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Daniel Mack, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Daniel Mack <zonque@gmail.com>

commit 245baf983cc39524cce39c24d01b276e6e653c9e upstream.

In order to support devices with implicit feedback streaming models,
packet sizes are now stored with each individual urb, and the PCM
handling code which fills the buffers purely relies on the size fields
now.

However, calling snd_usb_audio_next_packet_size() for all possible
packets in an URB at once, prior to letting the PCM code do its job
does in fact not lead to the same behaviour than what the old code did:
The PCM code will break its loop once a period boundary is reached,
consequently using up less packets that it really could.

As snd_usb_audio_next_packet_size() implements a feedback mechanism to
the endpoints phase accumulator, the number of calls to that function
matters, and when called too often, the data rate runs out of bounds.

Fix this by making the next_packet function public, and call it from the
PCM code as before if the packet data sizes are not defined.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/endpoint.c |   13 +------------
 sound/usb/endpoint.h |    1 +
 sound/usb/pcm.c      |    7 ++++++-
 3 files changed, 8 insertions(+), 13 deletions(-)

--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -141,7 +141,7 @@ int snd_usb_endpoint_implict_feedback_si
  *
  * For implicit feedback, next_packet_size() is unused.
  */
-static int next_packet_size(struct snd_usb_endpoint *ep)
+int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
 {
 	unsigned long flags;
 	int ret;
@@ -177,15 +177,6 @@ static void retire_inbound_urb(struct sn
 		ep->retire_data_urb(ep->data_subs, urb);
 }
 
-static void prepare_outbound_urb_sizes(struct snd_usb_endpoint *ep,
-				       struct snd_urb_ctx *ctx)
-{
-	int i;
-
-	for (i = 0; i < ctx->packets; ++i)
-		ctx->packet_size[i] = next_packet_size(ep);
-}
-
 /*
  * Prepare a PLAYBACK urb for submission to the bus.
  */
@@ -370,7 +361,6 @@ static void snd_complete_urb(struct urb
 			goto exit_clear;
 		}
 
-		prepare_outbound_urb_sizes(ep, ctx);
 		prepare_outbound_urb(ep, ctx);
 	} else {
 		retire_inbound_urb(ep, ctx);
@@ -857,7 +847,6 @@ int snd_usb_endpoint_start(struct snd_us
 			goto __error;
 
 		if (usb_pipeout(ep->pipe)) {
-			prepare_outbound_urb_sizes(ep, urb->context);
 			prepare_outbound_urb(ep, urb->context);
 		} else {
 			prepare_inbound_urb(ep, urb->context);
--- a/sound/usb/endpoint.h
+++ b/sound/usb/endpoint.h
@@ -21,6 +21,7 @@ int  snd_usb_endpoint_deactivate(struct
 void snd_usb_endpoint_free(struct list_head *head);
 
 int snd_usb_endpoint_implict_feedback_sink(struct snd_usb_endpoint *ep);
+int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
 
 void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
 			     struct snd_usb_endpoint *sender,
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1029,6 +1029,7 @@ static void prepare_playback_urb(struct
 				 struct urb *urb)
 {
 	struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
+	struct snd_usb_endpoint *ep = subs->data_endpoint;
 	struct snd_urb_ctx *ctx = urb->context;
 	unsigned int counts, frames, bytes;
 	int i, stride, period_elapsed = 0;
@@ -1040,7 +1041,11 @@ static void prepare_playback_urb(struct
 	urb->number_of_packets = 0;
 	spin_lock_irqsave(&subs->lock, flags);
 	for (i = 0; i < ctx->packets; i++) {
-		counts = ctx->packet_size[i];
+		if (ctx->packet_size[i])
+			counts = ctx->packet_size[i];
+		else
+			counts = snd_usb_endpoint_next_packet_size(ep);
+
 		/* set up descriptor */
 		urb->iso_frame_desc[i].offset = frames * stride;
 		urb->iso_frame_desc[i].length = counts * stride;



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

* [ 077/108] ALSA: snd-usb: fix cross-interface streaming devices
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (74 preceding siblings ...)
  2012-09-12 23:29   ` [ 076/108] ALSA: snd-usb: fix calls to next_packet_size Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 078/108] powerpc: Update DSCR on all CPUs when writing sysfs dscr_default Greg Kroah-Hartman
                     ` (30 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Daniel Mack, Robert M. Albrecht, Takashi Iwai

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Daniel Mack <zonque@gmail.com>

commit 2e4a263ca80a203ac6109f5932722a716c265395 upstream.

Commit 68e67f40b ("ALSA: snd-usb: move calls to usb_set_interface")
saved us some unnecessary calls to snd_usb_set_interface() but ignored
the fact that there is at least one device out there which operates on
two endpoint in different interfaces simultaniously.

Take care for this by catching the case where data and sync endpoints
are located on different interfaces and calling snd_usb_set_interface()
between the start of the two endpoints.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Robert M. Albrecht <linux@romal.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/pcm.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -236,6 +236,21 @@ static int start_endpoints(struct snd_us
 	    !test_and_set_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags)) {
 		struct snd_usb_endpoint *ep = subs->sync_endpoint;
 
+		if (subs->data_endpoint->iface != subs->sync_endpoint->iface ||
+		    subs->data_endpoint->alt_idx != subs->sync_endpoint->alt_idx) {
+			err = usb_set_interface(subs->dev,
+						subs->sync_endpoint->iface,
+						subs->sync_endpoint->alt_idx);
+			if (err < 0) {
+				snd_printk(KERN_ERR
+					   "%d:%d:%d: cannot set interface (%d)\n",
+					   subs->dev->devnum,
+					   subs->sync_endpoint->iface,
+					   subs->sync_endpoint->alt_idx, err);
+				return -EIO;
+			}
+		}
+
 		snd_printdd(KERN_DEBUG "Starting sync EP @%p\n", ep);
 
 		ep->sync_slave = subs->data_endpoint;



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

* [ 078/108] powerpc: Update DSCR on all CPUs when writing sysfs dscr_default
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (75 preceding siblings ...)
  2012-09-12 23:29   ` [ 077/108] ALSA: snd-usb: fix cross-interface streaming devices Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 079/108] powerpc: Keep thread.dscr and thread.dscr_inherit in sync Greg Kroah-Hartman
                     ` (29 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Anton Blanchard, Benjamin Herrenschmidt

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Anton Blanchard <anton@samba.org>

commit 1b6ca2a6fe56e7697d57348646e07df08f43b1bb upstream.

Writing to dscr_default in sysfs doesn't actually change the DSCR -
we rely on a context switch on each CPU to do the work. There is no
guarantee we will get a context switch in a reasonable amount of time
so fire off an IPI to force an immediate change.

This issue was found with the following test case:

http://ozlabs.org/~anton/junkcode/dscr_explicit_test.c

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/sysfs.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -194,6 +194,12 @@ static ssize_t show_dscr_default(struct
 	return sprintf(buf, "%lx\n", dscr_default);
 }
 
+static void update_dscr(void *dummy)
+{
+	if (!current->thread.dscr_inherit)
+		mtspr(SPRN_DSCR, dscr_default);
+}
+
 static ssize_t __used store_dscr_default(struct device *dev,
 		struct device_attribute *attr, const char *buf,
 		size_t count)
@@ -206,6 +212,8 @@ static ssize_t __used store_dscr_default
 		return -EINVAL;
 	dscr_default = val;
 
+	on_each_cpu(update_dscr, NULL, 1);
+
 	return count;
 }
 



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

* [ 079/108] powerpc: Keep thread.dscr and thread.dscr_inherit in sync
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (76 preceding siblings ...)
  2012-09-12 23:29   ` [ 078/108] powerpc: Update DSCR on all CPUs when writing sysfs dscr_default Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 080/108] powerpc: Fix DSCR inheritance in copy_thread() Greg Kroah-Hartman
                     ` (28 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Anton Blanchard, Benjamin Herrenschmidt

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Anton Blanchard <anton@samba.org>

commit 00ca0de02f80924dfff6b4f630e1dff3db005e35 upstream.

When we update the DSCR either via emulation of mtspr(DSCR) or via
a change to dscr_default in sysfs we don't update thread.dscr.
We will eventually update it at context switch time but there is
a period where thread.dscr is incorrect.

If we fork at this point we will copy the old value of thread.dscr
into the child. To avoid this, always keep thread.dscr in sync with
reality.

This issue was found with the following testcase:

http://ozlabs.org/~anton/junkcode/dscr_inherit_test.c

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/sysfs.c |    4 +++-
 arch/powerpc/kernel/traps.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -196,8 +196,10 @@ static ssize_t show_dscr_default(struct
 
 static void update_dscr(void *dummy)
 {
-	if (!current->thread.dscr_inherit)
+	if (!current->thread.dscr_inherit) {
+		current->thread.dscr = dscr_default;
 		mtspr(SPRN_DSCR, dscr_default);
+	}
 }
 
 static ssize_t __used store_dscr_default(struct device *dev,
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -972,8 +972,9 @@ static int emulate_instruction(struct pt
 			cpu_has_feature(CPU_FTR_DSCR)) {
 		PPC_WARN_EMULATED(mtdscr, regs);
 		rd = (instword >> 21) & 0x1f;
-		mtspr(SPRN_DSCR, regs->gpr[rd]);
+		current->thread.dscr = regs->gpr[rd];
 		current->thread.dscr_inherit = 1;
+		mtspr(SPRN_DSCR, current->thread.dscr);
 		return 0;
 	}
 #endif



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

* [ 080/108] powerpc: Fix DSCR inheritance in copy_thread()
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (77 preceding siblings ...)
  2012-09-12 23:29   ` [ 079/108] powerpc: Keep thread.dscr and thread.dscr_inherit in sync Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 081/108] powerpc: Restore correct DSCR in context switch Greg Kroah-Hartman
                     ` (27 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Anton Blanchard, Benjamin Herrenschmidt

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Anton Blanchard <anton@samba.org>

commit 1021cb268b3025573c4811f1dee4a11260c4507b upstream.

If the default DSCR is non zero we set thread.dscr_inherit in
copy_thread() meaning the new thread and all its children will ignore
future updates to the default DSCR. This is not intended and is
a change in behaviour that a number of our users have hit.

We just need to inherit thread.dscr and thread.dscr_inherit from
the parent which ends up being much simpler.

This was found with the following test case:

http://ozlabs.org/~anton/junkcode/dscr_default_test.c

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/process.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -802,16 +802,8 @@ int copy_thread(unsigned long clone_flag
 #endif /* CONFIG_PPC_STD_MMU_64 */
 #ifdef CONFIG_PPC64 
 	if (cpu_has_feature(CPU_FTR_DSCR)) {
-		if (current->thread.dscr_inherit) {
-			p->thread.dscr_inherit = 1;
-			p->thread.dscr = current->thread.dscr;
-		} else if (0 != dscr_default) {
-			p->thread.dscr_inherit = 1;
-			p->thread.dscr = dscr_default;
-		} else {
-			p->thread.dscr_inherit = 0;
-			p->thread.dscr = 0;
-		}
+		p->thread.dscr_inherit = current->thread.dscr_inherit;
+		p->thread.dscr = current->thread.dscr;
 	}
 #endif
 



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

* [ 081/108] powerpc: Restore correct DSCR in context switch
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (78 preceding siblings ...)
  2012-09-12 23:29   ` [ 080/108] powerpc: Fix DSCR inheritance in copy_thread() Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 082/108] powerpc: Make sure IPI handlers see data written by IPI senders Greg Kroah-Hartman
                     ` (26 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Anton Blanchard, Benjamin Herrenschmidt

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Anton Blanchard <anton@samba.org>

commit 714332858bfd40dcf8f741498336d93875c23aa7 upstream.

During a context switch we always restore the per thread DSCR value.
If we aren't doing explicit DSCR management
(ie thread.dscr_inherit == 0) and the default DSCR changed while
the process has been sleeping we end up with the wrong value.

Check thread.dscr_inherit and select the default DSCR or per thread
DSCR as required.

This was found with the following test case, when running with
more threads than CPUs (ie forcing context switching):

http://ozlabs.org/~anton/junkcode/dscr_default_test.c

With the four patches applied I can run a combination of all
test cases successfully at the same time:

http://ozlabs.org/~anton/junkcode/dscr_default_test.c
http://ozlabs.org/~anton/junkcode/dscr_explicit_test.c
http://ozlabs.org/~anton/junkcode/dscr_inherit_test.c

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/asm-offsets.c |    1 +
 arch/powerpc/kernel/entry_64.S    |   23 +++++++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -76,6 +76,7 @@ int main(void)
 	DEFINE(SIGSEGV, SIGSEGV);
 	DEFINE(NMI_MASK, NMI_MASK);
 	DEFINE(THREAD_DSCR, offsetof(struct thread_struct, dscr));
+	DEFINE(THREAD_DSCR_INHERIT, offsetof(struct thread_struct, dscr_inherit));
 #else
 	DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
 #endif /* CONFIG_PPC64 */
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -369,6 +369,12 @@ _GLOBAL(ret_from_fork)
 	li	r3,0
 	b	syscall_exit
 
+	.section	".toc","aw"
+DSCR_DEFAULT:
+	.tc dscr_default[TC],dscr_default
+
+	.section	".text"
+
 /*
  * This routine switches between two different tasks.  The process
  * state of one is saved on its kernel stack.  Then the state
@@ -508,9 +514,6 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
 	mr	r1,r8		/* start using new stack pointer */
 	std	r7,PACAKSAVE(r13)
 
-	ld	r6,_CCR(r1)
-	mtcrf	0xFF,r6
-
 #ifdef CONFIG_ALTIVEC
 BEGIN_FTR_SECTION
 	ld	r0,THREAD_VRSAVE(r4)
@@ -519,14 +522,22 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
 #ifdef CONFIG_PPC64
 BEGIN_FTR_SECTION
+	lwz	r6,THREAD_DSCR_INHERIT(r4)
+	ld	r7,DSCR_DEFAULT@toc(2)
 	ld	r0,THREAD_DSCR(r4)
-	cmpd	r0,r25
-	beq	1f
+	cmpwi	r6,0
+	bne	1f
+	ld	r0,0(r7)
+1:	cmpd	r0,r25
+	beq	2f
 	mtspr	SPRN_DSCR,r0
-1:	
+2:
 END_FTR_SECTION_IFSET(CPU_FTR_DSCR)
 #endif
 
+	ld	r6,_CCR(r1)
+	mtcrf	0xFF,r6
+
 	/* r3-r13 are destroyed -- Cort */
 	REST_8GPRS(14, r1)
 	REST_10GPRS(22, r1)



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

* [ 082/108] powerpc: Make sure IPI handlers see data written by IPI senders
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (79 preceding siblings ...)
  2012-09-12 23:29   ` [ 081/108] powerpc: Restore correct DSCR in context switch Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 083/108] Remove user-triggerable BUG from mpol_to_str Greg Kroah-Hartman
                     ` (25 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Milton Miller, Paul Mackerras, Benjamin Herrenschmidt

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Paul Mackerras <paulus@samba.org>

commit 9fb1b36ca1234e64a5d1cc573175303395e3354d upstream.

We have been observing hangs, both of KVM guest vcpu tasks and more
generally, where a process that is woken doesn't properly wake up and
continue to run, but instead sticks in TASK_WAKING state.  This
happens because the update of rq->wake_list in ttwu_queue_remote()
is not ordered with the update of ipi_message in
smp_muxed_ipi_message_pass(), and the reading of rq->wake_list in
scheduler_ipi() is not ordered with the reading of ipi_message in
smp_ipi_demux().  Thus it is possible for the IPI receiver not to see
the updated rq->wake_list and therefore conclude that there is nothing
for it to do.

In order to make sure that anything done before smp_send_reschedule()
is ordered before anything done in the resulting call to scheduler_ipi(),
this adds barriers in smp_muxed_message_pass() and smp_ipi_demux().
The barrier in smp_muxed_message_pass() is a full barrier to ensure that
there is a full ordering between the smp_send_reschedule() caller and
scheduler_ipi().  In smp_ipi_demux(), we use xchg() rather than
xchg_local() because xchg() includes release and acquire barriers.
Using xchg() rather than xchg_local() makes sense given that
ipi_message is not just accessed locally.

This moves the barrier between setting the message and calling the
cause_ipi() function into the individual cause_ipi implementations.
Most of them -- those that used outb, out_8 or similar -- already had
a full barrier because out_8 etc. include a sync before the MMIO
store.  This adds an explicit barrier in the two remaining cases.

These changes made no measurable difference to the speed of IPIs as
measured using a simple ping-pong latency test across two CPUs on
different cores of a POWER7 machine.

The analysis of the reason why processes were not waking up properly
is due to Milton Miller.

Reported-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/dbell.c       |    2 ++
 arch/powerpc/kernel/smp.c         |   11 +++++++++--
 arch/powerpc/sysdev/xics/icp-hv.c |    6 +++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

--- a/arch/powerpc/kernel/dbell.c
+++ b/arch/powerpc/kernel/dbell.c
@@ -28,6 +28,8 @@ void doorbell_setup_this_cpu(void)
 
 void doorbell_cause_ipi(int cpu, unsigned long data)
 {
+	/* Order previous accesses vs. msgsnd, which is treated as a store */
+	mb();
 	ppc_msgsnd(PPC_DBELL, 0, data);
 }
 
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -197,8 +197,15 @@ void smp_muxed_ipi_message_pass(int cpu,
 	struct cpu_messages *info = &per_cpu(ipi_message, cpu);
 	char *message = (char *)&info->messages;
 
+	/*
+	 * Order previous accesses before accesses in the IPI handler.
+	 */
+	smp_mb();
 	message[msg] = 1;
-	mb();
+	/*
+	 * cause_ipi functions are required to include a full barrier
+	 * before doing whatever causes the IPI.
+	 */
 	smp_ops->cause_ipi(cpu, info->data);
 }
 
@@ -210,7 +217,7 @@ irqreturn_t smp_ipi_demux(void)
 	mb();	/* order any irq clear */
 
 	do {
-		all = xchg_local(&info->messages, 0);
+		all = xchg(&info->messages, 0);
 
 #ifdef __BIG_ENDIAN
 		if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION)))
--- a/arch/powerpc/sysdev/xics/icp-hv.c
+++ b/arch/powerpc/sysdev/xics/icp-hv.c
@@ -65,7 +65,11 @@ static inline void icp_hv_set_xirr(unsig
 static inline void icp_hv_set_qirr(int n_cpu , u8 value)
 {
 	int hw_cpu = get_hard_smp_processor_id(n_cpu);
-	long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
+	long rc;
+
+	/* Make sure all previous accesses are ordered before IPI sending */
+	mb();
+	rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
 	if (rc != H_SUCCESS) {
 		pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
 			"returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);



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

* [ 083/108] Remove user-triggerable BUG from mpol_to_str
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (80 preceding siblings ...)
  2012-09-12 23:29   ` [ 082/108] powerpc: Make sure IPI handlers see data written by IPI senders Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 084/108] Fix order of arguments to compat_put_time[spec|val] Greg Kroah-Hartman
                     ` (24 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Dave Jones, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Dave Jones <davej@redhat.com>

commit 80de7c3138ee9fd86a98696fd2cf7ad89b995d0a upstream.

Trivially triggerable, found by trinity:

  kernel BUG at mm/mempolicy.c:2546!
  Process trinity-child2 (pid: 23988, threadinfo ffff88010197e000, task ffff88007821a670)
  Call Trace:
    show_numa_map+0xd5/0x450
    show_pid_numa_map+0x13/0x20
    traverse+0xf2/0x230
    seq_read+0x34b/0x3e0
    vfs_read+0xac/0x180
    sys_pread64+0xa2/0xc0
    system_call_fastpath+0x1a/0x1f
  RIP: mpol_to_str+0x156/0x360

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/mempolicy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2556,7 +2556,7 @@ int mpol_to_str(char *buffer, int maxlen
 		break;
 
 	default:
-		BUG();
+		return -EINVAL;
 	}
 
 	l = strlen(policy_modes[mode]);



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

* [ 084/108] Fix order of arguments to compat_put_time[spec|val]
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (81 preceding siblings ...)
  2012-09-12 23:29   ` [ 083/108] Remove user-triggerable BUG from mpol_to_str Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 085/108] usbnet: fix deadlock in resume Greg Kroah-Hartman
                     ` (23 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Mikulas Patocka, Linus Torvalds

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mikulas Patocka <mpatocka@redhat.com>

commit ed6fe9d614fc1bca95eb8c0ccd0e92db00ef9d5d upstream.

Commit 644595f89620 ("compat: Handle COMPAT_USE_64BIT_TIME in
net/socket.c") introduced a bug where the helper functions to take
either a 64-bit or compat time[spec|val] got the arguments in the wrong
order, passing the kernel stack pointer off as a user pointer (and vice
versa).

Because of the user address range check, that in turn then causes an
EFAULT due to the user pointer range checking failing for the kernel
address.  Incorrectly resuling in a failed system call for 32-bit
processes with a 64-bit kernel.

On odder architectures like HP-PA (with separate user/kernel address
spaces), it can be used read kernel memory.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/socket.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/socket.c
+++ b/net/socket.c
@@ -2605,7 +2605,7 @@ static int do_siocgstamp(struct net *net
 	err = sock_do_ioctl(net, sock, cmd, (unsigned long)&ktv);
 	set_fs(old_fs);
 	if (!err)
-		err = compat_put_timeval(up, &ktv);
+		err = compat_put_timeval(&ktv, up);
 
 	return err;
 }
@@ -2621,7 +2621,7 @@ static int do_siocgstampns(struct net *n
 	err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts);
 	set_fs(old_fs);
 	if (!err)
-		err = compat_put_timespec(up, &kts);
+		err = compat_put_timespec(&kts, up);
 
 	return err;
 }



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

* [ 085/108] usbnet: fix deadlock in resume
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (82 preceding siblings ...)
  2012-09-12 23:29   ` [ 084/108] Fix order of arguments to compat_put_time[spec|val] Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 086/108] SCSI: megaraid_sas: Move poll_aen_lock initializer Greg Kroah-Hartman
                     ` (22 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Oliver Neukum, David S. Miller

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Oliver Neukum <oliver@neukum.org>

commit ab6f148de28261682d300662e87b9477f7efc95b upstream.

A usbnet device can share a multifunction device
with a storage device. If the storage device is autoresumed
the usbnet devices also needs to be autoresumed. Allocating
memory with GFP_KERNEL can deadlock in this case.

This should go back into all kernels that have
commit 65841fd5132c3941cdf5df09e70df3ed28323212
That is 3.5

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/usb/usbnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1580,7 +1580,7 @@ int usbnet_resume (struct usb_interface
 				netif_device_present(dev->net) &&
 				!timer_pending(&dev->delay) &&
 				!test_bit(EVENT_RX_HALT, &dev->flags))
-					rx_alloc_submit(dev, GFP_KERNEL);
+					rx_alloc_submit(dev, GFP_NOIO);
 
 			if (!(dev->txq.qlen >= TX_QLEN(dev)))
 				netif_tx_wake_all_queues(dev->net);



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

* [ 086/108] SCSI: megaraid_sas: Move poll_aen_lock initializer
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (83 preceding siblings ...)
  2012-09-12 23:29   ` [ 085/108] usbnet: fix deadlock in resume Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 087/108] SCSI: scsi_lib: fix scsi_io_completions SG_IO error propagation Greg Kroah-Hartman
                     ` (21 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Kashyap Desai, Adam Radford, James Bottomley

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Kashyap Desai <Kashyap.Desai@lsi.com>

commit bd8d6dd43a77bfd2b8fef5b094b9d6095e169dee upstream.

The following patch moves the poll_aen_lock initializer from
megasas_probe_one() to megasas_init().  This prevents a crash when a user
loads the driver and tries to issue a poll() system call on the ioctl
interface with no adapters present.

Signed-off-by: Kashyap Desai <Kashyap.Desai@lsi.com>
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/megaraid/megaraid_sas_base.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4066,7 +4066,6 @@ megasas_probe_one(struct pci_dev *pdev,
 	spin_lock_init(&instance->cmd_pool_lock);
 	spin_lock_init(&instance->hba_lock);
 	spin_lock_init(&instance->completion_lock);
-	spin_lock_init(&poll_aen_lock);
 
 	mutex_init(&instance->aen_mutex);
 	mutex_init(&instance->reset_mutex);
@@ -5392,6 +5391,8 @@ static int __init megasas_init(void)
 	printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
 	       MEGASAS_EXT_VERSION);
 
+	spin_lock_init(&poll_aen_lock);
+
 	support_poll_for_event = 2;
 	support_device_change = 1;
 



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

* [ 087/108] SCSI: scsi_lib: fix scsi_io_completions SG_IO error propagation
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (84 preceding siblings ...)
  2012-09-12 23:29   ` [ 086/108] SCSI: megaraid_sas: Move poll_aen_lock initializer Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 088/108] SCSI: mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Paolo Bonzini, Mike Snitzer, Babu Moger, James Bottomley

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mike Snitzer <snitzer@redhat.com>

commit 27c419739b67decced4650440829b8d51bef954b upstream.

The following v3.4-rc1 commit unmasked an existing bug in scsi_io_completion's
SG_IO error handling: 47ac56d [SCSI] scsi_error: classify some ILLEGAL_REQUEST
sense as a permanent TARGET_ERROR

Given that certain ILLEGAL_REQUEST are now properly categorized as
TARGET_ERROR the host_byte is being set (before host_byte wasn't ever
set for these ILLEGAL_REQUEST).

In scsi_io_completion, initialize req->errors with cmd->result _after_
the SG_IO block that calls __scsi_error_from_host_byte (which may
modify the host_byte).

Before this fix:

    cdb to send: 12 01 01 00 00 00
ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[12, 01, 01, 00, 00, 00],
    mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=20000, flags=0,
    status=02, masked_status=01, sb[19]=[70, 00, 05, 00, 00, 00, 00, 0b,
    00, 00, 00, 00, 24, 00, 00, 00, 00, 00, 00], host_status=0x10,
    driver_status=0x8, resid=0, duration=0, info=0x1}) = 0
SCSI Status: Check Condition

Sense Information:
sense buffer empty

After:

    cdb to send: 12 01 01 00 00 00
ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[12, 01, 01, 00, 00, 00],
    mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=20000, flags=0,
    status=02, masked_status=01, sb[19]=[70, 00, 05, 00, 00, 00, 00, 0b,
    00, 00, 00, 00, 24, 00, 00, 00, 00, 00, 00], host_status=0,
    driver_status=0x8, resid=0, duration=0, info=0x1}) = 0
SCSI Status: Check Condition

Sense Information:
 Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in cdb
 Raw sense data (in hex):
        70 00 05 00 00 00 00 0b  00 00 00 00 24 00 00 00
        00 00 00

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

---
 drivers/scsi/scsi_lib.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -760,7 +760,6 @@ void scsi_io_completion(struct scsi_cmnd
 	}
 
 	if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */
-		req->errors = result;
 		if (result) {
 			if (sense_valid && req->sense) {
 				/*
@@ -776,6 +775,10 @@ void scsi_io_completion(struct scsi_cmnd
 			if (!sense_deferred)
 				error = __scsi_error_from_host_byte(cmd, result);
 		}
+		/*
+		 * __scsi_error_from_host_byte may have reset the host_byte
+		 */
+		req->errors = cmd->result;
 
 		req->resid_len = scsi_get_resid(cmd);
 



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

* [ 088/108] SCSI: mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (85 preceding siblings ...)
  2012-09-12 23:29   ` [ 087/108] SCSI: scsi_lib: fix scsi_io_completions SG_IO error propagation Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 089/108] SCSI: Fix Device not ready issue on mpt2sas Greg Kroah-Hartman
                     ` (19 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Sreekanth Reddy, James Bottomley

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: "sreekanth.reddy@lsi.com" <sreekanth.reddy@lsi.com>

commit 338b131a3269881c7431234855c93c219b0979b6 upstream.

If the specified max_queue_depth setting is less than the
expected number of internal commands, then driver will calculate
the queue depth size to a negitive number. This negitive number
is actually a very large number because variable is unsigned
16bit integer. So, the driver will ask for a very large amount of
memory for message frames and resulting into oops as memory
allocation routines will not able to handle such a large request.

So, in order to limit this kind of oops, The driver need to set
the max_queue_depth to a scsi mid layer's can_queue value. Then
the overall message frames required for IO is minimum of either
(max_queue_depth plus internal commands) or the IOC global
credits.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/mpt2sas/mpt2sas_base.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -2424,10 +2424,13 @@ _base_allocate_memory_pools(struct MPT2S
 	}
 
 	/* command line tunables  for max controller queue depth */
-	if (max_queue_depth != -1)
-		max_request_credit = (max_queue_depth < facts->RequestCredit)
-		    ? max_queue_depth : facts->RequestCredit;
-	else
+	if (max_queue_depth != -1 && max_queue_depth != 0) {
+		max_request_credit = min_t(u16, max_queue_depth +
+			ioc->hi_priority_depth + ioc->internal_depth,
+			facts->RequestCredit);
+		if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
+			max_request_credit =  MAX_HBA_QUEUE_DEPTH;
+	} else
 		max_request_credit = min_t(u16, facts->RequestCredit,
 		    MAX_HBA_QUEUE_DEPTH);
 
@@ -2502,7 +2505,7 @@ _base_allocate_memory_pools(struct MPT2S
 	/* set the scsi host can_queue depth
 	 * with some internal commands that could be outstanding
 	 */
-	ioc->shost->can_queue = ioc->scsiio_depth - (2);
+	ioc->shost->can_queue = ioc->scsiio_depth;
 	dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: "
 	    "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue));
 



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

* [ 089/108] SCSI: Fix Device not ready issue on mpt2sas
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (86 preceding siblings ...)
  2012-09-12 23:29   ` [ 088/108] SCSI: mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 090/108] udf: Fix data corruption for files in ICB Greg Kroah-Hartman
                     ` (18 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Matthias Prager, James Bottomley

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: James Bottomley <JBottomley@Parallels.com>

commit 14216561e164671ce147458653b1fea06a4ada1e upstream.

This is a particularly nasty SCSI ATA Translation Layer (SATL) problem.

SAT-2 says (section 8.12.2)

        if the device is in the stopped state as the result of
        processing a START STOP UNIT command (see 9.11), then the SATL
        shall terminate the TEST UNIT READY command with CHECK CONDITION
        status with the sense key set to NOT READY and the additional
        sense code of LOGICAL UNIT NOT READY, INITIALIZING COMMAND
        REQUIRED;

mpt2sas internal SATL seems to implement this.  The result is very confusing
standby behaviour (using hdparm -y).  If you suspend a drive and then send
another command, usually it wakes up.  However, if the next command is a TEST
UNIT READY, the SATL sees that the drive is suspended and proceeds to follow
the SATL rules for this, returning NOT READY to all subsequent commands.  This
means that the ordering of TEST UNIT READY is crucial: if you send TUR and
then a command, you get a NOT READY to both back.  If you send a command and
then a TUR, you get GOOD status because the preceeding command woke the drive.

This bit us badly because

commit 85ef06d1d252f6a2e73b678591ab71caad4667bb
Author: Tejun Heo <tj@kernel.org>
Date:   Fri Jul 1 16:17:47 2011 +0200

    block: flush MEDIA_CHANGE from drivers on close(2)

Changed our ordering on TEST UNIT READY commands meaning that SATA drives
connected to an mpt2sas now suspend and refuse to wake (because the mpt2sas
SATL sees the suspend *before* the drives get awoken by the next ATA command)
resulting in lots of failed commands.

The standard is completely nuts forcing this inconsistent behaviour, but we
have to work around it.

The fix for this is twofold:

   1. Set the allow_restart flag so we wake the drive when we see it has been
      suspended

   2. Return all TEST UNIT READY status directly to the mid layer without any
      further error handling which prevents us causing error handling which
      may offline the device just because of a media check TUR.

Reported-by: Matthias Prager <linux@matthiasprager.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/scsi_error.c |   10 ++++++++++
 drivers/scsi/scsi_scan.c  |   10 ++++++++++
 2 files changed, 20 insertions(+)

--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -42,6 +42,8 @@
 
 #include <trace/events/scsi.h>
 
+static void scsi_eh_done(struct scsi_cmnd *scmd);
+
 #define SENSE_TIMEOUT		(10*HZ)
 
 /*
@@ -241,6 +243,14 @@ static int scsi_check_sense(struct scsi_
 	if (! scsi_command_normalize_sense(scmd, &sshdr))
 		return FAILED;	/* no valid sense data */
 
+	if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
+		/*
+		 * nasty: for mid-layer issued TURs, we need to return the
+		 * actual sense data without any recovery attempt.  For eh
+		 * issued ones, we need to try to recover and interpret
+		 */
+		return SUCCESS;
+
 	if (scsi_sense_is_deferred(&sshdr))
 		return NEEDS_RETRY;
 
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -779,6 +779,16 @@ static int scsi_add_lun(struct scsi_devi
 	sdev->model = (char *) (sdev->inquiry + 16);
 	sdev->rev = (char *) (sdev->inquiry + 32);
 
+	if (strncmp(sdev->vendor, "ATA     ", 8) == 0) {
+		/*
+		 * sata emulation layer device.  This is a hack to work around
+		 * the SATL power management specifications which state that
+		 * when the SATL detects the device has gone into standby
+		 * mode, it shall respond with NOT READY.
+		 */
+		sdev->allow_restart = 1;
+	}
+
 	if (*bflags & BLIST_ISROM) {
 		sdev->type = TYPE_ROM;
 		sdev->removable = 1;



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

* [ 090/108] udf: Fix data corruption for files in ICB
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (87 preceding siblings ...)
  2012-09-12 23:29   ` [ 089/108] SCSI: Fix Device not ready issue on mpt2sas Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 091/108] ext3: Fix fdatasync() for files with only i_size changes Greg Kroah-Hartman
                     ` (17 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Ian Abbott, Jan Kara

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jan Kara <jack@suse.cz>

commit 9c2fc0de1a6e638fe58c354a463f544f42a90a09 upstream.

When a file is stored in ICB (inode), we overwrite part of the file, and
the page containing file's data is not in page cache, we end up corrupting
file's data by overwriting them with zeros. The problem is we use
simple_write_begin() which simply zeroes parts of the page which are not
written to. The problem has been introduced by be021ee4 (udf: convert to
new aops).

Fix the problem by providing a ->write_begin function which makes the page
properly uptodate.

Reported-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/udf/file.c |   35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -39,20 +39,24 @@
 #include "udf_i.h"
 #include "udf_sb.h"
 
-static int udf_adinicb_readpage(struct file *file, struct page *page)
+static void __udf_adinicb_readpage(struct page *page)
 {
 	struct inode *inode = page->mapping->host;
 	char *kaddr;
 	struct udf_inode_info *iinfo = UDF_I(inode);
 
-	BUG_ON(!PageLocked(page));
-
 	kaddr = kmap(page);
-	memset(kaddr, 0, PAGE_CACHE_SIZE);
 	memcpy(kaddr, iinfo->i_ext.i_data + iinfo->i_lenEAttr, inode->i_size);
+	memset(kaddr + inode->i_size, 0, PAGE_CACHE_SIZE - inode->i_size);
 	flush_dcache_page(page);
 	SetPageUptodate(page);
 	kunmap(page);
+}
+
+static int udf_adinicb_readpage(struct file *file, struct page *page)
+{
+	BUG_ON(!PageLocked(page));
+	__udf_adinicb_readpage(page);
 	unlock_page(page);
 
 	return 0;
@@ -77,6 +81,25 @@ static int udf_adinicb_writepage(struct
 	return 0;
 }
 
+static int udf_adinicb_write_begin(struct file *file,
+			struct address_space *mapping, loff_t pos,
+			unsigned len, unsigned flags, struct page **pagep,
+			void **fsdata)
+{
+	struct page *page;
+
+	if (WARN_ON_ONCE(pos >= PAGE_CACHE_SIZE))
+		return -EIO;
+	page = grab_cache_page_write_begin(mapping, 0, flags);
+	if (!page)
+		return -ENOMEM;
+	*pagep = page;
+
+	if (!PageUptodate(page) && len != PAGE_CACHE_SIZE)
+		__udf_adinicb_readpage(page);
+	return 0;
+}
+
 static int udf_adinicb_write_end(struct file *file,
 			struct address_space *mapping,
 			loff_t pos, unsigned len, unsigned copied,
@@ -98,8 +121,8 @@ static int udf_adinicb_write_end(struct
 const struct address_space_operations udf_adinicb_aops = {
 	.readpage	= udf_adinicb_readpage,
 	.writepage	= udf_adinicb_writepage,
-	.write_begin = simple_write_begin,
-	.write_end = udf_adinicb_write_end,
+	.write_begin	= udf_adinicb_write_begin,
+	.write_end	= udf_adinicb_write_end,
 };
 
 static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,



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

* [ 091/108] ext3: Fix fdatasync() for files with only i_size changes
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (88 preceding siblings ...)
  2012-09-12 23:29   ` [ 090/108] udf: Fix data corruption for files in ICB Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 092/108] fuse: fix retrieve length Greg Kroah-Hartman
                     ` (16 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Kristian Nielsen, Jan Kara

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Jan Kara <jack@suse.cz>

commit 156bddd8e505b295540f3ca0e27dda68cb0d49aa upstream.

Code tracking when transaction needs to be committed on fdatasync(2) forgets
to handle a situation when only inode's i_size is changed. Thus in such
situations fdatasync(2) doesn't force transaction with new i_size to disk
and that can result in wrong i_size after a crash.

Fix the issue by updating inode's i_datasync_tid whenever its size is
updated.

Reported-by: Kristian Nielsen <knielsen@knielsen-hq.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext3/inode.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -3072,6 +3072,8 @@ static int ext3_do_update_inode(handle_t
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	struct buffer_head *bh = iloc->bh;
 	int err = 0, rc, block;
+	int need_datasync = 0;
+	__le32 disksize;
 	uid_t i_uid;
 	gid_t i_gid;
 
@@ -3113,7 +3115,11 @@ again:
 		raw_inode->i_gid_high = 0;
 	}
 	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
-	raw_inode->i_size = cpu_to_le32(ei->i_disksize);
+	disksize = cpu_to_le32(ei->i_disksize);
+	if (disksize != raw_inode->i_size) {
+		need_datasync = 1;
+		raw_inode->i_size = disksize;
+	}
 	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
 	raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
 	raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec);
@@ -3129,8 +3135,11 @@ again:
 	if (!S_ISREG(inode->i_mode)) {
 		raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl);
 	} else {
-		raw_inode->i_size_high =
-			cpu_to_le32(ei->i_disksize >> 32);
+		disksize = cpu_to_le32(ei->i_disksize >> 32);
+		if (disksize != raw_inode->i_size_high) {
+			raw_inode->i_size_high = disksize;
+			need_datasync = 1;
+		}
 		if (ei->i_disksize > 0x7fffffffULL) {
 			struct super_block *sb = inode->i_sb;
 			if (!EXT3_HAS_RO_COMPAT_FEATURE(sb,
@@ -3183,6 +3192,8 @@ again:
 	ext3_clear_inode_state(inode, EXT3_STATE_NEW);
 
 	atomic_set(&ei->i_sync_tid, handle->h_transaction->t_tid);
+	if (need_datasync)
+		atomic_set(&ei->i_datasync_tid, handle->h_transaction->t_tid);
 out_brelse:
 	brelse (bh);
 	ext3_std_error(inode->i_sb, err);



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

* [ 092/108] fuse: fix retrieve length
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (89 preceding siblings ...)
  2012-09-12 23:29   ` [ 091/108] ext3: Fix fdatasync() for files with only i_size changes Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 093/108] i2c-designware: Fix build error if CONFIG_I2C_DESIGNWARE_PLATFORM=y && CONFIG_I2C_DESIGNWARE_PCI=y Greg Kroah-Hartman
                     ` (15 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Miklos Szeredi

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit c9e67d483776d8d2a5f3f70491161b205930ffe1 upstream.

In some cases fuse_retrieve() would return a short byte count if offset was
non-zero.  The data returned was correct, though.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/fuse/dev.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1576,6 +1576,7 @@ static int fuse_retrieve(struct fuse_con
 		req->pages[req->num_pages] = page;
 		req->num_pages++;
 
+		offset = 0;
 		num -= this_num;
 		total_len += this_num;
 		index++;



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

* [ 093/108] i2c-designware: Fix build error if CONFIG_I2C_DESIGNWARE_PLATFORM=y && CONFIG_I2C_DESIGNWARE_PCI=y
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (90 preceding siblings ...)
  2012-09-12 23:29   ` [ 092/108] fuse: fix retrieve length Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 094/108] i2c-i801: Add Device IDs for Intel Lynx Point-LP PCH Greg Kroah-Hartman
                     ` (14 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Axel Lin, Jean Delvare, Jiri Slaby

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit e68bb91baa0bb9817567bd45d560919e8e26373b upstream.

This patch adds config I2C_DESIGNWARE_CORE in Kconfig, and let
I2C_DESIGNWARE_PLATFORM and I2C_DESIGNWARE_PCI select I2C_DESIGNWARE_CORE.

Because both I2C_DESIGNWARE_PLATFORM and I2C_DESIGNWARE_PCI can be built as
built-in or module, we also need to export the functions in i2c-designware-core.

This fixes below build error when CONFIG_I2C_DESIGNWARE_PLATFORM=y &&
CONFIG_I2C_DESIGNWARE_PCI=y:

  LD      drivers/i2c/busses/built-in.o
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_clear_int':
i2c-designware-core.c:(.text+0xa10): multiple definition of `i2c_dw_clear_int'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x928): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_init':
i2c-designware-core.c:(.text+0x178): multiple definition of `i2c_dw_init'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x90): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `dw_readl':
i2c-designware-core.c:(.text+0xe8): multiple definition of `dw_readl'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x0): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_isr':
i2c-designware-core.c:(.text+0x724): multiple definition of `i2c_dw_isr'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x63c): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_xfer':
i2c-designware-core.c:(.text+0x4b0): multiple definition of `i2c_dw_xfer'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x3c8): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_is_enabled':
i2c-designware-core.c:(.text+0x9d4): multiple definition of `i2c_dw_is_enabled'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x8ec): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `dw_writel':
i2c-designware-core.c:(.text+0x124): multiple definition of `dw_writel'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x3c): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_xfer_msg':
i2c-designware-core.c:(.text+0x2e8): multiple definition of `i2c_dw_xfer_msg'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x200): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_enable':
i2c-designware-core.c:(.text+0x9c8): multiple definition of `i2c_dw_enable'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x8e0): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_read_comp_param':
i2c-designware-core.c:(.text+0xa24): multiple definition of `i2c_dw_read_comp_param'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x93c): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_disable':
i2c-designware-core.c:(.text+0x9dc): multiple definition of `i2c_dw_disable'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x8f4): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_func':
i2c-designware-core.c:(.text+0x710): multiple definition of `i2c_dw_func'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x628): first defined here
drivers/i2c/busses/i2c-designware-pci.o: In function `i2c_dw_disable_int':
i2c-designware-core.c:(.text+0xa18): multiple definition of `i2c_dw_disable_int'
drivers/i2c/busses/i2c-designware-platform.o:i2c-designware-platdrv.c:(.text+0x930): first defined here
make[3]: *** [drivers/i2c/busses/built-in.o] Error 1
make[2]: *** [drivers/i2c/busses] Error 2
make[1]: *** [drivers/i2c] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/Kconfig               |    5 +++++
 drivers/i2c/busses/Makefile              |    5 +++--
 drivers/i2c/busses/i2c-designware-core.c |   11 +++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -350,9 +350,13 @@ config I2C_DAVINCI
 	  devices such as DaVinci NIC.
 	  For details please see http://www.ti.com/davinci
 
+config I2C_DESIGNWARE_CORE
+	tristate
+
 config I2C_DESIGNWARE_PLATFORM
 	tristate "Synopsys DesignWare Platform"
 	depends on HAVE_CLK
+	select I2C_DESIGNWARE_CORE
 	help
 	  If you say yes to this option, support will be included for the
 	  Synopsys DesignWare I2C adapter. Only master mode is supported.
@@ -363,6 +367,7 @@ config I2C_DESIGNWARE_PLATFORM
 config I2C_DESIGNWARE_PCI
 	tristate "Synopsys DesignWare PCI"
 	depends on PCI
+	select I2C_DESIGNWARE_CORE
 	help
 	  If you say yes to this option, support will be included for the
 	  Synopsys DesignWare I2C adapter. Only master mode is supported.
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -33,10 +33,11 @@ obj-$(CONFIG_I2C_AU1550)	+= i2c-au1550.o
 obj-$(CONFIG_I2C_BLACKFIN_TWI)	+= i2c-bfin-twi.o
 obj-$(CONFIG_I2C_CPM)		+= i2c-cpm.o
 obj-$(CONFIG_I2C_DAVINCI)	+= i2c-davinci.o
+obj-$(CONFIG_I2C_DESIGNWARE_CORE)	+= i2c-designware-core.o
 obj-$(CONFIG_I2C_DESIGNWARE_PLATFORM)	+= i2c-designware-platform.o
-i2c-designware-platform-objs := i2c-designware-platdrv.o i2c-designware-core.o
+i2c-designware-platform-objs := i2c-designware-platdrv.o
 obj-$(CONFIG_I2C_DESIGNWARE_PCI)	+= i2c-designware-pci.o
-i2c-designware-pci-objs := i2c-designware-pcidrv.o i2c-designware-core.o
+i2c-designware-pci-objs := i2c-designware-pcidrv.o
 obj-$(CONFIG_I2C_EG20T)		+= i2c-eg20t.o
 obj-$(CONFIG_I2C_GPIO)		+= i2c-gpio.o
 obj-$(CONFIG_I2C_HIGHLANDER)	+= i2c-highlander.o
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -25,6 +25,7 @@
  * ----------------------------------------------------------------------------
  *
  */
+#include <linux/export.h>
 #include <linux/clk.h>
 #include <linux/errno.h>
 #include <linux/err.h>
@@ -316,6 +317,7 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
 	dw_writel(dev, dev->master_cfg , DW_IC_CON);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_init);
 
 /*
  * Waiting for bus not busy
@@ -568,12 +570,14 @@ done:
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_xfer);
 
 u32 i2c_dw_func(struct i2c_adapter *adap)
 {
 	struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
 	return dev->functionality;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_func);
 
 static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
 {
@@ -678,17 +682,20 @@ tx_aborted:
 
 	return IRQ_HANDLED;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_isr);
 
 void i2c_dw_enable(struct dw_i2c_dev *dev)
 {
        /* Enable the adapter */
 	dw_writel(dev, 1, DW_IC_ENABLE);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_enable);
 
 u32 i2c_dw_is_enabled(struct dw_i2c_dev *dev)
 {
 	return dw_readl(dev, DW_IC_ENABLE);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_is_enabled);
 
 void i2c_dw_disable(struct dw_i2c_dev *dev)
 {
@@ -699,18 +706,22 @@ void i2c_dw_disable(struct dw_i2c_dev *d
 	dw_writel(dev, 0, DW_IC_INTR_MASK);
 	dw_readl(dev, DW_IC_CLR_INTR);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_disable);
 
 void i2c_dw_clear_int(struct dw_i2c_dev *dev)
 {
 	dw_readl(dev, DW_IC_CLR_INTR);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_clear_int);
 
 void i2c_dw_disable_int(struct dw_i2c_dev *dev)
 {
 	dw_writel(dev, 0, DW_IC_INTR_MASK);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_disable_int);
 
 u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev)
 {
 	return dw_readl(dev, DW_IC_COMP_PARAM_1);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);



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

* [ 094/108] i2c-i801: Add Device IDs for Intel Lynx Point-LP PCH
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (91 preceding siblings ...)
  2012-09-12 23:29   ` [ 093/108] i2c-designware: Fix build error if CONFIG_I2C_DESIGNWARE_PLATFORM=y && CONFIG_I2C_DESIGNWARE_PCI=y Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 095/108] HID: add NOGET quirk for Eaton Ellipse MAX UPS Greg Kroah-Hartman
                     ` (13 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, James Ralston, Jean Delvare

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: James Ralston <james.d.ralston@intel.com>

commit 4a8f1ddde942e232387e6129ce4f4c412e43802f upstream.

Add the SMBus Device IDs for the Intel Lynx Point-LP PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 Documentation/i2c/busses/i2c-i801 |    1 +
 drivers/i2c/busses/Kconfig        |    1 +
 drivers/i2c/busses/i2c-i801.c     |    3 +++
 3 files changed, 5 insertions(+)

--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -21,6 +21,7 @@ Supported adapters:
   * Intel DH89xxCC (PCH)
   * Intel Panther Point (PCH)
   * Intel Lynx Point (PCH)
+  * Intel Lynx Point-LP (PCH)
    Datasheets: Publicly available at the Intel website
 
 On Intel Patsburg and later chipsets, both the normal host SMBus controller
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -104,6 +104,7 @@ config I2C_I801
 	    DH89xxCC (PCH)
 	    Panther Point (PCH)
 	    Lynx Point (PCH)
+	    Lynx Point-LP (PCH)
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-i801.
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -52,6 +52,7 @@
   DH89xxCC (PCH)        0x2330     32     hard     yes     yes     yes
   Panther Point (PCH)   0x1e22     32     hard     yes     yes     yes
   Lynx Point (PCH)      0x8c22     32     hard     yes     yes     yes
+  Lynx Point-LP (PCH)   0x9c22     32     hard     yes     yes     yes
 
   Features supported by this driver:
   Software PEC                     no
@@ -147,6 +148,7 @@
 #define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS	0x2330
 #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS	0x3b30
 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS	0x8c22
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS	0x9c22
 
 struct i801_priv {
 	struct i2c_adapter adapter;
@@ -636,6 +638,7 @@ static DEFINE_PCI_DEVICE_TABLE(i801_ids)
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS) },
 	{ 0, }
 };
 



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

* [ 095/108] HID: add NOGET quirk for Eaton Ellipse MAX UPS
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (92 preceding siblings ...)
  2012-09-12 23:29   ` [ 094/108] i2c-i801: Add Device IDs for Intel Lynx Point-LP PCH Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 096/108] Input: i8042 - add Gigabyte T1005 series netbooks to noloop table Greg Kroah-Hartman
                     ` (12 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Alan Stern, Laurent Bigonville, Jiri Kosina

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 67ddbb3e6568fb1820b2cc45b00c50702b114801 upstream.

This patch (as1603) adds a NOGET quirk for the Eaton Ellipse MAX UPS
device.  (The USB IDs were already present in hid-ids.h, apparently
under a different name.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Laurent Bigonville <l.bigonville@edpnet.be>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hid/usbhid/hid-quirks.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -70,6 +70,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },



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

* [ 096/108] Input: i8042 - add Gigabyte T1005 series netbooks to noloop table
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (93 preceding siblings ...)
  2012-09-12 23:29   ` [ 095/108] HID: add NOGET quirk for Eaton Ellipse MAX UPS Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 097/108] UBI: fix a horrible memory deallocation bug Greg Kroah-Hartman
                     ` (11 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Dmitry Torokhov

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

commit 7b125b94ca16b7e618c6241cb02c4c8060cea5e3 upstream.

They all define their chassis type as "Other" and therefore are not
categorized as "laptops" by the driver, which tries to perform AUX IRQ
delivery test which fails and causes touchpad not working.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42620
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/serio/i8042-x86ia64io.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -177,6 +177,20 @@ static const struct dmi_system_id __init
 		},
 	},
 	{
+		/* Gigabyte T1005 - defines wrong chassis type ("Other") */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
+		},
+	},
+	{
+		/* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
+		},
+	},
+	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),



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

* [ 097/108] UBI: fix a horrible memory deallocation bug
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (94 preceding siblings ...)
  2012-09-12 23:29   ` [ 096/108] Input: i8042 - add Gigabyte T1005 series netbooks to noloop table Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 098/108] drm/vmwgfx: add MODULE_DEVICE_TABLE so vmwgfx loads at boot Greg Kroah-Hartman
                     ` (10 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Richard Genoud, Artem Bityutskiy

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 78b495c39add820ab66ab897af9bd77a5f2e91f6 upstream.

UBI was mistakingly using 'kfree()' instead of 'kmem_cache_free()' when
freeing "attach eraseblock" structures in vtbl.c. Thankfully, this happened
only when we were doing auto-format, so many systems were unaffected. However,
there are still many users affected.

It is strange, but the system did not crash and nothing bad happened when
the SLUB memory allocator was used. However, in case of SLOB we observed an
crash right away.

This problem was introduced in 2.6.39 by commit
"6c1e875 UBI: add slab cache for ubi_scan_leb objects"

A note for stable trees:
  Because variable were renamed, this won't cleanly apply to older kernels.
  Changing names like this should help:
	1. ai -> si
	2. aeb_slab_cache -> seb_slab_cache
	3. new_aeb -> new_seb

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Tested-by: Richard Genoud <richard.genoud@gmail.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/ubi/vtbl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -340,7 +340,7 @@ retry:
 	 * of this LEB as it will be deleted and freed in 'ubi_add_to_av()'.
 	 */
 	err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, vid_hdr, 0);
-	kfree(new_aeb);
+	kmem_cache_free(ai->aeb_slab_cache, new_aeb);
 	ubi_free_vid_hdr(ubi, vid_hdr);
 	return err;
 
@@ -353,7 +353,7 @@ write_error:
 		list_add(&new_aeb->u.list, &ai->erase);
 		goto retry;
 	}
-	kfree(new_aeb);
+	kmem_cache_free(ai->aeb_slab_cache, new_aeb);
 out_free:
 	ubi_free_vid_hdr(ubi, vid_hdr);
 	return err;



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

* [ 098/108] drm/vmwgfx: add MODULE_DEVICE_TABLE so vmwgfx loads at boot
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (95 preceding siblings ...)
  2012-09-12 23:29   ` [ 097/108] UBI: fix a horrible memory deallocation bug Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 099/108] OMAPFB: fix framebuffer console colors Greg Kroah-Hartman
                     ` (9 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Jakob Bornecrantz, Dave Airlie

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Dave Airlie <airlied@redhat.com>

commit c4903429a92be60e6fe59868924a65eca4cd1a38 upstream.

This will cause udev to load vmwgfx instead of waiting for X
to do it.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -182,6 +182,7 @@ static struct pci_device_id vmw_pci_id_l
 	{0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
 	{0, 0, 0}
 };
+MODULE_DEVICE_TABLE(pci, vmw_pci_id_list);
 
 static int enable_fbdev;
 



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

* [ 099/108] OMAPFB: fix framebuffer console colors
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (96 preceding siblings ...)
  2012-09-12 23:29   ` [ 098/108] drm/vmwgfx: add MODULE_DEVICE_TABLE so vmwgfx loads at boot Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 100/108] e1000e: DoS while TSO enabled caused by link partner with small MSS Greg Kroah-Hartman
                     ` (8 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Grazvydas Ignotas, Tomi Valkeinen, Florian Tobias Schandinat

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Grazvydas Ignotas <notasas@gmail.com>

commit c1c52848cef52e157468b8879fc3cae23b6f3a99 upstream.

omapfb does not currently set pseudo palette correctly for color depths
above 16bpp, making red text invisible, command like
  echo -e '\e[0;31mRED' > /dev/tty1
will display nothing on framebuffer console in 24bpp mode.
This is because temporary variable is declared incorrectly, fix it.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/video/omap2/omapfb/omapfb-main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1188,7 +1188,7 @@ static int _setcolreg(struct fb_info *fb
 			break;
 
 		if (regno < 16) {
-			u16 pal;
+			u32 pal;
 			pal = ((red >> (16 - var->red.length)) <<
 					var->red.offset) |
 				((green >> (16 - var->green.length)) <<



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

* [ 100/108] e1000e: DoS while TSO enabled caused by link partner with small MSS
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (97 preceding siblings ...)
  2012-09-12 23:29   ` [ 099/108] OMAPFB: fix framebuffer console colors Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 101/108] PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts Greg Kroah-Hartman
                     ` (7 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Ben Hutchings, Bruce Allan, Aaron Brown, Jeff Kirsher,
	David S. Miller

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Bruce Allan <bruce.w.allan@intel.com>

commit d821a4c4d11ad160925dab2bb009b8444beff484 upstream.

With a low enough MSS on the link partner and TSO enabled locally, the
networking stack can periodically send a very large (e.g.  64KB) TCP
message for which the driver will attempt to use more Tx descriptors than
are available by default in the Tx ring.  This is due to a workaround in
the code that imposes a limit of only 4 MSS-sized segments per descriptor
which appears to be a carry-over from the older e1000 driver and may be
applicable only to some older PCI or PCIx parts which are not supported in
e1000e.  When the driver gets a message that is too large to fit across the
configured number of Tx descriptors, it stops the upper stack from queueing
any more and gets stuck in this state.  After a timeout, the upper stack
assumes the adapter is hung and calls the driver to reset it.

Remove the unnecessary limitation of using up to only 4 MSS-sized segments
per Tx descriptor, and put in a hard failure test to catch when attempting
to check for message sizes larger than would fit in the whole Tx ring.
Refactor the remaining logic that limits the size of data per Tx descriptor
from a seemingly arbitrary 8KB to a limit based on the dynamic size of the
Tx packet buffer as described in the hardware specification.

Also, fix the logic in the check for space in the Tx ring for the next
largest possible packet after the current one has been successfully queued
for transmit, and use the appropriate defines for default ring sizes in
e1000_probe instead of magic values.

This issue goes back to the introduction of e1000e in 2.6.24 when it was
split off from e1000.

Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/intel/e1000e/e1000.h  |    1 
 drivers/net/ethernet/intel/e1000e/netdev.c |   48 +++++++++++++----------------
 2 files changed, 24 insertions(+), 25 deletions(-)

--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -310,6 +310,7 @@ struct e1000_adapter {
 	 */
 	struct e1000_ring *tx_ring /* One per active queue */
 						____cacheline_aligned_in_smp;
+	u32 tx_fifo_limit;
 
 	struct napi_struct napi;
 
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3477,6 +3477,15 @@ void e1000e_reset(struct e1000_adapter *
 	}
 
 	/*
+	 * Alignment of Tx data is on an arbitrary byte boundary with the
+	 * maximum size per Tx descriptor limited only to the transmit
+	 * allocation of the packet buffer minus 96 bytes with an upper
+	 * limit of 24KB due to receive synchronization limitations.
+	 */
+	adapter->tx_fifo_limit = min_t(u32, ((er32(PBA) >> 16) << 10) - 96,
+				       24 << 10);
+
+	/*
 	 * Disable Adaptive Interrupt Moderation if 2 full packets cannot
 	 * fit in receive buffer.
 	 */
@@ -4745,12 +4754,9 @@ static bool e1000_tx_csum(struct e1000_r
 	return 1;
 }
 
-#define E1000_MAX_PER_TXD	8192
-#define E1000_MAX_TXD_PWR	12
-
 static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
 			unsigned int first, unsigned int max_per_txd,
-			unsigned int nr_frags, unsigned int mss)
+			unsigned int nr_frags)
 {
 	struct e1000_adapter *adapter = tx_ring->adapter;
 	struct pci_dev *pdev = adapter->pdev;
@@ -4983,20 +4989,19 @@ static int __e1000_maybe_stop_tx(struct
 
 static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size)
 {
+	BUG_ON(size > tx_ring->count);
+
 	if (e1000_desc_unused(tx_ring) >= size)
 		return 0;
 	return __e1000_maybe_stop_tx(tx_ring, size);
 }
 
-#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1)
 static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 				    struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	struct e1000_ring *tx_ring = adapter->tx_ring;
 	unsigned int first;
-	unsigned int max_per_txd = E1000_MAX_PER_TXD;
-	unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
 	unsigned int tx_flags = 0;
 	unsigned int len = skb_headlen(skb);
 	unsigned int nr_frags;
@@ -5016,18 +5021,8 @@ static netdev_tx_t e1000_xmit_frame(stru
 	}
 
 	mss = skb_shinfo(skb)->gso_size;
-	/*
-	 * The controller does a simple calculation to
-	 * make sure there is enough room in the FIFO before
-	 * initiating the DMA for each buffer.  The calc is:
-	 * 4 = ceil(buffer len/mss).  To make sure we don't
-	 * overrun the FIFO, adjust the max buffer len if mss
-	 * drops.
-	 */
 	if (mss) {
 		u8 hdr_len;
-		max_per_txd = min(mss << 2, max_per_txd);
-		max_txd_pwr = fls(max_per_txd) - 1;
 
 		/*
 		 * TSO Workaround for 82571/2/3 Controllers -- if skb->data
@@ -5057,12 +5052,12 @@ static netdev_tx_t e1000_xmit_frame(stru
 		count++;
 	count++;
 
-	count += TXD_USE_COUNT(len, max_txd_pwr);
+	count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
 
 	nr_frags = skb_shinfo(skb)->nr_frags;
 	for (f = 0; f < nr_frags; f++)
-		count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]),
-				       max_txd_pwr);
+		count += DIV_ROUND_UP(skb_frag_size(&skb_shinfo(skb)->frags[f]),
+				      adapter->tx_fifo_limit);
 
 	if (adapter->hw.mac.tx_pkt_filtering)
 		e1000_transfer_dhcp_info(adapter, skb);
@@ -5104,15 +5099,18 @@ static netdev_tx_t e1000_xmit_frame(stru
 		tx_flags |= E1000_TX_FLAGS_NO_FCS;
 
 	/* if count is 0 then mapping error has occurred */
-	count = e1000_tx_map(tx_ring, skb, first, max_per_txd, nr_frags, mss);
+	count = e1000_tx_map(tx_ring, skb, first, adapter->tx_fifo_limit,
+			     nr_frags);
 	if (count) {
 		skb_tx_timestamp(skb);
 
 		netdev_sent_queue(netdev, skb->len);
 		e1000_tx_queue(tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
-		e1000_maybe_stop_tx(tx_ring, MAX_SKB_FRAGS + 2);
-
+		e1000_maybe_stop_tx(tx_ring,
+				    (MAX_SKB_FRAGS *
+				     DIV_ROUND_UP(PAGE_SIZE,
+						  adapter->tx_fifo_limit) + 2));
 	} else {
 		dev_kfree_skb_any(skb);
 		tx_ring->buffer_info[first].time_stamp = 0;
@@ -6284,8 +6282,8 @@ static int __devinit e1000_probe(struct
 	adapter->hw.phy.autoneg_advertised = 0x2f;
 
 	/* ring size defaults */
-	adapter->rx_ring->count = 256;
-	adapter->tx_ring->count = 256;
+	adapter->rx_ring->count = E1000_DEFAULT_RXD;
+	adapter->tx_ring->count = E1000_DEFAULT_TXD;
 
 	/*
 	 * Initial Wake on LAN setting - If APM wake is enabled in



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

* [ 101/108] PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (98 preceding siblings ...)
  2012-09-12 23:29   ` [ 100/108] e1000e: DoS while TSO enabled caused by link partner with small MSS Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 102/108] xen: Use correct masking in xen_swiotlb_alloc_coherent Greg Kroah-Hartman
                     ` (6 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Fengguang Wu, Mel Gorman, James Bottomley

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mel Gorman <mgorman@suse.de>

commit bba3d8c3b3c0f2123be5bc687d1cddc13437c923 upstream.

The following build error occured during a parisc build with
swap-over-NFS patches applied.

net/core/sock.c:274:36: error: initializer element is not constant
net/core/sock.c:274:36: error: (near initialization for 'memalloc_socks')
net/core/sock.c:274:36: error: initializer element is not constant

Dave Anglin says:
> Here is the line in sock.i:
>
> struct static_key memalloc_socks = ((struct static_key) { .enabled =
> ((atomic_t) { (0) }) });

The above line contains two compound literals.  It also uses a designated
initializer to initialize the field enabled.  A compound literal is not a
constant expression.

The location of the above statement isn't fully clear, but if a compound
literal occurs outside the body of a function, the initializer list must
consist of constant expressions.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/parisc/include/asm/atomic.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -141,7 +141,7 @@ static __inline__ int __atomic_add_unles
 
 #define atomic_sub_and_test(i,v)	(atomic_sub_return((i),(v)) == 0)
 
-#define ATOMIC_INIT(i)	((atomic_t) { (i) })
+#define ATOMIC_INIT(i)	{ (i) }
 
 #define smp_mb__before_atomic_dec()	smp_mb()
 #define smp_mb__after_atomic_dec()	smp_mb()
@@ -150,7 +150,7 @@ static __inline__ int __atomic_add_unles
 
 #ifdef CONFIG_64BIT
 
-#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
+#define ATOMIC64_INIT(i) { (i) }
 
 static __inline__ s64
 __atomic64_add_return(s64 i, atomic64_t *v)



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

* [ 102/108] xen: Use correct masking in xen_swiotlb_alloc_coherent.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (99 preceding siblings ...)
  2012-09-12 23:29   ` [ 101/108] PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 103/108] xen/p2m: Fix one-off error in checking the P2M tree directory Greg Kroah-Hartman
                     ` (5 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Ronny Hegewald, Stefano Panella, David Vrabel,
	Konrad Rzeszutek Wilk

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Ronny Hegewald <ronny.hegewald@online.de>

commit b5031ed1be0aa419250557123633453753181643 upstream.

When running 32-bit pvops-dom0 and a driver tries to allocate a coherent
DMA-memory the xen swiotlb-implementation returned memory beyond 4GB.

The underlaying reason is that if the supplied driver passes in a
DMA_BIT_MASK(64) ( hwdev->coherent_dma_mask is set to 0xffffffffffffffff)
our dma_mask will be u64 set to 0xffffffffffffffff even if we set it to
DMA_BIT_MASK(32) previously. Meaning we do not reset the upper bits.
By using the dma_alloc_coherent_mask function - it does the proper casting
and we get 0xfffffffff.

This caused not working sound on a system with 4 GB and a 64-bit
compatible sound-card with sets the DMA-mask to 64bit.

On bare-metal and the forward-ported xen-dom0 patches from OpenSuse a coherent
DMA-memory is always allocated inside the 32-bit address-range by calling
dma_alloc_coherent_mask.

This patch adds the same functionality to xen swiotlb and is a rebase of the
original patch from Ronny Hegewald which never got upstream b/c the
underlaying reason was not understood until now.

The original email with the original patch is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-02/msg00038.html
the original thread from where the discussion started is in:
http://old-list-archives.xen.org/archives/html/xen-devel/2010-01/msg00928.html

Signed-off-by: Ronny Hegewald <ronny.hegewald@online.de>
Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Acked-By: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/swiotlb-xen.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -232,7 +232,7 @@ xen_swiotlb_alloc_coherent(struct device
 		return ret;
 
 	if (hwdev && hwdev->coherent_dma_mask)
-		dma_mask = hwdev->coherent_dma_mask;
+		dma_mask = dma_alloc_coherent_mask(hwdev, flags);
 
 	phys = virt_to_phys(ret);
 	dev_addr = xen_phys_to_bus(phys);



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

* [ 103/108] xen/p2m: Fix one-off error in checking the P2M tree directory.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (100 preceding siblings ...)
  2012-09-12 23:29   ` [ 102/108] xen: Use correct masking in xen_swiotlb_alloc_coherent Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 104/108] xen/pciback: Fix proper FLR steps Greg Kroah-Hartman
                     ` (4 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Konrad Rzeszutek Wilk

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 50e900417b8096939d12a46848f965e27a905e36 upstream.

We would traverse the full P2M top directory (from 0->MAX_DOMAIN_PAGES
inclusive) when trying to figure out whether we can re-use some of the
P2M middle leafs.

Which meant that if the kernel was compiled with MAX_DOMAIN_PAGES=512
we would try to use the 512th entry. Fortunately for us the p2m_top_index
has a check for this:

 BUG_ON(pfn >= MAX_P2M_PFN);

which we hit and saw this:

(XEN) domain_crash_sync called from entry.S
(XEN) Domain 0 (vcpu#0) crashed on cpu#0:
(XEN) ----[ Xen-4.1.2-OVM  x86_64  debug=n  Tainted:    C ]----
(XEN) CPU:    0
(XEN) RIP:    e033:[<ffffffff819cadeb>]
(XEN) RFLAGS: 0000000000000212   EM: 1   CONTEXT: pv guest
(XEN) rax: ffffffff81db5000   rbx: ffffffff81db4000   rcx: 0000000000000000
(XEN) rdx: 0000000000480211   rsi: 0000000000000000   rdi: ffffffff81db4000
(XEN) rbp: ffffffff81793db8   rsp: ffffffff81793d38   r8:  0000000008000000
(XEN) r9:  4000000000000000   r10: 0000000000000000   r11: ffffffff81db7000
(XEN) r12: 0000000000000ff8   r13: ffffffff81df1ff8   r14: ffffffff81db6000
(XEN) r15: 0000000000000ff8   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 0000000661795000   cr2: 0000000000000000

Fixes-Oracle-Bug: 14570662
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/p2m.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -599,7 +599,7 @@ bool __init early_can_reuse_p2m_middle(u
 	if (p2m_index(set_pfn))
 		return false;
 
-	for (pfn = 0; pfn <= MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) {
+	for (pfn = 0; pfn < MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) {
 		topidx = p2m_top_index(pfn);
 
 		if (!p2m_top[topidx])



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

* [ 104/108] xen/pciback: Fix proper FLR steps.
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (101 preceding siblings ...)
  2012-09-12 23:29   ` [ 103/108] xen/p2m: Fix one-off error in checking the P2M tree directory Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 105/108] uprobes: Fix mmap_region()s mm->mm_rb corruption if uprobe_mmap() fails Greg Kroah-Hartman
                     ` (3 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg KH, Ren, Yongjie, Konrad Rzeszutek Wilk

From: Greg KH <gregkh@linuxfoundation.org>

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

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

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

commit 80ba77dfbce85f2d1be54847de3c866de1b18a9a upstream.

When we do FLR and save PCI config we did it in the wrong order.
The end result was that if a PCI device was unbind from
its driver, then binded to xen-pciback, and then back to its
driver we would get:

> lspci -s 04:00.0
04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
13:42:12 # 4 :~/
> echo "0000:04:00.0" > /sys/bus/pci/drivers/pciback/unbind
> modprobe e1000e
e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
e1000e 0000:04:00.0: Disabling ASPM L0s L1
e1000e 0000:04:00.0: enabling device (0000 -> 0002)
xen: registering gsi 48 triggering 0 polarity 1
Already setup the GSI :48
e1000e 0000:04:00.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
e1000e: probe of 0000:04:00.0 failed with error -2

This fixes it by first saving the PCI configuration space, then
doing the FLR.

Reported-by: Ren, Yongjie <yongjie.ren@intel.com>
Reported-and-Tested-by: Tobias Geiger <tobias.geiger@vido.info>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/xen-pciback/pci_stub.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -353,16 +353,16 @@ static int __devinit pcistub_init_device
 	if (err)
 		goto config_release;
 
-	dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
-	__pci_reset_function_locked(dev);
-
 	/* We need the device active to save the state. */
 	dev_dbg(&dev->dev, "save state of device\n");
 	pci_save_state(dev);
 	dev_data->pci_saved_state = pci_store_saved_state(dev);
 	if (!dev_data->pci_saved_state)
 		dev_err(&dev->dev, "Could not store PCI conf saved state!\n");
-
+	else {
+		dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
+		__pci_reset_function_locked(dev);
+	}
 	/* Now disable the device (this also ensures some private device
 	 * data is setup before we export)
 	 */



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

* [ 105/108] uprobes: Fix mmap_region()s mm->mm_rb corruption if uprobe_mmap() fails
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (102 preceding siblings ...)
  2012-09-12 23:29   ` [ 104/108] xen/pciback: Fix proper FLR steps Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 106/108] x86, microcode, AMD: Fix broken ucode patch size check Greg Kroah-Hartman
                     ` (2 subsequent siblings)
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Oleg Nesterov, Srikar Dronamraju, Anton Arapov,
	William Cohen, Linus Torvalds, Ingo Molnar

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Oleg Nesterov <oleg@redhat.com>

commit c7a3a88c938fbe3d70c2278e082b80eb830d1c58 upstream.

This patch fixes:

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

If mmap_region()->uprobe_mmap() fails, unmap_and_free_vma path
does unmap_region() but does not remove the soon-to-be-freed vma
from rb tree. Actually there are more problems but this is how
William noticed this bug.

Perhaps we could do do_munmap() + return in this case, but in
fact it is simply wrong to abort if uprobe_mmap() fails. Until
at least we move the !UPROBE_COPY_INSN code from
install_breakpoint() to uprobe_register().

For example, uprobe_mmap()->install_breakpoint() can fail if the
probed insn is not supported (remember, uprobe_register()
succeeds if nobody mmaps inode/offset), mmap() should not fail
in this case.

dup_mmap()->uprobe_mmap() is wrong too by the same reason,
fork() can race with uprobe_register() and fail for no reason if
it wins the race and does install_breakpoint() first.

And, if nothing else, both mmap_region() and dup_mmap() return
success if uprobe_mmap() fails. Change them to ignore the error
code from uprobe_mmap().

Reported-and-tested-by: William Cohen <wcohen@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20120819171042.GB26957@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/fork.c |    4 ++--
 mm/mmap.c     |    5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -459,8 +459,8 @@ static int dup_mmap(struct mm_struct *mm
 		if (retval)
 			goto out;
 
-		if (file && uprobe_mmap(tmp))
-			goto out;
+		if (file)
+			uprobe_mmap(tmp);
 	}
 	/* a new mm has just been created */
 	arch_dup_mmap(oldmm, mm);
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1355,9 +1355,8 @@ out:
 	} else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
 		make_pages_present(addr, addr + len);
 
-	if (file && uprobe_mmap(vma))
-		/* matching probes but cannot insert */
-		goto unmap_and_free_vma;
+	if (file)
+		uprobe_mmap(vma);
 
 	return addr;
 



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

* [ 106/108] x86, microcode, AMD: Fix broken ucode patch size check
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (103 preceding siblings ...)
  2012-09-12 23:29   ` [ 105/108] uprobes: Fix mmap_region()s mm->mm_rb corruption if uprobe_mmap() fails Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 107/108] dccp: check ccid before dereferencing Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 108/108] hwmon: (asus_atk0110) Add quirk for Asus M5A78L Greg Kroah-Hartman
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Andreas Herrmann, Borislav Petkov, H. Peter Anvin

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Andreas Herrmann <andreas.herrmann3@amd.com>

commit 36bf50d7697be18c6bfd0401e037df10bff1e573 upstream.

This issue was recently observed on an AMD C-50 CPU where a patch of
maximum size was applied.

Commit be62adb49294 ("x86, microcode, AMD: Simplify ucode verification")
added current_size in get_matching_microcode(). This is calculated as
size of the ucode patch + 8 (ie. size of the header). Later this is
compared against the maximum possible ucode patch size for a CPU family.
And of course this fails if the patch has already maximum size.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Link: http://lkml.kernel.org/r/1344361461-10076-1-git-send-email-bp@amd64.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/microcode_amd.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -143,11 +143,12 @@ static int get_matching_microcode(int cp
 				  unsigned int *current_size)
 {
 	struct microcode_header_amd *mc_hdr;
-	unsigned int actual_size;
+	unsigned int actual_size, patch_size;
 	u16 equiv_cpu_id;
 
 	/* size of the current patch we're staring at */
-	*current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
+	patch_size = *(u32 *)(ucode_ptr + 4);
+	*current_size = patch_size + SECTION_HDR_SIZE;
 
 	equiv_cpu_id = find_equiv_id();
 	if (!equiv_cpu_id)
@@ -174,7 +175,7 @@ static int get_matching_microcode(int cp
 	/*
 	 * now that the header looks sane, verify its size
 	 */
-	actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
+	actual_size = verify_ucode_size(cpu, patch_size, leftover_size);
 	if (!actual_size)
 		return 0;
 



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

* [ 107/108] dccp: check ccid before dereferencing
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (104 preceding siblings ...)
  2012-09-12 23:29   ` [ 106/108] x86, microcode, AMD: Fix broken ucode patch size check Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  2012-09-12 23:29   ` [ 108/108] hwmon: (asus_atk0110) Add quirk for Asus M5A78L Greg Kroah-Hartman
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Mathias Krause, Gerrit Renker, David S. Miller

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Mathias Krause <minipli@googlemail.com>

commit 276bdb82dedb290511467a5a4fdbe9f0b52dce6f upstream.

ccid_hc_rx_getsockopt() and ccid_hc_tx_getsockopt() might be called with
a NULL ccid pointer leading to a NULL pointer dereference. This could
lead to a privilege escalation if the attacker is able to map page 0 and
prepare it with a fake ccid_ops pointer.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/dccp/ccid.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/dccp/ccid.h
+++ b/net/dccp/ccid.h
@@ -246,7 +246,7 @@ static inline int ccid_hc_rx_getsockopt(
 					u32 __user *optval, int __user *optlen)
 {
 	int rc = -ENOPROTOOPT;
-	if (ccid->ccid_ops->ccid_hc_rx_getsockopt != NULL)
+	if (ccid != NULL && ccid->ccid_ops->ccid_hc_rx_getsockopt != NULL)
 		rc = ccid->ccid_ops->ccid_hc_rx_getsockopt(sk, optname, len,
 						 optval, optlen);
 	return rc;
@@ -257,7 +257,7 @@ static inline int ccid_hc_tx_getsockopt(
 					u32 __user *optval, int __user *optlen)
 {
 	int rc = -ENOPROTOOPT;
-	if (ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
+	if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
 		rc = ccid->ccid_ops->ccid_hc_tx_getsockopt(sk, optname, len,
 						 optval, optlen);
 	return rc;



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

* [ 108/108] hwmon: (asus_atk0110) Add quirk for Asus M5A78L
  2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
                     ` (105 preceding siblings ...)
  2012-09-12 23:29   ` [ 107/108] dccp: check ccid before dereferencing Greg Kroah-Hartman
@ 2012-09-12 23:29   ` Greg Kroah-Hartman
  106 siblings, 0 replies; 112+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 23:29 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg KH, Göran Uddeborg, Luca Tettamanti, Guenter Roeck

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Luca Tettamanti <kronos.it@gmail.com>

commit 43ca6cb28c871f2fbad10117b0648e5ae3b0f638 upstream.

The old interface is bugged and reads the wrong sensor when retrieving
the reading for the chassis fan (it reads the CPU sensor); the new
interface works fine.

Reported-by: Göran Uddeborg <goeran@uddeborg.se>
Tested-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwmon/asus_atk0110.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -34,6 +34,12 @@ static const struct dmi_system_id __init
 		.matches = {
 			DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58")
 		}
+	}, {
+		/* Old interface reads the same sensor for fan0 and fan1 */
+		.ident = "Asus M5A78L",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_NAME, "M5A78L")
+		}
 	},
 	{ }
 };



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

* Re: [ 042/108] NFS: Alias the nfs module to nfs4
  2012-09-12 23:28   ` [ 042/108] NFS: Alias the nfs module to nfs4 Greg Kroah-Hartman
@ 2012-09-13  1:08     ` Josh Boyer
  2012-09-13  1:24       ` Myklebust, Trond
  0 siblings, 1 reply; 112+ messages in thread
From: Josh Boyer @ 2012-09-13  1:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, Bryan Schumaker, Trond Myklebust, Ben Hutchings

On Wed, Sep 12, 2012 at 7:28 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> From: Greg KH <gregkh@linuxfoundation.org>
>
> 3.5-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> commit 425e776d93a7a5070b77d4f458a5bab0f924652c upstream.
>
> This allows distros to remove the line from their modprobe
> configuration.
>
> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> [bwh: Backported to 3.2: adjust context]
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Could someone elaborate why this is acceptable now, while it wasn't
during the timeframe I sent an identical patch months ago?

http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/02064.html

We had some trouble in Fedora 17 because of this and would up with
patches to nfs-utils because the modalias was NAKed.  If we're bringing
it into stable (and upstream) at this point, it would be good to know
what changed so I can go and undo what we did because I was told no.

Please don't get me wrong, I'm all for simplicity.  I'm just perhaps
so simple that the brief changelog confuses me because it doesn't
actually describe why the original solution wasn't followed up on.

josh

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

* Re: [ 042/108] NFS: Alias the nfs module to nfs4
  2012-09-13  1:08     ` Josh Boyer
@ 2012-09-13  1:24       ` Myklebust, Trond
  2012-09-13  2:35         ` Josh Boyer
  0 siblings, 1 reply; 112+ messages in thread
From: Myklebust, Trond @ 2012-09-13  1:24 UTC (permalink / raw)
  To: Josh Boyer
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Schumaker, Bryan,
	Ben Hutchings

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2096 bytes --]

On Wed, 2012-09-12 at 21:08 -0400, Josh Boyer wrote:
> On Wed, Sep 12, 2012 at 7:28 PM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > From: Greg KH <gregkh@linuxfoundation.org>
> >
> > 3.5-stable review patch.  If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > commit 425e776d93a7a5070b77d4f458a5bab0f924652c upstream.
> >
> > This allows distros to remove the line from their modprobe
> > configuration.
> >
> > Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> > Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> > [bwh: Backported to 3.2: adjust context]
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Could someone elaborate why this is acceptable now, while it wasn't
> during the timeframe I sent an identical patch months ago?
> 
> http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/02064.html
> 
> We had some trouble in Fedora 17 because of this and would up with
> patches to nfs-utils because the modalias was NAKed.  If we're bringing
> it into stable (and upstream) at this point, it would be good to know
> what changed so I can go and undo what we did because I was told no.
> 
> Please don't get me wrong, I'm all for simplicity.  I'm just perhaps
> so simple that the brief changelog confuses me because it doesn't
> actually describe why the original solution wasn't followed up on.

Linux-3.6 converts NFSv2/v3/v4 into modules, and so modprobe.conf
entries of the form

  alias nfs4 nfs

will now fail to ensure that 'mount -t nfs4 ...' works. In order to
facilitate the task for the distros when dealing with kernels >= 3.5.x,
we've added the automatic module alias so that they can remove the
hard-coded aliases in modprobe.conf while remaining backward-compatible.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [ 042/108] NFS: Alias the nfs module to nfs4
  2012-09-13  1:24       ` Myklebust, Trond
@ 2012-09-13  2:35         ` Josh Boyer
  0 siblings, 0 replies; 112+ messages in thread
From: Josh Boyer @ 2012-09-13  2:35 UTC (permalink / raw)
  To: Myklebust, Trond
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Schumaker, Bryan,
	Ben Hutchings

On Wed, Sep 12, 2012 at 9:24 PM, Myklebust, Trond
<Trond.Myklebust@netapp.com> wrote:
> On Wed, 2012-09-12 at 21:08 -0400, Josh Boyer wrote:
>> On Wed, Sep 12, 2012 at 7:28 PM, Greg Kroah-Hartman
>> <gregkh@linuxfoundation.org> wrote:
>> > From: Greg KH <gregkh@linuxfoundation.org>
>> >
>> > 3.5-stable review patch.  If anyone has any objections, please let me know.
>> >
>> > ------------------
>> >
>> > commit 425e776d93a7a5070b77d4f458a5bab0f924652c upstream.
>> >
>> > This allows distros to remove the line from their modprobe
>> > configuration.
>> >
>> > Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
>> > Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
>> > [bwh: Backported to 3.2: adjust context]
>> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>
>> Could someone elaborate why this is acceptable now, while it wasn't
>> during the timeframe I sent an identical patch months ago?
>>
>> http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/02064.html
>>
>> We had some trouble in Fedora 17 because of this and would up with
>> patches to nfs-utils because the modalias was NAKed.  If we're bringing
>> it into stable (and upstream) at this point, it would be good to know
>> what changed so I can go and undo what we did because I was told no.
>>
>> Please don't get me wrong, I'm all for simplicity.  I'm just perhaps
>> so simple that the brief changelog confuses me because it doesn't
>> actually describe why the original solution wasn't followed up on.
>
> Linux-3.6 converts NFSv2/v3/v4 into modules, and so modprobe.conf
> entries of the form
>
>   alias nfs4 nfs
>
> will now fail to ensure that 'mount -t nfs4 ...' works. In order to

Ah, ok.  That makes sense.

> facilitate the task for the distros when dealing with kernels >= 3.5.x,
> we've added the automatic module alias so that they can remove the
> hard-coded aliases in modprobe.conf while remaining backward-compatible.

This is queued for 3.5.x, 3.4.x, 3.2.x, and 3.0.x.  That's probably OK,
but it's a slightly broader scope that what you mentioned above.

At any rate, I'm glad to see this go in.  It will make things easier
going forward.  Thanks for the reply.

josh

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

end of thread, other threads:[~2012-09-13  2:35 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 23:28 [ 000/108] 3.5.4-stable review Greg KH
2012-09-12 23:27 ` [ 001/108] USB: vt6656: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
2012-09-12 23:28   ` [ 002/108] USB: emi62: " Greg Kroah-Hartman
2012-09-12 23:28   ` [ 003/108] ALSA: hda - fix Copyright debug message Greg Kroah-Hartman
2012-09-12 23:28   ` [ 004/108] ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_VFPv3 is enabled Greg Kroah-Hartman
2012-09-12 23:28   ` [ 005/108] ARM: 7487/1: mm: avoid setting nG bit for user mappings that arent present Greg Kroah-Hartman
2012-09-12 23:28   ` [ 006/108] ARM: 7488/1: mm: use 5 bits for swapfile type encoding Greg Kroah-Hartman
2012-09-12 23:28   ` [ 007/108] ARM: 7489/1: errata: fix workaround for erratum #720789 on UP systems Greg Kroah-Hartman
2012-09-12 23:28   ` [ 008/108] ARM: OMAP2+: Fix dmtimer set source clock failure Greg Kroah-Hartman
2012-09-12 23:28   ` [ 009/108] ARM: S3C24XX: Add missing DMACH_DT_PROP Greg Kroah-Hartman
2012-09-12 23:28   ` [ 010/108] ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters Greg Kroah-Hartman
2012-09-12 23:28   ` [ 011/108] xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID Greg Kroah-Hartman
2012-09-12 23:28   ` [ 012/108] xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M Greg Kroah-Hartman
2012-09-12 23:28   ` [ 013/108] ARM: imx6: spin the cpu until hardware takes it down Greg Kroah-Hartman
2012-09-12 23:28   ` [ 014/108] ARM: imx: build pm-imx5 code only when PM is enabled Greg Kroah-Hartman
2012-09-12 23:28   ` [ 015/108] ARM: imx: select CPU_FREQ_TABLE when needed Greg Kroah-Hartman
2012-09-12 23:28   ` [ 016/108] ARM: imx: build i.MX6 functions only " Greg Kroah-Hartman
2012-09-12 23:28   ` [ 017/108] MIPS: pci-ar724x: avoid data bus error due to a missing PCIe module Greg Kroah-Hartman
2012-09-12 23:28   ` [ 018/108] ASoC: wm9712: Fix microphone source selection Greg Kroah-Hartman
2012-09-12 23:28   ` [ 019/108] ASoC: omap-mcbsp: Fix 6pin mux configuration Greg Kroah-Hartman
2012-09-12 23:28   ` [ 020/108] vfs: missed source of ->f_pos races Greg Kroah-Hartman
2012-09-12 23:28   ` [ 021/108] vfs: canonicalize create mode in build_open_flags() Greg Kroah-Hartman
2012-09-12 23:28   ` [ 022/108] alpha: fix fpu.h usage in userspace Greg Kroah-Hartman
2012-09-12 23:28   ` [ 023/108] alpha: Dont export SOCK_NONBLOCK to user space Greg Kroah-Hartman
2012-09-12 23:28   ` [ 024/108] USB: winbond: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
2012-09-12 23:28   ` [ 025/108] mm: hugetlbfs: correctly populate shared pmd Greg Kroah-Hartman
2012-09-12 23:28   ` [ 026/108] ALSA: hda - dont create dysfunctional mixer controls for ca0132 Greg Kroah-Hartman
2012-09-12 23:28   ` [ 027/108] ALSA: hda - Fix leftover codec->power_transition Greg Kroah-Hartman
2012-09-12 23:28   ` [ 028/108] target: fix NULL pointer dereference bug alloc_page() fails to get memory Greg Kroah-Hartman
2012-09-12 23:28   ` [ 029/108] NFSv3: Ensure that do_proc_get_root() reports errors correctly Greg Kroah-Hartman
2012-09-12 23:28   ` [ 030/108] pnfs: defer release of pages in layoutget Greg Kroah-Hartman
2012-09-12 23:28   ` [ 031/108] nfs: tear down caches in nfs_init_writepagecache when allocation fails Greg Kroah-Hartman
2012-09-12 23:28   ` [ 032/108] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done Greg Kroah-Hartman
2012-09-12 23:28   ` [ 033/108] NFS: Clear key construction data if the idmap upcall fails Greg Kroah-Hartman
2012-09-12 23:28   ` [ 034/108] NFS: return -ENOKEY when the upcall fails to map the name Greg Kroah-Hartman
2012-09-12 23:28   ` [ 035/108] nfsd4: fix security flavor of NFSv4.0 callback Greg Kroah-Hartman
2012-09-12 23:28   ` [ 036/108] UBIFS: fix crash on error path Greg Kroah-Hartman
2012-09-12 23:28   ` [ 037/108] UBIFS: fix complaints about too small debug buffer size Greg Kroah-Hartman
2012-09-12 23:28   ` [ 038/108] Bluetooth: Fix using NULL inquiry entry Greg Kroah-Hartman
2012-09-12 23:28   ` [ 039/108] Bluetooth: Fix using a NULL inquiry cache entry Greg Kroah-Hartman
2012-09-12 23:28   ` [ 040/108] Bluetooth: Set name_state to unknown when entry name is empty Greg Kroah-Hartman
2012-09-12 23:28   ` [ 041/108] Bluetooth: Fix legacy pairing with some devices Greg Kroah-Hartman
2012-09-12 23:28   ` [ 042/108] NFS: Alias the nfs module to nfs4 Greg Kroah-Hartman
2012-09-13  1:08     ` Josh Boyer
2012-09-13  1:24       ` Myklebust, Trond
2012-09-13  2:35         ` Josh Boyer
2012-09-12 23:28   ` [ 043/108] audit: dont free_chunk() after fsnotify_add_mark() Greg Kroah-Hartman
2012-09-12 23:28   ` [ 044/108] audit: fix refcounting in audit-tree Greg Kroah-Hartman
2012-09-12 23:28   ` [ 045/108] drm: stop vmgfx driver explosion Greg Kroah-Hartman
2012-09-12 23:28   ` [ 046/108] Revert "drm/radeon: fix bo creation retry path" Greg Kroah-Hartman
2012-09-12 23:28   ` [ 047/108] Btrfs: revert checksum error statistic which can cause a BUG() Greg Kroah-Hartman
2012-09-12 23:28   ` [ 048/108] svcrpc: fix BUG() in svc_tcp_clear_pages Greg Kroah-Hartman
2012-09-12 23:28   ` [ 049/108] svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping Greg Kroah-Hartman
2012-09-12 23:28   ` [ 050/108] svcrpc: sends on closed socket should stop immediately Greg Kroah-Hartman
2012-09-12 23:28   ` [ 051/108] cciss: fix incorrect scsi status reporting Greg Kroah-Hartman
2012-09-12 23:28   ` [ 052/108] ACPI: export symbol acpi_get_table_with_size Greg Kroah-Hartman
2012-09-12 23:28   ` [ 053/108] ath9k: stop btcoex on device suspend Greg Kroah-Hartman
2012-09-12 23:28   ` [ 054/108] ath9k: fix decrypt_error initialization in ath_rx_tasklet() Greg Kroah-Hartman
2012-09-12 23:28   ` [ 055/108] PCI: EHCI: Fix crash during hibernation on ASUS computers Greg Kroah-Hartman
2012-09-12 23:28   ` [ 056/108] gma500: Consider CRTC initially active Greg Kroah-Hartman
2012-09-12 23:28   ` [ 057/108] block: replace __getblk_slow misfix by grow_dev_page fix Greg Kroah-Hartman
2012-09-12 23:28   ` [ 058/108] jbd: dont write superblock when unmounting an ro filesystem Greg Kroah-Hartman
2012-09-12 23:28   ` [ 059/108] ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream Greg Kroah-Hartman
2012-09-12 23:28   ` [ 060/108] sched,cgroup: Fix up task_groups list Greg Kroah-Hartman
2012-09-12 23:28   ` [ 061/108] sched: fix divide by zero at {thread_group,task}_times Greg Kroah-Hartman
2012-09-12 23:29   ` [ 062/108] [media] uvcvideo: Reset the bytesused field when recycling an erroneous buffer Greg Kroah-Hartman
2012-09-12 23:29   ` [ 063/108] rapidio/tsi721: fix inbound doorbell interrupt handling Greg Kroah-Hartman
2012-09-12 23:29   ` [ 064/108] rapidio/tsi721: fix unused variable compiler warning Greg Kroah-Hartman
2012-09-12 23:29   ` [ 065/108] regulator: twl-regulator: fix up VINTANA1/VINTANA2 Greg Kroah-Hartman
2012-09-12 23:29   ` [ 066/108] x32: Use compat shims for {g,s}etsockopt Greg Kroah-Hartman
2012-09-12 23:29   ` [ 067/108] USB: spca506: remove __devinit* from the struct usb_device_id table Greg Kroah-Hartman
2012-09-12 23:29   ` [ 068/108] USB: jl2005bcd: " Greg Kroah-Hartman
2012-09-12 23:29   ` [ 069/108] USB: p54usb: " Greg Kroah-Hartman
2012-09-12 23:29   ` [ 070/108] USB: rtl8187: " Greg Kroah-Hartman
2012-09-12 23:29   ` [ 071/108] USB: smsusb: " Greg Kroah-Hartman
2012-09-12 23:29   ` [ 072/108] USB: CDC ACM: Fix NULL pointer dereference Greg Kroah-Hartman
2012-09-12 23:29   ` [ 073/108] ALSA: snd-usb: Fix URB cancellation at stream start Greg Kroah-Hartman
2012-09-12 23:29   ` [ 074/108] ALSA: snd-usb: use list_for_each_safe for endpoint resources Greg Kroah-Hartman
2012-09-12 23:29   ` [ 075/108] ALSA: snd-usb: restore delay information Greg Kroah-Hartman
2012-09-12 23:29   ` [ 076/108] ALSA: snd-usb: fix calls to next_packet_size Greg Kroah-Hartman
2012-09-12 23:29   ` [ 077/108] ALSA: snd-usb: fix cross-interface streaming devices Greg Kroah-Hartman
2012-09-12 23:29   ` [ 078/108] powerpc: Update DSCR on all CPUs when writing sysfs dscr_default Greg Kroah-Hartman
2012-09-12 23:29   ` [ 079/108] powerpc: Keep thread.dscr and thread.dscr_inherit in sync Greg Kroah-Hartman
2012-09-12 23:29   ` [ 080/108] powerpc: Fix DSCR inheritance in copy_thread() Greg Kroah-Hartman
2012-09-12 23:29   ` [ 081/108] powerpc: Restore correct DSCR in context switch Greg Kroah-Hartman
2012-09-12 23:29   ` [ 082/108] powerpc: Make sure IPI handlers see data written by IPI senders Greg Kroah-Hartman
2012-09-12 23:29   ` [ 083/108] Remove user-triggerable BUG from mpol_to_str Greg Kroah-Hartman
2012-09-12 23:29   ` [ 084/108] Fix order of arguments to compat_put_time[spec|val] Greg Kroah-Hartman
2012-09-12 23:29   ` [ 085/108] usbnet: fix deadlock in resume Greg Kroah-Hartman
2012-09-12 23:29   ` [ 086/108] SCSI: megaraid_sas: Move poll_aen_lock initializer Greg Kroah-Hartman
2012-09-12 23:29   ` [ 087/108] SCSI: scsi_lib: fix scsi_io_completions SG_IO error propagation Greg Kroah-Hartman
2012-09-12 23:29   ` [ 088/108] SCSI: mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value Greg Kroah-Hartman
2012-09-12 23:29   ` [ 089/108] SCSI: Fix Device not ready issue on mpt2sas Greg Kroah-Hartman
2012-09-12 23:29   ` [ 090/108] udf: Fix data corruption for files in ICB Greg Kroah-Hartman
2012-09-12 23:29   ` [ 091/108] ext3: Fix fdatasync() for files with only i_size changes Greg Kroah-Hartman
2012-09-12 23:29   ` [ 092/108] fuse: fix retrieve length Greg Kroah-Hartman
2012-09-12 23:29   ` [ 093/108] i2c-designware: Fix build error if CONFIG_I2C_DESIGNWARE_PLATFORM=y && CONFIG_I2C_DESIGNWARE_PCI=y Greg Kroah-Hartman
2012-09-12 23:29   ` [ 094/108] i2c-i801: Add Device IDs for Intel Lynx Point-LP PCH Greg Kroah-Hartman
2012-09-12 23:29   ` [ 095/108] HID: add NOGET quirk for Eaton Ellipse MAX UPS Greg Kroah-Hartman
2012-09-12 23:29   ` [ 096/108] Input: i8042 - add Gigabyte T1005 series netbooks to noloop table Greg Kroah-Hartman
2012-09-12 23:29   ` [ 097/108] UBI: fix a horrible memory deallocation bug Greg Kroah-Hartman
2012-09-12 23:29   ` [ 098/108] drm/vmwgfx: add MODULE_DEVICE_TABLE so vmwgfx loads at boot Greg Kroah-Hartman
2012-09-12 23:29   ` [ 099/108] OMAPFB: fix framebuffer console colors Greg Kroah-Hartman
2012-09-12 23:29   ` [ 100/108] e1000e: DoS while TSO enabled caused by link partner with small MSS Greg Kroah-Hartman
2012-09-12 23:29   ` [ 101/108] PARISC: Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts Greg Kroah-Hartman
2012-09-12 23:29   ` [ 102/108] xen: Use correct masking in xen_swiotlb_alloc_coherent Greg Kroah-Hartman
2012-09-12 23:29   ` [ 103/108] xen/p2m: Fix one-off error in checking the P2M tree directory Greg Kroah-Hartman
2012-09-12 23:29   ` [ 104/108] xen/pciback: Fix proper FLR steps Greg Kroah-Hartman
2012-09-12 23:29   ` [ 105/108] uprobes: Fix mmap_region()s mm->mm_rb corruption if uprobe_mmap() fails Greg Kroah-Hartman
2012-09-12 23:29   ` [ 106/108] x86, microcode, AMD: Fix broken ucode patch size check Greg Kroah-Hartman
2012-09-12 23:29   ` [ 107/108] dccp: check ccid before dereferencing Greg Kroah-Hartman
2012-09-12 23:29   ` [ 108/108] hwmon: (asus_atk0110) Add quirk for Asus M5A78L Greg Kroah-Hartman

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).