RE: [PATCH 1/1 v3] driver:mtd:spi-nor: Add Micron quad I/O support

2014-10-03 Thread bpqw
>> Signed-off-by: bean huo 

>I don't see anything obviously wrong.

>Acked-by: Marek Vasut 

Hi,Brian

How do you think about this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


lening bieden

2014-10-03 Thread DIAMOND SWISS LOAN COMPANY



Goede dag,
  
 We zijn Diamond Zwitserse lening bedrijf geven van leningen per post
advertentie. Wij bieden verschillende soorten leningen (korte en lange
termijn leningen, persoonlijke leningen, leningen aan bedrijven etc.) met
3% rente. We geven leningen aan mensen in nood niet, ongeacht hun locatie,
geslacht, burgerlijke staat, opleiding, status van de taak, maar moet een
wettelijke middelen van terugbetaling hebben. Onze leningen variëren
tussen 5.000,00 tot 10.000.000,00 Amerikaanse dollar of de euro of pond
met een looptijd van maximaal 20 jaar. Als u geïnteresseerd bent in meer
informatie, vul dan onderstaand formulier in en stuur deze naar ons
e-mailadres: diamondswissloan...@gmail.com

Gelieve in te vullen:

naam:

Adres:

Leeftijd:

Geslacht:

Contact-Phone:

Beroep:

Maandelijks inkomen:

Het benodigde bedrag van de lening:

Duur van de lening:

Het doel van de lening:

land:

Postcode:


"Wij tonen u een betere manier om uw financiële vrijheid"

Met vriendelijke groet,
Mr Diamond Peters (algemeen directeur).
De heer Bill Anthony (Marketing Manager).

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [x86, locking/rwlocks, btrfs] INFO: rcu_sched self-detected stall on CPU

2014-10-03 Thread Waiman Long

On 10/03/2014 09:33 AM, Fengguang Wu wrote:

Hi Waiman,

FYI, we noticed the below changes on commit

bd01ec1a13f9a327950c8e3080096446c7804753 ("x86, locking/rwlocks: Enable qrwlocks on 
x86")

+--+++
|  | 70af2f8a4f | bd01ec1a13 |
+--+++
| boot_successes   | 3  | 2  |
| boot_failures| 7  | 13 |
| BUG:kernel_test_crashed  | 7  | 8  |
| INFO:rcu_sched_self-detected_stall_on_CPU| 0  | 4  |
| RIP:intel_idle   | 0  | 4  |
| RIP:queue_write_lock_slowpath| 0  | 4  |
| RIP:queue_read_lock_slowpath | 0  | 4  |
| RIP:sys_imageblit_sysimgblt  | 0  | 2  |
| RIP:default_send_IPI_mask_sequence_phys  | 0  | 1  |
| RIP:memcpy   | 0  | 1  |
| RIP:delay_tsc| 0  | 4  |
| backtrace:cpu_startup_entry  | 0  | 3  |
| backtrace:do_fsync   | 0  | 4  |
| backtrace:SyS_fsync  | 0  | 4  |
| backtrace:normal_work_helper | 0  | 1  |
| backtrace:vfs_write  | 0  | 3  |
| backtrace:SyS_write  | 0  | 3  |
| backtrace:do_sys_open| 0  | 4  |
| backtrace:SyS_open   | 0  | 4  |
| backtrace:flush_to_ldisc | 0  | 1  |
| RIP:cpu_startup_entry| 0  | 1  |
| RIP:native_read_tsc  | 0  | 2  |
| RIP:rcu_eqs_exit_common  | 0  | 1  |
| INFO:rcu_sched_detected_stalls_on_CPUs/tasks | 0  | 1  |
+--+++


run: /lkp/lkp/src/monitors/wrapper sched_debug  {"interval"=>"10"}
run: /usr/bin/time -v -o /lkp/lkp/src/tmp/time /lkp/lkp/src/tests/wrapper fsmark{"filesize"=>"9B", "test_size"=>"400M", 
"sync_method"=>"fsyncBeforeClose", "nr_directories"=>"16d", "nr_files_per_directory"=>"256fpd"}
run: /lkp/lkp/src/monitors/wrapper pmeter   {}
[  125.656200] INFO: rcu_sched self-detected stall on CPU
[  125.657199] INFO: rcu_sched self-detected stall on CPUINFO: rcu_sched 
self-detected stall on CPUINFO: rcu_sched self-detected stall on CPUINFO: 
rcu_sched self-detected stall on CPU { { { { 0 9 7 14} } } }  (t=10 jiffies 
g=1792 c=1791 q=0)
[  125.657218]  (t=10 jiffies g=1792 c=1791 q=0)
[  125.657219]  (t=10 jiffies g=1792 c=1791 q=0)
[  125.657221]  (t=10 jiffies g=1792 c=1791 q=0)
[  125.657222] sending NMI to all CPUs:
[  125.657224] NMI backtrace for cpu 0
[  125.657227] CPU: 0 PID: 3025 Comm: fs_mark Not tainted 3.16.0 #1
[  125.657227] Hardware name: Intel Corporation S5520UR/S5520UR, BIOS 
S5500.86B.01.00.0050.050620101605 05/06/2010
[  125.657228] task: 88007ef58000 ti: 88007ef54000 task.ti: 
88007ef54000
[  125.657229] RIP: 0010:[]  [] 
native_read_tsc+0x6/0x20
[  125.657236] RSP: 0018:88036fc03d20  EFLAGS: 0002
[  125.657237] RAX: 3f172acf RBX: 3f172ab0 RCX: 0028
[  125.657238] RDX: 14e5 RSI: 0018 RDI: 0004773a
[  125.657238] RBP: 88036fc03d20 R08: 81da2200 R09: 0092
[  125.657239] R10: 14e53edc9480 R11: 0008 R12: 0004773a
[  125.657239] R13:  R14: 0002 R15: 0001
[  125.657241] FS:  01ee0880(0063) GS:88036fc0() 
knlGS:
[  125.657241] CS:  0010 DS:  ES:  CR0: 8005003b
[  125.657242] CR2: 0061c000 CR3: 7ef3c000 CR4: 07f0
[  125.657243] Stack:
[  125.657243]  88036fc03d48 813f85e3 1000 
03e9
[  125.657244]  0400 88036fc03d58 813f8538 
88036fc03d78
[  125.657246]  81046d1a b032 81da2200 
88036fc03dc0
[  125.657247] Call Trace:
[  125.657247]   [] delay_tsc+0x43/0x90
[  125.657253]  [] __const_udelay+0x28/0x30
[  125.657254]  [] native_safe_apic_wait_icr_idle+0x2a/0x60
[  125.657257]  [] 
default_send_IPI_mask_sequence_phys+0xd0/0x100
[  125.657259]  [] physflat_send_IPI_mask+0xe/0x10
[  125.657261]  [] arch_trigger_all_cpu_backtrace+0x134/0x150
[  125.657262]  [] rcu_check_callbacks+0x4c9/0x740
[  125.657265]  [] update_process_times+0x47/0x70
[  125.657267]  [] 

Re: [PATCH 3.16 000/357] 3.16.4-stable review

2014-10-03 Thread Guenter Roeck

On 10/03/2014 02:26 PM, Greg Kroah-Hartman wrote:

-
Note: This is a big stable release.  Mostly my fault for being on the
road last week, combined with an unusually large number of patches being
tagged for the stable tree.  Anyway, I've caught up with all pending
patches before 3.17-rc7, so if you have marked something for the stable
tree that I have not applied, or emailed the stable@v.k.o list asking
for a patch, that is not here, please let me know.
-

This is the start of the stable review cycle for the 3.16.4 release.
There are 357 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 Sun Oct  5 21:28:42 UTC 2014.
Anything received after that time might be too late.



Build results:
total: 136 pass: 134 fail: 2
Failed builds:
arm:omap2plus_defconfig
arm:multi_v7_defconfig

Qemu test results:
total: 28 pass: 28 fail: 0

Build errors are the same as in 3.14, with the same culprit and fix.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] MIPS executable stack protection

2014-10-03 Thread Leonid Yegoshin
The following series implements an executable stack protection in MIPS.

It sets up a per-thread 'VDSO' page and appropriate TLB support.
Page is set write-protected from user and is maintained via kernel VA.
MIPS FPU emulation is shifted to new page and stack is relieved for
execute protection as is as all data pages in default setup during ELF
binary initialization. The real protection is controlled by GLIBC and
it can do stack protected now as it is done in other architectures and
I learned today that GLIBC team is ready for this.

Note: actual execute-protection depends from HW capability, of course.

This patch is required for MIPS32/64 R2 emulation on MIPS R6 architecture.
Without it 'ssh-keygen' crashes pretty fast on attempt to execute instruction
in stack.
---

Leonid Yegoshin (3):
  MIPS: mips_flush_cache_range is added
  MIPS: Setup an instruction emulation in VDSO protected page instead of 
user stack
  MIPS: set stack/data protection as non-executable


 arch/mips/include/asm/cacheflush.h  |3 +
 arch/mips/include/asm/mmu.h |2 +
 arch/mips/include/asm/page.h|2 -
 arch/mips/include/asm/processor.h   |2 -
 arch/mips/include/asm/switch_to.h   |   12 
 arch/mips/include/asm/thread_info.h |3 +
 arch/mips/include/asm/tlbmisc.h |1 
 arch/mips/include/asm/vdso.h|2 +
 arch/mips/kernel/process.c  |7 ++
 arch/mips/kernel/vdso.c |   41 -
 arch/mips/math-emu/dsemul.c |  114 ++-
 arch/mips/mm/c-octeon.c |8 ++
 arch/mips/mm/c-r3k.c|8 ++
 arch/mips/mm/c-r4k.c|   43 +
 arch/mips/mm/c-tx39.c   |9 +++
 arch/mips/mm/cache.c|4 +
 arch/mips/mm/fault.c|5 ++
 arch/mips/mm/tlb-r4k.c  |   39 
 18 files changed, 273 insertions(+), 32 deletions(-)

-- 
Signature
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-03 Thread Leonid Yegoshin
Historically, during FPU emulation MIPS runs live BD-slot instruction in stack.
This is needed because it was the only way to correctly handle branch
exceptions with unknown COP2 instructions in BD-slot. Now there is
an eXecuteInhibit feature and it is desirable to protect stack from execution
for security reasons.
This patch moves FPU emulation from stack area to VDSO-located page which is set
write-protected for application access. VDSO page itself is now per-thread and
it's addresses and offsets are stored in thread_info.
Small stack of emulation blocks is supported because nested traps are possible
in MIPS32/64 R6 emulation mix with FPU emulation.

Explanation of problem (current state before patch):

If I set eXecute-disabled stack in ELF binary initialisation then GLIBC ignores
it and may change stack protection at library load. If this library has
eXecute-disabled stack then anything is OK, but if this section (PT_GNU_STACK)
is just missed as usual, then GLIBC applies it's own default == eXecute-enabled
stack.
So, ssh_keygen is built explicitly with eXecute-disabled stack. But GLIBC
ignores it and set stack executable. And because of that - anything works,
FPU emulation and hacker tools.
However, if I use all *.SO libraries with eXecute-disabled stack in PT_GNU_STACK
section then GLIBC keeps stack non-executable but things fails at FPU emulation
later.

Here are two issues which are bind together and to solve an incorrect
behaviour of GLIBC (ignoring X ssh-keygen intention) the splitting both issues
is needed. So, I did a kernel emulation protected and out of stack.

Signed-off-by: Leonid Yegoshin 
---
 arch/mips/include/asm/mmu.h |2 +
 arch/mips/include/asm/processor.h   |2 -
 arch/mips/include/asm/switch_to.h   |   12 
 arch/mips/include/asm/thread_info.h |3 +
 arch/mips/include/asm/tlbmisc.h |1 
 arch/mips/include/asm/vdso.h|2 +
 arch/mips/kernel/process.c  |7 ++
 arch/mips/kernel/vdso.c |   41 -
 arch/mips/math-emu/dsemul.c |  114 ++-
 arch/mips/mm/fault.c|5 ++
 arch/mips/mm/tlb-r4k.c  |   39 
 11 files changed, 197 insertions(+), 31 deletions(-)

diff --git a/arch/mips/include/asm/mmu.h b/arch/mips/include/asm/mmu.h
index c436138..96266b8 100644
--- a/arch/mips/include/asm/mmu.h
+++ b/arch/mips/include/asm/mmu.h
@@ -3,7 +3,9 @@
 
 typedef struct {
unsigned long asid[NR_CPUS];
+   unsigned long vdso_asid[NR_CPUS];
void *vdso;
+   struct vm_area_struct   *vdso_vma;
 } mm_context_t;
 
 #endif /* __ASM_MMU_H */
diff --git a/arch/mips/include/asm/processor.h 
b/arch/mips/include/asm/processor.h
index 05f0843..c87b1da 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -40,7 +40,7 @@ extern unsigned int vced_count, vcei_count;
  * A special page (the vdso) is mapped into all processes at the very
  * top of the virtual memory space.
  */
-#define SPECIAL_PAGES_SIZE PAGE_SIZE
+#define SPECIAL_PAGES_SIZE (PAGE_SIZE * 2)
 
 #ifdef CONFIG_32BIT
 #ifdef CONFIG_KVM_GUEST
diff --git a/arch/mips/include/asm/switch_to.h 
b/arch/mips/include/asm/switch_to.h
index b928b6f..0968f51 100644
--- a/arch/mips/include/asm/switch_to.h
+++ b/arch/mips/include/asm/switch_to.h
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct task_struct;
 
@@ -104,6 +105,16 @@ do {   
\
disable_msa();  \
 } while (0)
 
+static inline void flush_vdso_page(void)
+{
+   if (current->mm && cpu_context(raw_smp_processor_id(), current->mm) &&
+   (current->mm->context.vdso_asid[raw_smp_processor_id()] ==
+cpu_asid(raw_smp_processor_id(), current->mm))) {
+   local_flush_tlb_page(current->mm->mmap, (unsigned 
long)current->mm->context.vdso);
+   current->mm->context.vdso_asid[raw_smp_processor_id()] = 0;
+   }
+}
+
 #define finish_arch_switch(prev)   \
 do {   \
u32 __c0_stat;  \
@@ -118,6 +129,7 @@ do {
\
__restore_dsp(current); \
if (cpu_has_userlocal)  \
write_c0_userlocal(current_thread_info()->tp_value);\
+   flush_vdso_page();  \
__restore_watch();  \
 } while (0)
 
diff --git a/arch/mips/include/asm/thread_info.h 
b/arch/mips/include/asm/thread_info.h
index 7de8658..8d16003 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -34,6 +34,8 @@ 

Re: [PATCH 3.14 000/238] 3.14.20-stable review

2014-10-03 Thread Guenter Roeck

On 10/03/2014 02:28 PM, Greg Kroah-Hartman wrote:

This is the start of the stable review cycle for the 3.14.20 release.
There are 238 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 Sun Oct  5 21:28:26 UTC 2014.
Anything received after that time might be too late.



Build results:
total: 137 pass: 135 fail: 2
Failed builds:
arm:omap2plus_defconfig
arm:multi_v7_defconfig

Qenu test results:
total: 28 pass: 28 fail: 0

---
Build error:

arch/arm/mach-omap2/omap_hwmod_7xx_data.c: In function 'dra7xx_hwmod_init':
arch/arm/mach-omap2/omap_hwmod_7xx_data.c:2735:2: error: implicit declaration 
of function 'soc_is_dra74x'
arch/arm/mach-omap2/omap_hwmod_7xx_data.c:2737:2: error: implicit declaration 
of function 'soc_is_dra72x'


Culprit:

'ARM: DRA7: hwmod: Add dra74x and dra72x specific ocp interface lists'

Needs patch af438fec6cb9 ("ARM: DRA7: Add support for soc_is_dra74x() and 
soc_is_dra72x() variants")
as prerequisit.

Same problem is in 3.16 as well.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] MIPS: set stack/data protection as non-executable

2014-10-03 Thread Leonid Yegoshin
This is a last step of 3 patches which shift FPU emulation out of
stack into protected area. So, it disables a default executable stack.

Additionally, it sets a default data area non-executable protection.

Signed-off-by: Leonid Yegoshin 
---
 arch/mips/include/asm/page.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 3be8180..d49ba81 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -230,7 +230,7 @@ extern int __virt_addr_valid(const volatile void *kaddr);
 #define virt_addr_valid(kaddr) \
__virt_addr_valid((const volatile void *) (kaddr))
 
-#define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
+#define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | \
 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 #define UNCAC_ADDR(addr)   ((addr) - PAGE_OFFSET + UNCAC_BASE)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] MIPS: mips_flush_cache_range is added

2014-10-03 Thread Leonid Yegoshin
New function mips_flush_cache_range() is added.
It flushes D-cache on kernel VA and I-cache on user VA.
It is significant in case of cache aliasing systems.
It can be used to flush a short sequence of newly written code
to user space and especially usefull in ptrace() and dsemul().
Today a full page is flushed by flush_cache_page in ptrace().

Signed-off-by: Leonid Yegoshin 
---
 arch/mips/include/asm/cacheflush.h |3 +++
 arch/mips/mm/c-octeon.c|8 +++
 arch/mips/mm/c-r3k.c   |8 +++
 arch/mips/mm/c-r4k.c   |   43 
 arch/mips/mm/c-tx39.c  |9 
 arch/mips/mm/cache.c   |4 +++
 6 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/cacheflush.h 
b/arch/mips/include/asm/cacheflush.h
index e08381a..8305241 100644
--- a/arch/mips/include/asm/cacheflush.h
+++ b/arch/mips/include/asm/cacheflush.h
@@ -94,6 +94,9 @@ extern void (*flush_cache_sigtramp)(unsigned long addr);
 extern void (*flush_icache_all)(void);
 extern void (*local_flush_data_cache_page)(void * addr);
 extern void (*flush_data_cache_page)(unsigned long addr);
+extern void (*mips_flush_data_cache_range)(struct vm_area_struct *vma,
+   unsigned long vaddr, struct page *page, unsigned long addr,
+   unsigned long size);
 
 /*
  * This flag is used to indicate that the page pointed to by a pte
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index 05b1d7c..38349d1 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -178,6 +178,13 @@ static void octeon_flush_kernel_vmap_range(unsigned long 
vaddr, int size)
BUG();
 }
 
+static void octeon_flush_data_cache_range(struct vm_area_struct *vma,
+   unsigned long vaddr, struct page *page, unsigned long addr,
+   unsigned long size)
+{
+   octeon_flush_cache_page(vma, addr, page_to_pfn(page));
+}
+
 /**
  * Probe Octeon's caches
  *
@@ -292,6 +299,7 @@ void octeon_cache_init(void)
flush_cache_sigtramp= octeon_flush_cache_sigtramp;
flush_icache_all= octeon_flush_icache_all;
flush_data_cache_page   = octeon_flush_data_cache_page;
+   mips_flush_data_cache_range = octeon_flush_data_cache_range;
flush_icache_range  = octeon_flush_icache_range;
local_flush_icache_range= local_octeon_flush_icache_range;
 
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 135ec31..93b4810 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -273,6 +273,13 @@ static void r3k_flush_data_cache_page(unsigned long addr)
 {
 }
 
+static void r3k_mips_flush_data_cache_range(struct vm_area_struct *vma,
+   unsigned long vaddr, struct page *page, unsigned long addr,
+   unsigned long size)
+{
+   r3k_flush_cache_page(vma, addr, page_to_pfn(page));
+}
+
 static void r3k_flush_cache_sigtramp(unsigned long addr)
 {
unsigned long flags;
@@ -322,6 +329,7 @@ void r3k_cache_init(void)
__flush_cache_all = r3k___flush_cache_all;
flush_cache_mm = r3k_flush_cache_mm;
flush_cache_range = r3k_flush_cache_range;
+   mips_flush_data_cache_range = r3k_mips_flush_data_cache_range;
flush_cache_page = r3k_flush_cache_page;
flush_icache_range = r3k_flush_icache_range;
local_flush_icache_range = r3k_flush_icache_range;
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index ad6ff7b..ee014e4 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -636,6 +636,48 @@ static void r4k_flush_data_cache_page(unsigned long addr)
r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr);
 }
 
+struct mips_flush_data_cache_range_args {
+   struct vm_area_struct *vma;
+   unsigned long vaddr;
+   unsigned long start;
+   unsigned long len;
+};
+
+static inline void local_r4k_mips_flush_data_cache_range(void *args)
+{
+   struct mips_flush_data_cache_range_args *f_args = args;
+   unsigned long vaddr = f_args->vaddr;
+   unsigned long start = f_args->start;
+   unsigned long len = f_args->len;
+   struct vm_area_struct * vma = f_args->vma;
+
+   blast_dcache_range(start, start + len);
+
+   if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) {
+   wmb();
+
+   /* vma is given for exec check only, mmap is current,
+  so - no non-current vma page flush, just user or kernel */
+   protected_blast_icache_range(vaddr, vaddr + len);
+   }
+}
+
+/* flush dirty kernel data and a corresponding user instructions (if needed).
+   used in copy_to_user_page() */
+static void r4k_mips_flush_data_cache_range(struct vm_area_struct *vma,
+   unsigned long vaddr, struct page *page, unsigned long start,
+   unsigned long len)
+{
+   struct mips_flush_data_cache_range_args args;
+
+   args.vma = vma;
+   args.vaddr = 

Re: [RESEND PATCH] iio: light: add support for TI's opt3001 light sensor

2014-10-03 Thread Michael Welling
On Thu, Oct 02, 2014 at 01:05:53PM -0500, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Sep 30, 2014 at 04:22:04PM -0500, Felipe Balbi wrote:
> > On Mon, Sep 29, 2014 at 06:41:59PM -0500, Michael Welling wrote:
> > > On Mon, Sep 29, 2014 at 05:46:38PM -0500, Felipe Balbi wrote:
> > > > Hi,
> > > > 
> > > > On Mon, Sep 29, 2014 at 05:38:33PM -0500, Michael Welling wrote:
> > > > > > > > Alright, this is already ridiculous. Andrew, if I resend the 
> > > > > > > > patch can
> > > > > > > > you apply it since maintainer has been ignoring this thread 
> > > > > > > > anyway ?
> > > > > > > > 
> > > > > > > 
> > > > > > > Do you reall think this is the best way to approach this?
> > > > > > 
> > > > > > when maintainer doesn't respond for weeks, yeah! Sure it is.
> > > > > > 
> > > > > > > Perhaps it would be better to explain what each field of the
> > > > > > > configuration register does and then we can move on.
> > > > > > 
> > > > > > perhaps Jonathan could tell me exactly what he wants because I can't
> > > > > > handle back-and-forth anymore. Specially when he complains about 
> > > > > > stuff
> > > > > > he asked me to modify himself.
> > > > > >
> > > > > > > In particular the OPT3001_CONFIGURATION_L field needs to be 
> > > > > > > explained
> > > > > > > such that the ABI can be properly applied.
> > > > > > > 
> > > > > > > Looking at the docs for the Windows demo program the field is 
> > > > > > > associated
> > > > > > > with a latch configuration. What does this bit field actually do?
> > > > > 
> > > > > Still no technical information. Without all the facts how can you 
> > > > > expect
> > > > > him to tell you what he wants?
> > > > 
> > > > yeah, because clearly he doesn't know himself, right ?
> > > 
> > > Could you explain how it works to me then?
> > 
> > checking how much of the docs I can expose now, gimme a couple days.
> 
> alright, here's a snippet of what's on preliminary docs:
> 

Firstly, there is logical error in the latest code.
The hysteresis setting is 0 not 1.

+   if (opt->hysteresis)
+   reg |= OPT3001_CONFIGURATION_L;
+   else
+   reg &= ~OPT3001_CONFIGURATION_L;


> Latch field (read or write).
> The latch field controls the functionality of the interrupt reporting
> mechanisms: the INT pin, the flag high field (FH), and flag low field (FL).
> This bit selects the reporting style between a latched window-style comparison
> and a transparent hysteresis-style comparison.
> 
> 0 = The device functions in transparent hysteresis-style comparison operation,
> where the three interrupt reporting mechanisms directly reflect the comparison
> of the result register with the high- and low-limit registers with no
> user-controlled clearing event. See the Interrupt Operation, INT Pin, and
> Interrupt Reporting Mechanisms section for further details.
> 
> 1 = The device functions in latched window-style comparison operation, 
> latching
> the interrupt reporting mechanisms until a user-controlled clearing event.
> 

How is the interrupt cleared in mode 1 in the latest version of your
code?

> [...]
> 
> 7.4.2.2 Transparent Hysteresis-Style Comparison Mode
> The transparent hysteresis-style comparison mode is typically used when a
> single digital signal is desired that indicates whether the input light is
> higher than or lower than a light level of interest. If the result register is
> higher than the high-limit register for a consecutive number of events set by
> the fault count field, the INT line is set to active, the flag high field is
> set to 1, and the flag low field is set to 0. If the result register is lower
> than the lowlimit register for a consecutive number of events set by the fault
> count field, the INT line is set to inactive, the flag low field is set to 1,
> and the flag high field is set to 0. The INT pin and flag high and flag low
> fields do not change state with configuration reads and writes. The INT pin 
> and
> flag fields continually report the appropriate comparison of the light to the
> low-limit and high-limit registers. The device does not respond to the SMBus
> alert response protocol while in either of the two transparent comparison 
> modes
> (configuration register, latch field = 0).
> 

The ABI confusion starts here.

You are dealing with a mode enable and IIO_EV_INFO_HYSTERESIS is associated
with a the hysteresis level of a threshold event.

http://lxr.free-electrons.com/source/Documentation/ABI/testing/sysfs-bus-iio#L605

You are going to have abstract the register access to conform to the ABI or add
to the ABI as Jonathan suggests.

> -- 
> balbi


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.10 000/143] 3.10.56-stable review

2014-10-03 Thread Guenter Roeck

On 10/03/2014 02:33 PM, Greg Kroah-Hartman wrote:

This is the start of the stable review cycle for the 3.10.56 release.
There are 143 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 Sun Oct  5 21:32:57 UTC 2014.
Anything received after that time might be too late.



Build results:
total: 137 pass: 137 fail: 0

Qemu test results:
total: 25 pass: 25 fail: 0

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

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] usb: chipidea: Fix oops when removing the ci_hdrc module

2014-10-03 Thread Peter Chen
On Fri, Oct 03, 2014 at 11:01:20AM +0200, Torsten Fleischer wrote:
> The call of 'kfree(ci->hw_bank.regmap)' in ci_hdrc_remove() sometimes causes
> a kernel oops when removing the ci_hdrc module.
> 
> Since there is no separate memory allocated for the ci->hw_bank.regmap array,
> there is no need to free it.
> 
> Signed-off-by: Torsten Fleischer 
> ---
>  drivers/usb/chipidea/core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 619d13e..4ecb650 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -732,7 +732,6 @@ static int ci_hdrc_remove(struct platform_device *pdev)
>   ci_role_destroy(ci);
>   ci_hdrc_enter_lpm(ci, true);
>   usb_phy_shutdown(ci->transceiver);
> - kfree(ci->hw_bank.regmap);
>  
>   return 0;
>  }
> -- 
> 1.8.4.5
> 

Good fix, applied, thanks.

-- 
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: staging: wlan-ng: fix sparse warnings

2014-10-03 Thread Cheng-wei Lee
This patch fix the sparse warnings in wlan-ng/cfg80211.c
The following functions were only used in this file, so done by
declaring them into static.

drivers/staging/wlan-ng/cfg80211.c:710:6: warning: symbol
'prism2_connect_result' was not declared. Should it be static?
drivers/staging/wlan-ng/cfg80211.c:719:6: warning: symbol
'prism2_disconnected' was not declared. Should it be static?
drivers/staging/wlan-ng/cfg80211.c:725:6: warning: symbol
'prism2_roamed' was not declared. Should it be static?

Signed-off-by: Quentin Lee 
---
 drivers/staging/wlan-ng/cfg80211.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c 
b/drivers/staging/wlan-ng/cfg80211.c
index 723319e..9e65429 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -707,7 +707,7 @@ exit:
 
 
 /* Interface callback functions, passing data back up to the cfg80211 layer */
-void prism2_connect_result(wlandevice_t *wlandev, u8 failed)
+static void prism2_connect_result(wlandevice_t *wlandev, u8 failed)
 {
 u16 status = failed ?
  WLAN_STATUS_UNSPECIFIED_FAILURE : WLAN_STATUS_SUCCESS;
@@ -716,13 +716,13 @@ void prism2_connect_result(wlandevice_t *wlandev, u8 
failed)
 NULL, 0, NULL, 0, status, GFP_KERNEL);
 }
 
-void prism2_disconnected(wlandevice_t *wlandev)
+static void prism2_disconnected(wlandevice_t *wlandev)
 {
 cfg80211_disconnected(wlandev->netdev, 0, NULL,
 0, GFP_KERNEL);
 }
 
-void prism2_roamed(wlandevice_t *wlandev)
+static void prism2_roamed(wlandevice_t *wlandev)
 {
 cfg80211_roamed(wlandev->netdev, NULL, wlandev->bssid,
 NULL, 0, NULL, 0, GFP_KERNEL);
-- 
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.16 000/357] 3.16.4-stable review

2014-10-03 Thread Greg Kroah-Hartman
On Fri, Oct 03, 2014 at 06:33:03PM -0600, Shuah Khan wrote:
> On 10/03/2014 03:26 PM, Greg Kroah-Hartman wrote:
> > -
> > Note: This is a big stable release.  Mostly my fault for being on the
> > road last week, combined with an unusually large number of patches being
> > tagged for the stable tree.  Anyway, I've caught up with all pending
> > patches before 3.17-rc7, so if you have marked something for the stable
> > tree that I have not applied, or emailed the stable@v.k.o list asking
> > for a patch, that is not here, please let me know.
> > -
> > 
> > This is the start of the stable review cycle for the 3.16.4 release.
> > There are 357 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 Sun Oct  5 21:28:42 UTC 2014.
> > 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.16.4-rc1.gz
> > and the diffstat can be found below.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> Compiled and booted on my test system. No dmesg regressions.
> 
> Looking better than the previous with clean dmesg err
> 
> drm:ivb_err_int_handlererrors I was seeing went away.
> Must be changes in drivers/gpu/drm/i915

Thanks for testing all of these and letting me know.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] x86: Reject x32 executables if x32 ABI not supported

2014-10-03 Thread Ben Hutchings
Can one of you please respond to this patch?

Ben.

On Sun, 2014-09-07 at 21:05 +0100, Ben Hutchings wrote:
> It is currently possible to execve() an x32 executable on an x86_64
> kernel that has only ia32 compat enabled.  However all its syscalls
> will fail, even _exit().  This usually causes it to segfault.
> 
> Change the ELF compat architecture check so that x32 executables are
> rejected if we don't support the x32 ABI.
> 
> Signed-off-by: Ben Hutchings 
> ---
>  arch/x86/include/asm/elf.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
> index 1a055c8..ca3347a 100644
> --- a/arch/x86/include/asm/elf.h
> +++ b/arch/x86/include/asm/elf.h
> @@ -160,8 +160,9 @@ do {  \
>  #define elf_check_arch(x)\
>   ((x)->e_machine == EM_X86_64)
>  
> -#define compat_elf_check_arch(x) \
> - (elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)
> +#define compat_elf_check_arch(x) \
> + (elf_check_arch_ia32(x) ||  \
> +  (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
>  
>  #if __USER32_DS != __USER_DS
>  # error "The following code assumes __USER32_DS == __USER_DS"
> 
> 

-- 
Ben Hutchings
One of the nice things about standards is that there are so many of them.


signature.asc
Description: This is a digitally signed message part


[PATCH 3/5] staging: rts5208: align divided lines to opening paranthesis

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius 

Make all divided lines aligned to the opening paranthesis.

Basically makes all lines aligned to the opening paranthesis to make the
code more readable and it also gets rid of a lot of checkpatch.pl
"checks".

Signed-off-by: Giedrius Statkevičius 
---
 drivers/staging/rts5208/rtsx_chip.c | 87 +++--
 1 file changed, 45 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_chip.c 
b/drivers/staging/rts5208/rtsx_chip.c
index 146b337..b47eade 100644
--- a/drivers/staging/rts5208/rtsx_chip.c
+++ b/drivers/staging/rts5208/rtsx_chip.c
@@ -126,10 +126,11 @@ static int rtsx_pre_handle_sdio_old(struct rtsx_chip 
*chip)
if (chip->ignore_sd && CHK_SDIO_EXIST(chip)) {
if (chip->asic_code) {
RTSX_WRITE_REG(chip, CARD_PULL_CTL5, 0xFF,
-   MS_INS_PU | SD_WP_PU | SD_CD_PU | SD_CMD_PU);
+  MS_INS_PU | SD_WP_PU |
+  SD_CD_PU | SD_CMD_PU);
} else {
RTSX_WRITE_REG(chip, FPGA_PULL_CTL, 0xFF,
-   FPGA_SD_PULL_CTL_EN);
+  FPGA_SD_PULL_CTL_EN);
}
RTSX_WRITE_REG(chip, CARD_SHARE_MODE, 0xFF, CARD_SHARE_48_SD);
 
@@ -137,7 +138,7 @@ static int rtsx_pre_handle_sdio_old(struct rtsx_chip *chip)
RTSX_WRITE_REG(chip, 0xFF2C, 0x01, 0x01);
 
RTSX_WRITE_REG(chip, SDIO_CTRL, 0xFF,
-   SDIO_BUS_CTRL | SDIO_CD_CTRL);
+  SDIO_BUS_CTRL | SDIO_CD_CTRL);
 
chip->sd_int = 1;
chip->sd_io = 1;
@@ -201,7 +202,7 @@ static int rtsx_pre_handle_sdio_new(struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
} else {
RTSX_WRITE_REG(chip, FPGA_PULL_CTL,
-   FPGA_SD_PULL_CTL_BIT | 0x20, 0);
+  FPGA_SD_PULL_CTL_BIT | 0x20, 0);
}
retval = card_share_mode(chip, SD_CARD);
if (retval != STATUS_SUCCESS)
@@ -268,7 +269,7 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
 
 #ifdef LED_AUTO_BLINK
RTSX_WRITE_REG(chip, CARD_AUTO_BLINK, 0xFF,
-   LED_BLINK_SPEED | BLINK_EN | LED_GPIO0);
+  LED_BLINK_SPEED | BLINK_EN | LED_GPIO0);
 #endif
 
if (chip->asic_code) {
@@ -297,7 +298,7 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
} else {
if (CHECK_PID(chip, 0x5208))
RTSX_WRITE_REG(chip, ASPM_FORCE_CTL,
-   0xFF, 0x3F);
+  0xFF, 0x3F);
 
retval = rtsx_write_config_byte(chip, LCTLR,
chip->aspm_l0s_l1_en);
@@ -337,10 +338,10 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
if (CHK_SDIO_EXIST(chip)) {
if (CHECK_PID(chip, 0x5288))
retval = rtsx_write_cfg_dw(chip, 2, 0xC0,
-   0xFF00, 0x0100);
+  0xFF00, 0x0100);
else
retval = rtsx_write_cfg_dw(chip, 1, 0xC0,
-   0xFF00, 0x0100);
+  0xFF00, 0x0100);
 
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
@@ -381,7 +382,7 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
reg &= 0xFE7F;
reg |= 0x80;
retval = rtsx_write_phy_register(chip, 0x00,
-   reg);
+reg);
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
 
@@ -392,13 +393,13 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
 
reg &= 0xFFF7;
retval = rtsx_write_phy_register(chip, 0x1C,
-   reg);
+reg);
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}
 
if (chip->driver_first_load &&
-   (chip->ic_version < IC_VER_C))
+   (chip->ic_version < IC_VER_C))
rtsx_calibration(chip);
 
  

[PATCH 3.16 004/357] drm/tegra: add MODULE_DEVICE_TABLEs

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Stephen Warren 

commit ef70728c7a6571a1a7115031e932b811f1740b2e upstream.

When tegra-drm.ko is built as a module, these MODULE_DEVICE_TABLEs allow
the module to be auto-loaded since the module will match the devices
instantiated from device tree.

(Notes for stable: in 3.14+, just git rm any conflicting file, since they
are added in later kernels. For 3.13 and below, manual merging will be
needed)

Signed-off-by: Stephen Warren 
Signed-off-by: Thierry Reding 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/tegra/dc.c|1 +
 drivers/gpu/drm/tegra/dpaux.c |1 +
 drivers/gpu/drm/tegra/dsi.c   |1 +
 drivers/gpu/drm/tegra/gr2d.c  |1 +
 drivers/gpu/drm/tegra/gr3d.c  |1 +
 drivers/gpu/drm/tegra/hdmi.c  |1 +
 drivers/gpu/drm/tegra/sor.c   |1 +
 7 files changed, 7 insertions(+)

--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1303,6 +1303,7 @@ static const struct of_device_id tegra_d
/* sentinel */
}
 };
+MODULE_DEVICE_TABLE(of, tegra_dc_of_match);
 
 static int tegra_dc_parse_dt(struct tegra_dc *dc)
 {
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -382,6 +382,7 @@ static const struct of_device_id tegra_d
{ .compatible = "nvidia,tegra124-dpaux", },
{ },
 };
+MODULE_DEVICE_TABLE(of, tegra_dpaux_of_match);
 
 struct platform_driver tegra_dpaux_driver = {
.driver = {
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -982,6 +982,7 @@ static const struct of_device_id tegra_d
{ .compatible = "nvidia,tegra114-dsi", },
{ },
 };
+MODULE_DEVICE_TABLE(of, tegra_dsi_of_match);
 
 struct platform_driver tegra_dsi_driver = {
.driver = {
--- a/drivers/gpu/drm/tegra/gr2d.c
+++ b/drivers/gpu/drm/tegra/gr2d.c
@@ -121,6 +121,7 @@ static const struct of_device_id gr2d_ma
{ .compatible = "nvidia,tegra20-gr2d" },
{ },
 };
+MODULE_DEVICE_TABLE(of, gr2d_match);
 
 static const u32 gr2d_addr_regs[] = {
GR2D_UA_BASE_ADDR,
--- a/drivers/gpu/drm/tegra/gr3d.c
+++ b/drivers/gpu/drm/tegra/gr3d.c
@@ -130,6 +130,7 @@ static const struct of_device_id tegra_g
{ .compatible = "nvidia,tegra20-gr3d" },
{ }
 };
+MODULE_DEVICE_TABLE(of, tegra_gr3d_match);
 
 static const u32 gr3d_addr_regs[] = {
GR3D_IDX_ATTRIBUTE( 0),
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1450,6 +1450,7 @@ static const struct of_device_id tegra_h
{ .compatible = "nvidia,tegra20-hdmi", .data = _hdmi_config },
{ },
 };
+MODULE_DEVICE_TABLE(of, tegra_hdmi_of_match);
 
 static int tegra_hdmi_probe(struct platform_device *pdev)
 {
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1455,6 +1455,7 @@ static const struct of_device_id tegra_s
{ .compatible = "nvidia,tegra124-sor", },
{ },
 };
+MODULE_DEVICE_TABLE(of, tegra_sor_of_match);
 
 struct platform_driver tegra_sor_driver = {
.driver = {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 002/357] cpufreq: OPP: Avoid sleeping while atomic

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Stephen Boyd 

commit 3c5445ce3a0c6d6935911212b735772af5115517 upstream.

We allocate the cpufreq table after calling rcu_read_lock(),
which disables preemption. This causes scheduling while atomic
warnings. Use GFP_ATOMIC instead of GFP_KERNEL and update for
kcalloc while we're here.

BUG: sleeping function called from invalid context at mm/slub.c:1246
in_atomic(): 0, irqs_disabled(): 0, pid: 80, name: modprobe
5 locks held by modprobe/80:
 #0:  (>mutex){..}, at: [] __driver_attach+0x48/0x98
 #1:  (>mutex){..}, at: [] __driver_attach+0x58/0x98
 #2:  (subsys mutex#5){+.+.+.}, at: [] 
subsys_interface_register+0x38/0xc8
 #3:  (cpufreq_rwsem){.+.+.+}, at: [] 
__cpufreq_add_dev.isra.22+0x84/0x92c
 #4:  (rcu_read_lock){..}, at: [] 
dev_pm_opp_init_cpufreq_table+0x18/0x10c
Preemption disabled at:[<  (null)>]   (null)

CPU: 2 PID: 80 Comm: modprobe Not tainted 
3.16.0-rc3-next-20140701-00035-g286857f216aa-dirty #217
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x70/0xbc)
[] (dump_stack) from [] (__kmalloc+0x124/0x250)
[] (__kmalloc) from [] 
(dev_pm_opp_init_cpufreq_table+0x3c/0x10c)
[] (dev_pm_opp_init_cpufreq_table) from [] 
(cpufreq_init+0x48/0x378 [cpufreq_generic])
[] (cpufreq_init [cpufreq_generic]) from [] 
(__cpufreq_add_dev.isra.22+0x200/0x92c)
[] (__cpufreq_add_dev.isra.22) from [] 
(subsys_interface_register+0x84/0xc8)
[] (subsys_interface_register) from [] 
(cpufreq_register_driver+0x108/0x2d8)
[] (cpufreq_register_driver) from [] 
(generic_cpufreq_probe+0x50/0x74 [cpufreq_generic])
[] (generic_cpufreq_probe [cpufreq_generic]) from [] 
(platform_drv_probe+0x18/0x48)
[] (platform_drv_probe) from [] 
(driver_probe_device+0x128/0x370)
[] (driver_probe_device) from [] (__driver_attach+0x94/0x98)
[] (__driver_attach) from [] (bus_for_each_dev+0x54/0x88)
[] (bus_for_each_dev) from [] (bus_add_driver+0xe8/0x204)
[] (bus_add_driver) from [] (driver_register+0x78/0xf4)
[] (driver_register) from [] (do_one_initcall+0xac/0x1d8)
[] (do_one_initcall) from [] (load_module+0x190c/0x21e8)
[] (load_module) from [] (SyS_init_module+0xa4/0x110)
[] (SyS_init_module) from [] (ret_fast_syscall+0x0/0x48)

Fixes: a0dd7b79657b (PM / OPP: Move cpufreq specific OPP functions out of 
generic OPP library)
Signed-off-by: Stephen Boyd 
Acked-by: Viresh Kumar 
Signed-off-by: Rafael J. Wysocki 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/cpufreq/cpufreq_opp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/cpufreq/cpufreq_opp.c
+++ b/drivers/cpufreq/cpufreq_opp.c
@@ -60,7 +60,7 @@ int dev_pm_opp_init_cpufreq_table(struct
goto out;
}
 
-   freq_table = kzalloc(sizeof(*freq_table) * (max_opps + 1), GFP_KERNEL);
+   freq_table = kcalloc(sizeof(*freq_table), (max_opps + 1), GFP_ATOMIC);
if (!freq_table) {
ret = -ENOMEM;
goto out;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 024/357] drm/i915: Fix crash when failing to parse MIPI VBT

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Rafael Barbalho 

commit ed3b6679936801fa2dab47e7a6ef74e383400ed9 upstream.

This particular nasty presented itself while trying to register the
intelfb device (intel_fbdev.c). During the process of registering the device
the driver will disable the crtc via i9xx_crtc_disable. These will
also disable the panel using the generic mipi panel functions in
dsi_mod_vbt_generic.c. The stale MIPI generic data sequence pointers would
cause a crash within those functions. However, all of this is happening
while console_lock is held from do_register_framebuffer inside fbcon.c. Which
means that you got kernel log and just the device appearing to reboot/hang for
no apparent reason.

The fault started from the FB_EVENT_FB_REGISTERED event using the
fb_notifier_call_chain call in fbcon.c.

This regression has been introduced in

commit d3b542fcfc72d7724585e3fd2c5e75351bc3df47
Author: Shobhit Kumar 
Date:   Mon Apr 14 11:00:34 2014 +0530

drm/i915: Add parsing support for new MIPI blocks in VBT

Cc: Shobhit Kumar 
Signed-off-by: Rafael Barbalho 
Reviewed-by: Shobhit Kumar 
[danvet: Add regression citation.]
Signed-off-by: Daniel Vetter 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/i915/intel_bios.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -877,7 +877,7 @@ err:
 
/* error during parsing so set all pointers to null
 * because of partial parsing */
-   memset(dev_priv->vbt.dsi.sequence, 0, MIPI_SEQ_MAX);
+   memset(dev_priv->vbt.dsi.sequence, 0, 
sizeof(dev_priv->vbt.dsi.sequence));
 }
 
 static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 003/357] carl9170: fix sending URBs with wrong type when using full-speed

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Ronald Wahl 

commit 671796dd96b6cd85b75fba9d3007bcf7e5f7c309 upstream.

The driver assumes that endpoint 4 is always an interrupt endpoint.
Unfortunately the type differs between high-speed and full-speed
configurations while in the former case it is indeed an interrupt
endpoint this is not true for the latter case - here it is a bulk
endpoint. When sending URBs with the wrong type the kernel will
generate a warning message including backtrace. In this specific
case there will be a huge amount of warnings which can bring the system
to freeze.

To fix this we are now sending URBs to endpoint 4 using the type
found in the endpoint descriptor.

A side note: The carl9170 firmware currently specifies endpoint 4 as
interrupt endpoint even in the full-speed configuration but this has
no relevance because before this firmware is loaded the endpoint type
is as described above and after the firmware is running the stick is not
reenumerated and so the old descriptor is used.

Signed-off-by: Ronald Wahl 
Signed-off-by: John W. Linville 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/net/wireless/ath/carl9170/carl9170.h |1 
 drivers/net/wireless/ath/carl9170/usb.c  |   31 +++
 2 files changed, 28 insertions(+), 4 deletions(-)

--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -256,6 +256,7 @@ struct ar9170 {
atomic_t rx_work_urbs;
atomic_t rx_pool_urbs;
kernel_ulong_t features;
+   bool usb_ep_cmd_is_bulk;
 
/* firmware settings */
struct completion fw_load_wait;
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -621,9 +621,16 @@ int __carl9170_exec_cmd(struct ar9170 *a
goto err_free;
}
 
-   usb_fill_int_urb(urb, ar->udev, usb_sndintpipe(ar->udev,
-   AR9170_USB_EP_CMD), cmd, cmd->hdr.len + 4,
-   carl9170_usb_cmd_complete, ar, 1);
+   if (ar->usb_ep_cmd_is_bulk)
+   usb_fill_bulk_urb(urb, ar->udev,
+ usb_sndbulkpipe(ar->udev, AR9170_USB_EP_CMD),
+ cmd, cmd->hdr.len + 4,
+ carl9170_usb_cmd_complete, ar);
+   else
+   usb_fill_int_urb(urb, ar->udev,
+usb_sndintpipe(ar->udev, AR9170_USB_EP_CMD),
+cmd, cmd->hdr.len + 4,
+carl9170_usb_cmd_complete, ar, 1);
 
if (free_buf)
urb->transfer_flags |= URB_FREE_BUFFER;
@@ -1032,9 +1039,10 @@ static void carl9170_usb_firmware_step2(
 static int carl9170_usb_probe(struct usb_interface *intf,
  const struct usb_device_id *id)
 {
+   struct usb_endpoint_descriptor *ep;
struct ar9170 *ar;
struct usb_device *udev;
-   int err;
+   int i, err;
 
err = usb_reset_device(interface_to_usbdev(intf));
if (err)
@@ -1050,6 +1058,21 @@ static int carl9170_usb_probe(struct usb
ar->intf = intf;
ar->features = id->driver_info;
 
+   /* We need to remember the type of endpoint 4 because it differs
+* between high- and full-speed configuration. The high-speed
+* configuration specifies it as interrupt and the full-speed
+* configuration as bulk endpoint. This information is required
+* later when sending urbs to that endpoint.
+*/
+   for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; ++i) {
+   ep = >cur_altsetting->endpoint[i].desc;
+
+   if (usb_endpoint_num(ep) == AR9170_USB_EP_CMD &&
+   usb_endpoint_dir_out(ep) &&
+   usb_endpoint_type(ep) == USB_ENDPOINT_XFER_BULK)
+   ar->usb_ep_cmd_is_bulk = true;
+   }
+
usb_set_intfdata(intf, ar);
SET_IEEE80211_DEV(ar->hw, >dev);
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 012/357] drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan().

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tetsuo Handa 

commit 11e504cc705e8ccb06ac93a276e11b5e8fee4d40 upstream.

list_empty(&_manager->pools) being false before taking _manager->lock
does not guarantee that _manager->npools != 0 after taking _manager->lock
because _manager->npools is updated under _manager->lock.

Signed-off-by: Tetsuo Handa 
Signed-off-by: Dave Airlie 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -1015,6 +1015,8 @@ ttm_dma_pool_shrink_scan(struct shrinker
return SHRINK_STOP;
 
mutex_lock(&_manager->lock);
+   if (!_manager->npools)
+   goto out;
pool_offset = pool_offset % _manager->npools;
list_for_each_entry(p, &_manager->pools, pools) {
unsigned nr_free;
@@ -1034,6 +1036,7 @@ ttm_dma_pool_shrink_scan(struct shrinker
 p->pool->dev_name, p->pool->name, current->pid,
 nr_free, shrink_pages);
}
+out:
mutex_unlock(&_manager->lock);
return freed;
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 014/357] drm/ttm: Use mutex_trylock() to avoid deadlock inside shrinker functions.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tetsuo Handa 

commit 22e71691fd54c637800d10816bbeba9cf132d218 upstream.

I can observe that RHEL7 environment stalls with 100% CPU usage when a
certain type of memory pressure is given. While the shrinker functions
are called by shrink_slab() before the OOM killer is triggered, the stall
lasts for many minutes.

One of reasons of this stall is that
ttm_dma_pool_shrink_count()/ttm_dma_pool_shrink_scan() are called and
are blocked at mutex_lock(&_manager->lock). GFP_KERNEL allocation with
_manager->lock held causes someone (including kswapd) to deadlock when
these functions are called due to memory pressure. This patch changes
"mutex_lock();" to "if (!mutex_trylock()) return ...;" in order to
avoid deadlock.

Signed-off-by: Tetsuo Handa 
Signed-off-by: Dave Airlie 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -1014,7 +1014,8 @@ ttm_dma_pool_shrink_scan(struct shrinker
if (list_empty(&_manager->pools))
return SHRINK_STOP;
 
-   mutex_lock(&_manager->lock);
+   if (!mutex_trylock(&_manager->lock))
+   return SHRINK_STOP;
if (!_manager->npools)
goto out;
pool_offset = ++start_pool % _manager->npools;
@@ -1047,7 +1048,8 @@ ttm_dma_pool_shrink_count(struct shrinke
struct device_pools *p;
unsigned long count = 0;
 
-   mutex_lock(&_manager->lock);
+   if (!mutex_trylock(&_manager->lock))
+   return 0;
list_for_each_entry(p, &_manager->pools, pools)
count += p->pool->npages_free;
mutex_unlock(&_manager->lock);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 023/357] drm/radeon: tweak ACCEL_WORKING2 query for hawaii

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit 3c64bd26f7e9bd589ebe0d1ebec69ef2f784c12d upstream.

Return 2 so we can be sure the kernel has the necessary
changes for acceleration to work.

Note: This patch depends on these two commits:
 - drm/radeon: fix cut and paste issue for hawaii.
 - drm/radeon: use packet2 for nop on hawaii with old firmware

Signed-off-by: Alex Deucher 
Signed-off-by: Andreas Boll 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/radeon_kms.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -254,7 +254,14 @@ static int radeon_info_ioctl(struct drm_
}
break;
case RADEON_INFO_ACCEL_WORKING2:
-   *value = rdev->accel_working;
+   if (rdev->family == CHIP_HAWAII) {
+   if (rdev->accel_working)
+   *value = 2;
+   else
+   *value = 0;
+   } else {
+   *value = rdev->accel_working;
+   }
break;
case RADEON_INFO_TILING_CONFIG:
if (rdev->family >= CHIP_BONAIRE)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 025/357] drm/i915: read HEAD register back in init_ring_common() to enforce ordering

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Jiri Kosina 

commit ece4a17d237a79f63fbfaf3f724a12b6d500555c upstream.

Withtout this, ring initialization fails reliabily during resume with

[drm:init_ring_common] *ERROR* render ring initialization failed ctl 
0001f001 head ff8804 tail  start 000e4000

This is not a complete fix, but it is verified to make the ring
initialization failures during resume much less likely.

We were not able to root-cause this bug (likely HW-specific to Gen4 chips)
yet. This is therefore used as a ducttape before problem is fully
understood and proper fix created, so that people don't suffer from
completely unusable systems in the meantime.

The discussion and debugging is happening at

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

Signed-off-by: Jiri Kosina 
Signed-off-by: Daniel Vetter 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -517,6 +517,9 @@ static int init_ring_common(struct intel
else
ring_setup_phys_status_page(ring);
 
+   /* Enforce ordering by reading HEAD register back */
+   I915_READ_HEAD(ring);
+
/* Initialize the ring. This must happen _after_ we've cleared the ring
 * registers with the above sequence (the readback of the HEAD registers
 * also enforces ordering), otherwise the hw might lose the new ring


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 026/357] drm/i915: Disable RCS flips on Ivybridge

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Chris Wilson 

commit 2a92d5bca1999b69c78f3c3e97b5484985b094b9 upstream.

We currently see random GPU hangs when using RCS flips with multiple
pipes on Ivybridge. Now that we have mmio flips, we can fairly cheaply
fallback to using CPU driven flips instead.

Signed-off-by: Chris Wilson 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77104
Signed-off-by: Daniel Vetter 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9294,6 +9294,8 @@ static int intel_crtc_page_flip(struct d
 
if (IS_VALLEYVIEW(dev)) {
ring = _priv->ring[BCS];
+   } else if (IS_IVYBRIDGE(dev)) {
+   ring = _priv->ring[BCS];
} else if (INTEL_INFO(dev)->gen >= 7) {
ring = obj->ring;
if (ring == NULL || ring->id != RCS)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 027/357] of: Allow mem_reserve of memory with a base address of zero

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Al Cooper 

commit b5f2a8c02697c3685ccbbb66495465742ffa0dc1 upstream.

__reserved_mem_reserve_reg() won't reserve memory if the base address
is zero. This change removes the check for a base address of zero and
allows it to be reserved.

Allowing the first 4K of memory to be reserved will help solve a
problem on some ARM systems where the the first 16K of memory is
unused and becomes allocable memory. This will prevent this memory
from being used for DMA by drivers like the USB OHCI driver which
consider a physical address of zero to be illegal.

Signed-off-by: Al Cooper 
Signed-off-by: Grant Likely 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/of/fdt.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -453,7 +453,7 @@ static int __init __reserved_mem_reserve
base = dt_mem_next_cell(dt_root_addr_cells, );
size = dt_mem_next_cell(dt_root_size_cells, );
 
-   if (base && size &&
+   if (size &&
early_init_dt_reserve_memory_arch(base, size, nomap) == 0)
pr_debug("Reserved memory: reserved region for node 
'%s': base %pa, size %ld MiB\n",
uname, , (unsigned long)size / SZ_1M);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 030/357] pata_scc: propagate return value of scc_wait_after_reset

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Arjun Sreedharan 

commit 4dc7c76cd500fa78c64adfda4b070b870a2b993c upstream.

scc_bus_softreset not necessarily should return zero.
Propagate the error code.

Signed-off-by: Arjun Sreedharan 
Signed-off-by: Tejun Heo 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/ata/pata_scc.c |   15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct a
  * Note: Original code is ata_bus_softreset().
  */
 
-static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int 
devmask,
+static int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
   unsigned long deadline)
 {
struct ata_ioports *ioaddr = >ioaddr;
@@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(st
udelay(20);
out_be32(ioaddr->ctl_addr, ap->ctl);
 
-   scc_wait_after_reset(>link, devmask, deadline);
-
-   return 0;
+   return scc_wait_after_reset(>link, devmask, deadline);
 }
 
 /**
@@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link
 {
struct ata_port *ap = link->ap;
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
-   unsigned int devmask = 0, err_mask;
+   unsigned int devmask = 0;
+   int rc;
u8 err;
 
DPRINTK("ENTER\n");
@@ -634,9 +633,9 @@ static int scc_softreset(struct ata_link
 
/* issue bus reset */
DPRINTK("about to softreset, devmask=%x\n", devmask);
-   err_mask = scc_bus_softreset(ap, devmask, deadline);
-   if (err_mask) {
-   ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask);
+   rc = scc_bus_softreset(ap, devmask, deadline);
+   if (rc) {
+   ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", rc);
return -EIO;
}
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 028/357] of/irq: Fix lookup to use interrupts-extended property first

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Florian Fainelli 

commit a9ecdc0fdc54aa499604dbd43132988effcac9b4 upstream.

In case the Device Tree blob passed by the boot agent supplies both an
'interrupts-extended' and an 'interrupts' property in order to allow for
older kernels to be usable, prefer the new-style 'interrupts-extended'
property which conveys a lot more information.

This allows us to have bootloaders willingly maintaining backwards
compatibility with older kernels without entirely deprecating the
'interrupts' property.

Update the bindings documentation to describe a situation where both the
'interrupts-extended' and the 'interrupts' property are present, and
which one takes precedence over the other.

Acked-by: Rob Herring 
Signed-off-by: Brian Norris 
Signed-off-by: Florian Fainelli 
Signed-off-by: Grant Likely 
Signed-off-by: Greg Kroah-Hartman 

---
 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt |   12 
---
 drivers/of/irq.c  |   17 
+-
 2 files changed, 16 insertions(+), 13 deletions(-)

--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -4,11 +4,13 @@ Specifying interrupt information for dev
 1) Interrupt client nodes
 -
 
-Nodes that describe devices which generate interrupts must contain an either an
-"interrupts" property or an "interrupts-extended" property. These properties
-contain a list of interrupt specifiers, one per output interrupt. The format of
-the interrupt specifier is determined by the interrupt controller to which the
-interrupts are routed; see section 2 below for details.
+Nodes that describe devices which generate interrupts must contain an
+"interrupts" property, an "interrupts-extended" property, or both. If both are
+present, the latter should take precedence; the former may be provided simply
+for compatibility with software that does not recognize the latter. These
+properties contain a list of interrupt specifiers, one per output interrupt. 
The
+format of the interrupt specifier is determined by the interrupt controller to
+which the interrupts are routed; see section 2 below for details.
 
   Example:
interrupt-parent = <>;
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node
/* Get the reg property (if any) */
addr = of_get_property(device, "reg", NULL);
 
+   /* Try the new-style interrupts-extended first */
+   res = of_parse_phandle_with_args(device, "interrupts-extended",
+   "#interrupt-cells", index, out_irq);
+   if (!res)
+   return of_irq_parse_raw(addr, out_irq);
+
/* Get the interrupts property */
intspec = of_get_property(device, "interrupts", );
-   if (intspec == NULL) {
-   /* Try the new-style interrupts-extended */
-   res = of_parse_phandle_with_args(device, "interrupts-extended",
-   "#interrupt-cells", index, 
out_irq);
-   if (res)
-   return -EINVAL;
-   return of_irq_parse_raw(addr, out_irq);
-   }
+   if (intspec == NULL)
+   return -EINVAL;
+
intlen /= sizeof(*intspec);
 
pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 029/357] libata: widen Crucial M550 blacklist matching

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tejun Heo 

commit 2a13772a144d2956a7fedd18685921d0a9b8b783 upstream.

Crucial M550 may cause data corruption on queued trims and is
blacklisted.  The pattern used for it fails to match 1TB one as the
capacity section will be four chars instead of three.  Widen the
pattern.

Signed-off-by: Tejun Heo 
Reported-by: Charles Reiss 
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81071
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/ata/libata-core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4227,7 +4227,7 @@ static const struct ata_blacklist_entry
{ "Micron_M500*",   NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
{ "Crucial_CT???M500SSD*",  NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
{ "Micron_M550*",   NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
-   { "Crucial_CT???M550SSD*",  NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
+   { "Crucial_CT*M550SSD*",NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 
/*
 * Some WD SATA-I drives spin up and down erratically when the link


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 001/357] module: Clean up ro/nx after early module load failures

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Andy Lutomirski 

commit ff7e0055bb5ddbbb320cdd8dfd3e18672bddd2ad upstream.

The commit

4982223e51e8 module: set nx before marking module MODULE_STATE_COMING.

introduced a regression: if a module fails to parse its arguments or
if mod_sysfs_setup fails, then the module's memory will be freed
while still read-only.  Anything that reuses that memory will crash
as soon as it tries to write to it.

Cc: Rusty Russell 
Signed-off-by: Andy Lutomirski 
Signed-off-by: Rusty Russell 
Signed-off-by: Greg Kroah-Hartman 

---
 kernel/module.c |5 +
 1 file changed, 5 insertions(+)

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3308,6 +3308,11 @@ static int load_module(struct load_info
mutex_lock(_mutex);
module_bug_cleanup(mod);
mutex_unlock(_mutex);
+
+   /* we can't deallocate the module until we clear memory protection */
+   unset_module_init_ro_nx(mod);
+   unset_module_core_ro_nx(mod);
+
  ddebug_cleanup:
dynamic_debug_remove(info->debug);
synchronize_sched();


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 015/357] drm/ttm: Fix possible stack overflow by recursive shrinker calls.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tetsuo Handa 

commit 71336e011d1d2312bcbcaa8fcec7365024f3a95d upstream.

While ttm_dma_pool_shrink_scan() tries to take mutex before doing GFP_KERNEL
allocation, ttm_pool_shrink_scan() does not do it. This can result in stack
overflow if kmalloc() in ttm_page_pool_free() triggered recursion due to
memory pressure.

  shrink_slab()
  => ttm_pool_shrink_scan()
 => ttm_page_pool_free()
=> kmalloc(GFP_KERNEL)
   => shrink_slab()
  => ttm_pool_shrink_scan()
 => ttm_page_pool_free()
=> kmalloc(GFP_KERNEL)

Change ttm_pool_shrink_scan() to do like ttm_dma_pool_shrink_scan() does.

Signed-off-by: Tetsuo Handa 
Signed-off-by: Dave Airlie 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -391,14 +391,17 @@ out:
 static unsigned long
 ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 {
-   static atomic_t start_pool = ATOMIC_INIT(0);
+   static DEFINE_MUTEX(lock);
+   static unsigned start_pool;
unsigned i;
-   unsigned pool_offset = atomic_add_return(1, _pool);
+   unsigned pool_offset;
struct ttm_page_pool *pool;
int shrink_pages = sc->nr_to_scan;
unsigned long freed = 0;
 
-   pool_offset = pool_offset % NUM_POOLS;
+   if (!mutex_trylock())
+   return SHRINK_STOP;
+   pool_offset = ++start_pool % NUM_POOLS;
/* select start pool in round robin fashion */
for (i = 0; i < NUM_POOLS; ++i) {
unsigned nr_free = shrink_pages;
@@ -408,6 +411,7 @@ ttm_pool_shrink_scan(struct shrinker *sh
shrink_pages = ttm_page_pool_free(pool, nr_free);
freed += nr_free - shrink_pages;
}
+   mutex_unlock();
return freed;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 031/357] ahci: Add Device IDs for Intel 9 Series PCH

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: James Ralston 

commit 1b071a0947dbce5c184c12262e02540fbc493457 upstream.

This patch adds the AHCI mode SATA Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston 
Signed-off-by: Tejun Heo 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/ata/ahci.c |8 
 1 file changed, 8 insertions(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -305,6 +305,14 @@ static const struct pci_device_id ahci_p
{ PCI_VDEVICE(INTEL, 0x9c85), board_ahci }, /* Wildcat Point-LP RAID */
{ PCI_VDEVICE(INTEL, 0x9c87), board_ahci }, /* Wildcat Point-LP RAID */
{ PCI_VDEVICE(INTEL, 0x9c8f), board_ahci }, /* Wildcat Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x8c82), board_ahci }, /* 9 Series AHCI */
+   { PCI_VDEVICE(INTEL, 0x8c83), board_ahci }, /* 9 Series AHCI */
+   { PCI_VDEVICE(INTEL, 0x8c84), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x8c85), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x8c86), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
 
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 017/357] drm/radeon/dpm: handle voltage info fetching on hawaii

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit 6b57f20cb5b708415fbab63847f8f8429b051af8 upstream.

Some hawaii cards use a different method to fetch the
voltage info from the vbios.

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

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/ci_dpm.c |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -940,7 +940,18 @@ static void ci_get_leakage_voltages(stru
pi->vddc_leakage.count = 0;
pi->vddci_leakage.count = 0;
 
-   if (radeon_atom_get_leakage_id_from_vbios(rdev, _id) == 0) {
+   if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_EVV) {
+   for (i = 0; i < CISLANDS_MAX_LEAKAGE_COUNT; i++) {
+   virtual_voltage_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
+   if (radeon_atom_get_voltage_evv(rdev, 
virtual_voltage_id, ) != 0)
+   continue;
+   if (vddc != 0 && vddc != virtual_voltage_id) {
+   
pi->vddc_leakage.actual_voltage[pi->vddc_leakage.count] = vddc;
+   
pi->vddc_leakage.leakage_id[pi->vddc_leakage.count] = virtual_voltage_id;
+   pi->vddc_leakage.count++;
+   }
+   }
+   } else if (radeon_atom_get_leakage_id_from_vbios(rdev, _id) == 
0) {
for (i = 0; i < CISLANDS_MAX_LEAKAGE_COUNT; i++) {
virtual_voltage_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
if 
(radeon_atom_get_leakage_vddc_based_on_leakage_params(rdev, , ,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 032/357] ahci: add pcid for Marvel 0x9182 controller

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Murali Karicheri 

commit c5edfff9db6f4d2c35c802acb4abe0df178becee upstream.

Keystone K2E EVM uses Marvel 0x9182 controller. This requires support
for the ID in the ahci driver.

Signed-off-by: Murali Karicheri 
Signed-off-by: Tejun Heo 
Cc: Santosh Shilimkar 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/ata/ahci.c |2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -450,6 +450,8 @@ static const struct pci_device_id ahci_p
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a),
  .driver_data = board_ahci_yes_fbs },  /* 88se9172 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172),
+ .driver_data = board_ahci_yes_fbs },  /* 88se9182 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9182),
  .driver_data = board_ahci_yes_fbs },  /* 88se9172 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192),
  .driver_data = board_ahci_yes_fbs },  /* 88se9172 on 
some Gigabyte */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 018/357] drm/radeon: re-enable dpm by default on cayman

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit 8f500af4efe347d1a8ac674d115220e8caa84559 upstream.

This patch depends on:
b0880e87c1fd038b84498944f52e52c3e86ebe59
(drm/radeon/dpm: fix vddci setup typo on cayman)

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

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/radeon_pm.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1306,7 +1306,6 @@ int radeon_pm_init(struct radeon_device
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
-   case CHIP_CAYMAN:
/* DPM requires the RLC, RV770+ dGPU requires SMC */
if (!rdev->rlc_fw)
rdev->pm.pm_method = PM_METHOD_PROFILE;
@@ -1330,6 +1329,7 @@ int radeon_pm_init(struct radeon_device
case CHIP_PALM:
case CHIP_SUMO:
case CHIP_SUMO2:
+   case CHIP_CAYMAN:
case CHIP_ARUBA:
case CHIP_TAHITI:
case CHIP_PITCAIRN:


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL 3.18] tinification for 3.18

2014-10-03 Thread Josh Triplett
Sending this preview *before* the merge window opens, to make sure I
haven't gotten anything horribly wrong in the process.  This is my first
time having a tree in -next and sending direct pull requests for it.

Assuming this looks correct, I'll resend it once the merge window opens.


The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:

  Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/josh/linux.git 
tags/tiny/for-3.18

for you to fetch changes up to 3cf6b0151ba584714f6eafb99bc66d7326efeed7:

  Merge branches 'tiny/bloat-o-meter-no-SyS', 'tiny/more-procless', 
'tiny/no-advice', 'tiny/tinyconfig' and 'tiny/x86-boot-compressed-use-yn' into 
tiny/next (2014-09-22 23:14:40 -0700)


Tinification for 3.18


Josh Triplett (10):
  x86, platform, kconfig: move kvmconfig functionality to a helper
  x86: Add "make tinyconfig" to configure the tiniest possible kernel
  x86, boot: Use the usual -y -n mechanism for objects in vmlinux
  x86, boot: Don't compile aslr.c when !CONFIG_RANDOMIZE_BASE
  x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK
  x86: Drop support for /proc files when !CONFIG_PROC_FS
  x86: Support compiling out human-friendly processor feature names
  mm: Support compiling out madvise and fadvise
  bloat-o-meter: Ignore syscall aliases SyS_ and compat_SyS_
  Merge branches 'tiny/bloat-o-meter-no-SyS', 'tiny/more-procless', 
'tiny/no-advice', 'tiny/tinyconfig' and 'tiny/x86-boot-compressed-use-yn' into 
tiny/next

 arch/x86/Kconfig| 12 +
 arch/x86/Makefile   |  7 ---
 arch/x86/boot/Makefile  |  7 ++-
 arch/x86/boot/compressed/Makefile   | 19 +++
 arch/x86/boot/compressed/aslr.c |  3 --
 arch/x86/boot/compressed/early_serial_console.c |  4 --
 arch/x86/boot/cpu.c | 68 +++--
 arch/x86/configs/tiny.config|  1 +
 arch/x86/include/asm/cpufeature.h   |  7 +++
 arch/x86/kernel/cpu/Makefile|  7 ++-
 arch/x86/kernel/cpu/common.c|  4 +-
 init/Kconfig| 10 
 kernel/configs/tiny.config  |  4 ++
 kernel/sys_ni.c |  3 ++
 mm/Makefile |  7 ++-
 scripts/bloat-o-meter   |  2 +
 scripts/kconfig/Makefile| 19 +++
 17 files changed, 127 insertions(+), 57 deletions(-)
 create mode 100644 arch/x86/configs/tiny.config
 create mode 100644 kernel/configs/tiny.config
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 000/357] 3.16.4-stable review

2014-10-03 Thread Greg Kroah-Hartman
-
Note: This is a big stable release.  Mostly my fault for being on the
road last week, combined with an unusually large number of patches being
tagged for the stable tree.  Anyway, I've caught up with all pending
patches before 3.17-rc7, so if you have marked something for the stable
tree that I have not applied, or emailed the stable@v.k.o list asking
for a patch, that is not here, please let me know.
-

This is the start of the stable review cycle for the 3.16.4 release.
There are 357 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 Sun Oct  5 21:28:42 UTC 2014.
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.16.4-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-
Pseudo-Shortlog of commits:

Greg Kroah-Hartman 
Linux 3.16.4-rc1

Stephen Boyd 
clk: qcom: Fix PLL rate configurations

Stephen Boyd 
clk: qcom: mdp_lut_clk is a child of mdp_src

Stephen Boyd 
clk: qcom: Fix MN frequency tables, parent map, and jpegd

Arnd Bergmann 
staging/lustre: disable virtual block device for 64K pages

Theodore Ts'o 
ext4: avoid trying to kfree an ERR_PTR pointer

Theodore Ts'o 
ext4: propagate errors up to ext4_find_entry()'s callers

Gu Zheng 
aio: block exit_aio() until all context requests are completed

Suman Tripathi 
ahci_xgene: Removing NCQ support from the APM X-Gene SoC AHCI SATA Host 
Controller driver.

Nishanth Menon 
clk: ti: divider: Provide error check for incoming parameters in set_rate

Tero Kristo 
clk: prevent erronous parsing of children during rate change

Nishanth Menon 
clk: ti: dra7-atl: Provide error check for incoming parameters in set_rate

Viresh Kumar 
cpufreq: update 'cpufreq_suspended' after stopping governors

Dan Carpenter 
partitions: aix.c: off by one bug

Andy Shevchenko 
dmaengine: dw: don't perform DMA when dmaengine_submit is called

Andy Shevchenko 
dmaengine: dw: introduce dwc_dostart_first_queued() helper

Ulf Hansson 
mmc: mmci: Reverse IRQ handling for the arm_variant

Pablo Neira Ayuso 
netfilter: nf_tables: don't update chain with unset counters

Julian Anastasov 
ipvs: fix ipv6 hook registration for local replies

Daniel Borkmann 
netfilter: x_tables: allow to use default cgroup match

Alex Gartrell 
ipvs: Maintain all DSCP and ECN bits for ipv6 tun forwarding

Eric Dumazet 
netfilter: xt_hashlimit: perform garbage collection from process context

NeilBrown 
md/raid1: intialise start_next_window for READ case to avoid hang

NeilBrown 
md/raid1: fix_read_error should act on all non-faulty devices.

NeilBrown 
md/raid1: count resync requests in nr_pending.

NeilBrown 
md/raid1: update next_resync under resync_lock.

NeilBrown 
md/raid1: Don't use next_resync to determine how far resync has progressed

NeilBrown 
md/raid1: make sure resync waits for conflicting writes to complete.

NeilBrown 
md/raid1: be more cautious where we read-balance during resync.

NeilBrown 
md/raid1: clean up request counts properly in close_sync()

Zhaowei Yuan 
media: vb2: fix plane index sanity check in vb2_plane_cookie()

Hans Verkuil 
media: vb2: fix vb2 state check when start_streaming fails

Hans Verkuil 
media: videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages

Mauro Carvalho Chehab 
media: em28xx: fix VBI handling logic

Hans Verkuil 
media: adv7604: fix inverted condition

Bimow Chen 
media: af9033: update IT9135 tuner inittabs

Hans Verkuil 
media: cx18: fix kernel oops with tda8290 tuner

Antti Palosaari 
media: af9033: feed clock to RF tuner

Malcolm Priestley 
media: af9035: new IDs: add support for PCTV 78e and PCTV 79e

Bimow Chen 
media: it913x: init tuner on attach

Lan Tianyu 
cpufreq: fix cpufreq suspend/resume for intel_pstate

Prarit Bhargava 
cpufreq: release policy->rwsem on error

Bjorn Helgaas 
Revert "PCI: Make sure bus number resources stay within their parents 
bounds"

Johannes Berg 
nl80211: clear skb cb before passing to netlink

Tom Lendacky 
crypto: ccp - Check for CCP before registering crypto algs

David Hildenbrand 
blk-mq: Avoid race condition with uninitialized requests

Anton Altaparmakov 
Fix nasty 32-bit overflow bug in buffer i/o code.

Alex Deucher 
drm/radeon/px: fix module unload

Alex Deucher 
drm/nouveau/runpm: fix module unload

Alex Deucher 
vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops

Bjorn Helgaas 
Revert "PCI: Don't scan random busses in pci_scan_bridge()"

Bjorn Helgaas 
PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device

Zhiqiang Zhang 
arm: armv7: perf: fix 

[PATCH 3.16 019/357] drm/radeon: re-enable dpm by default on BTC

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit c08abf11900e19b14dd3a0cc3d105bd74519cd18 upstream.

This patch depends on:
e07929810f0a19ddd756558290c7d72827cbfcd9
(drm/radeon/dpm: fix typo in vddci setup for eg/btc)

bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=73053
https://bugzilla.kernel.org/show_bug.cgi?id=68571

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/radeon_pm.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1303,9 +1303,6 @@ int radeon_pm_init(struct radeon_device
case CHIP_RS780:
case CHIP_RS880:
case CHIP_RV770:
-   case CHIP_BARTS:
-   case CHIP_TURKS:
-   case CHIP_CAICOS:
/* DPM requires the RLC, RV770+ dGPU requires SMC */
if (!rdev->rlc_fw)
rdev->pm.pm_method = PM_METHOD_PROFILE;
@@ -1329,6 +1326,9 @@ int radeon_pm_init(struct radeon_device
case CHIP_PALM:
case CHIP_SUMO:
case CHIP_SUMO2:
+   case CHIP_BARTS:
+   case CHIP_TURKS:
+   case CHIP_CAICOS:
case CHIP_CAYMAN:
case CHIP_ARUBA:
case CHIP_TAHITI:


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 016/357] drm/ttm: Pass GFP flags in order to avoid deadlock.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tetsuo Handa 

commit a91576d7916f6cce76d30303e60e1ac47cf4a76d upstream.

Commit 7dc19d5a "drivers: convert shrinkers to new count/scan API" added
deadlock warnings that ttm_page_pool_free() and ttm_dma_page_pool_free()
are currently doing GFP_KERNEL allocation.

But these functions did not get updated to receive gfp_t argument.
This patch explicitly passes sc->gfp_mask or GFP_KERNEL to these functions,
and removes the deadlock warning.

Signed-off-by: Tetsuo Handa 
Signed-off-by: Dave Airlie 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c |   19 ++-
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c |   19 +--
 2 files changed, 19 insertions(+), 19 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -297,8 +297,10 @@ static void ttm_pool_update_free_locked(
  *
  * @pool: to free the pages from
  * @free_all: If set to true will free all pages in pool
+ * @gfp: GFP flags.
  **/
-static int ttm_page_pool_free(struct ttm_page_pool *pool, unsigned nr_free)
+static int ttm_page_pool_free(struct ttm_page_pool *pool, unsigned nr_free,
+ gfp_t gfp)
 {
unsigned long irq_flags;
struct page *p;
@@ -309,8 +311,7 @@ static int ttm_page_pool_free(struct ttm
if (NUM_PAGES_TO_ALLOC < nr_free)
npages_to_free = NUM_PAGES_TO_ALLOC;
 
-   pages_to_free = kmalloc(npages_to_free * sizeof(struct page *),
-   GFP_KERNEL);
+   pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
if (!pages_to_free) {
pr_err("Failed to allocate memory for pool free operation\n");
return 0;
@@ -382,9 +383,7 @@ out:
  *
  * XXX: (dchinner) Deadlock warning!
  *
- * ttm_page_pool_free() does memory allocation using GFP_KERNEL.  that means
- * this can deadlock when called a sc->gfp_mask that is not equal to
- * GFP_KERNEL.
+ * We need to pass sc->gfp_mask to ttm_page_pool_free().
  *
  * This code is crying out for a shrinker per pool
  */
@@ -408,7 +407,8 @@ ttm_pool_shrink_scan(struct shrinker *sh
if (shrink_pages == 0)
break;
pool = &_manager->pools[(i + pool_offset)%NUM_POOLS];
-   shrink_pages = ttm_page_pool_free(pool, nr_free);
+   shrink_pages = ttm_page_pool_free(pool, nr_free,
+ sc->gfp_mask);
freed += nr_free - shrink_pages;
}
mutex_unlock();
@@ -710,7 +710,7 @@ static void ttm_put_pages(struct page **
}
spin_unlock_irqrestore(>lock, irq_flags);
if (npages)
-   ttm_page_pool_free(pool, npages);
+   ttm_page_pool_free(pool, npages, GFP_KERNEL);
 }
 
 /*
@@ -850,7 +850,8 @@ void ttm_page_alloc_fini(void)
ttm_pool_mm_shrink_fini(_manager);
 
for (i = 0; i < NUM_POOLS; ++i)
-   ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES);
+   ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES,
+  GFP_KERNEL);
 
kobject_put(&_manager->kobj);
_manager = NULL;
--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -411,8 +411,10 @@ static void ttm_dma_page_put(struct dma_
  *
  * @pool: to free the pages from
  * @nr_free: If set to true will free all pages in pool
+ * @gfp: GFP flags.
  **/
-static unsigned ttm_dma_page_pool_free(struct dma_pool *pool, unsigned nr_free)
+static unsigned ttm_dma_page_pool_free(struct dma_pool *pool, unsigned nr_free,
+  gfp_t gfp)
 {
unsigned long irq_flags;
struct dma_page *dma_p, *tmp;
@@ -430,8 +432,7 @@ static unsigned ttm_dma_page_pool_free(s
 npages_to_free, nr_free);
}
 #endif
-   pages_to_free = kmalloc(npages_to_free * sizeof(struct page *),
-   GFP_KERNEL);
+   pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
 
if (!pages_to_free) {
pr_err("%s: Failed to allocate memory for pool free 
operation\n",
@@ -530,7 +531,7 @@ static void ttm_dma_free_pool(struct dev
if (pool->type != type)
continue;
/* Takes a spinlock.. */
-   ttm_dma_page_pool_free(pool, FREE_ALL_PAGES);
+   ttm_dma_page_pool_free(pool, FREE_ALL_PAGES, GFP_KERNEL);
WARN_ON(((pool->npages_in_use + pool->npages_free) != 0));
/* This code path is called after _all_ references to the
 * struct device has been dropped - so nobody should be
@@ -983,7 +984,7 @@ void ttm_dma_unpopulate(struct ttm_dma_t
 
/* shrink pool if necessary (only on !is_cached pools)*/

[PATCH 3.16 020/357] drm/radeon: load the lm63 driver for an lm64 thermal chip.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit 5dc355325b648dc9b4cf3bea4d968de46fd59215 upstream.

Looks like the lm63 driver supports the lm64 as well.

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/radeon_atombios.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1963,7 +1963,7 @@ static const char *thermal_controller_na
"adm1032",
"adm1030",
"max6649",
-   "lm64",
+   "lm63", /* lm64 */
"f75375",
"asc7xxx",
 };
@@ -1974,7 +1974,7 @@ static const char *pp_lib_thermal_contro
"adm1032",
"adm1030",
"max6649",
-   "lm64",
+   "lm63", /* lm64 */
"f75375",
"RV6xx",
"RV770",


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 044/357] i2c: rk3x: fix bug that cause transfer fails in master receive mode

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: addy ke 

commit 5da4309f9e1b4de9c2b69e917912fbb84006d44e upstream.

In rk3x SOC, the I2C controller can receive/transmit up to 32 bytes data
in one chunk, so the size of data to be write/read to/from TXDATAx/RXDATAx
must be less than or equal 32 bytes at a time.

Tested on rk3288-pinky board, elan receive 158 bytes data.

Signed-off-by: Addy Ke 
Acked-by: Max Schwarz 
Reviewed-by: Doug Anderson 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-rk3x.c |4 
 1 file changed, 4 insertions(+)

--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -323,6 +323,10 @@ static void rk3x_i2c_handle_read(struct
/* ack interrupt */
i2c_writel(i2c, REG_INT_MBRF, REG_IPD);
 
+   /* Can only handle a maximum of 32 bytes at a time */
+   if (len > 32)
+   len = 32;
+
/* read the data from receive buffer */
for (i = 0; i < len; ++i) {
if (i % 4 == 0)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 046/357] i2c: at91: add bound checking on SMBus block length bytes

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Marek Roszko 

commit 75b81f339c6af43f6f4a1b3eabe0603321dade65 upstream.

The driver was not bound checking the received length byte to ensure it was 
within the
the buffer size that is allocated for SMBus blocks. This resulted in buffer 
overflows
whenever an invalid length byte was received.
It also failed to ensure the length byte was not zero. If it received zero, it 
would end up
in an infinite loop as the at91_twi_read_next_byte function returned 
immediately without
allowing RHR to be read to clear the RXRDY interrupt.

Tested agaisnt a SMBus compliant battery.

Signed-off-by: Marek Roszko 
Acked-by: Ludovic Desroches 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-at91.c |   28 
 1 file changed, 24 insertions(+), 4 deletions(-)

--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -101,6 +101,7 @@ struct at91_twi_dev {
unsigned twi_cwgr_reg;
struct at91_twi_pdata *pdata;
bool use_dma;
+   bool recv_len_abort;
struct at91_twi_dma dma;
 };
 
@@ -267,12 +268,24 @@ static void at91_twi_read_next_byte(stru
*dev->buf = at91_twi_read(dev, AT91_TWI_RHR) & 0xff;
--dev->buf_len;
 
+   /* return if aborting, we only needed to read RHR to clear RXRDY*/
+   if (dev->recv_len_abort)
+   return;
+
/* handle I2C_SMBUS_BLOCK_DATA */
if (unlikely(dev->msg->flags & I2C_M_RECV_LEN)) {
-   dev->msg->flags &= ~I2C_M_RECV_LEN;
-   dev->buf_len += *dev->buf;
-   dev->msg->len = dev->buf_len + 1;
-   dev_dbg(dev->dev, "received block length %d\n", dev->buf_len);
+   /* ensure length byte is a valid value */
+   if (*dev->buf <= I2C_SMBUS_BLOCK_MAX && *dev->buf > 0) {
+   dev->msg->flags &= ~I2C_M_RECV_LEN;
+   dev->buf_len += *dev->buf;
+   dev->msg->len = dev->buf_len + 1;
+   dev_dbg(dev->dev, "received block length %d\n",
+dev->buf_len);
+   } else {
+   /* abort and send the stop by reading one more byte */
+   dev->recv_len_abort = true;
+   dev->buf_len = 1;
+   }
}
 
/* send stop if second but last byte has been read */
@@ -444,6 +457,12 @@ static int at91_do_twi_transfer(struct a
ret = -EIO;
goto error;
}
+   if (dev->recv_len_abort) {
+   dev_err(dev->dev, "invalid smbus block length recvd\n");
+   ret = -EPROTO;
+   goto error;
+   }
+
dev_dbg(dev->dev, "transfer complete\n");
 
return 0;
@@ -500,6 +519,7 @@ static int at91_twi_xfer(struct i2c_adap
dev->buf_len = m_start->len;
dev->buf = m_start->buf;
dev->msg = m_start;
+   dev->recv_len_abort = false;
 
ret = at91_do_twi_transfer(dev);
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 047/357] i2c: at91: Fix a race condition during signal handling in at91_do_twi_xfer.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Simon Lindgren 

commit 6721f28a26efd6368497abbdef5dcfc59608d899 upstream.

There is a race condition in at91_do_twi_xfer when signals arrive.
If a signal is recieved while waiting for a transfer to complete
wait_for_completion_interruptible_timeout() will return -ERESTARTSYS.
This is not handled correctly resulting in interrupts still being
enabled and a transfer being in flight when we return.

Symptoms include a range of oopses and bus lockups. Oopses can happen
when the transfer completes because the interrupt handler will corrupt
the stack. If a new transfer is started before the interrupt fires
the controller will start a new transfer in the middle of the old one,
resulting in confused slaves and a locked bus.

To avoid this, use wait_for_completion_io_timeout instead so that we
don't have to deal with gracefully shutting down the transfer and
disabling the interrupts.

Signed-off-by: Simon Lindgren 
Acked-by: Ludovic Desroches 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-at91.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -434,8 +434,8 @@ static int at91_do_twi_transfer(struct a
}
}
 
-   ret = wait_for_completion_interruptible_timeout(>cmd_complete,
-   dev->adapter.timeout);
+   ret = wait_for_completion_io_timeout(>cmd_complete,
+dev->adapter.timeout);
if (ret == 0) {
dev_err(dev->dev, "controller timed out\n");
at91_init_twi_bus(dev);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 045/357] i2c: mv64xxx: continue probe when clock-frequency is missing

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Chen-Yu Tsai 

commit 0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7 upstream.

The "clock-frequency" DT property is listed as optional, However,
the current code stores the return value of of_property_read_u32 in
the return code of mv64xxx_of_config, but then forgets to clear it
after setting the default value of "clock-frequency". It is then
passed out to the main probe function, resulting in a probe failure
when "clock-frequency" is missing.

This patch checks and then throws away the return value of
of_property_read_u32, instead of storing it and having to clear it
afterwards.

This issue was discovered after the property was removed from all
sunxi DTs.

Fixes: 4c730a06c19bb ("i2c: mv64xxx: Set bus frequency to 100kHz if 
clock-frequency is not provided")
Signed-off-by: Chen-Yu Tsai 
Acked-by: Andrew Lunn 
Acked-by: Maxime Ripard 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-mv64xxx.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -746,8 +746,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_dat
}
tclk = clk_get_rate(drv_data->clk);
 
-   rc = of_property_read_u32(np, "clock-frequency", _freq);
-   if (rc)
+   if (of_property_read_u32(np, "clock-frequency", _freq))
bus_freq = 10; /* 100kHz by default */
 
if (!mv64xxx_find_baud_factors(bus_freq, tclk,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 050/357] i2c: rcar: fix RCAR_IRQ_ACK_{RECV|SEND}

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Sergei Shtylyov 

commit 938916fbb8e8cb67eacb784f4eda17e2950c16c5 upstream.

Bits 8-31 of all registers reflect the value of bits 0-7 on reads and should be
0 on writes, according to the manuals. RCAR_IRQ_ACK_{RECV|SEND} macros have all
1's in bits 8-31, thus going against the manuals, so fix them.

Signed-off-by: Sergei Shtylyov 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-rcar.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -76,8 +76,8 @@
 #define RCAR_IRQ_RECV  (MNR | MAL | MST | MAT | MDR)
 #define RCAR_IRQ_STOP  (MST)
 
-#define RCAR_IRQ_ACK_SEND  (~(MAT | MDE))
-#define RCAR_IRQ_ACK_RECV  (~(MAT | MDR))
+#define RCAR_IRQ_ACK_SEND  (~(MAT | MDE) & 0xFF)
+#define RCAR_IRQ_ACK_RECV  (~(MAT | MDR) & 0xFF)
 
 #define ID_LAST_MSG(1 << 0)
 #define ID_IOERROR (1 << 1)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 048/357] Revert "i2c: rcar: remove spinlock"

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Sergei Shtylyov 

commit 91bfe2989af02e709ca01ccf518c4fbda3efc70f upstream.

This reverts commit 150b8be3cda54412ad7b54f5392b513b25c0aaa7.

The I2C core's per-adapter locks can't protect from IRQs, so the driver still
needs a spinlock to protect the register accesses.

Signed-off-by: Sergei Shtylyov 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-rcar.c |   22 ++
 1 file changed, 22 insertions(+)

--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* register offsets */
 #define ICSCR  0x00/* slave ctrl */
@@ -95,6 +96,7 @@ struct rcar_i2c_priv {
struct i2c_msg  *msg;
struct clk *clk;
 
+   spinlock_t lock;
wait_queue_head_t wait;
 
int pos;
@@ -365,6 +367,9 @@ static irqreturn_t rcar_i2c_irq(int irq,
struct rcar_i2c_priv *priv = ptr;
u32 msr;
 
+   /*-- spin lock -*/
+   spin_lock(>lock);
+
msr = rcar_i2c_read(priv, ICMSR);
 
/* Arbitration lost */
@@ -400,6 +405,9 @@ out:
wake_up(>wait);
}
 
+   spin_unlock(>lock);
+   /*-- spin unlock -*/
+
return IRQ_HANDLED;
 }
 
@@ -409,14 +417,21 @@ static int rcar_i2c_master_xfer(struct i
 {
struct rcar_i2c_priv *priv = i2c_get_adapdata(adap);
struct device *dev = rcar_i2c_priv_to_dev(priv);
+   unsigned long flags;
int i, ret, timeout;
 
pm_runtime_get_sync(dev);
 
+   /*-- spin lock -*/
+   spin_lock_irqsave(>lock, flags);
+
rcar_i2c_init(priv);
/* start clock */
rcar_i2c_write(priv, ICCCR, priv->icccr);
 
+   spin_unlock_irqrestore(>lock, flags);
+   /*-- spin unlock -*/
+
ret = rcar_i2c_bus_barrier(priv);
if (ret < 0)
goto out;
@@ -428,6 +443,9 @@ static int rcar_i2c_master_xfer(struct i
break;
}
 
+   /*-- spin lock -*/
+   spin_lock_irqsave(>lock, flags);
+
/* init each data */
priv->msg   = [i];
priv->pos   = 0;
@@ -437,6 +455,9 @@ static int rcar_i2c_master_xfer(struct i
 
ret = rcar_i2c_prepare_msg(priv);
 
+   spin_unlock_irqrestore(>lock, flags);
+   /*-- spin unlock -*/
+
if (ret < 0)
break;
 
@@ -540,6 +561,7 @@ static int rcar_i2c_probe(struct platfor
 
irq = platform_get_irq(pdev, 0);
init_waitqueue_head(>wait);
+   spin_lock_init(>lock);
 
adap= >adap;
adap->nr= pdev->id;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 043/357] ARM/ARM64: KVM: Nuke Hyp-mode tlbs before enabling MMU

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Pranavkumar Sawargaonkar 

commit f6edbbf36da3a27b298b66c7955fc84e1dcca305 upstream.

X-Gene u-boot runs in EL2 mode with MMU enabled hence we might
have stale EL2 tlb enteris when we enable EL2 MMU on each host CPU.

This can happen on any ARM/ARM64 board running bootloader in
Hyp-mode (or EL2-mode) with MMU enabled.

This patch ensures that we flush all Hyp-mode (or EL2-mode) TLBs
on each host CPU before enabling Hyp-mode (or EL2-mode) MMU.

Tested-by: Mark Rutland 
Reviewed-by: Marc Zyngier 
Signed-off-by: Pranavkumar Sawargaonkar 
Signed-off-by: Anup Patel 
Signed-off-by: Christoffer Dall 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm/kvm/init.S   |4 
 arch/arm64/kvm/hyp-init.S |4 
 2 files changed, 8 insertions(+)

--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -98,6 +98,10 @@ __do_hyp_init:
mrc p15, 0, r0, c10, c2, 1
mcr p15, 4, r0, c10, c2, 1
 
+   @ Invalidate the stale TLBs from Bootloader
+   mcr p15, 4, r0, c8, c7, 0   @ TLBIALLH
+   dsb ish
+
@ Set the HSCTLR to:
@  - ARM/THUMB exceptions: Kernel config (Thumb-2 kernel)
@  - Endianness: Kernel config
--- a/arch/arm64/kvm/hyp-init.S
+++ b/arch/arm64/kvm/hyp-init.S
@@ -80,6 +80,10 @@ __do_hyp_init:
msr mair_el2, x4
isb
 
+   /* Invalidate the stale TLBs from Bootloader */
+   tlbialle2
+   dsb sy
+
mrs x4, sctlr_el2
and x4, x4, #SCTLR_EL2_EE   // preserve endianness of EL2
ldr x5, =SCTLR_EL2_FLAGS


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 052/357] i2c: ismt: use correct length when copy buffer

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Fan Du 

commit 979bbf7b7ae75cfc06e09d09eda38009a3bdc4a4 upstream.

In block write mode, when encapsulating dma_buffer, first element is
'command', the rest is data buffer, so only copy actual data buffer
starting from block[1] with the size indicating by block[0].

Signed-off-by: Fan Du 
Acked-by: Neil Horman 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-ismt.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -497,7 +497,7 @@ static int ismt_access(struct i2c_adapte
desc->wr_len_cmd = dma_size;
desc->control |= ISMT_DESC_BLK;
priv->dma_buffer[0] = command;
-   memcpy(>dma_buffer[1], >block[1], dma_size);
+   memcpy(>dma_buffer[1], >block[1], dma_size 
- 1);
} else {
/* Block Read */
dev_dbg(dev, "I2C_SMBUS_BLOCK_DATA:  READ\n");
@@ -525,7 +525,7 @@ static int ismt_access(struct i2c_adapte
desc->wr_len_cmd = dma_size;
desc->control |= ISMT_DESC_I2C;
priv->dma_buffer[0] = command;
-   memcpy(>dma_buffer[1], >block[1], dma_size);
+   memcpy(>dma_buffer[1], >block[1], dma_size 
- 1);
} else {
/* i2c Block Read */
dev_dbg(dev, "I2C_SMBUS_I2C_BLOCK_DATA:  READ\n");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 051/357] i2c: rk3x: fix divisor calculation for SCL frequency

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: addy ke 

commit b4a7bd7a386dc6b0bb49cb47614e06e8295d495a upstream.

I2C_CLKDIV register descripted in the previous version of
RK3x chip manual is incorrect. Plus 1 is required.

The correct formula:
- T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8
- T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8
- (SCL Divsor) = 8 * ((CLKDIVL + 1) + (CLKDIVH + 1))
- SCL = PCLK / (CLK Divsor)

It will be updated to the latest version of chip manual.

Signed-off-by: Addy Ke 
Reviewed-by: Doug Anderson 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-rk3x.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -433,12 +433,11 @@ static void rk3x_i2c_set_scl_rate(struct
unsigned long i2c_rate = clk_get_rate(i2c->clk);
unsigned int div;
 
-   /* SCL rate = (clk rate) / (8 * DIV) */
-   div = DIV_ROUND_UP(i2c_rate, scl_rate * 8);
-
-   /* The lower and upper half of the CLKDIV reg describe the length of
-* SCL low & high periods. */
-   div = DIV_ROUND_UP(div, 2);
+   /* set DIV = DIVH = DIVL
+* SCL rate = (clk rate) / (8 * (DIVH + 1 + DIVL + 1))
+*  = (clk rate) / (16 * (DIV + 1))
+*/
+   div = DIV_ROUND_UP(i2c_rate, scl_rate * 16) - 1;
 
i2c_writel(i2c, (div << 16) | (div & 0x), REG_CLKDIV);
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 053/357] ftrace: Use current addr when converting to nop in __ftrace_replace_code()

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: "Steven Rostedt (Red Hat)" 

commit 39b5552cd5090d4c210d278cd2732f493075f033 upstream.

In __ftrace_replace_code(), when converting the call to a nop in a function
it needs to compare against the "curr" (current) value of the ftrace ops, and
not the "new" one. It currently does not affect x86 which is the only arch
to do the trampolines with function graph tracer, but when other archs that do
depend on this code implement the function graph trampoline, it can crash.

Here's an example when ARM uses the trampolines (in the future):

 [ cut here ]
 WARNING: CPU: 0 PID: 9 at kernel/trace/ftrace.c:1716 ftrace_bug+0x17c/0x1f4()
 Modules linked in: omap_rng rng_core ipv6
 CPU: 0 PID: 9 Comm: migration/0 Not tainted 
3.16.0-test-10959-gf0094b28f303-dirty #52
 [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
 [] (show_stack) from [] (dump_stack+0x78/0x94)
 [] (dump_stack) from [] (warn_slowpath_common+0x7c/0x9c)
 [] (warn_slowpath_common) from [] 
(warn_slowpath_null+0x2c/0x34)
 [] (warn_slowpath_null) from [] (ftrace_bug+0x17c/0x1f4)
 [] (ftrace_bug) from [] (ftrace_replace_code+0x80/0x9c)
 [] (ftrace_replace_code) from [] 
(ftrace_modify_all_code+0xb8/0x164)
 [] (ftrace_modify_all_code) from [] 
(__ftrace_modify_code+0x14/0x1c)
 [] (__ftrace_modify_code) from [] 
(multi_cpu_stop+0xf4/0x134)
 [] (multi_cpu_stop) from [] (cpu_stopper_thread+0x54/0x130)
 [] (cpu_stopper_thread) from [] 
(smpboot_thread_fn+0x1ac/0x1bc)
 [] (smpboot_thread_fn) from [] (kthread+0xe0/0xfc)
 [] (kthread) from [] (ret_from_fork+0x14/0x20)
 ---[ end trace dc9ce72c5b617d8f ]---
[   65.047264] ftrace failed to modify [] asm_do_IRQ+0x10/0x1c
[   65.054070]  actual: 85:1b:00:eb

Fixes: 7413af1fb70e7 "ftrace: Make get_ftrace_addr() and get_ftrace_addr_old() 
global"
Signed-off-by: Steven Rostedt 
Signed-off-by: Greg Kroah-Hartman 

---
 kernel/trace/ftrace.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1809,7 +1809,7 @@ __ftrace_replace_code(struct dyn_ftrace
return ftrace_make_call(rec, ftrace_addr);
 
case FTRACE_UPDATE_MAKE_NOP:
-   return ftrace_make_nop(NULL, rec, ftrace_addr);
+   return ftrace_make_nop(NULL, rec, ftrace_old_addr);
 
case FTRACE_UPDATE_MODIFY_CALL:
return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 049/357] i2c: rcar: fix MNR interrupt handling

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Sergei Shtylyov 

commit dd318b0df27c582ac0d72a346fd6e693700be23c upstream.

Sometimes the MNR and MST interrupts happen simultaneously  (stop  automatically
follows NACK, according to the manuals) and in such case the ID_NACK flag  isn't
set since the MST interrupt handling precedes MNR and all interrupts are cleared
and disabled then, so that MNR interrupt is never noticed -- this causes NACK'ed
transfers to be falsely reported as successful. Exchanging MNR and  MST handlers
fixes this issue, however the MNR bit  somehow  gets set again even after  being
explicitly cleared, so I decided to completely suppress handling of all disabled
interrupts (which is a good thing anyway)...

Signed-off-by: Sergei Shtylyov 
Signed-off-by: Wolfram Sang 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/i2c/busses/i2c-rcar.c |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -372,18 +372,15 @@ static irqreturn_t rcar_i2c_irq(int irq,
 
msr = rcar_i2c_read(priv, ICMSR);
 
+   /* Only handle interrupts that are currently enabled */
+   msr &= rcar_i2c_read(priv, ICMIER);
+
/* Arbitration lost */
if (msr & MAL) {
rcar_i2c_flags_set(priv, (ID_DONE | ID_ARBLOST));
goto out;
}
 
-   /* Stop */
-   if (msr & MST) {
-   rcar_i2c_flags_set(priv, ID_DONE);
-   goto out;
-   }
-
/* Nack */
if (msr & MNR) {
/* go to stop phase */
@@ -393,6 +390,12 @@ static irqreturn_t rcar_i2c_irq(int irq,
goto out;
}
 
+   /* Stop */
+   if (msr & MST) {
+   rcar_i2c_flags_set(priv, ID_DONE);
+   goto out;
+   }
+
if (rcar_i2c_is_recv(priv))
rcar_i2c_flags_set(priv, rcar_i2c_irq_recv(priv, msr));
else


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 035/357] aio: fix reqs_available handling

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Benjamin LaHaise 

commit d856f32a86b2b015ab180ab7a55e455ed8d3ccc5 upstream.

As reported by Dan Aloni, commit f8567a3845ac ("aio: fix aio request
leak when events are reaped by userspace") introduces a regression when
user code attempts to perform io_submit() with more events than are
available in the ring buffer.  Reverting that commit would reintroduce a
regression when user space event reaping is used.

Fixing this bug is a bit more involved than the previous attempts to fix
this regression.  Since we do not have a single point at which we can
count events as being reaped by user space and io_getevents(), we have
to track event completion by looking at the number of events left in the
event ring.  So long as there are as many events in the ring buffer as
there have been completion events generate, we cannot call
put_reqs_available().  The code to check for this is now placed in
refill_reqs_available().

A test program from Dan and modified by me for verifying this bug is available
at http://www.kvack.org/~bcrl/20140824-aio_bug.c .

Reported-by: Dan Aloni 
Signed-off-by: Benjamin LaHaise 
Acked-by: Dan Aloni 
Cc: Kent Overstreet 
Cc: Mateusz Guzik 
Cc: Petr Matousek 
Signed-off-by: Linus Torvalds 
Signed-off-by: Greg Kroah-Hartman 

---
 fs/aio.c |   77 +++
 1 file changed, 73 insertions(+), 4 deletions(-)

--- a/fs/aio.c
+++ b/fs/aio.c
@@ -141,6 +141,7 @@ struct kioctx {
 
struct {
unsignedtail;
+   unsignedcompleted_events;
spinlock_t  completion_lock;
} cacheline_aligned_in_smp;
 
@@ -880,6 +881,68 @@ out:
return ret;
 }
 
+/* refill_reqs_available
+ * Updates the reqs_available reference counts used for tracking the
+ * number of free slots in the completion ring.  This can be called
+ * from aio_complete() (to optimistically update reqs_available) or
+ * from aio_get_req() (the we're out of events case).  It must be
+ * called holding ctx->completion_lock.
+ */
+static void refill_reqs_available(struct kioctx *ctx, unsigned head,
+  unsigned tail)
+{
+   unsigned events_in_ring, completed;
+
+   /* Clamp head since userland can write to it. */
+   head %= ctx->nr_events;
+   if (head <= tail)
+   events_in_ring = tail - head;
+   else
+   events_in_ring = ctx->nr_events - (head - tail);
+
+   completed = ctx->completed_events;
+   if (events_in_ring < completed)
+   completed -= events_in_ring;
+   else
+   completed = 0;
+
+   if (!completed)
+   return;
+
+   ctx->completed_events -= completed;
+   put_reqs_available(ctx, completed);
+}
+
+/* user_refill_reqs_available
+ * Called to refill reqs_available when aio_get_req() encounters an
+ * out of space in the completion ring.
+ */
+static void user_refill_reqs_available(struct kioctx *ctx)
+{
+   spin_lock_irq(>completion_lock);
+   if (ctx->completed_events) {
+   struct aio_ring *ring;
+   unsigned head;
+
+   /* Access of ring->head may race with aio_read_events_ring()
+* here, but that's okay since whether we read the old version
+* or the new version, and either will be valid.  The important
+* part is that head cannot pass tail since we prevent
+* aio_complete() from updating tail by holding
+* ctx->completion_lock.  Even if head is invalid, the check
+* against ctx->completed_events below will make sure we do the
+* safe/right thing.
+*/
+   ring = kmap_atomic(ctx->ring_pages[0]);
+   head = ring->head;
+   kunmap_atomic(ring);
+
+   refill_reqs_available(ctx, head, ctx->tail);
+   }
+
+   spin_unlock_irq(>completion_lock);
+}
+
 /* aio_get_req
  * Allocate a slot for an aio request.
  * Returns NULL if no requests are free.
@@ -888,8 +951,11 @@ static inline struct kiocb *aio_get_req(
 {
struct kiocb *req;
 
-   if (!get_reqs_available(ctx))
-   return NULL;
+   if (!get_reqs_available(ctx)) {
+   user_refill_reqs_available(ctx);
+   if (!get_reqs_available(ctx))
+   return NULL;
+   }
 
req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL|__GFP_ZERO);
if (unlikely(!req))
@@ -948,8 +1014,8 @@ void aio_complete(struct kiocb *iocb, lo
struct kioctx   *ctx = iocb->ki_ctx;
struct aio_ring *ring;
struct io_event *ev_page, *event;
+   unsigned tail, pos, head;
unsigned long   flags;
-   unsigned tail, pos;
 
/*
 * Special case handling for sync iocbs:
@@ -1010,10 

[PATCH 3.16 055/357] arm64: ptrace: fix compat hardware watchpoint reporting

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Will Deacon 

commit 27d7ff273c2aad37b28f6ff0cab2cfa35b51e648 upstream.

I'm not sure what I was on when I wrote this, but when iterating over
the hardware watchpoint array (hbp_watch_array), our index is off by
ARM_MAX_BRP, so we walk off the end of our thread_struct...

... except, a dodgy condition in the loop means that it never executes
at all (bp cannot be NULL).

This patch fixes the code so that we remove the bp check and use the
correct index for accessing the watchpoint structures.

Signed-off-by: Will Deacon 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm64/include/asm/hw_breakpoint.h |1 -
 arch/arm64/kernel/ptrace.c |3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arm64/include/asm/hw_breakpoint.h
+++ b/arch/arm64/include/asm/hw_breakpoint.h
@@ -79,7 +79,6 @@ static inline void decode_ctrl_reg(u32 r
  */
 #define ARM_MAX_BRP16
 #define ARM_MAX_WRP16
-#define ARM_MAX_HBP_SLOTS  (ARM_MAX_BRP + ARM_MAX_WRP)
 
 /* Virtual debug register bases. */
 #define AARCH64_DBG_REG_BVR0
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -85,7 +85,8 @@ static void ptrace_hbptriggered(struct p
break;
}
}
-   for (i = ARM_MAX_BRP; i < ARM_MAX_HBP_SLOTS && !bp; ++i) {
+
+   for (i = 0; i < ARM_MAX_WRP; ++i) {
if (current->thread.debug.hbp_watch[i] == bp) {
info.si_errno = -((i << 1) + 1);
break;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 054/357] trace: Fix epoll hang when we race with new entries

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Josef Bacik 

commit 4ce97dbf50245227add17c83d87dc838e7ca79d0 upstream.

Epoll on trace_pipe can sometimes hang in a weird case.  If the ring buffer is
empty when we set waiters_pending but an event shows up exactly at that moment
we can miss being woken up by the ring buffers irq work.  Since
ring_buffer_empty() is inherently racey we will sometimes think that the buffer
is not empty.  So we don't get woken up and we don't think there are any events
even though there were some ready when we added the watch, which makes us hang.
This patch fixes this by making sure that we are actually on the wait list
before we set waiters_pending, and add a memory barrier to make sure
ring_buffer_empty() is going to be correct.

Link: http://lkml.kernel.org/p/1408989581-23727-1-git-send-email-jba...@fb.com

Cc: Martin Lau 
Signed-off-by: Josef Bacik 
Signed-off-by: Steven Rostedt 
Signed-off-by: Greg Kroah-Hartman 

---
 kernel/trace/ring_buffer.c |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -626,8 +626,22 @@ int ring_buffer_poll_wait(struct ring_bu
work = _buffer->irq_work;
}
 
-   work->waiters_pending = true;
poll_wait(filp, >waiters, poll_table);
+   work->waiters_pending = true;
+   /*
+* There's a tight race between setting the waiters_pending and
+* checking if the ring buffer is empty.  Once the waiters_pending bit
+* is set, the next event will wake the task up, but we can get stuck
+* if there's only a single event in.
+*
+* FIXME: Ideally, we need a memory barrier on the writer side as well,
+* but adding a memory barrier to all events will cause too much of a
+* performance hit in the fast path.  We only need a memory barrier when
+* the buffer goes from empty to having content.  But as this race is
+* extremely small, and it's not a problem if another event comes in, we
+* will fix it later.
+*/
+   smp_mb();
 
if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) ||
(cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, 
cpu)))


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 057/357] ALSA: dice: fix wrong channel mappping at higher sampling rate

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Takashi Sakamoto 

commit 1033eb5b5aeeb526c22068e0fb0cef9f3c14231e upstream.

The channel mapping is initialized by amdtp_stream_set_parameters(), however
Dice driver set it before calling this function. Furthermore, the setting is
wrong because the index is the value of array, and vice versa.

This commit moves codes for channel mapping after the function and set it 
correctly.

Reported-by: Daniel Robbins 
Fixes: 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete 
CIP_HI_DUALWIRE")
Signed-off-by: Takashi Sakamoto 
Signed-off-by: Takashi Iwai 
Signed-off-by: Greg Kroah-Hartman 

---
 sound/firewire/dice.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

--- a/sound/firewire/dice.c
+++ b/sound/firewire/dice.c
@@ -579,11 +579,6 @@ static int dice_hw_params(struct snd_pcm
return err;
}
 
-   for (i = 0; i < channels; i++) {
-   dice->stream.pcm_positions[i * 2] = i;
-   dice->stream.pcm_positions[i * 2 + 1] = i + channels;
-   }
-
rate /= 2;
channels *= 2;
}
@@ -591,6 +586,15 @@ static int dice_hw_params(struct snd_pcm
mode = rate_index_to_mode(rate_index);
amdtp_stream_set_parameters(>stream, rate, channels,
dice->rx_midi_ports[mode]);
+   if (rate_index > 4) {
+   channels /= 2;
+
+   for (i = 0; i < channels; i++) {
+   dice->stream.pcm_positions[i] = i * 2;
+   dice->stream.pcm_positions[i + channels] = i * 2 + 1;
+   }
+   }
+
amdtp_stream_set_pcm_format(>stream,
params_format(hw_params));
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 037/357] ARM: imx: fix TLB missing of IOMUXC base address during suspend

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Shawn Guo 

commit 59d05b518321618177b898a6801503e31b15b25b upstream.

After the suspend routine running in OCRAM puts DDR into self-refresh,
it will access IOMUXC block to float DDR IO for power saving.  A TLB
missing of IOMUXC base address may happen in this case, and triggers an
access to DDR, and thus hangs the system.

The failure is discovered by running suspend/resume on a Cubox-i board.
Though the issue is not Cubox-i specific, it can be hit the on the board
quite easily with the 3.15 or 3.16 kernel.

Fix the issue with a dummy access to IOMUXC block at the beginning of
suspend routine, so that the address translation can be filled into TLB
before DDR is put into self-refresh.

Signed-off-by: Shawn Guo 
Acked-by: Anson Huang 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm/mach-imx/suspend-imx6.S |2 ++
 1 file changed, 2 insertions(+)

--- a/arch/arm/mach-imx/suspend-imx6.S
+++ b/arch/arm/mach-imx/suspend-imx6.S
@@ -172,6 +172,8 @@ ENTRY(imx6_suspend)
ldr r6, [r11, #0x0]
ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
ldr r6, [r11, #0x0]
+   ldr r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET]
+   ldr r6, [r11, #0x0]
 
/* use r11 to store the IO address */
ldr r11, [r0, #PM_INFO_MX6Q_SRC_V_OFFSET]


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 013/357] drm/ttm: Choose a pool to shrink correctly in ttm_dma_pool_shrink_scan().

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tetsuo Handa 

commit 46c2df68f03a236b30808bba361f10900c88d95e upstream.

We can use "unsigned int" instead of "atomic_t" by updating start_pool
variable under _manager->lock. This patch will make it possible to avoid
skipping when choosing a pool to shrink in round-robin style, after next
patch changes mutex_lock(_manager->lock) to !mutex_trylock(_manager->lork).

Signed-off-by: Tetsuo Handa 
Signed-off-by: Dave Airlie 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -1004,9 +1004,9 @@ EXPORT_SYMBOL_GPL(ttm_dma_unpopulate);
 static unsigned long
 ttm_dma_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 {
-   static atomic_t start_pool = ATOMIC_INIT(0);
+   static unsigned start_pool;
unsigned idx = 0;
-   unsigned pool_offset = atomic_add_return(1, _pool);
+   unsigned pool_offset;
unsigned shrink_pages = sc->nr_to_scan;
struct device_pools *p;
unsigned long freed = 0;
@@ -1017,7 +1017,7 @@ ttm_dma_pool_shrink_scan(struct shrinker
mutex_lock(&_manager->lock);
if (!_manager->npools)
goto out;
-   pool_offset = pool_offset % _manager->npools;
+   pool_offset = ++start_pool % _manager->npools;
list_for_each_entry(p, &_manager->pools, pools) {
unsigned nr_free;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 056/357] ALSA: core: fix buffer overflow in snd_info_get_line()

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Clemens Ladisch 

commit ddc64b278a4dda052390b3de1b551e59acdff105 upstream.

snd_info_get_line() documents that its last parameter must be one
less than the buffer size, but this API design guarantees that
(literally) every caller gets it wrong.

Just change this parameter to have its obvious meaning.

Reported-by: Tommi Rantala 
Signed-off-by: Clemens Ladisch 
Signed-off-by: Takashi Iwai 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -684,7 +684,7 @@ int snd_info_card_free(struct snd_card *
  * snd_info_get_line - read one line from the procfs buffer
  * @buffer: the procfs buffer
  * @line: the buffer to store
- * @len: the max. buffer size - 1
+ * @len: the max. buffer size
  *
  * Reads one line from the buffer and stores the string.
  *
@@ -704,7 +704,7 @@ int snd_info_get_line(struct snd_info_bu
buffer->stop = 1;
if (c == '\n')
break;
-   if (len) {
+   if (len > 1) {
len--;
*line++ = c;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 022/357] drm/radeon/atom: add new voltage fetch function for hawaii

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit e9f274b2a1bd4ecc569b823b1e7942e9bf92593e upstream.

Some hawaii boards use a different method for fetching the
voltage information from the vbios.

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/radeon.h  |3 ++
 drivers/gpu/drm/radeon/radeon_atombios.c |   35 +++
 2 files changed, 38 insertions(+)

--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -304,6 +304,9 @@ int radeon_atom_get_leakage_vddc_based_o
 u16 *vddc, u16 *vddci,
 u16 virtual_voltage_id,
 u16 vbios_voltage_id);
+int radeon_atom_get_voltage_evv(struct radeon_device *rdev,
+   u16 virtual_voltage_id,
+   u16 *voltage);
 int radeon_atom_round_to_true_voltage(struct radeon_device *rdev,
  u8 voltage_type,
  u16 nominal_voltage,
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -3236,6 +3236,41 @@ int radeon_atom_get_leakage_vddc_based_o
return 0;
 }
 
+union get_voltage_info {
+   struct  _GET_VOLTAGE_INFO_INPUT_PARAMETER_V1_2 in;
+   struct  _GET_EVV_VOLTAGE_INFO_OUTPUT_PARAMETER_V1_2 evv_out;
+};
+
+int radeon_atom_get_voltage_evv(struct radeon_device *rdev,
+   u16 virtual_voltage_id,
+   u16 *voltage)
+{
+   int index = GetIndexIntoMasterTable(COMMAND, GetVoltageInfo);
+   u32 entry_id;
+   u32 count = rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk.count;
+   union get_voltage_info args;
+
+   for (entry_id = 0; entry_id < count; entry_id++) {
+   if 
(rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk.entries[entry_id].v ==
+   virtual_voltage_id)
+   break;
+   }
+
+   if (entry_id >= count)
+   return -EINVAL;
+
+   args.in.ucVoltageType = VOLTAGE_TYPE_VDDC;
+   args.in.ucVoltageMode = ATOM_GET_VOLTAGE_EVV_VOLTAGE;
+   args.in.ulSCLKFreq =
+   
cpu_to_le32(rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk.entries[entry_id].clk);
+
+   atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t 
*));
+
+   *voltage = le16_to_cpu(args.evv_out.usVoltageLevel);
+
+   return 0;
+}
+
 int radeon_atom_get_voltage_gpio_settings(struct radeon_device *rdev,
  u16 voltage_level, u8 voltage_type,
  u32 *gpio_value, u32 *gpio_mask)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 033/357] pwm: Fix period and polarity in pwm_get() for non-perfect matches

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Geert Uytterhoeven 

commit d717ea73e36dd5659640fae82605ad85c4117f4d upstream.

If pwm_get() finds a look-up entry with a perfect match (both dev_id and
con_id match), the loop is aborted, and "p" still points to the correct
struct pwm_lookup.

If only an entry with a matching dev_id or con_id is found, the loop
terminates after traversing the whole list, and "p" now points to
arbitrary memory, not part of the pwm_lookup list.
Then pwm_set_period() and pwm_set_polarity() will set random values for
period resp. polarity.

To fix this, save period and polarity when finding a new best match,
just like is done for chip (for the provider) and index.

This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
period 0 and polarity -1068821144 instead of 3 resp. 1.

Fixes: 3796ce1d4d4b ("pwm: add period and polarity to struct pwm_lookup")
Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Thierry Reding 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/pwm/core.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -606,6 +606,8 @@ struct pwm_device *pwm_get(struct device
unsigned int best = 0;
struct pwm_lookup *p;
unsigned int match;
+   unsigned int period;
+   enum pwm_polarity polarity;
 
/* look up via DT first */
if (IS_ENABLED(CONFIG_OF) && dev && dev->of_node)
@@ -653,6 +655,8 @@ struct pwm_device *pwm_get(struct device
if (match > best) {
chip = pwmchip_find_by_name(p->provider);
index = p->index;
+   period = p->period;
+   polarity = p->polarity;
 
if (match != 3)
best = match;
@@ -668,8 +672,8 @@ struct pwm_device *pwm_get(struct device
if (IS_ERR(pwm))
return pwm;
 
-   pwm_set_period(pwm, p->period);
-   pwm_set_polarity(pwm, p->polarity);
+   pwm_set_period(pwm, period);
+   pwm_set_polarity(pwm, polarity);
 
 
return pwm;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 036/357] aio: add missing smp_rmb() in read_events_ring

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Jeff Moyer 

commit 2ff396be602f10b5eab8e73b24f20348fa2de159 upstream.

We ran into a case on ppc64 running mariadb where io_getevents would
return zeroed out I/O events.  After adding instrumentation, it became
clear that there was some missing synchronization between reading the
tail pointer and the events themselves.  This small patch fixes the
problem in testing.

Thanks to Zach for helping to look into this, and suggesting the fix.

Signed-off-by: Jeff Moyer 
Signed-off-by: Benjamin LaHaise 
Signed-off-by: Greg Kroah-Hartman 

---
 fs/aio.c |6 ++
 1 file changed, 6 insertions(+)

--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1134,6 +1134,12 @@ static long aio_read_events_ring(struct
tail = ring->tail;
kunmap_atomic(ring);
 
+   /*
+* Ensure that once we've read the current tail pointer, that
+* we also see the events that were stored up to the tail.
+*/
+   smp_rmb();
+
pr_debug("h%u t%u m%u\n", head, tail, ctx->nr_events);
 
if (head == tail)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 041/357] arm64: use irq_set_affinity with force=false when migrating irqs

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Sudeep Holla 

commit 3d8afe3099ebc602848aa7f09235cce3a9a023ce upstream.

The arm64 interrupt migration code on cpu offline calls
irqchip.irq_set_affinity() with the argument force=true. Originally
this argument had no effect because it was not used by any interrupt
chip driver and there was no semantics defined.

This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
affinity of interrupts") which made the force argument useful to route
interrupts to not yet online cpus without checking the target cpu
against the cpu online mask. The following commit ffde1de64012
("irqchip: gic: Support forced affinity setting") implemented this for
the GIC interrupt controller.

As a consequence the cpu offline irq migration fails if CPU0 is
offlined, because CPU0 is still set in the affinity mask and the
validation against cpu online mask is skipped to the force argument
being true. The following first_cpu(mask) selection always selects
CPU0 as the target.

Commit 601c942176d8("arm64: use cpu_online_mask when using forced
irq_set_affinity") intended to fix the above mentioned issue but
introduced another issue where affinity can be migrated to a wrong
CPU due to unconditional copy of cpu_online_mask.

As with for arm, solve the issue by calling irq_set_affinity() with
force=false from the CPU offline irq migration code so the GIC driver
validates the affinity mask against CPU online mask and therefore
removes CPU0 from the possible target candidates. Also revert the
changes done in the commit 601c942176d8 as it's no longer needed.

Tested on Juno platform.

Fixes: 601c942176d8("arm64: use cpu_online_mask when using forced
irq_set_affinity")
Signed-off-by: Sudeep Holla 
Acked-by: Mark Rutland 
Cc: Catalin Marinas 
Cc: Will Deacon 
Signed-off-by: Will Deacon 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm64/kernel/irq.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

--- a/arch/arm64/kernel/irq.c
+++ b/arch/arm64/kernel/irq.c
@@ -97,19 +97,15 @@ static bool migrate_one_irq(struct irq_d
if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), 
affinity))
return false;
 
-   if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids)
+   if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+   affinity = cpu_online_mask;
ret = true;
+   }
 
-   /*
-* when using forced irq_set_affinity we must ensure that the cpu
-* being offlined is not present in the affinity mask, it may be
-* selected as the target CPU otherwise
-*/
-   affinity = cpu_online_mask;
c = irq_data_get_irq_chip(d);
if (!c->irq_set_affinity)
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-   else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && 
ret)
+   else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && 
ret)
cpumask_copy(d->affinity, affinity);
 
return ret;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 038/357] ARM: dts: vf610-twr: Fix pinctrl_esdhc1 pin definitions.

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Bill Pringlemeir 

commit 0aa4dcb5b730f5da2540926b94d98636fe7d1cbc upstream.

Previous version had an extra 'fsl' which made the pins not match
any entry.  The console message,

 vf610-pinctrl 40048000.iomuxc: no fsl,pins property in node \
/soc/aips-bus@4000/iomuxc@40048000/vf610-twr/esdhc1grp

is displayed without the fix.  The prior version would generally
work as u-boot sets the pins properly for sdhc.  This change allows
Linux sdhc use even if u-boot is built without sdhc support.

Signed-off-by: Bill Pringlemeir 
Acked-by: Stefan Agner 
Fixes: 0517fe6aa880 ("ARM: dts: vf610-twr: Add support for sdhc1")
Signed-off-by: Shawn Guo 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm/boot/dts/vf610-twr.dts |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -168,7 +168,7 @@
};
 
pinctrl_esdhc1: esdhc1grp {
-   fsl,fsl,pins = <
+   fsl,pins = <
VF610_PAD_PTA24__ESDHC1_CLK 0x31ef
VF610_PAD_PTA25__ESDHC1_CMD 0x31ef
VF610_PAD_PTA26__ESDHC1_DAT00x31ef


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 059/357] ALSA: hda - Fix digital mic on Acer Aspire 3830TG

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Takashi Iwai 

commit ff50479ad61069f3ee14863225aebe36d598e93e upstream.

Acer Aspire 3830TG with CX20588 codec has a digital built-in mic that
has the same problem like many others, the inverted signal in stereo.
Apply the same fixup to this machine, too.

Signed-off-by: Takashi Iwai 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2822,6 +2822,7 @@ enum {
CXT_FIXUP_HEADPHONE_MIC_PIN,
CXT_FIXUP_HEADPHONE_MIC,
CXT_FIXUP_GPIO1,
+   CXT_FIXUP_ASPIRE_DMIC,
CXT_FIXUP_THINKPAD_ACPI,
CXT_FIXUP_OLPC_XO,
CXT_FIXUP_CAP_MIX_AMP,
@@ -3269,6 +3270,12 @@ static const struct hda_fixup cxt_fixups
{ }
},
},
+   [CXT_FIXUP_ASPIRE_DMIC] = {
+   .type = HDA_FIXUP_FUNC,
+   .v.func = cxt_fixup_stereo_dmic,
+   .chained = true,
+   .chain_id = CXT_FIXUP_GPIO1,
+   },
[CXT_FIXUP_THINKPAD_ACPI] = {
.type = HDA_FIXUP_FUNC,
.v.func = hda_fixup_thinkpad_acpi,
@@ -3349,7 +3356,7 @@ static const struct hda_model_fixup cxt5
 
 static const struct snd_pci_quirk cxt5066_fixups[] = {
SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", 
CXT_FIXUP_STEREO_DMIC),
-   SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_GPIO1),
+   SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", 
CXT_FIXUP_ASPIRE_DMIC),
SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 040/357] arm64: flush TLS registers during exec

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Will Deacon 

commit eb35bdd7bca29a13c8ecd44e6fd747a84ce675db upstream.

Nathan reports that we leak TLS information from the parent context
during an exec, as we don't clear the TLS registers when flushing the
thread state.

This patch updates the flushing code so that we:

  (1) Unconditionally zero the tpidr_el0 register (since this is fully
  context switched for native tasks and zeroed for compat tasks)

  (2) Zero the tp_value state in thread_info before clearing the
  tpidrr0_el0 register for compat tasks (since this is only writable
  by the set_tls compat syscall and therefore not fully switched).

A missing compiler barrier is also added to the compat set_tls syscall.

Acked-by: Nathan Lynch 
Reported-by: Nathan Lynch 
Signed-off-by: Will Deacon 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm64/kernel/process.c|   18 ++
 arch/arm64/kernel/sys_compat.c |6 ++
 2 files changed, 24 insertions(+)

--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -224,9 +224,27 @@ void exit_thread(void)
 {
 }
 
+static void tls_thread_flush(void)
+{
+   asm ("msr tpidr_el0, xzr");
+
+   if (is_compat_task()) {
+   current->thread.tp_value = 0;
+
+   /*
+* We need to ensure ordering between the shadow state and the
+* hardware state, so that we don't corrupt the hardware state
+* with a stale shadow state during context switch.
+*/
+   barrier();
+   asm ("msr tpidrro_el0, xzr");
+   }
+}
+
 void flush_thread(void)
 {
fpsimd_flush_thread();
+   tls_thread_flush();
flush_ptrace_hw_breakpoint(current);
 }
 
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -79,6 +79,12 @@ long compat_arm_syscall(struct pt_regs *
 
case __ARM_NR_compat_set_tls:
current->thread.tp_value = regs->regs[0];
+
+   /*
+* Protect against register corruption from context switch.
+* See comment in tls_thread_flush.
+*/
+   barrier();
asm ("msr tpidrro_el0, %0" : : "r" (regs->regs[0]));
return 0;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 087/357] drm/radeon/dpm: select the appropriate vce power state for KV/KB/ML

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher 

commit c83dec3bb6c38629398b65c231c80978b3e00e14 upstream.

Compare the clock in the limits table to the requested evclk rather
than just taking the first value.  Improves vce performance in certain
cases.

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/radeon/kv_dpm.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -1438,14 +1438,14 @@ static int kv_update_uvd_dpm(struct rade
return kv_enable_uvd_dpm(rdev, !gate);
 }
 
-static u8 kv_get_vce_boot_level(struct radeon_device *rdev)
+static u8 kv_get_vce_boot_level(struct radeon_device *rdev, u32 evclk)
 {
u8 i;
struct radeon_vce_clock_voltage_dependency_table *table =
>pm.dpm.dyn_state.vce_clock_voltage_dependency_table;
 
for (i = 0; i < table->count; i++) {
-   if (table->entries[i].evclk >= 0) /* XXX */
+   if (table->entries[i].evclk >= evclk)
break;
}
 
@@ -1468,7 +1468,7 @@ static int kv_update_vce_dpm(struct rade
if (pi->caps_stable_p_state)
pi->vce_boot_level = table->count - 1;
else
-   pi->vce_boot_level = kv_get_vce_boot_level(rdev);
+   pi->vce_boot_level = kv_get_vce_boot_level(rdev, 
radeon_new_state->evclk);
 
ret = kv_copy_bytes_to_smc(rdev,
   pi->dpm_table_start +


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 084/357] drm/vmwgfx: Fix a potential infinite spin waiting for fifo idle

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Thomas Hellstrom 

commit f01ea0c3d9db536c64d47922716d8b3b8f21d850 upstream.

The code waiting for fifo idle was incorrect and could possibly spin
forever under certain circumstances.

Signed-off-by: Thomas Hellstrom 
Reported-by: Mark Sheldon 
Reviewed-by: Jakob Bornecrantz 
Reivewed-by: Mark Sheldon 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -180,8 +180,9 @@ void vmw_fifo_release(struct vmw_private
 
mutex_lock(_priv->hw_mutex);
 
+   vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
while (vmw_read(dev_priv, SVGA_REG_BUSY) != 0)
-   vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
+   ;
 
dev_priv->last_read_seqno = ioread32(fifo_mem + SVGA_FIFO_FENCE);
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 086/357] drm/radeon: Add missing lines to ci_set_thermal_temperature_range

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Oleg Chernovskiy 

commit 6bce8d9772c1c606921a9c99e566eb14202f6669 upstream.

Properly set the thermal min and max temp on CI.
Otherwise, we end up setting the thermal ranges
to 0 on resume and end up in the lowest power state.

Signed-off-by: Oleg Chernovskiy 
Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -869,6 +869,9 @@ static int ci_set_thermal_temperature_ra
WREG32_SMC(CG_THERMAL_CTRL, tmp);
 #endif
 
+   rdev->pm.dpm.thermal.min_temp = low_temp;
+   rdev->pm.dpm.thermal.max_temp = high_temp;
+
return 0;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 042/357] arm/arm64: KVM: Complete WFI/WFE instructions

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Christoffer Dall 

commit 05e0127f9e362b36aa35f17b1a3d52bca9322a3a upstream.

The architecture specifies that when the processor wakes up from a WFE
or WFI instruction, the instruction is considered complete, however we
currrently return to EL1 (or EL0) at the WFI/WFE instruction itself.

While most guests may not be affected by this because their local
exception handler performs an exception returning setting the event bit
or with an interrupt pending, some guests like UEFI will get wedged due
this little mishap.

Simply skip the instruction when we have completed the emulation.

Acked-by: Marc Zyngier 
Cc: Ard Biesheuvel 
Signed-off-by: Christoffer Dall 
Signed-off-by: Greg Kroah-Hartman 

---
 arch/arm/kvm/handle_exit.c   |2 ++
 arch/arm64/kvm/handle_exit.c |2 ++
 2 files changed, 4 insertions(+)

--- a/arch/arm/kvm/handle_exit.c
+++ b/arch/arm/kvm/handle_exit.c
@@ -93,6 +93,8 @@ static int kvm_handle_wfx(struct kvm_vcp
else
kvm_vcpu_block(vcpu);
 
+   kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
+
return 1;
 }
 
--- a/arch/arm64/kvm/handle_exit.c
+++ b/arch/arm64/kvm/handle_exit.c
@@ -66,6 +66,8 @@ static int kvm_handle_wfx(struct kvm_vcp
else
kvm_vcpu_block(vcpu);
 
+   kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
+
return 1;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 121/357] usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tony Lindgren 

commit 85601b8d81e24ce9ae2d31e93f35468ab7616b18 upstream.

Commit 249751f22380 ("usb: phy: twl4030-usb: poll for ID disconnect")
added twl4030_id_workaround_work() to deal with lost interrupts
after ID pin goes down. Looks like commit f1ddc24c9e33 ("usb: phy:
twl4030-usb: remove *set_suspend* and *phy_init* ops") changed
things around for the generic phy framework, and delayed work no
longer got called except initially during boot.

The PHY connect and disconnect interrupts for twl4030-usb are not
working after disconnecting a USB-A cable from the board, and the
deeper idle states for omap are blocked as the USB controller
stays busy.

The issue can be solved by calling delayed work from twl4030_usb_irq()
when ID pin is down and the PHY is not asleep like we already do
in twl4030_id_workaround_work().

But as both twl4030_usb_irq() and twl4030_id_workaround_work()
already do pretty much the same thing, let's call twl4030_usb_irq()
from twl4030_id_workaround_work() instead of adding some more
duplicate code. We also must call sysfs_notify() only when we have
an interrupt and not from the delayed work as notified by
Grazvydas Ignotas .

Fixes: f1ddc24c9e33 ("usb: phy: twl4030-usb: remove *set_suspend* and 
*phy_init* ops")
Acked-by: Felipe Balbi 
Signed-off-by: Tony Lindgren 
Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/phy/phy-twl4030-usb.c |   33 ++---
 1 file changed, 10 insertions(+), 23 deletions(-)

--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -560,7 +560,15 @@ static irqreturn_t twl4030_usb_irq(int i
 */
omap_musb_mailbox(status);
}
-   sysfs_notify(>dev->kobj, NULL, "vbus");
+
+   /* don't schedule during sleep - irq works right then */
+   if (status == OMAP_MUSB_ID_GROUND && !twl->asleep) {
+   cancel_delayed_work(>id_workaround_work);
+   schedule_delayed_work(>id_workaround_work, HZ);
+   }
+
+   if (irq)
+   sysfs_notify(>dev->kobj, NULL, "vbus");
 
return IRQ_HANDLED;
 }
@@ -569,29 +577,8 @@ static void twl4030_id_workaround_work(s
 {
struct twl4030_usb *twl = container_of(work, struct twl4030_usb,
id_workaround_work.work);
-   enum omap_musb_vbus_id_status status;
-   bool status_changed = false;
-
-   status = twl4030_usb_linkstat(twl);
-
-   spin_lock_irq(>lock);
-   if (status >= 0 && status != twl->linkstat) {
-   twl->linkstat = status;
-   status_changed = true;
-   }
-   spin_unlock_irq(>lock);
 
-   if (status_changed) {
-   dev_dbg(twl->dev, "handle missing status change to %d\n",
-   status);
-   omap_musb_mailbox(status);
-   }
-
-   /* don't schedule during sleep - irq works right then */
-   if (status == OMAP_MUSB_ID_GROUND && !twl->asleep) {
-   cancel_delayed_work(>id_workaround_work);
-   schedule_delayed_work(>id_workaround_work, HZ);
-   }
+   twl4030_usb_irq(0, twl);
 }
 
 static int twl4030_phy_init(struct phy *phy)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 058/357] ALSA: firewire-lib/dice: add arrangements of PCM pointer and interrupts for Dice quirk

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Takashi Sakamoto 

commit 65845f29bec6bc17f80eff25c3bc39bcf3be9bf9 upstream.

In IEC 61883-6, one data block transfers one event. In ALSA, the event equals 
one PCM frame,
hence one data block transfers one PCM frame. But Dice has a quirk at higher 
sampling rate
(176.4/192.0 kHz) that one data block transfers two PCM frames.

Commit 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete
CIP_HI_DUALWIRE") moved some codes related to this quirk into Dice driver. But 
the commit
forgot to add arrangements for PCM period interrupts and DMA pointer updates. 
As a result, Dice
driver cannot work correctly at higher sampling rate.

This commit adds 'double_pcm_frames' parameter to amdtp structure for this 
quirk. When this
parameter is set, PCM period interrupts and DMA pointer updates occur at double 
speed than in
IEC 61883-6.

Reported-by: Daniel Robbins 
Fixes: 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete 
CIP_HI_DUALWIRE")
Signed-off-by: Takashi Sakamoto 
Signed-off-by: Takashi Iwai 
Signed-off-by: Greg Kroah-Hartman 

---
 sound/firewire/amdtp.c |   11 ++-
 sound/firewire/amdtp.h |1 +
 sound/firewire/dice.c  |   15 +++
 3 files changed, 22 insertions(+), 5 deletions(-)

--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -507,7 +507,16 @@ static void amdtp_pull_midi(struct amdtp
 static void update_pcm_pointers(struct amdtp_stream *s,
struct snd_pcm_substream *pcm,
unsigned int frames)
-{  unsigned int ptr;
+{
+   unsigned int ptr;
+
+   /*
+* In IEC 61883-6, one data block represents one event. In ALSA, one
+* event equals to one PCM frame. But Dice has a quirk to transfer
+* two PCM frames in one data block.
+*/
+   if (s->double_pcm_frames)
+   frames *= 2;
 
ptr = s->pcm_buffer_pointer + frames;
if (ptr >= pcm->runtime->buffer_size)
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -125,6 +125,7 @@ struct amdtp_stream {
unsigned int pcm_buffer_pointer;
unsigned int pcm_period_pointer;
bool pointer_flush;
+   bool double_pcm_frames;
 
struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
 
--- a/sound/firewire/dice.c
+++ b/sound/firewire/dice.c
@@ -567,10 +567,14 @@ static int dice_hw_params(struct snd_pcm
return err;
 
/*
-* At rates above 96 kHz, pretend that the stream runs at half the
-* actual sample rate with twice the number of channels; two samples
-* of a channel are stored consecutively in the packet. Requires
-* blocking mode and PCM buffer size should be aligned to SYT_INTERVAL.
+* At 176.4/192.0 kHz, Dice has a quirk to transfer two PCM frames in
+* one data block of AMDTP packet. Thus sampling transfer frequency is
+* a half of PCM sampling frequency, i.e. PCM frames at 192.0 kHz are
+* transferred on AMDTP packets at 96 kHz. Two successive samples of a
+* channel are stored consecutively in the packet. This quirk is called
+* as 'Dual Wire'.
+* For this quirk, blocking mode is required and PCM buffer size should
+* be aligned to SYT_INTERVAL.
 */
channels = params_channels(hw_params);
if (rate_index > 4) {
@@ -581,6 +585,9 @@ static int dice_hw_params(struct snd_pcm
 
rate /= 2;
channels *= 2;
+   dice->stream.double_pcm_frames = true;
+   } else {
+   dice->stream.double_pcm_frames = false;
}
 
mode = rate_index_to_mode(rate_index);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 120/357] usb: phy: tegra: Avoid use of sizeof(void)

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Thierry Reding 

commit 9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8 upstream.

The PHY configuration is stored in an opaque "config" field, but when
allocating the structure, its proper size needs to be known. In the case
of UTMI, the proper structure is tegra_utmip_config of which a local
variable already exists, so we can use that to obtain the size from.

Fixes the following warning from the sparse checker:

drivers/usb/phy/phy-tegra-usb.c:882:17: warning: expression using 
sizeof(void)

Fixes: 81d5dfe6d8b3 (usb: phy: tegra: Read UTMIP parameters from device tree)
Signed-off-by: Thierry Reding 
Signed-off-by: Felipe Balbi 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/phy/phy-tegra-usb.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -881,8 +881,8 @@ static int utmi_phy_probe(struct tegra_u
return -ENOMEM;
}
 
-   tegra_phy->config = devm_kzalloc(>dev,
-   sizeof(*tegra_phy->config), GFP_KERNEL);
+   tegra_phy->config = devm_kzalloc(>dev, sizeof(*config),
+GFP_KERNEL);
if (!tegra_phy->config) {
dev_err(>dev,
"unable to allocate memory for USB UTMIP config\n");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 132/357] xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Mathias Nyman 

commit 96044694b8511bc2b04df0776b4ba295cfe005c0 upstream.

Resuming from hibernate (S4) will restart and re-initialize xHC.
The device contexts are freed and will be re-allocated later during device 
reset.

Usb core will disable link pm in device resume before device reset, which will
try to change the max exit latency, accessing the device contexts before they 
are re-allocated.

There is no need to zero (disable) the max exit latency when disabling hw lpm
for a freshly re-initialized xHC. So check that device context exists before
doing anything. The max exit latency will be set again after device reset when 
usb core
enables the link pm.

Reported-by: Imre Deak 
Tested-by: Imre Deak 
Signed-off-by: Mathias Nyman 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/host/xhci.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3982,13 +3982,21 @@ static int __maybe_unused xhci_change_ma
int ret;
 
spin_lock_irqsave(>lock, flags);
-   if (max_exit_latency == xhci->devs[udev->slot_id]->current_mel) {
+
+   virt_dev = xhci->devs[udev->slot_id];
+
+   /*
+* virt_dev might not exists yet if xHC resumed from hibernate (S4) and
+* xHC was re-initialized. Exit latency will be set later after
+* hub_port_finish_reset() is done and xhci->devs[] are re-allocated
+*/
+
+   if (!virt_dev || max_exit_latency == virt_dev->current_mel) {
spin_unlock_irqrestore(>lock, flags);
return 0;
}
 
/* Attempt to issue an Evaluate Context command to change the MEL. */
-   virt_dev = xhci->devs[udev->slot_id];
command = xhci->lpm_command;
ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
if (!ctrl_ctx) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 117/357] USB: zte_ev: remove duplicate Qualcom PID

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold 

commit 754eb21c0c4b8830a9a864b286323b84225f upstream.

Remove dublicate Qualcom PID 0x3197 which is already handled by the
moto-modem driver since commit 6986a978eec7 ("USB: add new moto_modem
driver for some Morotola phones").

Fixes: 799ee9243d89 ("USB: serial: add zte_ev.c driver")
Signed-off-by: Johan Hovold 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/serial/zte_ev.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/usb/serial/zte_ev.c
+++ b/drivers/usb/serial/zte_ev.c
@@ -274,7 +274,6 @@ static void zte_ev_usb_serial_close(stru
 static const struct usb_device_id id_table[] = {
/* MG880 */
{ USB_DEVICE(0x19d2, 0xfffd) },
-   { USB_DEVICE(0x05C6, 0x3197) },
{ },
 };
 MODULE_DEVICE_TABLE(usb, id_table);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 122/357] usb: phy: twl4030-usb: Fix regressions to runtime PM on omaps

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Tony Lindgren 

commit 96be39ab34b77c6f6f5cd6ae03aac6c6449ee5c4 upstream.

Commit 30a70b026b4cd ("usb: musb: fix obex in g_nokia.ko causing kernel
panic") attempted to fix runtime PM handling for PHYs that are on the
I2C bus. Commit 3063a12be2b0 ("usb: musb: fix PHY power on/off") then
changed things around to enable of PHYs that rely on runtime PM.

These changes however broke idling of the PHY and causes at least
100 mW extra power consumption on omaps, which is a lot with
the idle power consumption being below 10 mW range on many devices.

As calling phy_power_on/off from runtime PM calls in the USB
causes complicated issues with I2C connected PHYs, let's just let
the PHY do it's own runtime PM as needed. This leaves out the
dependency between PHYs and USB controller drivers for runtime
PM.

Let's fix the regression for twl4030-usb by adding minimal runtime
PM support. This allows idling the PHY on disconnect.

Note that we are changing to use standard runtime PM handling
for twl4030_phy_init() as that function just checks the state
and does not initialize the PHY. The PHY won't get initialized
until in twl4030_phy_power_on().

Fixes: 30a70b026b4cd ("usb: musb: fix obex in g_nokia.ko causing kernel panic")
Fixes: 3063a12be2b0 ("usb: musb: fix PHY power on/off")
Acked-by: Felipe Balbi 
Signed-off-by: Tony Lindgren 
Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/phy/phy-twl4030-usb.c |   88 ++
 1 file changed, 63 insertions(+), 25 deletions(-)

--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -422,37 +423,55 @@ static void twl4030_phy_power(struct twl
}
 }
 
-static int twl4030_phy_power_off(struct phy *phy)
+static int twl4030_usb_runtime_suspend(struct device *dev)
 {
-   struct twl4030_usb *twl = phy_get_drvdata(phy);
+   struct twl4030_usb *twl = dev_get_drvdata(dev);
 
+   dev_dbg(twl->dev, "%s\n", __func__);
if (twl->asleep)
return 0;
 
twl4030_phy_power(twl, 0);
twl->asleep = 1;
-   dev_dbg(twl->dev, "%s\n", __func__);
+
return 0;
 }
 
-static void __twl4030_phy_power_on(struct twl4030_usb *twl)
+static int twl4030_usb_runtime_resume(struct device *dev)
 {
+   struct twl4030_usb *twl = dev_get_drvdata(dev);
+
+   dev_dbg(twl->dev, "%s\n", __func__);
+   if (!twl->asleep)
+   return 0;
+
twl4030_phy_power(twl, 1);
-   twl4030_i2c_access(twl, 1);
-   twl4030_usb_set_mode(twl, twl->usb_mode);
-   if (twl->usb_mode == T2_USB_MODE_ULPI)
-   twl4030_i2c_access(twl, 0);
+   twl->asleep = 0;
+
+   return 0;
+}
+
+static int twl4030_phy_power_off(struct phy *phy)
+{
+   struct twl4030_usb *twl = phy_get_drvdata(phy);
+
+   dev_dbg(twl->dev, "%s\n", __func__);
+   pm_runtime_mark_last_busy(twl->dev);
+   pm_runtime_put_autosuspend(twl->dev);
+
+   return 0;
 }
 
 static int twl4030_phy_power_on(struct phy *phy)
 {
struct twl4030_usb *twl = phy_get_drvdata(phy);
 
-   if (!twl->asleep)
-   return 0;
-   __twl4030_phy_power_on(twl);
-   twl->asleep = 0;
dev_dbg(twl->dev, "%s\n", __func__);
+   pm_runtime_get_sync(twl->dev);
+   twl4030_i2c_access(twl, 1);
+   twl4030_usb_set_mode(twl, twl->usb_mode);
+   if (twl->usb_mode == T2_USB_MODE_ULPI)
+   twl4030_i2c_access(twl, 0);
 
/*
 * XXX When VBUS gets driven after musb goes to A mode,
@@ -558,6 +577,16 @@ static irqreturn_t twl4030_usb_irq(int i
 * USB_LINK_VBUS state.  musb_hdrc won't care until it
 * starts to handle softconnect right.
 */
+   if ((status == OMAP_MUSB_VBUS_VALID) ||
+   (status == OMAP_MUSB_ID_GROUND)) {
+   if (twl->asleep)
+   pm_runtime_get_sync(twl->dev);
+   } else {
+   if (!twl->asleep) {
+   pm_runtime_mark_last_busy(twl->dev);
+   pm_runtime_put_autosuspend(twl->dev);
+   }
+   }
omap_musb_mailbox(status);
}
 
@@ -586,22 +615,17 @@ static int twl4030_phy_init(struct phy *
struct twl4030_usb *twl = phy_get_drvdata(phy);
enum omap_musb_vbus_id_status status;
 
-   /*
-* Start in sleep state, we'll get called through set_suspend()
-* callback when musb is runtime resumed and it's time to start.
-*/
-   __twl4030_phy_power(twl, 0);
-   twl->asleep = 1;
-
+   pm_runtime_get_sync(twl->dev);
status = twl4030_usb_linkstat(twl);
twl->linkstat = status;
 
-   if (status 

[PATCH 3.16 115/357] Revert "USB: option,zte_ev: move most ZTE CDMA devices to zte_ev"

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold 

commit 63a901c06e3c2c45bd601916fe04e870e9ccae1e upstream.

This reverts commit 73228a0538a7 ("USB: option,zte_ev: move most ZTE
CDMA devices to zte_ev").

Move the IDs of the devices that were previously driven by the option
driver back to that driver.

As several users have reported, the zte_ev driver is causing random
disconnects as well as reconnect failures.

A closer analysis of the zte_ev setup code reveals that it consists of
standard CDC requests (SET/GET_LINE_CODING and SET_CONTROL_LINE_STATE)
but unfortunately fails to get some of those right. In particular, as
reported by Liu Lei, it fails to lower DTR/RTS on close. It also appears
that the control requests lack the interface argument.

Note that the zte_ev driver is based on code (once) distributed by ZTE
that still appears to originally have been reverse-engineered and bolted
onto the generic driver.

Since line control is already handled properly by the option driver, and
the SET/GET_LINE_CODING requests appears to be redundant (amounts to a
SET 9600 8N1), this is a first step in ultimately removing the redundant
zte_ev driver.

Note that AC2726 had already been moved back to option, and that some
IDs were in the device table of both drivers prior to the commit being
reverted.

Reported-by: Lei Liu 
Signed-off-by: Johan Hovold 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/serial/option.c |   24 +---
 drivers/usb/serial/zte_ev.c |   18 --
 2 files changed, 21 insertions(+), 21 deletions(-)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -275,8 +275,12 @@ static void option_instat_callback(struc
 #define ZTE_PRODUCT_MF622  0x0001
 #define ZTE_PRODUCT_MF628  0x0015
 #define ZTE_PRODUCT_MF626  0x0031
-#define ZTE_PRODUCT_MC2718 0xffe8
 #define ZTE_PRODUCT_AC2726 0xfff1
+#define ZTE_PRODUCT_CDMA_TECH  0xfffe
+#define ZTE_PRODUCT_AC8710T0x
+#define ZTE_PRODUCT_MC2718 0xffe8
+#define ZTE_PRODUCT_AD3812 0xffeb
+#define ZTE_PRODUCT_MC2716 0xffed
 
 #define BENQ_VENDOR_ID 0x04a5
 #define BENQ_PRODUCT_H10   0x4068
@@ -531,10 +535,18 @@ static const struct option_blacklist_inf
.reserved = BIT(4),
 };
 
+static const struct option_blacklist_info zte_ad3812_z_blacklist = {
+   .sendsetup = BIT(0) | BIT(1) | BIT(2),
+};
+
 static const struct option_blacklist_info zte_mc2718_z_blacklist = {
.sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4),
 };
 
+static const struct option_blacklist_info zte_mc2716_z_blacklist = {
+   .sendsetup = BIT(1) | BIT(2) | BIT(3),
+};
+
 static const struct option_blacklist_info huawei_cdc12_blacklist = {
.reserved = BIT(1) | BIT(2),
 };
@@ -1074,6 +1086,7 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 
0xff) },
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) },
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
+   { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
@@ -1548,13 +1561,18 @@ static const struct usb_device_id option
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 
0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 
0xff) },
 
-   /* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */
+   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 
0xff, 0xff, 0xff) },
+   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 
0xff, 0xff, 0xff) },
+   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 
0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 
0xff, 0xff, 0xff),
 .driver_info = (kernel_ulong_t)_mc2718_z_blacklist },
+   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 
0xff, 0xff, 0xff),
+.driver_info = (kernel_ulong_t)_ad3812_z_blacklist },
+   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 
0xff, 0xff, 0xff),
+.driver_info = (kernel_ulong_t)_mc2716_z_blacklist },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
-   { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 
0xff, 0xff, 

[PATCH 3.16 124/357] usb: chipidea: msm: Initialize PHY on reset event

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: "Ivan T. Ivanov" 

commit 233c7daf4eecd1e992dc42591182cd4a892e687c upstream.

Initialize USB PHY after every Link controller reset

Cc: Tim Bird 
Signed-off-by: Peter Chen 
Signed-off-by: Ivan T. Ivanov 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/chipidea/ci_hdrc_msm.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -26,6 +26,7 @@ static void ci_hdrc_msm_notify_event(str
dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
writel(0, USB_AHBBURST);
writel(0, USB_AHBMODE);
+   usb_phy_init(ci->transceiver);
break;
case CI_HDRC_CONTROLLER_STOPPED_EVENT:
dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 146/357] usb: dwc2/gadget: do not call disconnect method in pullup

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Marek Szyprowski 

commit b510df5a36c066da3a188f4ade3404118b63c6de upstream.

This leads to potential spinlock recursion in composite framework, other
udc drivers also don't call it directly from pullup method.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Robert Baldyga 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/dwc2/gadget.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2943,7 +2943,6 @@ static int s3c_hsotg_pullup(struct usb_g
s3c_hsotg_phy_enable(hsotg);
s3c_hsotg_core_init(hsotg);
} else {
-   s3c_hsotg_disconnect(hsotg);
s3c_hsotg_phy_disable(hsotg);
}
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 123/357] usb: chipidea: msm: Use USB PHY API to control PHY state

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: "Ivan T. Ivanov" 

commit ea290056d7c46f7781ff13801048ed957b96d1a5 upstream.

PHY drivers keep track of the current state of the hardware,
so don't change PHY settings under it.

Cc: Tim Bird 
Signed-off-by: Peter Chen 
Signed-off-by: Ivan T. Ivanov 
Acked-by: Felipe Balbi 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/chipidea/ci_hdrc_msm.c |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -20,7 +20,6 @@
 static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
 {
struct device *dev = ci->gadget.dev.parent;
-   int val;
 
switch (event) {
case CI_HDRC_CONTROLLER_RESET_EVENT:
@@ -34,10 +33,7 @@ static void ci_hdrc_msm_notify_event(str
 * Put the transceiver in non-driving mode. Otherwise host
 * may not detect soft-disconnection.
 */
-   val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL);
-   val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
-   val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
-   usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL);
+   usb_phy_notify_disconnect(ci->transceiver, USB_SPEED_UNKNOWN);
break;
default:
dev_dbg(dev, "unknown ci_hdrc event\n");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 135/357] storage: Add single-LUN quirk for Jaz USB Adapter

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Mark 

commit c66f1c62e85927357e7b3f4c701614dcb5c498a2 upstream.

The Iomega Jaz USB Adapter is a SCSI-USB converter cable. The hardware
seems to be identical to e.g. the Microtech XpressSCSI, using a Shuttle/
SCM chip set. However its firmware restricts it to only work with Jaz
drives.

On connecting the cable a message like this appears four times in the log:
 reset full speed USB device number 4 using uhci_hcd

That's non-fatal but the US_FL_SINGLE_LUN quirk fixes it.

Signed-off-by: Mark Knibbs 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/storage/unusual_devs.h |6 ++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -741,6 +741,12 @@ UNUSUAL_DEV(  0x059b, 0x0001, 0x0100, 0x
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_SINGLE_LUN ),
 
+UNUSUAL_DEV(  0x059b, 0x0040, 0x0100, 0x0100,
+   "Iomega",
+   "Jaz USB Adapter",
+   USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+   US_FL_SINGLE_LUN ),
+
 /* Reported by  */
 UNUSUAL_DEV(  0x059f, 0x0643, 0x, 0x,
"LaCie",


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 148/357] usb: dwc2/gadget: avoid disabling ep0

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Robert Baldyga 

commit 604eac3c0c69e98f2fd0133305f9e777418f1d3b upstream.

Endpoint 0 should not be disabled, so we start loop counter from number 1.

Signed-off-by: Robert Baldyga 
Signed-off-by: Greg Kroah-Hartman 

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

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2896,7 +2896,7 @@ static int s3c_hsotg_udc_stop(struct usb
return -ENODEV;
 
/* all endpoints should be shutdown */
-   for (ep = 0; ep < hsotg->num_of_eps; ep++)
+   for (ep = 1; ep < hsotg->num_of_eps; ep++)
s3c_hsotg_ep_disable(>eps[ep].ep);
 
spin_lock_irqsave(>lock, flags);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 144/357] usb: dwc2/gadget: fix phy initialization sequence

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Kamil Debski 

commit ca2c5ba80f823a38c4aae506e2f03c1afb076b0a upstream.

In the Generic PHY Framework a NULL phy is considered to be a valid phy
thus the "if (hsotg->phy)" check does not give us the information whether
the Generic PHY Framework is used.

In addition to the above this patch also removes phy_init from probe and
phy_exit from remove. This is not necessary when init/exit is done in the
s3c_hsotg_phy_enable/disable functions.

Signed-off-by: Kamil Debski 
Signed-off-by: Marek Szyprowski 
Signed-off-by: Robert Baldyga 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/dwc2/gadget.c |   27 ---
 1 file changed, 12 insertions(+), 15 deletions(-)

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2748,13 +2748,14 @@ static void s3c_hsotg_phy_enable(struct
 
dev_dbg(hsotg->dev, "pdev 0x%p\n", pdev);
 
-   if (hsotg->phy) {
-   phy_init(hsotg->phy);
-   phy_power_on(hsotg->phy);
-   } else if (hsotg->uphy)
+   if (hsotg->uphy)
usb_phy_init(hsotg->uphy);
-   else if (hsotg->plat->phy_init)
+   else if (hsotg->plat && hsotg->plat->phy_init)
hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
+   else {
+   phy_init(hsotg->phy);
+   phy_power_on(hsotg->phy);
+   }
 }
 
 /**
@@ -2768,13 +2769,14 @@ static void s3c_hsotg_phy_disable(struct
 {
struct platform_device *pdev = to_platform_device(hsotg->dev);
 
-   if (hsotg->phy) {
-   phy_power_off(hsotg->phy);
-   phy_exit(hsotg->phy);
-   } else if (hsotg->uphy)
+   if (hsotg->uphy)
usb_phy_shutdown(hsotg->uphy);
-   else if (hsotg->plat->phy_exit)
+   else if (hsotg->plat && hsotg->plat->phy_exit)
hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
+   else {
+   phy_power_off(hsotg->phy);
+   phy_exit(hsotg->phy);
+   }
 }
 
 /**
@@ -3489,9 +3491,6 @@ static int s3c_hsotg_probe(struct platfo
if (hsotg->phy && (phy_get_bus_width(phy) == 8))
hsotg->phyif = GUSBCFG_PHYIF8;
 
-   if (hsotg->phy)
-   phy_init(hsotg->phy);
-
/* usb phy enable */
s3c_hsotg_phy_enable(hsotg);
 
@@ -3584,8 +3583,6 @@ static int s3c_hsotg_remove(struct platf
usb_gadget_unregister_driver(hsotg->driver);
}
 
-   if (hsotg->phy)
-   phy_exit(hsotg->phy);
clk_disable_unprepare(hsotg->clk);
 
return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 145/357] usb: dwc2/gadget: break infinite loop in endpoint disable code

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Marek Szyprowski 

commit e0cbe595db72b037260bbda77106f6811a1ebb1d upstream.

This patch fixes possible freeze caused by infinite loop in interrupt
context.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Robert Baldyga 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/dwc2/gadget.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -1650,6 +1650,7 @@ static void s3c_hsotg_txfifo_flush(struc
dev_err(hsotg->dev,
"%s: timeout flushing fifo (GRSTCTL=%08x)\n",
__func__, val);
+   break;
}
 
udelay(1);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 147/357] usb: dwc2/gadget: delay enabling irq once hardware is configured properly

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Marek Szyprowski 

commit eb3c56c5ccdd252940cb0ec0541fcdc94894bd8d upstream.

This patch fixes kernel panic/interrupt storm/etc issues if bootloader
left s3c-hsotg module in enabled state. Now interrupt handler is enabled
only after proper configuration of hardware registers.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Robert Baldyga 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/dwc2/gadget.c |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3444,13 +3444,6 @@ static int s3c_hsotg_probe(struct platfo
 
hsotg->irq = ret;
 
-   ret = devm_request_irq(>dev, hsotg->irq, s3c_hsotg_irq, 0,
-   dev_name(dev), hsotg);
-   if (ret < 0) {
-   dev_err(dev, "cannot claim IRQ\n");
-   goto err_clk;
-   }
-
dev_info(dev, "regs %p, irq %d\n", hsotg->regs, hsotg->irq);
 
hsotg->gadget.max_speed = USB_SPEED_HIGH;
@@ -3498,6 +3491,17 @@ static int s3c_hsotg_probe(struct platfo
s3c_hsotg_init(hsotg);
s3c_hsotg_hw_cfg(hsotg);
 
+   ret = devm_request_irq(>dev, hsotg->irq, s3c_hsotg_irq, 0,
+   dev_name(dev), hsotg);
+   if (ret < 0) {
+   s3c_hsotg_phy_disable(hsotg);
+   clk_disable_unprepare(hsotg->clk);
+   regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
+  hsotg->supplies);
+   dev_err(dev, "cannot claim IRQ\n");
+   goto err_clk;
+   }
+
/* hsotg->num_of_eps holds number of EPs other than ep0 */
 
if (hsotg->num_of_eps == 0) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 150/357] ACPI / LPSS: complete PM entries for LPSS power domain

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Fu Zhonghui 

commit f4168b617ac09986c4333accaff5d8ba5a9db7bf upstream.

PM entries of LPSS power domain were not implemented correctly
in commit c78b0830667a "ACPI / LPSS: custom power domain for LPSS".

This patch fixes and completes these PM entries.

Fixes: c78b0830667a (ACPI / LPSS: custom power domain for LPSS)
Signed-off-by: Li Aubrey 
Signed-off-by: Mika Westerberg 
Signed-off-by: Fu Zhonghui 
Signed-off-by: Rafael J. Wysocki 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/acpi/acpi_lpss.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -583,7 +583,7 @@ static int acpi_lpss_suspend_late(struct
return acpi_dev_suspend_late(dev);
 }
 
-static int acpi_lpss_restore_early(struct device *dev)
+static int acpi_lpss_resume_early(struct device *dev)
 {
int ret = acpi_dev_resume_early(dev);
 
@@ -623,15 +623,15 @@ static int acpi_lpss_runtime_resume(stru
 static struct dev_pm_domain acpi_lpss_pm_domain = {
.ops = {
 #ifdef CONFIG_PM_SLEEP
-   .suspend_late = acpi_lpss_suspend_late,
-   .restore_early = acpi_lpss_restore_early,
.prepare = acpi_subsys_prepare,
.complete = acpi_subsys_complete,
.suspend = acpi_subsys_suspend,
-   .resume_early = acpi_subsys_resume_early,
+   .suspend_late = acpi_lpss_suspend_late,
+   .resume_early = acpi_lpss_resume_early,
.freeze = acpi_subsys_freeze,
.poweroff = acpi_subsys_suspend,
-   .poweroff_late = acpi_subsys_suspend_late,
+   .poweroff_late = acpi_lpss_suspend_late,
+   .restore_early = acpi_lpss_resume_early,
 #endif
 #ifdef CONFIG_PM_RUNTIME
.runtime_suspend = acpi_lpss_runtime_suspend,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 149/357] ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: "Lee, Chun-Yi" 

commit 9389f46e9782ea5e56fbd7b2e59ba7c08f3ba86b upstream.

The value64 parameter is an u64 point that used to transfer the value
for write to CMOS, or used to return the value that's read from CMOS.

The value64 is an u64 point, so don't need get address again. It causes
acpi_cmos_rtc_space_handler always return 0 to reader and didn't write
expected value to CMOS.

Signed-off-by: Lee, Chun-Yi 
Signed-off-by: Rafael J. Wysocki 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/acpi/acpi_cmos_rtc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/acpi/acpi_cmos_rtc.c
+++ b/drivers/acpi/acpi_cmos_rtc.c
@@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function
  void *handler_context, void *region_context)
 {
int i;
-   u8 *value = (u8 *)
+   u8 *value = (u8 *)value64;
 
if (address > 0xff || !value64)
return AE_BAD_PARAMETER;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 152/357] iommu/vt-d: Check return value of acpi_bus_get_device()

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Joerg Roedel 

commit c0df975f9045d6b2b13d88746e628ac308ff49ea upstream.

Checking adev == NULL is not sufficient as
acpi_bus_get_device() might not touch the value of this
parameter in an error case, so check the return value
directly.

Fixes: ed40356b5fcf1ce28e026ab39c5b2b6939068b50
Cc: David Woodhouse 
Signed-off-by: Joerg Roedel 
Reviewed-by: Alex Williamson 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/iommu/dmar.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -677,8 +677,7 @@ static int __init dmar_acpi_dev_scope_in
   andd->object_name);
continue;
}
-   acpi_bus_get_device(h, );
-   if (!adev) {
+   if (acpi_bus_get_device(h, )) {
pr_err("Failed to get device for ACPI object 
%s\n",
   andd->object_name);
continue;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 137/357] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Mark 

commit b6a3ed677991558ce09046397a7c4d70530d15b3 upstream.

Hi,

The Ariston Technologies iConnect 025 and iConnect 050 (also known as e.g.
iSCSI-50) are SCSI-USB converters which use Shuttle Technology/SCM
Microsystems chips. Only the connectors differ; both have the same USB ID.
The US_FL_SCM_MULT_TARG quirk is required to use SCSI devices with ID other
than 0.

I don't have one of these, but based on the other entries for Shuttle/
SCM-based converters this patch is very likely correct. I used 0x and
0x for bcdDeviceMin and bcdDeviceMax because I'm not sure which
bcdDevice value the products use.

Signed-off-by: Mark Knibbs 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/storage/unusual_devs.h |6 ++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1986,6 +1986,12 @@ UNUSUAL_DEV(  0x177f, 0x0400, 0x, 0x
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
 
+UNUSUAL_DEV(  0x1822, 0x0001, 0x, 0x,
+   "Ariston Technologies",
+   "iConnect USB to SCSI adapter",
+   USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+   US_FL_SCM_MULT_TARG ),
+
 /* Reported by Hans de Goede 
  * These Appotech controllers are found in Picture Frames, they provide a
  * (buggy) emulation of a cdrom drive which contains the windows software


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 154/357] iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Olav Haugan 

commit 1fc870c7efa364862c3bc792cfbdb38afea26742 upstream.

Stage-1 context banks do not have the SMMU_CBn_TCR[SL0] field since it
is only applicable to stage-2 context banks.

This patch ensures that we don't set the reserved TCR bits for stage-1
translations.

Signed-off-by: Olav Haugan 
Signed-off-by: Will Deacon 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/iommu/arm-smmu.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -830,8 +830,11 @@ static void arm_smmu_init_context_bank(s
reg |= TTBCR_EAE |
  (TTBCR_SH_IS << TTBCR_SH0_SHIFT) |
  (TTBCR_RGN_WBWA << TTBCR_ORGN0_SHIFT) |
- (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT) |
- (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+ (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT);
+
+   if (!stage1)
+   reg |= (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+
writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR);
 
/* MAIR0 (stage-1 only) */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [tip:x86/asm] x86: Speed up ___preempt_schedule*() by using THUNK helpers

2014-10-03 Thread Oleg Nesterov
On 10/03, Linus Torvalds wrote:
>
> On Fri, Oct 3, 2014 at 5:01 PM, Linus Torvalds
>  wrote:
> >
> > The real fix would appear to be to use
> > "preempt_enable_no_resched_notrace()", which your patch did, but
> > without the loop.
>
> Actually, the real fix would be to not be stupid, and just make the
> code do something like
>
> >if (likely(!preemptible()))
> >return;
> >
> > __preempt_count_add(PREEMPT_ACTIVE);
> > prev_ctx = exception_enter();
> >
> > __schedule();
> >
> > exception_exit(prev_ctx);
> > __preempt_count_sub(PREEMPT_ACTIVE);
>
> and *not* enable preemption around the scheduling at all. The whole
> enable and then re-disable seems entirely broken, and comes from the
> code using "preempt_schedule()" which doesn't work while preemption is
> disabled. So don't do that then.

Again, it is too late for me... Most probably I am wrong, but somehow
it seems to me that the real fix should try to kill preempt_schedule_context()
altogether and teach preempt_schedule() to play well with CONTEXT_TRACKING.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 066/357] HID: magicmouse: sanity check report size in raw_event() callback

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Jiri Kosina 

commit c54def7bd64d7c0b6993336abcffb8444795bf38 upstream.

The report passed to us from transport driver could potentially be
arbitrarily large, therefore we better sanity-check it so that
magicmouse_emit_touch() gets only valid values of raw_id.

Reported-by: Steven Vittitoe 
Signed-off-by: Jiri Kosina 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/hid/hid-magicmouse.c |   10 ++
 1 file changed, 10 insertions(+)

--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -290,6 +290,11 @@ static int magicmouse_raw_event(struct h
if (size < 4 || ((size - 4) % 9) != 0)
return 0;
npoints = (size - 4) / 9;
+   if (npoints > 15) {
+   hid_warn(hdev, "invalid size value (%d) for 
TRACKPAD_REPORT_ID\n",
+   size);
+   return 0;
+   }
msc->ntouches = 0;
for (ii = 0; ii < npoints; ii++)
magicmouse_emit_touch(msc, ii, data + ii * 9 + 4);
@@ -307,6 +312,11 @@ static int magicmouse_raw_event(struct h
if (size < 6 || ((size - 6) % 8) != 0)
return 0;
npoints = (size - 6) / 8;
+   if (npoints > 15) {
+   hid_warn(hdev, "invalid size value (%d) for 
MOUSE_REPORT_ID\n",
+   size);
+   return 0;
+   }
msc->ntouches = 0;
for (ii = 0; ii < npoints; ii++)
magicmouse_emit_touch(msc, ii, data + ii * 8 + 6);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 136/357] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Mark 

commit 67d365a57a51fb9dece6a5ceb504aa381cae1e5b upstream.

The Adaptec USBConnect 2000 is another SCSI-USB converter which uses
Shuttle Technology/SCM Microsystems chips. The US_FL_SCM_MULT_TARG quirk is
required to use SCSI devices with ID other than 0.

I don't have a USBConnect 2000, but based on the other entries for Shuttle/
SCM-based converters this patch is very likely correct. I used 0x and
0x for bcdDeviceMin and bcdDeviceMax because I'm not sure which
bcdDevice value the product uses.

Signed-off-by: Mark Knibbs 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/storage/unusual_devs.h |6 ++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -101,6 +101,12 @@ UNUSUAL_DEV(  0x03f0, 0x4002, 0x0001, 0x
"PhotoSmart R707",
USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY),
 
+UNUSUAL_DEV(  0x03f3, 0x0001, 0x, 0x,
+   "Adaptec",
+   "USBConnect 2000",
+   USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+   US_FL_SCM_MULT_TARG ),
+
 /* Reported by Sebastian Kapfer 
  * and Olaf Hering  (different bcd's, same vendor/product)
  * for USB floppies that need the SINGLE_LUN enforcement.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 153/357] iommu/fsl: Fix warning resulting from adding PCI device twice

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Varun Sethi 

commit 5a9137a66b521d667236e95c307b92af532fe600 upstream.

iommu_group_get_for_dev determines the iommu group for the PCI device and adds
the device to the group.

In the PAMU driver we were again adding the device to the same group without 
checking
if the device already had an iommu group. This resulted in the following 
warning.

sysfs: cannot create duplicate filename 
'/devices/ffe20.pcie/pci:00/:00:00.0/iommu_group'
[ cut here ]
WARNING: at fs/sysfs/dir.c:31
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc3-2-g7505cea-dirty #126
task: c001fe0a ti: c001fe044000 task.ti: c001fe044000
NIP: c018879c LR: c0188798 CTR: c001ea50
REGS: c001fe047040 TRAP: 0700   Not tainted  
(3.17.0-rc3-2-g7505cea-dirty)
MSR: 80029000   CR: 24ad8e22  XER: 2000
SOFTE: 1
GPR00: c0188798 c001fe0472c0 c09a52e0 0065
GPR04: 0001  3a30303a 2700
GPR08: 2f696f6d c08d3830 c09b3938 c09bb3d0
GPR12: 28ad8e24 cfff4000 c000205c 
GPR16:    
GPR20:    c08a4c70
GPR24: c07e9010 c001fe0140a8 ffef 0001
GPR28: c001fe22ebb8 c07e9010 c090bf10 c001fe22
NIP [c018879c] .sysfs_warn_dup+0x74/0xa4
LR [c0188798] .sysfs_warn_dup+0x70/0xa4
Call Trace:
[c001fe0472c0] [c0188798] .sysfs_warn_dup+0x70/0xa4 (unreliable)
[c001fe047350] [c0188d34] 
.sysfs_do_create_link_sd.clone.2+0x168/0x174
[c001fe047400] [c04b3cf8] .iommu_group_add_device+0x78/0x244
[c001fe0474b0] [c04b6964] .fsl_pamu_add_device+0x88/0x1a8
[c001fe047570] [c04b3960] .iommu_bus_notifier+0xdc/0x15c
[c001fe047600] [c0059848] .notifier_call_chain+0x8c/0xe8
[c001fe0476a0] [c0059d04] .__blocking_notifier_call_chain+0x58/0x84
[c001fe047750] [c036619c] .device_add+0x464/0x5c8
[c001fe047820] [c0300ebc] .pci_device_add+0x14c/0x17c
[c001fe0478c0] [c0300fbc] .pci_scan_single_device+0xd0/0xf4
[c001fe047970] [c030104c] .pci_scan_slot+0x6c/0x18c
[c001fe047a10] [c030226c] .pci_scan_child_bus+0x40/0x114
[c001fe047ac0] [c0021974] .pcibios_scan_phb+0x240/0x2c8
[c001fe047b70] [c085a970] .pcibios_init+0x64/0xc8
[c001fe047c00] [c0001884] .do_one_initcall+0xbc/0x224
[c001fe047d00] [c0852d50] .kernel_init_freeable+0x14c/0x21c
[c001fe047db0] [c0002078] .kernel_init+0x1c/0xfa4
[c001fe047e30] [c884] .ret_from_kernel_thread+0x58/0xd4
Instruction dump:
7c7f1b79 4182001c 7fe4fb78 7f83e378 38a01000 4bffc905 6000 7c641b78
e87e8008 7fa5eb78 48482ff5 6000 <0fe0> 7fe3fb78 4bf7bd39 6000

Signed-off-by: Varun Sethi 
Signed-off-by: Joerg Roedel 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/iommu/fsl_pamu_domain.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1048,7 +1048,7 @@ static int fsl_pamu_add_device(struct de
struct iommu_group *group = ERR_PTR(-ENODEV);
struct pci_dev *pdev;
const u32 *prop;
-   int ret, len;
+   int ret = 0, len;
 
/*
 * For platform devices we allocate a separate group for
@@ -1071,7 +1071,13 @@ static int fsl_pamu_add_device(struct de
if (IS_ERR(group))
return PTR_ERR(group);
 
-   ret = iommu_group_add_device(group, dev);
+   /*
+* Check if device has already been added to an iommu group.
+* Group could have already been created for a PCI device in
+* the iommu_group_get_for_dev path.
+*/
+   if (!dev->iommu_group)
+   ret = iommu_group_add_device(group, dev);
 
iommu_group_put(group);
return ret;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 138/357] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Mark 

commit c80b4495c61636edc58fe1ce300f09f24db28e10 upstream.

This patch adds quirks for Entrega Technologies (later Xircom PortGear) USB-
SCSI converters. They use Shuttle Technology EUSB-01/EUSB-S1 chips. The
US_FL_SCM_MULT_TARG quirk is needed to allow multiple devices on the SCSI
chain to be accessed. Without it only the (single) device with SCSI ID 0
can be used.

The standalone converter sold by Entrega had model number U1-SC25. Xircom
acquired Entrega and re-branded the product line PortGear. The PortGear USB
to SCSI Converter (model PGSCSI) is internally identical to the Entrega
product, but later models may use a different USB ID. The Entrega-branded
units have USB ID 1645:0007, as does my Xircom PGSCSI, but the Windows and
Macintosh drivers also support 085A:0028.

Entrega also sold the "Mac USB Dock", which provides two USB ports, a Mac
(8-pin mini-DIN) serial port and a SCSI port. It appears to the computer as
a four-port hub, USB-serial, and USB-SCSI converters. The USB-SCSI part may
have initially used the same ID as the standalone U1-SC25 (1645:0007), but
later production used 085A:0026.

My Xircom PortGear PGSCSI has bcdDevice=0x0100. Units with bcdDevice=0x0133
probably also exist.

This patch adds quirks for 1645:0007, 085A:0026 and 085A:0028. The Windows
driver INF file also mentions 085A:0032 "PortStation SCSI Module", but I
couldn't find any mention of that actually existing in the wild; perhaps it
was cancelled before release?

Signed-off-by: Mark Knibbs 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/storage/unusual_devs.h |   20 
 1 file changed, 20 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1125,6 +1125,18 @@ UNUSUAL_DEV(  0x0851, 0x1543, 0x0200, 0x
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_NOT_LOCKABLE),
 
+UNUSUAL_DEV(  0x085a, 0x0026, 0x0100, 0x0133,
+   "Xircom",
+   "PortGear USB-SCSI (Mac USB Dock)",
+   USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+   US_FL_SCM_MULT_TARG ),
+
+UNUSUAL_DEV(  0x085a, 0x0028, 0x0100, 0x0133,
+   "Xircom",
+   "PortGear USB to SCSI Converter",
+   USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+   US_FL_SCM_MULT_TARG ),
+
 /* Submitted by Jan De Luyck  */
 UNUSUAL_DEV(  0x08bd, 0x1100, 0x, 0x,
"CITIZEN",
@@ -1964,6 +1976,14 @@ UNUSUAL_DEV(  0x152d, 0x2329, 0x0100, 0x
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ),
 
+/* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI)
+ * and Mac USB Dock USB-SCSI */
+UNUSUAL_DEV(  0x1645, 0x0007, 0x0100, 0x0133,
+   "Entrega Technologies",
+   "USB to SCSI Converter",
+   USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+   US_FL_SCM_MULT_TARG ),
+
 /* Reported by Robert Schedel 
  * Note: this is a 'super top' device like the above 14cd/6600 device */
 UNUSUAL_DEV(  0x1652, 0x6600, 0x0201, 0x0201,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 140/357] usb: dwc3: core: fix order of PM runtime calls

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Felipe Balbi 

commit fed33afce0eda44a46ae24d93aec1b5198c0bac4 upstream.

Currently, we disable pm_runtime before all register
accesses are done, this is dangerous and might lead
to abort exceptions due to the driver trying to access
a register which is clocked by a clock which was long
gated.

Fix that by moving pm_runtime_put_sync() and pm_runtime_disable()
as the last thing we do before returning from our ->remove()
method.

Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver)
Signed-off-by: Felipe Balbi 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/dwc3/core.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -791,15 +791,15 @@ static int dwc3_remove(struct platform_d
phy_power_off(dwc->usb2_generic_phy);
phy_power_off(dwc->usb3_generic_phy);
 
-   pm_runtime_put_sync(>dev);
-   pm_runtime_disable(>dev);
-
dwc3_debugfs_exit(dwc);
dwc3_core_exit_mode(dwc);
dwc3_event_buffers_cleanup(dwc);
dwc3_free_event_buffers(dwc);
dwc3_core_exit(dwc);
 
+   pm_runtime_put_sync(>dev);
+   pm_runtime_disable(>dev);
+
return 0;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 139/357] USB: EHCI: unlink QHs even after the controller has stopped

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Alan Stern 

commit 7312b5ddd47fee2356baa78c5516ef8e04eed452 upstream.

Old code in ehci-hcd tries to expedite disabling endpoints after the
controller has stopped, by destroying the endpoint's associated QH
without first unlinking the QH.  This was necessary back when the
driver wasn't so careful about keeping track of the controller's
state.

But now we are careful about it, and the driver knows that when the
controller isn't running, no unlinking delay is needed.  Furthermore,
skipping the unlink step will trigger a BUG() in qh_destroy() when the
preceding QH is released, because the link pointer will be non-NULL.

Removing the lines that skip the unlinking step and go directly to
QH_STATE_IDLE fixes the problem.

Signed-off-by: Alan Stern 
Reported-by: Joe Lawrence 
Tested-by: Joe Lawrence 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/host/ehci-hcd.c |2 --
 1 file changed, 2 deletions(-)

--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -965,8 +965,6 @@ rescan:
}
 
qh->exception = 1;
-   if (ehci->rh_state < EHCI_RH_RUNNING)
-   qh->qh_state = QH_STATE_IDLE;
switch (qh->qh_state) {
case QH_STATE_LINKED:
WARN_ON(!list_empty(>qtd_list));


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 065/357] HID: picolcd: sanity check report size in raw_event() callback

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--

From: Jiri Kosina 

commit 844817e47eef14141cf59b8d5ac08dd11c0a9189 upstream.

The report passed to us from transport driver could potentially be
arbitrarily large, therefore we better sanity-check it so that raw_data
that we hold in picolcd_pending structure are always kept within proper
bounds.

Reported-by: Steven Vittitoe 
Signed-off-by: Jiri Kosina 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/hid/hid-picolcd_core.c |6 ++
 1 file changed, 6 insertions(+)

--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -350,6 +350,12 @@ static int picolcd_raw_event(struct hid_
if (!data)
return 1;
 
+   if (size > 64) {
+   hid_warn(hdev, "invalid size value (%d) for picolcd raw 
event\n",
+   size);
+   return 0;
+   }
+
if (report->id == REPORT_KEY_STATE) {
if (data->input_keys)
ret = picolcd_raw_keypad(data, report, raw_data+1, 
size-1);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 168/357] nfs: fix nonblocking calls to nfs_page_group_lock

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--


From: Weston Andros Adamson 

commit bc8a309e88a86205fc3e17f06e42a2e56fc6f807 upstream.

nfs_page_group_lock was calling wait_on_bit_lock even when told not to
block. Fix by first trying test_and_set_bit, followed by wait_on_bit_lock
if and only if blocking is allowed.  Return -EAGAIN if nonblocking and the
test_and_set of the bit was already locked.

Signed-off-by: Weston Andros Adamson 
Reviewed-by: Peng Tao 
Signed-off-by: Trond Myklebust 
Signed-off-by: Greg Kroah-Hartman 
---
 fs/nfs/pagelist.c |   23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -149,24 +149,29 @@ static int nfs_wait_bit_uninterruptible(
  *
  * this lock must be held if modifying the page group list
  *
- * returns result from wait_on_bit_lock: 0 on success, < 0 on error
+ * return 0 on success, < 0 on error: -EDELAY if nonblocking or the
+ * result from wait_on_bit_lock
+ *
+ * NOTE: calling with nonblock=false should always have set the
+ *   lock bit (see fs/buffer.c and other uses of wait_on_bit_lock
+ *   with TASK_UNINTERRUPTIBLE), so there is no need to check the result.
  */
 int
 nfs_page_group_lock(struct nfs_page *req, bool nonblock)
 {
struct nfs_page *head = req->wb_head;
-   int ret;
 
WARN_ON_ONCE(head != head->wb_head);
 
-   do {
-   ret = wait_on_bit_lock(>wb_flags, PG_HEADLOCK,
-   nfs_wait_bit_uninterruptible,
-   TASK_UNINTERRUPTIBLE);
-   } while (!nonblock && ret != 0);
+   if (!test_and_set_bit(PG_HEADLOCK, >wb_flags))
+   return 0;
+
+   if (!nonblock)
+   return wait_on_bit_lock(>wb_flags, PG_HEADLOCK,
+   nfs_wait_bit_uninterruptible,
+   TASK_UNINTERRUPTIBLE);
 
-   WARN_ON_ONCE(ret > 0);
-   return ret;
+   return -EAGAIN;
 }
 
 /*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL 3.17] tinification: Kconfig bugfixes for 3.17

2014-10-03 Thread Josh Triplett
The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:

  Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/josh/linux.git 
tags/tiny/kconfig-for-3.17

for you to fetch changes up to 62b4d2041117f35ab2409c9f5c4b8d3dc8e59d0f:

  init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu 
(2014-10-03 16:49:43 -0700)


Two Kconfig bugfixes for 3.17 related to tinification.  These fixes make the
Kconfig "General Setup" menu much more usable.



Neither of these fixes changes the resulting built kernel in any way;
they just improve the usability of the kconfig "General Setup" menu.
Randy Dunlap suggested them for 3.17 rather than waiting for 3.18.

Josh Triplett (2):
  init/Kconfig: Hide printk log config if CONFIG_PRINTK=n
  init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu

 init/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16 167/357] nfs: change nfs_page_group_lock argument

2014-10-03 Thread Greg Kroah-Hartman
3.16-stable review patch.  If anyone has any objections, please let me know.

--


From: Weston Andros Adamson 

commit fd2f3a06d30c85a17cf035ebc60c88c2a13a8ece upstream.

Flip the meaning of the second argument from 'wait' to 'nonblock' to
match related functions. Update all five calls to reflect this change.

Signed-off-by: Weston Andros Adamson 
Reviewed-by: Peng Tao 
Signed-off-by: Trond Myklebust 
Signed-off-by: Greg Kroah-Hartman 
---
 fs/nfs/pagelist.c |   11 ++-
 fs/nfs/write.c|4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -145,13 +145,14 @@ static int nfs_wait_bit_uninterruptible(
 /*
  * nfs_page_group_lock - lock the head of the page group
  * @req - request in group that is to be locked
+ * @nonblock - if true don't block waiting for lock
  *
  * this lock must be held if modifying the page group list
  *
  * returns result from wait_on_bit_lock: 0 on success, < 0 on error
  */
 int
-nfs_page_group_lock(struct nfs_page *req, bool wait)
+nfs_page_group_lock(struct nfs_page *req, bool nonblock)
 {
struct nfs_page *head = req->wb_head;
int ret;
@@ -162,7 +163,7 @@ nfs_page_group_lock(struct nfs_page *req
ret = wait_on_bit_lock(>wb_flags, PG_HEADLOCK,
nfs_wait_bit_uninterruptible,
TASK_UNINTERRUPTIBLE);
-   } while (wait && ret != 0);
+   } while (!nonblock && ret != 0);
 
WARN_ON_ONCE(ret > 0);
return ret;
@@ -226,7 +227,7 @@ bool nfs_page_group_sync_on_bit(struct n
 {
bool ret;
 
-   nfs_page_group_lock(req, true);
+   nfs_page_group_lock(req, false);
ret = nfs_page_group_sync_on_bit_locked(req, bit);
nfs_page_group_unlock(req);
 
@@ -869,7 +870,7 @@ static int __nfs_pageio_add_request(stru
unsigned int offset, pgbase;
int ret;
 
-   ret = nfs_page_group_lock(req, false);
+   ret = nfs_page_group_lock(req, true);
if (ret < 0) {
desc->pg_error = ret;
return 0;
@@ -895,7 +896,7 @@ static int __nfs_pageio_add_request(stru
if (desc->pg_recoalesce)
return 0;
/* retry add_request for this subreq */
-   ret = nfs_page_group_lock(req, false);
+   ret = nfs_page_group_lock(req, true);
if (ret < 0) {
desc->pg_error = ret;
return 0;
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -216,7 +216,7 @@ static bool nfs_page_group_covers_page(s
unsigned int pos = 0;
unsigned int len = nfs_page_length(req->wb_page);
 
-   nfs_page_group_lock(req, true);
+   nfs_page_group_lock(req, false);
 
do {
tmp = nfs_page_group_search_locked(req->wb_head, pos);
@@ -454,7 +454,7 @@ try_again:
}
 
/* lock each request in the page group */
-   ret = nfs_page_group_lock(head, false);
+   ret = nfs_page_group_lock(head, true);
if (ret < 0)
return ERR_PTR(ret);
subreq = head;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   8   9   10   >