]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoMerge remote-tracking branch 'xtensa/for_next'
Stephen Rothwell [Fri, 7 Jun 2013 01:25:28 +0000 (11:25 +1000)]
Merge remote-tracking branch 'xtensa/for_next'

11 years agoMerge remote-tracking branch 'sh/sh-latest'
Stephen Rothwell [Fri, 7 Jun 2013 01:23:51 +0000 (11:23 +1000)]
Merge remote-tracking branch 'sh/sh-latest'

Conflicts:
arch/sh/kernel/cpu/sh2a/Makefile

11 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Fri, 7 Jun 2013 01:20:12 +0000 (11:20 +1000)]
Merge remote-tracking branch 's390/features'

11 years agoMerge remote-tracking branch 'mpc5xxx/next'
Stephen Rothwell [Fri, 7 Jun 2013 01:18:38 +0000 (11:18 +1000)]
Merge remote-tracking branch 'mpc5xxx/next'

11 years agoMerge remote-tracking branch 'parisc-hd/for-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:17:03 +0000 (11:17 +1000)]
Merge remote-tracking branch 'parisc-hd/for-next'

11 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:15:29 +0000 (11:15 +1000)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

11 years agoMerge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:13:56 +0000 (11:13 +1000)]
Merge remote-tracking branch 'm68k/for-next'

11 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Fri, 7 Jun 2013 01:12:24 +0000 (11:12 +1000)]
Merge remote-tracking branch 'ia64/next'

11 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:10:51 +0000 (11:10 +1000)]
Merge remote-tracking branch 'cris/for-next'

Conflicts:
arch/cris/arch-v32/drivers/Kconfig

11 years agoMerge remote-tracking branch 'arm64/upstream'
Stephen Rothwell [Fri, 7 Jun 2013 01:09:12 +0000 (11:09 +1000)]
Merge remote-tracking branch 'arm64/upstream'

11 years agoMerge remote-tracking branch 'xilinx/arm-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:09:11 +0000 (11:09 +1000)]
Merge remote-tracking branch 'xilinx/arm-next'

Conflicts:
arch/arm/mach-highbank/highbank.c
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-spear/spear13xx.c
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-zynq/platsmp.c
drivers/clocksource/Makefile
drivers/clocksource/tegra20_timer.c

11 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:07:34 +0000 (11:07 +1000)]
Merge remote-tracking branch 'arm/for-next'

11 years agoMerge remote-tracking branch 'arc/for-next'
Stephen Rothwell [Fri, 7 Jun 2013 01:06:02 +0000 (11:06 +1000)]
Merge remote-tracking branch 'arc/for-next'

11 years agoMerge remote-tracking branch 'vfio-fixes/for-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:27 +0000 (11:00 +1000)]
Merge remote-tracking branch 'vfio-fixes/for-linus'

11 years agoMerge remote-tracking branch 'devicetree-current/devicetree/merge'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:24 +0000 (11:00 +1000)]
Merge remote-tracking branch 'devicetree-current/devicetree/merge'

Conflicts:
scripts/Makefile.lib

11 years agoMerge remote-tracking branch 'irqdomain-current/irqdomain/merge'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:22 +0000 (11:00 +1000)]
Merge remote-tracking branch 'irqdomain-current/irqdomain/merge'

11 years agoMerge remote-tracking branch 'ide/master'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:18 +0000 (11:00 +1000)]
Merge remote-tracking branch 'ide/master'

11 years agoMerge remote-tracking branch 'crypto-current/master'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:16 +0000 (11:00 +1000)]
Merge remote-tracking branch 'crypto-current/master'

11 years agoMerge remote-tracking branch 'staging.current/staging-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:11 +0000 (11:00 +1000)]
Merge remote-tracking branch 'staging.current/staging-linus'

11 years agoMerge remote-tracking branch 'usb.current/usb-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:11 +0000 (11:00 +1000)]
Merge remote-tracking branch 'usb.current/usb-linus'

11 years agoMerge remote-tracking branch 'tty.current/tty-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:10 +0000 (11:00 +1000)]
Merge remote-tracking branch 'tty.current/tty-linus'

11 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:09 +0000 (11:00 +1000)]
Merge remote-tracking branch 'wireless/master'

11 years agoMerge remote-tracking branch 'pci-current/for-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:08 +0000 (11:00 +1000)]
Merge remote-tracking branch 'pci-current/for-linus'

11 years agoMerge remote-tracking branch 'sound-current/for-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:07 +0000 (11:00 +1000)]
Merge remote-tracking branch 'sound-current/for-linus'

11 years agoMerge remote-tracking branch 'net/master'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:06 +0000 (11:00 +1000)]
Merge remote-tracking branch 'net/master'

11 years agoMerge remote-tracking branch 'powerpc-merge/merge'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:05 +0000 (11:00 +1000)]
Merge remote-tracking branch 'powerpc-merge/merge'

11 years agoMerge remote-tracking branch 'm68k-current/for-linus'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:04 +0000 (11:00 +1000)]
Merge remote-tracking branch 'm68k-current/for-linus'

11 years agoMerge remote-tracking branch 'arm-current/fixes'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:04 +0000 (11:00 +1000)]
Merge remote-tracking branch 'arm-current/fixes'

11 years agoMerge remote-tracking branch 'arc-current/for-curr'
Stephen Rothwell [Fri, 7 Jun 2013 01:00:03 +0000 (11:00 +1000)]
Merge remote-tracking branch 'arc-current/for-curr'

11 years agonet: Unbreak compat_sys_{send,recv}msg
Andy Lutomirski [Wed, 5 Jun 2013 19:38:26 +0000 (19:38 +0000)]
net: Unbreak compat_sys_{send,recv}msg

I broke them in this commit:

    commit 1be374a0518a288147c6a7398792583200a67261
    Author: Andy Lutomirski <luto@amacapital.net>
    Date:   Wed May 22 14:07:44 2013 -0700

        net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg

This patch adds __sys_sendmsg and __sys_sendmsg as common helpers that accept
MSG_CMSG_COMPAT and blocks MSG_CMSG_COMPAT at the syscall entrypoints.  It
also reverts some unnecessary checks in sys_socketcall.

Apparently I was suffering from underscore blindness the first time around.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Tested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoUSB: option,zte_ev: move most ZTE CDMA devices to zte_ev
Dan Williams [Wed, 5 Jun 2013 20:26:27 +0000 (15:26 -0500)]
USB: option,zte_ev: move most ZTE CDMA devices to zte_ev

Per some ZTE Linux drivers I found for the AC2716, the following patch
moves most ZTE CDMA devices from option to zte_ev.  The blacklist stuff
that option does is not required with zte_ev, because it doesn't
implement any of the send_setup hooks which the blacklist suppressed.

I did not move the 2718 over because I could not find any ZTE Linux
drivers for that device, nor even any Windows drivers.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoUSB: option: blacklist network interface on Huawei E1820
Bjørn Mork [Thu, 6 Jun 2013 10:57:24 +0000 (12:57 +0200)]
USB: option: blacklist network interface on Huawei E1820

The mode used by Windows for the Huawei E1820 will use the
same ff/ff/ff class codes for both serial and network
functions.

Reported-by: Graham Inggs <graham.inggs@uct.ac.za>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoUSB: whiteheat: fix broken port configuration
Johan Hovold [Thu, 6 Jun 2013 11:32:47 +0000 (13:32 +0200)]
USB: whiteheat: fix broken port configuration

When configuring the port (e.g. set_termios) the port minor number
rather than the port number was used in the request (and they only
coincide for minor number 0).

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoMerge branch '3.10-fixes' into mips-for-linux-next
Ralf Baechle [Thu, 6 Jun 2013 14:18:06 +0000 (16:18 +0200)]
Merge branch '3.10-fixes' into mips-for-linux-next

11 years agoMIPS: ralink: add missing SZ_1M multiplier
John Crispin [Thu, 6 Jun 2013 12:55:53 +0000 (12:55 +0000)]
MIPS: ralink: add missing SZ_1M multiplier

On RT5350 the memory size is set to Bytes and not MegaBytes due to a missing
multiplier.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: John Crispin <blogic@openwrt.org>
Patchwork: https://patchwork.linux-mips.org/patch/5378/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: Compat: Fix cputime_to_timeval() arguments in compat binfmt_elf.
Ralf Baechle [Tue, 28 May 2013 22:48:10 +0000 (00:48 +0200)]
MIPS: Compat: Fix cputime_to_timeval() arguments in compat binfmt_elf.

cputime_to_timeval() takes a struct timeval *as its second argument but
a struct compat_timeval * will be passed resulting in:

  CC      arch/mips/kernel/binfmt_elfn32.o
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c: In function ‘fill_prstatus’:
arch/mips/kernel/../../../fs/binfmt_elf.c:1330:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1331:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1336:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1337:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1339:2: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfn32.c:122:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1340:2: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfn32.c:55:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
  AS      arch/mips/kernel/scall64-n32.o
  CC      arch/mips/kernel/signal_n32.o
  CC      arch/mips/kernel/binfmt_elfo32.o
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c: In function ‘fill_prstatus’:
arch/mips/kernel/../../../fs/binfmt_elf.c:1330:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1331:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1336:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1337:3: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1339:2: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’
In file included from arch/mips/kernel/binfmt_elfo32.c:165:0:
arch/mips/kernel/../../../fs/binfmt_elf.c:1340:2: warning: passing argument 2 of ‘cputime_to_timeval’ from incompatible pointer type [enabled by default]
In file included from include/asm-generic/cputime.h:12:0,
                 from /home/ralf/src/linux/linux-mips/arch/mips/include/asm/cputime.h:4,
                 from include/linux/sched.h:28,
                 from include/linux/ptrace.h:5,
                 from include/uapi/linux/elfcore.h:7,
                 from include/linux/elfcore.h:7,
                 from arch/mips/kernel/binfmt_elfo32.c:78:
include/asm-generic/cputime_nsecs.h:92:91: note: expected ‘struct timeval *’ but argument is of type ‘struct compat_timeval *’

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: OCTEON: Improve _machine_halt implementation.
David Daney [Fri, 24 May 2013 16:23:02 +0000 (16:23 +0000)]
MIPS: OCTEON: Improve _machine_halt implementation.

As noted by Wladislav Wiebe:
   $ halt
   ..
   Sent SIGKILL to all processes
   Requesting system halt
   [66.729373] System halted.
   [66.733244]
   [66.734761] =====================================
   [66.739473] [ BUG: lock held at task exit time! ]
   [66.744188] 3.8.7-0-sampleversion-fct #49 Tainted: G           O
   [66.750202] -------------------------------------
   [66.754913] init/21479 is exiting with locks still held!
   [66.760234] 1 lock held by init/21479:
   [66.763990]  #0:  (reboot_mutex){+.+...}, at: [<ffffffff801776c8>] SyS_reboot+0xe0/0x218
   [66.772165]
   [66.772165] stack backtrace:
   [66.776532] Call Trace:
   [66.778992] [<ffffffff805780a8>] dump_stack+0x8/0x34
   [66.783972] [<ffffffff801618b0>] do_exit+0x610/0xa70
   [66.788948] [<ffffffff801777a8>] SyS_reboot+0x1c0/0x218
   [66.794186] [<ffffffff8013d6a4>] handle_sys64+0x44/0x64

This is an alternative fix to the one sent by Wladislav.  We kill the
watchdog for each CPU and then spin in WAIT with interrupts disabled.
This is the lowest power mode for the OCTEON.  If we were to spin with
interrupts enabled, we would get a continual stream of warning messages
and backtraces from the lockup detector, so I chose to disable
interrupts.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Maxim Uvarov <muvarov@gmail.com>
Cc: Wladislav Wiebe <wladislav.kw@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/5324/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: rtlx: Fix implicit declaration of function set_vi_handler()
Yoichi Yuasa [Tue, 28 May 2013 01:23:22 +0000 (01:23 +0000)]
MIPS: rtlx: Fix implicit declaration of function set_vi_handler()

arch/mips/kernel/rtlx.c: In function 'rtlx_module_init':
arch/mips/kernel/rtlx.c:523:3: error: implicit declaration of function 'set_vi_handler' [-Werror=implicit-function-declaration]

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5340/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agob43: stop format string leaking into error msgs
Kees Cook [Fri, 10 May 2013 21:48:21 +0000 (14:48 -0700)]
b43: stop format string leaking into error msgs

The module parameter "fwpostfix" is userspace controllable, unfiltered,
and is used to define the firmware filename. b43_do_request_fw() populates
ctx->errors[] on error, containing the firmware filename. b43err()
parses its arguments as a format string. For systems with b43 hardware,
this could lead to a uid-0 to ring-0 escalation.

CVE-2013-2852

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use minstrel rate control by default
Sujith Manoharan [Thu, 6 Jun 2013 04:36:29 +0000 (10:06 +0530)]
ath9k: Use minstrel rate control by default

The ath9k rate control algorithm has various architectural
issues that make it a poor fit in scenarios like congested
environments etc.

An example: https://bugzilla.redhat.com/show_bug.cgi?id=927191

Change the default to minstrel which is more robust in such cases.
The ath9k RC code is left in the driver for now, maybe it can
be removed altogether later on.

Cc: stable@vger.kernel.org
Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMIPS: Implement HAVE_CONTEXT_TRACKING.
Ralf Baechle [Tue, 28 May 2013 23:07:19 +0000 (01:07 +0200)]
MIPS: Implement HAVE_CONTEXT_TRACKING.

This enables support for CONFIG_NO_HZ_FULL.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: Cleanup flags in syscall flags handlers.
Ralf Baechle [Tue, 28 May 2013 23:02:18 +0000 (01:02 +0200)]
MIPS: Cleanup flags in syscall flags handlers.

This will simplify further modifications.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agopowerpc/hw_breakpoints: Add DABRX cpu feature to fix 32-bit regression
Michael Neuling [Thu, 16 May 2013 20:27:31 +0000 (20:27 +0000)]
powerpc/hw_breakpoints: Add DABRX cpu feature to fix 32-bit regression

When introducing support for DABRX in 4474ef0, we broke older 32-bit CPUs
that don't have that register.

Some CPUs have a DABR but not DABRX.  Configuration are:
- No 32bit CPUs have DABRX but some have DABR.
- POWER4+ and below have the DABR but no DABRX.
- 970 and POWER5 and above have DABR and DABRX.
- POWER8 has DAWR, hence no DABRX.

This introduces CPU_FTR_DABRX and sets it on appropriate CPUs.  We use
the top 64 bits for CPU FTR bits since only 64 bit CPUs have this.

Processors that don't have the DABRX will still work as they will fall
back to software filtering these breakpoints via perf_exclude_event().

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: "Gorelik, Jacob (335F)" <jacob.gorelik@jpl.nasa.gov>
cc: stable@vger.kernel.org (v3.9 only)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/power8: Update denormalization handler
Michael Neuling [Wed, 29 May 2013 21:33:19 +0000 (21:33 +0000)]
powerpc/power8: Update denormalization handler

POWER8 can take a denormalisation exception on any VSX registers.

This does the extra 32 VSX registers we don't currently handle.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pseries: Simplify denormalization handler
Michael Neuling [Wed, 29 May 2013 21:33:18 +0000 (21:33 +0000)]
powerpc/pseries: Simplify denormalization handler

The following simplifies the denorm code by using macros to generate the long
stream of almost identical instructions.

This patch results in no changes to the output binary, but removes a lot of
lines of code.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/power8: Fix oprofile and perf
Michael Neuling [Tue, 4 Jun 2013 19:38:54 +0000 (19:38 +0000)]
powerpc/power8: Fix oprofile and perf

In 2ac6f42 powerpc/cputable: Fix oprofile_cpu_type on power8
we broke all power8 hw events.

This reverts this change and uses oprofile_type instead. Perf now works
on POWER8 again and oprofile will revert to using timers on POWER8.

Kudos to mpe this fix.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Rename PMU interrupts from CNT to PMI
Michael Ellerman [Mon, 3 Jun 2013 18:21:17 +0000 (18:21 +0000)]
powerpc: Rename PMU interrupts from CNT to PMI

Back in commit 89713ed "Add timer, performance monitor and machine check
counts to /proc/interrupts" we added a count of PMU interrupts to the
output of /proc/interrupts.

At the time we named them "CNT" to match x86.

However in commit 89ccf46 "Rename 'performance counter interrupt'", the
x86 guys renamed theirs from "CNT" to "PMI".

Arguably changing the name could break someone's script, but I think the
chance of that is minimal, and it's preferable to have a name that 1) is
somewhat meaningful, and 2) matches x86.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/eeh: Don't check RTAS token to get PE addr
Gavin Shan [Wed, 5 Jun 2013 14:25:50 +0000 (14:25 +0000)]
powerpc/eeh: Don't check RTAS token to get PE addr

RTAS token "ibm,get-config-addr-info" or ibm,get-config-addr-info2"
are used to retrieve the PE address according to PCI address, which
made up of domain/bus/slot/function. If we don't have those 2 tokens,
the domain/bus/slot/function would be used as the address for EEH
RTAS operations. Some older f/w might not have those 2 tokens and
that blocks the EEH functionality to be initialized. It was introduced
by commit e2af155c ("powerpc/eeh: pseries platform EEH initialization").

The patch skips the check on those 2 tokens so we can bring up EEH
functionality successfully. And domain/bus/slot/function will be
used as address for EEH RTAS operations.

Cc: <stable@vger.kernel.org> # v3.4+
Reported-by: Robert Knight <knight@princeton.edu>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Tested-by: Robert Knight <knight@princeton.edu>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pci: Check the bus address instead of resource address in pcibios_fixup_resources
Kevin Hao [Wed, 5 Jun 2013 02:26:51 +0000 (02:26 +0000)]
powerpc/pci: Check the bus address instead of resource address in pcibios_fixup_resources

If a BAR has the value of 0, we would assume that it is unset yet and
then mark the resource as unset and would reassign it later. But after
commit 6c5705fe (powerpc/PCI: get rid of device resource fixups)
the pcibios_fixup_resources is invoked after the bus address was
translated to linux resource. So the value of res->start is resource
address. And since the resource and bus address may be different, we
should translate it to the bus address before doing the check.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoarch, mm: Remove tlb_fast_mode()
Peter Zijlstra [Wed, 5 Jun 2013 10:26:50 +0000 (12:26 +0200)]
arch, mm: Remove tlb_fast_mode()

Since the introduction of preemptible mmu_gather TLB fast mode has been
broken. TLB fast mode relies on there being absolutely no concurrency;
it frees pages first and invalidates TLBs later.

However now we can get concurrency and stuff goes *bang*.

This patch removes all tlb_fast_mode() code; it was found the better
option vs trying to patch the hole by entangling tlb invalidation with
the scheduler.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Thu, 6 Jun 2013 01:05:45 +0000 (10:05 +0900)]
Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild fixes from Michal Marek:
 "There is one fix for a kbuild regression, plus three kconfig fixes for
  bugs that have alway been there, but are simple enough to be fixed in
  an -rc"

* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig/menu.c: fix multiple references to expressions in menu_add_prop()
  mconf: handle keys in empty dialogs
  kbuild: Don't assume dts files live in arch/*/boot/dts
  scripts/config: fix assignment of parameters for short version of --*-after options

11 years agoMerge branches 'devel-stable', 'fixes', 'mcpm', 'misc' and 'mmci' into for-next
Russell King [Wed, 5 Jun 2013 22:58:46 +0000 (23:58 +0100)]
Merge branches 'devel-stable', 'fixes', 'mcpm', 'misc' and 'mmci' into for-next

11 years agoARM: 7741/1: mcpm_platsmp.c: remove empty smp_init_cpus method
Nicolas Pitre [Fri, 31 May 2013 04:24:03 +0000 (05:24 +0100)]
ARM: 7741/1: mcpm_platsmp.c: remove empty smp_init_cpus method

The smp_init_cpus method in the smp_operations structure is optional
and can be omitted entirely.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7740/1: MCPM: prettify debug output
Nicolas Pitre [Fri, 31 May 2013 04:17:29 +0000 (05:17 +0100)]
ARM: 7740/1: MCPM: prettify debug output

The CPU and cluster numbers (MPIDR affinity levels 0 and 1) may have
at most 8 bits each.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7746/1: mm: lazy cache flushing on non-mapped pages
Ming Lei [Wed, 5 Jun 2013 01:44:00 +0000 (02:44 +0100)]
ARM: 7746/1: mm: lazy cache flushing on non-mapped pages

Currently flush_dcache_page() thinks pages as non-mapped if
mapping_mapped(mapping) return false. This approach is very
coase:
- mmap on part of file may cause all pages backed on
the file being thought as mmaped

- file-backed pages aren't mapped into user space actually
if the memory mmaped on the file isn't accessed

This patch uses page_mapped() to decide if the page has been
mapped.

From the attached test code, I find there is much performance
improvement(>25%) when accessing page caches via read under this
situations, so memcpy benefits a lot from not flushing cache
under this situation.

No.   read time without the patch No. read time with the patch
================================================================
No. 0, time  22615636 us No. 0, time  22014717 us
No. 1, time  4387851 us  No. 1, time  3113184 us
No. 2, time  4276535 us  No. 2, time  3005244 us
No. 3, time  4259821 us  No. 3, time  3001565 us
No. 4, time  4263811 us  No. 4, time  3002748 us
No. 5, time  4258486 us  No. 5, time  3004104 us
No. 6, time  4253009 us  No. 6, time  3002188 us
No. 7, time  4262809 us  No. 7, time  2998196 us
No. 8, time  4264525 us  No. 8, time  3007255 us
No. 9, time  4267795 us  No. 9, time  3005094 us

1), No.0. is to read the file from storage device, and others are
to read the file from page caches basically.
2), file size is 512M, and is on ext4 over usb mass storage.
3), the test is done on Pandaboard.

unsigned int  sum = 0;
unsigned long sum_val = 0;

static unsigned long tv_diff(struct timeval *tv1, struct timeval *tv2)
{
return (tv2->tv_sec - tv1->tv_sec) * 1000000 +
(tv2->tv_usec - tv1->tv_usec);
}

int main(int argc, char *argv[])
{
char *mbuf, fbuf;
int fd;
int i;
unsigned long page_size, size;
struct stat stat;
struct timeval t1, t2;
unsigned char *rbuf = malloc(32 * page_size);

if (!rbuf) {
printf(" %sn", "malloc failed");
exit(-1);
}

page_size = getpagesize();
fd = open(argv[1], O_RDWR);
assert(fd >= 0);

fstat(fd, &stat);
size = stat.st_size;
printf("%s: file %s, size %lu, page size %lun",
argv[0],
argv[1], size, page_size);

gettimeofday(&t1, NULL);
mbuf = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (!mbuf) {
printf(" %sn", "mmap failed");
exit(-1);
}

for (i = 0 ; i < size ; i += (page_size * 32)) {
int rcnt;
lseek(fd, i, SEEK_SET);
rcnt = read(fd, rbuf, page_size * 32);
if (rcnt != page_size * 32) {
printf("%s: read faildn", __func__);
exit(-1);
}
}
free(rbuf);
munmap(mbuf, size);
gettimeofday(&t2, NULL);
printf("tread mmaped time: %luusn", tv_diff(&t1, &t2));

close(fd);
}

Cc: Michel Lespinasse <walken@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7745/1: psci: fix building without HOTPLUG_CPU
Arnd Bergmann [Mon, 3 Jun 2013 22:09:14 +0000 (23:09 +0100)]
ARM: 7745/1: psci: fix building without HOTPLUG_CPU

The cpu_die field in smp_operations is not valid with CONFIG_HOTPLUG_CPU,
so we must enclose it in #ifdef, but at least that lets us remove
two other lines.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7747/1: pcpu: ensure __my_cpu_offset cannot be re-ordered across barrier()
Will Deacon [Wed, 5 Jun 2013 10:20:33 +0000 (11:20 +0100)]
ARM: 7747/1: pcpu: ensure __my_cpu_offset cannot be re-ordered across barrier()

__my_cpu_offset is non-volatile, since we want its value to be cached
when we access several per-cpu variables in a row with preemption
disabled. This means that we rely on preempt_{en,dis}able to hazard
with the operation via the barrier() macro, so that we can't end up
migrating CPUs without reloading the per-cpu offset.

Unfortunately, GCC doesn't treat a "memory" clobber on a non-volatile
asm block as a side-effect, and will happily re-order it before other
memory clobbers (including those in prempt_disable()) and cache the
value. This has been observed to break the cmpxchg logic in the slub
allocator, leading to livelock in kmem_cache_alloc in mainline kernels.

This patch adds a dummy memory input operand to __my_cpu_offset,
forcing it to be ordered with respect to the barrier() macro.

Cc: <stable@vger.kernel.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7750/1: update legacy CPU ID in decompressor cache support jump table
Marc C [Wed, 5 Jun 2013 21:02:23 +0000 (22:02 +0100)]
ARM: 7750/1: update legacy CPU ID in decompressor cache support jump table

The previous mask values for the legacy ARM CPU IDs were conflicting
with the CPU ID assignments for late-generation CPUs (like the
Qualcomm MSM/QSD or Broadcom Brahma-15 processors). This change
corrects the legacy ARM CPU ID value so that the jump table can
fall-through to the appropriate cache maintenance / MMU functions.

Signed-off-by: Marc C <marc.ceeeee@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7743/1: compressed/head.S: work around new binutils warning
Arnd Bergmann [Fri, 31 May 2013 21:50:47 +0000 (22:50 +0100)]
ARM: 7743/1: compressed/head.S: work around new binutils warning

In August 2012, Matthew Gretton-Dann checked a change into binutils
labelled "Error on obsolete & warn on deprecated registers", apparently as
part of ARMv8 support. Apparently, this was supposed to emit the message
"Warning: This coprocessor register access is deprecated in ARMv8" when
using certain mcr/mrc instructions and building for ARMv8. Unfortunately,
the message that is actually emitted appears to be '(null)', which is
less helpful in comparison.

Even more unfortunately, this is biting us on every single kernel
build with a new gas, because arch/arm/boot/compressed/head.S and some
other files in that directory are built with -march=all since kernel
commit 80cec14a8 "[ARM] Add -march=all to assembly file build in
arch/arm/boot/compressed" back in v2.6.28.

This patch reverts Russell's nice solution and instead marks the head.S
file to be built for armv7-a, which fortunately lets us build all
instructions in that file without warnings even on the broken binutils.

Without this patch, building anything results in:

arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:565: Warning: (null)
arch/arm/boot/compressed/head.S:676: Warning: (null)
arch/arm/boot/compressed/head.S:698: Warning: (null)
arch/arm/boot/compressed/head.S:722: Warning: (null)
arch/arm/boot/compressed/head.S:726: Warning: (null)
arch/arm/boot/compressed/head.S:957: Warning: (null)
arch/arm/boot/compressed/head.S:996: Warning: (null)
arch/arm/boot/compressed/head.S:997: Warning: (null)
arch/arm/boot/compressed/head.S:1027: Warning: (null)
arch/arm/boot/compressed/head.S:1035: Warning: (null)
arch/arm/boot/compressed/head.S:1046: Warning: (null)
arch/arm/boot/compressed/head.S:1060: Warning: (null)
arch/arm/boot/compressed/head.S:1092: Warning: (null)
arch/arm/boot/compressed/head.S:1094: Warning: (null)
arch/arm/boot/compressed/head.S:1095: Warning: (null)
arch/arm/boot/compressed/head.S:1102: Warning: (null)
arch/arm/boot/compressed/head.S:1134: Warning: (null)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org
Cc: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7742/1: topology: export cpu_topology
Arnd Bergmann [Fri, 31 May 2013 21:49:22 +0000 (22:49 +0100)]
ARM: 7742/1: topology: export cpu_topology

The cpu_topology symbol is required by any driver using the topology
interfaces, which leads to a couple of build errors:

ERROR: "cpu_topology" [drivers/net/ethernet/sfc/sfc.ko] undefined!
ERROR: "cpu_topology" [drivers/cpufreq/arm_big_little.ko] undefined!
ERROR: "cpu_topology" [drivers/block/mtip32xx/mtip32xx.ko] undefined!

The obvious solution is to export this symbol.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoARM: 7737/1: fix kernel decompressor compilation error with CONFIG_DEBUG_SEMIHOSTING
Nicolas Pitre [Wed, 29 May 2013 15:57:30 +0000 (16:57 +0100)]
ARM: 7737/1: fix kernel decompressor compilation error with CONFIG_DEBUG_SEMIHOSTING

Selecting this option produces:

  AS      arch/arm/boot/compressed/debug.o
arch/arm/boot/compressed/debug.S:4:33: fatal error: mach/debug-macro.S: No such file or directory
compilation terminated.
make[3]: *** [arch/arm/boot/compressed/debug.o] Error 1

The semihosting support cannot be modelled into a senduart macro as
it requires memory space for argument passing.  So the
CONFIG_DEBUG_LL_INCLUDE may not have any sensible value and the include
directive should be omitted.

While at it, let's add proper semihosting output support to the
decompressor.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agoparisc: fix kernel BUG at arch/parisc/include/asm/mmzone.h:50 (part 2)
Helge Deller [Wed, 5 Jun 2013 20:50:01 +0000 (20:50 +0000)]
parisc: fix kernel BUG at arch/parisc/include/asm/mmzone.h:50 (part 2)

Make sure that we really return -1 (instead of 0x00ff) as node id for
page frame numbers which are not physically available.

This finally fixes the kernel panic when running
cat /proc/kpageflags /proc/kpagecount.

Theoretically this patch now limits the number of physical memory ranges
to 127 instead of 254, but currently we have MAX_PHYSMEM_RANGES
hardcoded to 8 which is sufficient for all existing parisc machines.

Signed-off-by: Helge Deller <deller@gmx.de>
11 years agoparisc: fix race conditions flushing user cache pages
John David Anglin [Tue, 28 May 2013 12:09:44 +0000 (12:09 +0000)]
parisc: fix race conditions flushing user cache pages

There are two issues addressed by this patch:

1) When we flush user instruction and data pages using the kernel
tmpalias region, we need to ensure that the local TLB entry for the
tmpalias page is never replaced with a different mapping. Previously, we
purged the entry before and after the cache flush loop. Although
preemption was disabled, it seemed possible that the value might change
during interrupt processing. The patch removes the purge and disables
interrupts during the initial TLB entry purge and cache flush.

2) In a number of places, we flush the TLB for the page and then flush
the page. We disabled preemption around the flush. This change disables
preemption around both the TLB and cache flushes as it seemed the effect
of the purge might be lost.

Without this change, I saw four random segmentation faults in about 1.5
days of intensive package building last weekend. With the change, I
haven't seen a single random segmentation fault in about one week of
building Debian packages on 4-way rp3440. So, there is a significant
improvement in system stability.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
11 years agoxtensa: tell git to ignore copied zlib source files
Baruch Siach [Mon, 3 Jun 2013 08:07:26 +0000 (11:07 +0300)]
xtensa: tell git to ignore copied zlib source files

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: fix section mismatch in pcibios_fixup_bus
Max Filippov [Mon, 27 May 2013 15:45:58 +0000 (19:45 +0400)]
xtensa: fix section mismatch in pcibios_fixup_bus

Remove __init annotation from pcibios_fixup_bus as is called from
pci_scan_child_bus which is not __init.

Also fix a couple of minor build warnings.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: ISS: fix section mismatch in iss_net_setup
Max Filippov [Mon, 27 May 2013 14:58:24 +0000 (18:58 +0400)]
xtensa: ISS: fix section mismatch in iss_net_setup

iss_net_setup is only called from __setup, so it should be marked
__init.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoarch: xtensa: include: asm: compiling issue, need cmpxchg64() defined.
Chen Gang [Mon, 27 May 2013 11:57:01 +0000 (19:57 +0800)]
arch: xtensa: include: asm: compiling issue, need cmpxchg64() defined.

When compiling with 'allmodconfig', some of drivers need cmpxchg64(),
xtensa does not supply 64-bit implementation for 'xchg', so use the
'generic' implementation.

e.g. (for next-20130527 tree):
  drivers/block/blockconsole.c:164:2: error: implicit declaration of function ‘cmpxchg64’ [-Werror=implicit-function-declaration]

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: xtfpga: fix section mismatch
Baruch Siach [Mon, 27 May 2013 06:11:59 +0000 (09:11 +0300)]
xtensa: xtfpga: fix section mismatch

platform_calibrate_ccount() calls update_clock_frequency() which is in .init
section. However, platform_calibrate_ccount() itself is only called from .init
(i.e., time_init()).

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: remove unused platform_init_irq()
Baruch Siach [Mon, 27 May 2013 09:23:52 +0000 (12:23 +0300)]
xtensa: remove unused platform_init_irq()

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: tell git to ignore generated files
Baruch Siach [Thu, 23 May 2013 07:58:18 +0000 (10:58 +0300)]
xtensa: tell git to ignore generated files

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: flush TLB entries for pages of non-current mm correctly
Max Filippov [Wed, 15 May 2013 15:02:06 +0000 (19:02 +0400)]
xtensa: flush TLB entries for pages of non-current mm correctly

Sometimes under high memory pressure one process gets a page of another
process, which manifests itself with an invalid instruction exception.

This happens because flush_tlb_page fails to clear TLB entries when
called with vma that does not belong to current mm, because it does not
set RASID appropriately. When page reclaiming mechanism swaps physical
pages out replacing their PTEs with none or swap PTEs, it calls
flush_tlb_page. Later physical page may be reused elsewhere, but the
stale TLB mapping still refers to it, allowing process that owned the
mapping to see the new state of that physical page.

Put ASID of the mm that owns vma to the RASID to fix that issue.
Also replace otherwise meaningless local_save_flags with local_irq_save.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agox86/PCI: Map PCI setup data with ioremap() so it can be in highmem
Matt Fleming [Wed, 5 Jun 2013 14:15:41 +0000 (15:15 +0100)]
x86/PCI: Map PCI setup data with ioremap() so it can be in highmem

f9a37be0f0 ("x86: Use PCI setup data") added support for using PCI ROM
images from setup_data.  This used phys_to_virt(), which is not valid for
highmem addresses, and can cause a crash when booting a 32-bit kernel via
the EFI boot stub.

pcibios_add_device() assumes that the physical addresses stored in
setup_data are accessible via the direct kernel mapping, and that calling
phys_to_virt() is valid.  This isn't guaranteed to be true on x86 where the
direct mapping range is much smaller than on x86-64.

Calling phys_to_virt() on a highmem address results in the following:

 BUG: unable to handle kernel paging request at 39a3c198
 IP: [<c262be0f>] pcibios_add_device+0x2f/0x90
 ...
 Call Trace:
  [<c2370c73>] pci_device_add+0xe3/0x130
  [<c274640b>] pci_scan_single_device+0x8b/0xb0
  [<c2370d08>] pci_scan_slot+0x48/0x100
  [<c2371904>] pci_scan_child_bus+0x24/0xc0
  [<c262a7b0>] pci_acpi_scan_root+0x2c0/0x490
  [<c23b7203>] acpi_pci_root_add+0x312/0x42f
  ...

The solution is to use ioremap() instead of phys_to_virt() to map the
setup data into the kernel address space.

[bhelgaas: changelog]
Tested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@vger.kernel.org # v3.8+
11 years agos390/pci: sysfs remove strlen
Sebastian Ott [Wed, 5 Jun 2013 14:08:07 +0000 (16:08 +0200)]
s390/pci: sysfs remove strlen

Get rid of the strlen calls, use the return value of sprintf instead.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pci: remove pdev during unplug
Sebastian Ott [Wed, 5 Jun 2013 14:07:28 +0000 (16:07 +0200)]
s390/pci: remove pdev during unplug

The disable slot implementation on s390 currently just detaches the
pci function from the partition - without informing the pci layer.
Fix this by calling pci_stop_and_remove_bus_device prior to the
operation.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pci: cleanup hotplug code
Sebastian Ott [Wed, 5 Jun 2013 14:06:42 +0000 (16:06 +0200)]
s390/pci: cleanup hotplug code

Provide wrappers for the [de]configure operations, add some error
handling, and use pci_scan_slot instead of pci_scan_single_device.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pci: implement pcibios_release_device
Sebastian Ott [Wed, 5 Jun 2013 14:06:16 +0000 (16:06 +0200)]
s390/pci: implement pcibios_release_device

Use pcibios_release_device to implement architecture-specific
functionality when a pci device is released. This function
will be called during pci_release_dev.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agopci: add pcibios_release_device
Sebastian Ott [Wed, 5 Jun 2013 14:05:32 +0000 (16:05 +0200)]
pci: add pcibios_release_device

Platforms may want to provide architecture-specific functionality when
a pci device is released. Add a pcibios_release_device() call that
architectures can override to do so.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/kvm: Provide function for setting the guest storage key
Christian Borntraeger [Mon, 27 May 2013 08:42:04 +0000 (10:42 +0200)]
s390/kvm: Provide function for setting the guest storage key

From time to time we need to set the guest storage key. Lets
provide a helper function that handles the changes with all the
right locking and checking.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390,sclp: add parameter to specify number of buffer pages
Martin Schwidefsky [Fri, 24 May 2013 10:30:03 +0000 (12:30 +0200)]
s390,sclp: add parameter to specify number of buffer pages

Add a kernel parameter to be able to specify the number of pages to be
used as output buffer by the line-mode sclp driver and the vt220 sclp
driver. The current number of output pages is 6, if the service element
is unavailable the boot messages alone can fill up the output buffer.
If this happens the system blocks until the service element is working
again. For a large LPAR with many devices it is sensible to have the
ability to increase the output buffer size. To help to debug this
situation add a counter for the page-pool-empty situation and make it
available as a sclp driver attribute.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390: remove virt_to_phys implementation
Sebastian Ott [Thu, 23 May 2013 09:55:07 +0000 (11:55 +0200)]
s390: remove virt_to_phys implementation

virt_to_phys on s390 currently uses the LRA instruction to translate
virtual to physical addresses. This creates an unnecessary overhead
and caused trouble with dma debugging code (when called with an
address pointing to a already unmapped page).
Just get rid of s390's implementation and use the one from
asm-generic/io.h .

Note: with this change virt_to_phys will no longer work on vmalloc'ed
addresses.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/smp: get rid of generic_smp_call_function_interrupt
Heiko Carstens [Tue, 21 May 2013 13:34:56 +0000 (15:34 +0200)]
s390/smp: get rid of generic_smp_call_function_interrupt

Since 9a46ad6d6 "smp: make smp_call_function_many() use logic similar
to smp_call_function_single()" generic_smp_call_function_interrupt()
is only an alias to generic_smp_call_function_single_interrupt().

So remove the superfluous variant.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/qdio: remove unused function
Sebastian Ott [Fri, 17 May 2013 14:39:51 +0000 (16:39 +0200)]
s390/qdio: remove unused function

Remove the unused function qdio_trace_aob.

Acked-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pci: use to_pci_dev
Sebastian Ott [Fri, 17 May 2013 14:33:40 +0000 (16:33 +0200)]
s390/pci: use to_pci_dev

Use the to_pci_dev macro to fetch a pci_dev from a struct device
pointer.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/sclp: fix new line detection
Peter Oberparleiter [Wed, 5 Jun 2013 13:51:57 +0000 (15:51 +0200)]
s390/sclp: fix new line detection

When printing multi-line text using sclp_print, line endings are not
correctly handled. The routine is expecting an EBCDIC new line character
as line terminator while the input text is encoded in ASCII format.

Fix this problem by modifying sclp_print to scan for ASCII new line
characters.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pgtable: make pgste lock an explicit barrier
Christian Borntraeger [Wed, 5 Jun 2013 07:25:34 +0000 (09:25 +0200)]
s390/pgtable: make pgste lock an explicit barrier

Getting and Releasing the pgste lock has lock semantics. Make the
code an explicit barrier.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pgtable: Save pgste during modify_prot_start/commit
Christian Borntraeger [Wed, 5 Jun 2013 07:22:33 +0000 (09:22 +0200)]
s390/pgtable: Save pgste during modify_prot_start/commit

In modify_prot_start we update the pgste value but never store it back
into the original location. Lets save the calculated result, since
modify_prot_commit will use the value of the pgste.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/dumpstack: fix address ranges for asynchronous and panic stack
Martin Schwidefsky [Tue, 4 Jun 2013 09:00:08 +0000 (11:00 +0200)]
s390/dumpstack: fix address ranges for asynchronous and panic stack

git commit dc7ee00d4771b321 "s390: lowcore stack pointer offsets"
introduced a regression in regard to show_stack(). The stack pointer
for the asynchronous and the panic stack in the lowcore now have an
additional offset applied to them. This offset needs to be taken into
account in the calculation for the low and high address for the stacks.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pgtable: Fix guest overindication for change bit
Christian Borntraeger [Tue, 4 Jun 2013 07:53:59 +0000 (09:53 +0200)]
s390/pgtable: Fix guest overindication for change bit

When doing the transition invalid->valid in the host page table for
a guest, then the guest view of C/R is in the pgste. After validation
the view is pgste OR real key. We must zero out the real key C/R to
avoid guest over-indication for change (and reference).

Touching the real key is ok also for the host: The change bit is
tracked via write protection and the reference bit is also ok
because set_pte_at was called and  the page will be touched anyway
soon. Furthermore architecture defines reference as "substantially
accurate", over- and underindication are ok.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agoUSB: serial: fix TIOCMIWAIT return value
Johan Hovold [Wed, 5 Jun 2013 10:21:11 +0000 (12:21 +0200)]
USB: serial: fix TIOCMIWAIT return value

Fix regression introduced by commit 143d9d9616 ("USB: serial: add
tiocmiwait subdriver operation") which made the ioctl operation return
ENODEV rather than ENOIOCTLCMD when a subdriver TIOCMIWAIT
implementation is missing.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agovfio: fix crash on rmmod
Alexey Kardashevskiy [Wed, 5 Jun 2013 14:54:16 +0000 (08:54 -0600)]
vfio: fix crash on rmmod

devtmpfs_delete_node() calls devnode() callback with mode==NULL but
vfio still tries to write there.

The patch fixes this.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agoRevert "ath9k_hw: Update rx gain initval to improve rx sensitivity"
Felix Fietkau [Mon, 3 Jun 2013 09:18:57 +0000 (11:18 +0200)]
Revert "ath9k_hw: Update rx gain initval to improve rx sensitivity"

This reverts commit 68d9e1fa24d9c7c2e527f49df8d18fb8cf0ec943

This change reduces rx sensitivity with no apparent extra benefit.
It looks like it was meant for testing in a specific scenario,
but it was never properly validated.

Cc: rmanohar@qca.qualcomm.com
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Disable PowerSave by default
Sujith Manoharan [Sat, 1 Jun 2013 01:38:09 +0000 (07:08 +0530)]
ath9k: Disable PowerSave by default

Almost all the DMA issues which have plagued ath9k (in station mode)
for years are related to PS. Disabling PS usually "fixes" the user's
connection stablility. Reports of DMA problems are still trickling in
and are sitting in the kernel bugzilla. Until the PS code in ath9k is
given a thorough review, disbale it by default. The slight increase
in chip power consumption is a small price to pay for improved link
stability.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agonet: wireless: iwlegacy: fix build error for il_pm_ops
Yijing Wang [Fri, 31 May 2013 06:05:32 +0000 (14:05 +0800)]
net: wireless: iwlegacy: fix build error for il_pm_ops

Fix build error for il_pm_ops if CONFIG_PM is set
but CONFIG_PM_SLEEP is not set.

ERROR: "il_pm_ops" [drivers/net/wireless/iwlegacy/iwl4965.ko] undefined!
ERROR: "il_pm_ops" [drivers/net/wireless/iwlegacy/iwl3945.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: Jingoo Han <jg1.han@samsung.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: Fix a false leak indication for PCI devices
Larry Finger [Thu, 30 May 2013 21:21:47 +0000 (16:21 -0500)]
rtlwifi: Fix a false leak indication for PCI devices

This false leak indication is avoided with a no-leak annotation to kmemleak.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowl12xx/wl18xx: scan all 5ghz channels
Eliad Peller [Tue, 7 May 2013 12:41:09 +0000 (15:41 +0300)]
wl12xx/wl18xx: scan all 5ghz channels

Due to a typo, the current code copies only sizeof(cmd->channels_2)
bytes, which is smaller than the correct sizeof(cmd->channels_5)
size, resulting in a partial scan (some channels are skipped).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowl12xx: increase minimum singlerole firmware version required
Luciano Coelho [Fri, 10 May 2013 07:44:25 +0000 (10:44 +0300)]
wl12xx: increase minimum singlerole firmware version required

The minimum firmware version required for singlerole after recent
driver changes is 6/7.3.10.0.133.

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowl12xx: fix minimum required firmware version for wl127x multirole
Luciano Coelho [Fri, 10 May 2013 07:19:38 +0000 (10:19 +0300)]
wl12xx: fix minimum required firmware version for wl127x multirole

There was a typo in commit 8675f9 (wlcore/wl12xx/wl18xx: verify
multi-role and single-role fw versions), which was causing the
multirole firmware for wl127x (WiLink6) to be rejected.  The actual
minimum version needed for wl127x multirole is 6.5.7.0.42.

Reported-by: Levi Pearson <levipearson@gmail.com>
Reported-by: Michael Scott <hashcode0f@gmail.com>
Cc: stable@kernel.org # 3.9+
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192cu: Fix problem in connecting to WEP or WPA(1) networks
Larry Finger [Thu, 30 May 2013 23:05:55 +0000 (18:05 -0500)]
rtlwifi: rtl8192cu: Fix problem in connecting to WEP or WPA(1) networks

Driver rtl8192cu can connect to WPA2 networks, but fails for any other
encryption method. The cause is a failure to set the rate control data
blocks. These changes fix https://bugzilla.redhat.com/show_bug.cgi?id=952793
and https://bugzilla.redhat.com/show_bug.cgi?id=761525.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: debugfs: Fix out of bounds array access
Mark A. Greer [Wed, 29 May 2013 19:25:34 +0000 (12:25 -0700)]
mwifiex: debugfs: Fix out of bounds array access

When reading the contents of '/sys/kernel/debug/mwifiex/p2p0/info',
the following panic occurs:

$ cat /sys/kernel/debug/mwifiex/p2p0/info
Unable to handle kernel paging request at virtual address 74706164
pgd = de530000
[74706164] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: phy_twl4030_usb omap2430 musb_hdrc mwifiex_sdio mwifiex
CPU: 0 PID: 1635 Comm: cat Not tainted 3.10.0-rc1-00010-g1268390 #1
task: de16b6c0 ti: de048000 task.ti: de048000
PC is at strnlen+0xc/0x4c
LR is at string+0x3c/0xf8
pc : [<c02c123c>]    lr : [<c02c2d1c>]    psr: a0000013
sp : de049e10  ip : c06efba0  fp : de6d2092
r10: bf01a260  r9 : ffffffff  r8 : 74706164
r7 : 0000ffff  r6 : ffffffff  r5 : de6d209c  r4 : 00000000
r3 : ff0a0004  r2 : 74706164  r1 : ffffffff  r0 : 74706164
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 9e530019  DAC: 00000015
Process cat (pid: 1635, stack limit = 0xde048240)
Stack: (0xde049e10 to 0xde04a000)
9e00:                                     de6d2092 00000002 bf01a25e de6d209c
9e20: de049e80 c02c438c 0000000a ff0a0004 ffffffff 00000000 00000000 de049e48
9e40: 00000000 2192df6d ff0a0004 ffffffff 00000000 de6d2092 de049ef8 bef3cc00
9e60: de6b0000 dc358000 de6d2000 00000000 00000003 c02c45a4 bf01790c bf01a254
9e80: 74706164 bf018698 00000000 de59c3c0 de048000 de049f80 00001000 bef3cc00
9ea0: 00000008 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ee0: 00000000 00000000 00000000 00000001 00000000 00000000 6669776d 20786569
9f00: 20302e31 2e343128 392e3636 3231702e 00202933 00000000 00000003 c0294898
9f20: 00000000 00000000 00000000 00000000 de59c3c0 c0107c04 de554000 de59c3c0
9f40: 00001000 bef3cc00 de049f80 bef3cc00 de049f80 00000000 00000003 c0108a00
9f60: de048000 de59c3c0 00000000 00000000 de59c3c0 00001000 bef3cc00 c0108b60
9f80: 00000000 00000000 00001000 bef3cc00 00000003 00000003 c0014128 de048000
9fa0: 00000000 c0013f80 00001000 bef3cc00 00000003 bef3cc00 00001000 00000000
9fc0: 00001000 bef3cc00 00000003 00000003 00000001 00000001 00000001 00000003
9fe0: 00000000 bef3cbdc 00011984 b6f1127c 60000010 00000003 18dbdd2c 7f7bfffd
[<c02c123c>] (strnlen+0xc/0x4c) from [<c02c2d1c>] (string+0x3c/0xf8)
[<c02c2d1c>] (string+0x3c/0xf8) from [<c02c438c>] (vsnprintf+0x1e8/0x3e8)
[<c02c438c>] (vsnprintf+0x1e8/0x3e8) from [<c02c45a4>] (sprintf+0x18/0x24)
[<c02c45a4>] (sprintf+0x18/0x24) from [<bf01790c>] (mwifiex_info_read+0xfc/0x3e8 [mwifiex])
[<bf01790c>] (mwifiex_info_read+0xfc/0x3e8 [mwifiex]) from [<c0108a00>] (vfs_read+0xb0/0x144)
[<c0108a00>] (vfs_read+0xb0/0x144) from [<c0108b60>] (SyS_read+0x44/0x70)
[<c0108b60>] (SyS_read+0x44/0x70) from [<c0013f80>] (ret_fast_syscall+0x0/0x30)
Code: e12fff1e e3510000 e1a02000 0a00000d (e5d03000)
---[ end trace ca98273dc605a04f ]---

The panic is caused by the mwifiex_info_read() routine assuming that
there can only be four modes (0-3) which is an invalid assumption.
For example, when testing P2P, the mode is '8' (P2P_CLIENT) so the
code accesses data beyond the bounds of the bss_modes[] array which
causes the panic.  Fix this by updating bss_modes[] to support the
current list of modes and adding a check to prevent the out-of-bounds
access from occuring in the future when more modes are added.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoBluetooth: Fix mgmt handling of power on failures
Johan Hedberg [Wed, 29 May 2013 06:51:29 +0000 (09:51 +0300)]
Bluetooth: Fix mgmt handling of power on failures

If hci_dev_open fails we need to ensure that the corresponding
mgmt_set_powered command gets an appropriate response. This patch fixes
the missing response by adding a new mgmt_set_powered_failed function
that's used to indicate a power on failure to mgmt. Since a situation
with the device being rfkilled may require special handling in user
space the patch uses a new dedicated mgmt status code for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Cc: stable@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>