deliverable/linux.git
9 years agolibceph: fix sparse endianness warnings
Ilya Dryomov [Fri, 19 Dec 2014 11:00:41 +0000 (14:00 +0300)] 
libceph: fix sparse endianness warnings

The only real issue is the one in auth_x.c and it came with
3.19-rc1 merge.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
9 years agoceph: use %zu for len in ceph_fill_inline_data()
Ilya Dryomov [Fri, 19 Dec 2014 10:10:10 +0000 (13:10 +0300)] 
ceph: use %zu for len in ceph_fill_inline_data()

len is size_t, should be printed with %zu.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
9 years agoselftests/vm: fix link error for transhuge-stress test
Andrey Skvortsov [Wed, 7 Jan 2015 18:35:54 +0000 (21:35 +0300)] 
selftests/vm: fix link error for transhuge-stress test

add -lrt to fix undefined reference to `clock_gettime'
error seen when the test is compiled using gcc 4.6.4.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
9 years agoperf hists browser: Fix segfault when showing callchain
Namhyung Kim [Wed, 24 Dec 2014 06:04:36 +0000 (15:04 +0900)] 
perf hists browser: Fix segfault when showing callchain

When perf report on TUI shows callchain it checks first node has
siblings to determine whether it needs to print percentage value.

But it missed a case that first node is NULL.  So sometimes it segfaults
like below:

  $ perf top -g
  perf: Segmentation fault
  -------- backtrace --------
  perf[0x4fcefb]
  /usr/lib/libc.so.6(+0x33b20)[0x7f2a35839b20]
  perf(rb_next+0x8)[0x47d3d8]
  perf[0x4f6058]
  perf[0x4f833b]
  perf[0x4f8610]
  perf[0x4f209e]
  perf(ui_browser__run+0x3a)[0x4f2e6a]
  perf[0x4f94ee]
  perf(perf_evlist__tui_browse_hists+0x94)[0x4fbbf4]
  perf[0x444d10]
  /usr/lib/libpthread.so.0(+0x7314)[0x7f2a37070314]
  /usr/lib/libc.so.6(clone+0x6d)[0x7f2a358ee5bd]

  $ addr2line -e `which perf` 0x4f6058
  /home/namhyung/project/linux/tools/perf/ui/browsers/hists.c:553

I don't know why the backtrace didn't print some symbols..

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Fixes: 4087d11cd945 ("perf hists browser: Print overhead percent value for first-level callchain")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1419401076-21700-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
9 years agoperf callchain: Free callchains when hist entries are deleted
Namhyung Kim [Tue, 30 Dec 2014 05:38:13 +0000 (14:38 +0900)] 
perf callchain: Free callchains when hist entries are deleted

Markus reported that "perf top -g" can leak ~300MB per second on his
machine.  This is partly because it missed to free callchains when hist
entries are deleted.  Fix it.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20141230053813.GD6081@sejong
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
9 years agoperf hists: Fix children sort key behavior
Namhyung Kim [Tue, 23 Dec 2014 04:36:21 +0000 (13:36 +0900)] 
perf hists: Fix children sort key behavior

When perf report --children resorts output fields, it tries to put
caller above the callee.  But this was only meaningful for a same thread
and doing this requires callchain enabled.  So fix its check before
comparing the callchain depth.

This also changes the hist accumulation tests: In test 3, xmalloc in
bash thread should be above than other perf threads due to alphabetical
order of comm string.  Also it's under page_fault in bash thread since
alphabetical order of dso name.  The sys_perf_event_open in perf thread
is put on the last line since it's self overhead is 0.

In test 4, the sys_perf_event_open is put above other perf entries that
have same children overhead since its callchain depth is smaller.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1419309381-2593-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
9 years agox86/xen: avoid freeing static 'name' when kasprintf() fails
Vitaly Kuznetsov [Mon, 5 Jan 2015 15:27:51 +0000 (16:27 +0100)] 
x86/xen: avoid freeing static 'name' when kasprintf() fails

In case kasprintf() fails in xen_setup_timer() we assign name to the
static string "<timer kasprintf failed>". We, however, don't check
that fact before issuing kfree() in xen_teardown_timer(), kernel is
supposed to crash with 'kernel BUG at mm/slub.c:3341!'

Solve the issue by making name a fixed length string inside struct
xen_clock_event_device. 16 bytes should be enough.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
9 years agox86/xen: add extra memory for remapped frames during setup
David Vrabel [Wed, 7 Jan 2015 11:21:50 +0000 (11:21 +0000)] 
x86/xen: add extra memory for remapped frames during setup

If the non-RAM regions in the e820 memory map are larger than the size
of the initial balloon, a BUG was triggered as the frames are remaped
beyond the limit of the linear p2m.  The frames are remapped into the
initial balloon area (xen_extra_mem) but not enough of this is
available.

Ensure enough extra memory regions are added for these remapped
frames.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
9 years agox86/xen: don't count how many PFNs are identity mapped
David Vrabel [Wed, 7 Jan 2015 11:01:08 +0000 (11:01 +0000)] 
x86/xen: don't count how many PFNs are identity mapped

This accounting is just used to print a diagnostic message that isn't
very useful.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
9 years agox86/xen: Free bootmem in free_p2m_page() during early boot
Boris Ostrovsky [Wed, 7 Jan 2015 14:08:54 +0000 (09:08 -0500)] 
x86/xen: Free bootmem in free_p2m_page() during early boot

With recent changes in p2m we now have legitimate cases when
p2m memory needs to be freed during early boot (i.e. before
slab is initialized).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
9 years agoarm64/efi: add missing call to early_ioremap_reset()
Ard Biesheuvel [Thu, 8 Jan 2015 09:54:58 +0000 (09:54 +0000)] 
arm64/efi: add missing call to early_ioremap_reset()

The early ioremap support introduced by patch bf4b558eba92
("arm64: add early_ioremap support") failed to add a call to
early_ioremap_reset() at an appropriate time. Without this call,
invocations of early_ioremap etc. that are done too late will go
unnoticed and may cause corruption.

This is exactly what happened when the first user of this feature
was added in patch f84d02755f5a ("arm64: add EFI runtime services").
The early mapping of the EFI memory map is unmapped during an early
initcall, at which time the early ioremap support is long gone.

Fix by adding the missing call to early_ioremap_reset() to
setup_arch(), and move the offending early_memunmap() to right after
the point where the early mapping of the EFI memory map is last used.

Fixes: f84d02755f5a ("arm64: add EFI runtime services")
Cc: <stable@vger.kernel.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoMerge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Thu, 8 Jan 2015 07:59:22 +0000 (08:59 +0100)] 
Merge tag 'perf-urgent-for-mingo' of git://git./linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

"
  - 'perf probe' should fall back to find probe point in symbols when failing
    to do so in a debuginfo file (Masami Hiramatsu)

  - Fix 'perf probe' crash in dwarf_getcfi_elf (Namhyung Kim)

  - Fix shell completion with 'perf list' --raw-dump option (Taesoo Kim)

  - Fix 'perf diff' to sort by baseline field by default (Namhyung Kim)
"

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
9 years agoMerge tag 'amdkfd-fixes-2015-01-06' of git://people.freedesktop.org/~gabbayo/linux...
Dave Airlie [Thu, 8 Jan 2015 00:36:37 +0000 (10:36 +1000)] 
Merge tag 'amdkfd-fixes-2015-01-06' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes

- Complete overhaul to the main IOCTL function, kfd_ioctl(), according to
  drm_ioctl() example. This includes changing the IOCTL definitions, so it
  breaks compatibility with previous versions of the userspace. However,
  because the kernel was not officialy released yet, and this the first
  kernel that includes amdkfd, I assume I can still do that at this stage.

- A couple of bug fixes for the non-HWS path (used for bring-ups and
  debugging purposes only).

* tag 'amdkfd-fixes-2015-01-06' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: rewrite kfd_ioctl() according to drm_ioctl()
  drm/amdkfd: reformat IOCTL definitions to drm-style
  drm/amdkfd: Do copy_to/from_user in general kfd_ioctl()
  drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
  drm/radeon: Assign VMID to PASID for IH in non-HWS mode
  drm/radeon: do not leave queue acquired if timeout happens in kgd_hqd_destroy()
  drm/amdkfd: Load mqd to hqd in non-HWS mode
  drm/amd: Fixing typos in kfd<->kgd interface

9 years agoMerge branch 'drm-fixes-3.19' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 8 Jan 2015 00:19:59 +0000 (10:19 +1000)] 
Merge branch 'drm-fixes-3.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

some minor radeon fixes.

* 'drm-fixes-3.19' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: integer underflow in radeon_cp_dispatch_texture()
  drm/radeon: adjust default bapm settings for KV
  drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw
  drm/radeon: fix sad_count check for dce3
  drm/radeon: KV has three PPLLs (v2)

9 years agoMerge branch 'linux-3.19' of git://anongit.freedesktop.org/git/nouveau/linux-2.6...
Dave Airlie [Thu, 8 Jan 2015 00:19:24 +0000 (10:19 +1000)] 
Merge branch 'linux-3.19' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

    - Fix BUG() on !SMP builds
    - Fix for OOPS on pre-NV50 that snuck into -next
    - MCP7[789A] hang fix where firmware hasn't already setup NISO pollers
    - NV4x IGP MSI disable, it doesn't appear to work correctly
    - Add GK208B to recognised boards (no code change aside from adding
    chipset recognition)

* 'linux-3.19' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP
  drm/nv4c/mc: disable msi
  drm/nouveau/fb/ram/mcp77: enable NISO poller
  drm/nouveau/fb/ram/mcp77: use carveout reg to determine size
  drm/nouveau/fb/ram/mcp77: subclass nouveau_ram
  drm/nouveau: wake up the card if necessary during gem callbacks
  drm/nouveau/device: Add support for GK208B, resolves bug 86935
  drm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulate
  drm/nouveau/bios: fix oops on pre-nv50 chipsets

9 years agoARM: 8253/1: mm: use phys_addr_t type in map_lowmem() for kernel mem region
Grygorii Strashko [Tue, 23 Dec 2014 18:36:55 +0000 (19:36 +0100)] 
ARM: 8253/1: mm: use phys_addr_t type in map_lowmem() for kernel mem region

Now local variables kernel_x_start and kernel_x_end defined using
'unsigned long' type which is wrong because they represent physical
memory range and will be calculated wrongly if LPAE is enabled.
As result, all following code in map_lowmem() will not work correctly.

For example, Keystone 2 boot is broken because
 kernel_x_start == 0x0000 0000
 kernel_x_end   == 0x0080 0000

instead of
 kernel_x_start == 0x0000 0008 0000 0000
 kernel_x_end   == 0x0000 0008 0080 0000
and as result whole low memory will be mapped with MT_MEMORY_RW
permissions by code (start > kernel_x_end):
} else if (start >= kernel_x_end) {
map.pfn = __phys_to_pfn(start);
map.virtual = __phys_to_virt(start);
map.length = end - start;
map.type = MT_MEMORY_RW;

create_mapping(&map);
}

Hence, fix it by using phys_addr_t type for variables kernel_x_start
and kernel_x_end.

Tested-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8249/1: mm: dump: don't skip regions
Mark Rutland [Wed, 17 Dec 2014 16:57:38 +0000 (17:57 +0100)] 
ARM: 8249/1: mm: dump: don't skip regions

Currently the arm page table dumping code starts dumping page tables
from USER_PGTABLES_CEILING. This is unnecessary for skipping any entries
related to userspace as the swapper_pg_dir does not contain such
entries, and results in a couple of unfortuante side effects.

Firstly, any kernel mappings which might exist below
USER_PGTABLES_CEILING will not be accounted in the dump output. This
masks any entries erroneously created below this address.

Secondly, if the final page table entry walked is part of a valid
mapping the page table dumping code will not log the region this entry
is part of, as the final note_page call in walk_pgd will trigger an
early return when 0 < USER_PGTABLES_CEILING. Luckily this isn't seen on
contemporary systems as they typically don't have enough RAM to extend
the linear mapping right to the end of the address space.

Due to the way addr is constructed in the walk_* functions, it can never
be less than USER_PGTABLES_CEILING when walking the page tables, so it
is not necessary to avoid dereferencing invalid table addresses. The
existing checks for st->current_prot and st->marker[1].start_address are
sufficient to ensure we will not print and/or dereference garbage when
trying to log information.

This patch removes both problematic uses of USER_PGTABLES_CEILING from
the arm page table dumping code, preventing both of these issues. We
will now report any low mappings, and the final note_page call will not
return early, ensuring all regions are logged.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: wire up execveat syscall
Russell King [Thu, 18 Dec 2014 19:43:36 +0000 (19:43 +0000)] 
ARM: wire up execveat syscall

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agorpc: fix xdr_truncate_encode to handle buffer ending on page boundary
J. Bruce Fields [Mon, 22 Dec 2014 21:14:51 +0000 (16:14 -0500)] 
rpc: fix xdr_truncate_encode to handle buffer ending on page boundary

A struct xdr_stream at a page boundary might point to the end of one
page or the beginning of the next, but xdr_truncate_encode isn't
prepared to handle the former.

This can cause corruption of NFSv4 READDIR replies in the case that a
readdir entry that would have exceeded the client's dircount/maxcount
limit would have ended exactly on a 4k page boundary.  You're more
likely to hit this case on large directories.

Other xdr_truncate_encode callers are probably also affected.

Reported-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Tested-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Fixes: 3e19ce762b53 "rpc: xdr_truncate_encode"
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
9 years agonfsd: fix fi_delegees leak when fi_had_conflict returns true
Jeff Layton [Sat, 13 Dec 2014 14:11:39 +0000 (09:11 -0500)] 
nfsd: fix fi_delegees leak when fi_had_conflict returns true

Currently, nfs4_set_delegation takes a reference to an existing
delegation and then checks to see if there is a conflict. If there is
one, then it doesn't release that reference.

Change the code to take the reference after the check and only if there
is no conflict.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
9 years agovfio-pci: Fix the check on pci device type in vfio_pci_probe()
Wei Yang [Wed, 7 Jan 2015 17:29:11 +0000 (10:29 -0700)] 
vfio-pci: Fix the check on pci device type in vfio_pci_probe()

Current vfio-pci just supports normal pci device, so vfio_pci_probe() will
return if the pci device is not a normal device. While current code makes a
mistake. PCI_HEADER_TYPE is the offset in configuration space of the device
type, but we use this value to mask the type value.

This patch fixs this by do the check directly on the pci_dev->hdr_type.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org # v3.6+
9 years agoassoc_array: Include rcupdate.h for call_rcu() definition
Pranith Kumar [Tue, 30 Dec 2014 05:46:21 +0000 (00:46 -0500)] 
assoc_array: Include rcupdate.h for call_rcu() definition

Include rcupdate.h header to provide call_rcu() definition. This was implicitly
being provided by slab.h file which include srcu.h somewhere in its include
hierarchy which in-turn included rcupdate.h.

Lately, tinification effort added support to remove srcu entirely because of
which we are encountering build errors like

lib/assoc_array.c: In function 'assoc_array_apply_edit':
lib/assoc_array.c:1426:2: error: implicit declaration of function 'call_rcu' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Fix these by including rcupdate.h explicitly.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Reported-by: Scott Wood <scottwood@freescale.com>
9 years agoALSA: fireworks: fix an endianness bug for transaction length
Takashi Sakamoto [Wed, 7 Jan 2015 15:31:16 +0000 (00:31 +0900)] 
ALSA: fireworks: fix an endianness bug for transaction length

Although the 't->length' is a big-endian value, it's used without any
conversion. This means that the driver always uses 'length' parameter.

Fixes: 555e8a8f7f14("ALSA: fireworks: Add command/response functionality into hwdep interface")
Reported-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoudf: Check length of extended attributes and allocation descriptors
Jan Kara [Wed, 7 Jan 2015 12:49:08 +0000 (13:49 +0100)] 
udf: Check length of extended attributes and allocation descriptors

Check length of extended attributes and allocation descriptors when
loading inodes from disk. Otherwise corrupted filesystems could confuse
the code and make the kernel oops.

Reported-by: Carl Henrik Lunde <chlunde@ping.uio.no>
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoudf: Remove repeated loads blocksize
Jan Kara [Wed, 7 Jan 2015 12:46:16 +0000 (13:46 +0100)] 
udf: Remove repeated loads blocksize

Store blocksize in a local variable in udf_fill_inode() since it is used
a lot of times.

Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoarm64: fix missing asm/io.h include in kernel/smp_spin_table.c
Paul Walmsley [Tue, 6 Jan 2015 00:38:42 +0000 (17:38 -0700)] 
arm64: fix missing asm/io.h include in kernel/smp_spin_table.c

On next-20150105, defconfig compilation breaks with:

arch/arm64/kernel/smp_spin_table.c:80:2: error: implicit declaration of function ‘ioremap_cache’ [-Werror=implicit-function-declaration]
arch/arm64/kernel/smp_spin_table.c:92:2: error: implicit declaration of function ‘writeq_relaxed’ [-Werror=implicit-function-declaration]
arch/arm64/kernel/smp_spin_table.c:101:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]

Fix by including asm/io.h, which contains definitions or prototypes
for these macros or functions.

This second version incorporates a comment from Mark Rutland
<mark.rutland@arm.com> to keep the includes in alphabetical order
by filename.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: fix missing asm/alternative.h include in kernel/module.c
Paul Walmsley [Tue, 6 Jan 2015 00:38:41 +0000 (17:38 -0700)] 
arm64: fix missing asm/alternative.h include in kernel/module.c

On next-20150105, defconfig compilation breaks with:

arch/arm64/kernel/module.c:408:4: error: implicit declaration of function ‘apply_alternatives’ [-Werror=implicit-function-declaration]

Fix by including asm/alternative.h, where the apply_alternatives()
prototype is declared.

This second version incorporates a comment from Mark Rutland
<mark.rutland@arm.com> to keep the includes in alphabetical order
by filename.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: fix missing linux/bug.h include in asm/arch_timer.h
Paul Walmsley [Tue, 6 Jan 2015 00:38:41 +0000 (17:38 -0700)] 
arm64: fix missing linux/bug.h include in asm/arch_timer.h

On next-20150105, defconfig compilation breaks with:

./arch/arm64/include/asm/arch_timer.h:112:2: error: implicit declaration of function ‘BUG’ [-Werror=implicit-function-declaration]

Fix by including linux/bug.h, where the BUG macro is defined.

This second version incorporates a comment from Mark Rutland
<mark.rutland@arm.com> to keep the includes in alphabetical order
by filename.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: fix missing asm/pgtable-hwdef.h include in asm/processor.h
Paul Walmsley [Tue, 6 Jan 2015 00:38:41 +0000 (17:38 -0700)] 
arm64: fix missing asm/pgtable-hwdef.h include in asm/processor.h

On next-20150105, defconfig compilation breaks with:

./arch/arm64/include/asm/processor.h:47:32: error: ‘PHYS_MASK’ undeclared (first use in this function)

Fix by including asm/pgtable-hwdef.h, where PHYS_MASK is defined.

This second version incorporates a comment from Mark Rutland
<mark.rutland@arm.com> to keep the includes in alphabetical order
by filename.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: sanity checks: add missing AArch32 registers
Mark Rutland [Wed, 7 Jan 2015 10:31:56 +0000 (10:31 +0000)] 
arm64: sanity checks: add missing AArch32 registers

We don't currently check a number of registers exposed to AArch32 guests
(MVFR{0,1,2}_EL1 and ID_DFR0_EL1), despite the fact these describe
AArch32 feature support exposed to userspace and KVM guests similarly to
AArch64 registers which we do check. We do not expect these registers to
vary across a set of CPUs.

This patch adds said registers to the cpuinfo framework and sanity
checks. No sanity check failures have been observed on a current ARMv8
big.LITTLE platform (Juno).

Cc: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: Remove unused prepare_to_copy()
Tobias Klauser [Mon, 5 Jan 2015 14:23:48 +0000 (14:23 +0000)] 
arm64: Remove unused prepare_to_copy()

prepare_to_copy() was removed from all architectures supported at that
time in commit 55ccf3fe3f9a ("fork: move the real prepare_to_copy()
users to arch_dup_task_struct()"). Remove it from arm64 as well.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agoarm64: Correct __NR_compat_syscalls for bpf
Mark Rutland [Mon, 5 Jan 2015 12:24:47 +0000 (12:24 +0000)] 
arm64: Correct __NR_compat_syscalls for bpf

Commit 97b56be10352a70c (arm64: compat: Enable bpf syscall) made the
usual mistake of forgetting to update __NR_compat_syscalls. Due to this,
when el0_sync_compat calls el0_svc_naked, the test against sc_nr
(__NR_compat_syscalls) will fail, and we'll call ni_sys, returning
-ENOSYS to userspace.

This patch bumps __NR_compat_syscalls appropriately, enabling the use of
the bpf syscall from compat tasks.

Due to the reorganisation of unistd{,32}.h as part of commit
f3e5c847ec3d12b4 (arm64: Add __NR_* definitions for compat syscalls) it
is not currently possible to include both headers and sanity-check the
value of __NR_compat_syscalls at build-time to prevent this from
happening again. Additional rework is required to make such niceties a
possibility.

Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
9 years agovhost/net: length miscalculation
Michael S. Tsirkin [Wed, 7 Jan 2015 08:51:00 +0000 (10:51 +0200)] 
vhost/net: length miscalculation

commit 8b38694a2dc8b18374310df50174f1e4376d6824
    vhost/net: virtio 1.0 byte swap
had this chunk:
-       heads[headcount - 1].len += datalen;
+       heads[headcount - 1].len = cpu_to_vhost32(vq, len - datalen);

This adds datalen with the wrong sign, causing guest panics.

Fixes: 8b38694a2dc8b18374310df50174f1e4376d6824
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Suggested-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopinctrl: st: Add irq_disable hook to st_gpio_irqchip
Patrice CHOTARD [Mon, 5 Jan 2015 10:04:14 +0000 (11:04 +0100)] 
pinctrl: st: Add irq_disable hook to st_gpio_irqchip

Currently disable_irq() doesn't work for pinctrl-st driver, due to
missing irq_disable hook in the driver.
disable_irq() is required only for level-triggered interrupts, which
is not the case normally.

Signed-off-by: Pankaj Dev <pankaj.dev@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 years agopinctrl: st: avoid multiple mutex lock
Francesco VIRLINZI [Mon, 5 Jan 2015 10:04:13 +0000 (11:04 +0100)] 
pinctrl: st: avoid multiple mutex lock

Using the sysfs inteface to inspect the pins configuration
the system can walk around a path which acquires the same
mutex twice.

On STiH407 platform, for example :
cat /sys/kernel/debug/pinctrl/920f080.pin-controller-front0/pinconf-pins
hangs the kernel and never returns.

With this patch the mutex is temporary freed.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 years agogpio: dln2: Fix gpio output value in dln2_gpio_direction_output()
Axel Lin [Wed, 17 Dec 2014 09:47:14 +0000 (17:47 +0800)] 
gpio: dln2: Fix gpio output value in dln2_gpio_direction_output()

dln2_gpio_direction_output() ignored the state passed into it. Fix it.
Also make dln2_gpio_pin_set_out_val return int, so we can check the error value.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Daniel Baluta <daniel.baluta@intel.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 years agogpio: dln2: fix issue when an IRQ is unmasked then enabled
Octavian Purdila [Tue, 16 Dec 2014 15:57:12 +0000 (17:57 +0200)] 
gpio: dln2: fix issue when an IRQ is unmasked then enabled

As noticed during suspend/resume operations, the IRQ can be unmasked
then disabled in suspend and eventually enabled in resume, but without
being unmasked.

The current implementation does not take into account interactions
between mask/unmask and enable/disable interrupts, and thus in the
above scenarios the IRQs remain unactive.

To fix this we removed the enable/disable operations as they fallback
to mask/unmask anyway.

We also remove the pending bitmaks as it is already done in irq_data
(i.e. IRQS_PENDING).

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 years agoisofs: Fix bug in the way to check if the year is a leap year
Oscar Forner Martinez [Wed, 7 Jan 2015 00:54:19 +0000 (16:54 -0800)] 
isofs: Fix bug in the way to check if the year is a leap year

Changed the whole algorithm for a call to mktime64 that takes
care of all that details.

Signed-off-by: Oscar Forner Martinez <oscar.forner.martinez@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda
Aaron Plattner [Tue, 6 Jan 2015 21:40:14 +0000 (13:40 -0800)] 
ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda

Vendor ID 0x10de0072 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 7 Jan 2015 01:48:14 +0000 (17:48 -0800)] 
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:
 "Just a pile of random fixes, including:

   1) Do not apply TSO limits to non-TSO packets, fix from Herbert Xu.

   2) MDI{,X} eeprom check in e100 driver is reversed, from John W.
      Linville.

   3) Missing error return assignments in several ethernet drivers, from
      Julia Lawall.

   4) Altera TSE device doesn't come back up after ifconfig down/up
      sequence, fix from Kostya Belezko.

   5) Add more cases to the check for whether the qmi_wwan device has a
      bogus MAC address and needs to be assigned a random one.  From
      Kristian Evensen.

   6) Fix interrupt hangs in CPSW, from Felipe Balbi.

   7) Implement ndo_features_check in r8152 so that the stack doesn't
      feed GSO packets which are outside of the chip's capabilities.
      From Hayes Wang"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
  qla3xxx: don't allow never end busy loop
  xen-netback: fixing the propagation of the transmit shaper timeout
  r8152: support ndo_features_check
  batman-adv: fix potential TT client + orig-node memory leak
  batman-adv: fix multicast counter when purging originators
  batman-adv: fix counter for multicast supporting nodes
  batman-adv: fix lock class for decoding hash in network-coding.c
  batman-adv: fix delayed foreign originator recognition
  batman-adv: fix and simplify condition when bonding should be used
  Revert "mac80211: Fix accounting of the tailroom-needed counter"
  net: ethernet: cpsw: fix hangs with interrupts
  enic: free all rq buffs when allocation fails
  qmi_wwan: Set random MAC on devices with buggy fw
  openvswitch: Consistently include VLAN header in flow and port stats.
  tcp: Do not apply TSO segment limit to non-TSO packets
  Altera TSE: Add missing phydev
  net/mlx4_core: Fix error flow in mlx4_init_hca()
  net/mlx4_core: Correcly update the mtt's offset in the MR re-reg flow
  qlcnic: Fix return value in qlcnic_probe()
  net: axienet: fix error return code
  ...

9 years agoMerge tag 'for-linus-3' of git://git.code.sf.net/p/openipmi/linux-ipmi
Linus Torvalds [Wed, 7 Jan 2015 01:39:31 +0000 (17:39 -0800)] 
Merge tag 'for-linus-3' of git://git.code.sf.net/p/openipmi/linux-ipmi

Pull IPMI fixlet from Corey Minyard:
 "Fix a compile warning"

* tag 'for-linus-3' of git://git.code.sf.net/p/openipmi/linux-ipmi:
  ipmi: Fix compile warning with tv_usec

9 years agoqla3xxx: don't allow never end busy loop
Andy Shevchenko [Tue, 6 Jan 2015 21:17:53 +0000 (23:17 +0200)] 
qla3xxx: don't allow never end busy loop

The counter variable wasn't increased at all which may stuck under
certain circumstances.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branches 'acpi-pm', 'acpi-processor' and 'acpi-video'
Rafael J. Wysocki [Tue, 6 Jan 2015 22:35:43 +0000 (23:35 +0100)] 
Merge branches 'acpi-pm', 'acpi-processor' and 'acpi-video'

* acpi-pm:
  ACPI / PM: Fix PM initialization for devices that are not present

* acpi-processor:
  ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()
  ACPI / processor: Convert apic_id to phys_id to make it arch agnostic

* acpi-video:
  ACPI / video: Add disable_native_backlight quirk for Dell XPS15 L521X

9 years agoACPI / video: Add disable_native_backlight quirk for Dell XPS15 L521X
Hans de Goede [Mon, 5 Jan 2015 07:57:04 +0000 (08:57 +0100)] 
ACPI / video: Add disable_native_backlight quirk for Dell XPS15 L521X

The L521X variant of the Dell XPS15 has integrated nvidia graphics, and
backlight control does not work properly when using the native interfaces.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1163574
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 6 Jan 2015 22:05:40 +0000 (14:05 -0800)] 
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 bugfixes from Ted Ts'o:
 "Revert a potential seek_data/hole regression which shows up when using
  ext4 to handle ext3 file systems, plus two minor bug fixes"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: remove spurious KERN_INFO from ext4_warning call
  Revert "ext4: fix suboptimal seek_{data,hole} extents traversial"
  ext4: prevent online resize with backup superblock

9 years agoDocumentation/target: Update fabric_ops to latest code
Nicholas Bellinger [Tue, 23 Dec 2014 08:32:21 +0000 (00:32 -0800)] 
Documentation/target: Update fabric_ops to latest code

This patch updates tcm_mod_builder.py to add/drop a handful of
struct target_core_fabric_ops functions to sync up with the
latest requirements to function in target_fabric_tf_ops_check().

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
9 years agovhost-scsi: Add missing virtio-scsi -> TCM attribute conversion
Nicholas Bellinger [Sun, 21 Dec 2014 18:42:08 +0000 (10:42 -0800)] 
vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion

While looking at hch's recent conversion to drop the MSG_*_TAG
definitions, I noticed a long standing bug in vhost-scsi where
the VIRTIO_SCSI_S_* attribute definitions where incorrectly
being passed directly into target_submit_cmd_map_sgls().

This patch adds the missing virtio-scsi to TCM/SAM task attribute
conversion.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: stable@vger.kernel.org # 3.5
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
9 years agomm: propagate error from stack expansion even for guard page
Linus Torvalds [Tue, 6 Jan 2015 21:00:05 +0000 (13:00 -0800)] 
mm: propagate error from stack expansion even for guard page

Jay Foad reports that the address sanitizer test (asan) sometimes gets
confused by a stack pointer that ends up being outside the stack vma
that is reported by /proc/maps.

This happens due to an interaction between RLIMIT_STACK and the guard
page: when we do the guard page check, we ignore the potential error
from the stack expansion, which effectively results in a missing guard
page, since the expected stack expansion won't have been done.

And since /proc/maps explicitly ignores the guard page (commit
d7824370e263: "mm: fix up some user-visible effects of the stack guard
page"), the stack pointer ends up being outside the reported stack area.

This is the minimal patch: it just propagates the error.  It also
effectively makes the guard page part of the stack limit, which in turn
measn that the actual real stack is one page less than the stack limit.

Let's see if anybody notices.  We could teach acct_stack_growth() to
allow an extra page for a grow-up/grow-down stack in the rlimit test,
but I don't want to add more complexity if it isn't needed.

Reported-and-tested-by: Jay Foad <jay.foad@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agotools: testing: selftests: mq_perf_tests: Fix infinite loop on ARM
dann frazier [Tue, 6 Jan 2015 02:54:40 +0000 (19:54 -0700)] 
tools: testing: selftests: mq_perf_tests: Fix infinite loop on ARM

We can't use a char type to check for a negative return value since char
isn't guaranteed to be signed. Indeed, the char type tends to be unsigned on
ARM.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
9 years agoselftests/exec: allow shell return code of 126
David Drysdale [Tue, 6 Jan 2015 08:23:56 +0000 (08:23 +0000)] 
selftests/exec: allow shell return code of 126

When the shell fails to invoke a script because its path name
is too long (ENAMETOOLONG), most shells return 127 to indicate
command not found.  However, some systems report 126 (which POSIX
suggests should indicate a non-executable file) for this case,
so allow that too.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David Drysdale <drysdale@google.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
9 years agoMerge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Tue, 6 Jan 2015 19:24:49 +0000 (14:24 -0500)] 
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge

Included changes:
- ensure bonding is used (if enabled) for packets coming in the soft
  interface
- fix race condition to avoid orig_nodes to be deleted right after
  being added
- avoid false positive lockdep splats by assigning lockclass to
  the proper hashtable lock objects
- avoid miscounting of multicast 'disabled' nodes in the network
- fix memory leak in the Global Translation Table in case of
  originator interval change

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoxen-netback: fixing the propagation of the transmit shaper timeout
Palik, Imre [Tue, 6 Jan 2015 15:44:44 +0000 (16:44 +0100)] 
xen-netback: fixing the propagation of the transmit shaper timeout

Since e9ce7cb6b107 ("xen-netback: Factor queue-specific data into queue struct"),
the transimt shaper timeout is always set to 0.  The value the user sets via
xenbus is never propagated to the transmit shaper.

This patch fixes the issue.

Cc: Anthony Liguori <aliguori@amazon.com>
Signed-off-by: Imre Palik <imrep@amazon.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'mac80211-for-davem-2015-01-06' of git://git.kernel.org/pub/scm/linux/kerne...
David S. Miller [Tue, 6 Jan 2015 18:29:27 +0000 (13:29 -0500)] 
Merge tag 'mac80211-for-davem-2015-01-06' of git://git./linux/kernel/git/jberg/mac80211

Here's just a single fix - a revert of a patch that broke the
p54 and cw2100 drivers (arguably due to bad assumptions there.)
Since this affects kernels since 3.17, I decided to revert for
now and we'll revisit this optimisation properly for -next.

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agor8152: support ndo_features_check
hayeswang [Tue, 6 Jan 2015 09:41:58 +0000 (17:41 +0800)] 
r8152: support ndo_features_check

Support ndo_features_check to avoid:
 - the transport offset is more than the hw limitation when using hw checksum.
 - the skb->len of a GSO packet is more than the limitation.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodrm/amdkfd: rewrite kfd_ioctl() according to drm_ioctl()
Oded Gabbay [Mon, 29 Dec 2014 12:20:05 +0000 (14:20 +0200)] 
drm/amdkfd: rewrite kfd_ioctl() according to drm_ioctl()

This patch changes kfd_ioctl() to be very similar to drm_ioctl().

The patch defines an array of amdkfd_ioctls, which maps IOCTL definition to the
ioctl function.

The kfd_ioctl() uses that mapping to call the appropriate ioctl function,
through a function pointer.

This patch also declares a new typedef for the ioctl function pointer.

v2: Renamed KFD_COMMAND_(START|END) to AMDKFD_...

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
9 years agodrm/amdkfd: reformat IOCTL definitions to drm-style
Oded Gabbay [Mon, 29 Dec 2014 13:24:25 +0000 (15:24 +0200)] 
drm/amdkfd: reformat IOCTL definitions to drm-style

This patch reformats the ioctl definitions in kfd_ioctl.h to be similar to the
drm ioctls definition style.

v2: Renamed KFD_COMMAND_(START|END) to AMDKFD_...

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
9 years agodrm/amdkfd: Do copy_to/from_user in general kfd_ioctl()
Oded Gabbay [Mon, 29 Dec 2014 11:52:22 +0000 (13:52 +0200)] 
drm/amdkfd: Do copy_to/from_user in general kfd_ioctl()

This patch moves the copy_to_user() and copy_from_user() calls from the
different ioctl functions in amdkfd to the general kfd_ioctl() function, as
this is a common code for all ioctls.

This was done according to example taken from drm_ioctl.c

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agovirtio_pci: document why we defer kfree
Michael S. Tsirkin [Sun, 4 Jan 2015 15:28:27 +0000 (17:28 +0200)] 
virtio_pci: document why we defer kfree

The reason we defer kfree until release function is because it's a
general rule for kobjects: kfree of the reference counter itself is only
legal in the release function.

Previous patch didn't make this clear, document this in code.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio_pci: defer kfree until release callback
Sasha Levin [Fri, 2 Jan 2015 19:47:40 +0000 (14:47 -0500)] 
virtio_pci: defer kfree until release callback

A struct device which has just been unregistered can live on past the
point at which a driver decides to drop it's initial reference to the
kobject gained on allocation.

This implies that when releasing a virtio device, we can't free a struct
virtio_device until the underlying struct device has been released,
which might not happen immediately on device_unregister().

Unfortunately, this is exactly what virtio pci does:
it has an empty release callback, and frees memory immediately
after unregistering the device.

This causes an easy to reproduce crash if CONFIG_DEBUG_KOBJECT_RELEASE
it enabled.

To fix, free the memory only once we know the device is gone in the release
callback.

Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio_pci: device-specific release callback
Michael S. Tsirkin [Sun, 4 Jan 2015 11:25:30 +0000 (13:25 +0200)] 
virtio_pci: device-specific release callback

It turns out we need to add device-specific code
in release callback. Move it to virtio_pci_legacy.c.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: make del_vqs idempotent
Michael S. Tsirkin [Sun, 4 Jan 2015 15:21:58 +0000 (17:21 +0200)] 
virtio: make del_vqs idempotent

Our code calls del_vqs multiple times, assuming
it's idempotent.

commit 3ec7a77bb3089bb01032fdbd958eb5c29da58b49
    virtio_pci: free up vq->priv
broke this assumption, by adding kfree there,
so multiple calls cause double free.

Fix it up.

Fixes: 3ec7a77bb3089bb01032fdbd958eb5c29da58b49
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agobatman-adv: fix potential TT client + orig-node memory leak
Linus Lüssing [Sat, 13 Dec 2014 22:32:15 +0000 (23:32 +0100)] 
batman-adv: fix potential TT client + orig-node memory leak

This patch fixes a potential memory leak which can occur once an
originator times out. On timeout the according global translation table
entry might not get purged correctly. Furthermore, the non purged TT
entry will cause its orig-node to leak, too. Which additionally can lead
to the new multicast optimization feature not kicking in because of a
therefore bogus counter.

In detail: The batadv_tt_global_entry->orig_list holds the reference to
the orig-node. Usually this reference is released after
BATADV_PURGE_TIMEOUT through: _batadv_purge_orig()->
batadv_purge_orig_node()->batadv_update_route()->_batadv_update_route()->
batadv_tt_global_del_orig() which purges this global tt entry and
releases the reference to the orig-node.

However, if between two batadv_purge_orig_node() calls the orig-node
timeout grew to 2*BATADV_PURGE_TIMEOUT then this call path isn't
reached. Instead the according orig-node is removed from the
originator hash in _batadv_purge_orig(), the batadv_update_route()
part is skipped and won't be reached anymore.

Fixing the issue by moving batadv_tt_global_del_orig() out of the rcu
callback.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Acked-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agobatman-adv: fix multicast counter when purging originators
Linus Lüssing [Thu, 30 Oct 2014 04:40:47 +0000 (05:40 +0100)] 
batman-adv: fix multicast counter when purging originators

When purging an orig_node we should only decrease counter tracking the
number of nodes without multicast optimizations support if it was
increased through this orig_node before.

A not yet quite initialized orig_node (meaning it did not have its turn
in the mcast-tvlv handler so far) which gets purged would not adhere to
this and will lead to a counter imbalance.

Fixing this by adding a check whether the orig_node is mcast-initalized
before decreasing the counter in the mcast-orig_node-purging routine.

Introduced by 60432d756cf06e597ef9da511402dd059b112447
("batman-adv: Announce new capability via multicast TVLV")

Reported-by: Tobias Hachmer <tobias@hachmer.de>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agobatman-adv: fix counter for multicast supporting nodes
Linus Lüssing [Thu, 30 Oct 2014 04:40:46 +0000 (05:40 +0100)] 
batman-adv: fix counter for multicast supporting nodes

A miscounting of nodes having multicast optimizations enabled can lead
to multicast packet loss in the following scenario:

If the first OGM a node receives from another one has no multicast
optimizations support (no multicast tvlv) then we are missing to
increase the counter. This potentially leads to the wrong assumption
that we could safely use multicast optimizations.

Fixings this by increasing the counter if the initial OGM has the
multicast TVLV unset, too.

Introduced by 60432d756cf06e597ef9da511402dd059b112447
("batman-adv: Announce new capability via multicast TVLV")

Reported-by: Tobias Hachmer <tobias@hachmer.de>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agobatman-adv: fix lock class for decoding hash in network-coding.c
Martin Hundebøll [Tue, 11 Nov 2014 15:22:23 +0000 (16:22 +0100)] 
batman-adv: fix lock class for decoding hash in network-coding.c

batadv_has_set_lock_class() is called with the wrong hash table as first
argument (probably due to a copy-paste error), which leads to false
positives when running with lockdep.

Introduced-by: 612d2b4fe0a1ff2f8389462a6f8be34e54124c05
("batman-adv: network coding - save overheard and tx packets for decoding")

Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agobatman-adv: fix delayed foreign originator recognition
Linus Lüssing [Thu, 30 Oct 2014 05:23:40 +0000 (06:23 +0100)] 
batman-adv: fix delayed foreign originator recognition

Currently it can happen that the reception of an OGM from a new
originator is not being accepted. More precisely it can happen that
an originator struct gets allocated and initialized
(batadv_orig_node_new()), even the TQ gets calculated and set correctly
(batadv_iv_ogm_calc_tq()) but still the periodic orig_node purging
thread will decide to delete it if it has a chance to jump between
these two function calls.

This is because batadv_orig_node_new() initializes the last_seen value
to zero and its caller (batadv_iv_ogm_orig_get()) makes it visible to
other threads by adding it to the hash table already.
batadv_iv_ogm_calc_tq() will set the last_seen variable to the correct,
current time a few lines later but if the purging thread jumps in between
that it will think that the orig_node timed out and will wrongly
schedule it for deletion already.

If the purging interval is the same as the originator interval (which is
the default: 1 second), then this game can continue for several rounds
until the random OGM jitter added enough difference between these
two (in tests, two to about four rounds seemed common).

Fixing this by initializing the last_seen variable of an orig_node
to the current time before adding it to the hash table.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agobatman-adv: fix and simplify condition when bonding should be used
Simon Wunderlich [Wed, 13 Aug 2014 12:26:56 +0000 (14:26 +0200)] 
batman-adv: fix and simplify condition when bonding should be used

The current condition actually does NOT consider bonding when the
interface the packet came in from is the soft interface, which is the
opposite of what it should do (and the comment describes). Fix that and
slightly simplify the condition.

Reported-by: Ray Gibson <booray@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
9 years agoLinux 3.19-rc3
Linus Torvalds [Tue, 6 Jan 2015 01:05:20 +0000 (17:05 -0800)] 
Linux 3.19-rc3

9 years agoint340x_thermal/processor_thermal_device: return failure when
Zhang Rui [Sun, 4 Jan 2015 08:35:59 +0000 (16:35 +0800)] 
int340x_thermal/processor_thermal_device: return failure when

 there is no ACPI device object

processor_thermal_device driver needs ACPI support to work. Thus, the driver
probing should fail when there is no ACPI device object asscociated.

This fixes a NULL pointer dereference when the driver is loaded
with INT340X feature disabled in BIOS.

Reported-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
9 years agoACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver
Zhang Rui [Sun, 4 Jan 2015 06:24:24 +0000 (14:24 +0800)] 
ACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver

Intel SoC DTS thermal driver on Baytrail platform uses IRQ 86 for
critical overheating notification.
But this IRQ 86 is described in the _CRS control method of INT3401 device,
thus we should enumerate INT3401 to set the IRQ descriptor when
Intel SoC DTS thermal driver is built.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
9 years agoACPI/int340x_thermal: enumerate INT340X devices even if they're not in _ART/_TRT
Zhang Rui [Sun, 4 Jan 2015 06:24:23 +0000 (14:24 +0800)] 
ACPI/int340x_thermal: enumerate INT340X devices even if they're not in _ART/_TRT

For some INT340X thermal devices, even if they are not referred in
_TRT/_ART table, they still can be used by userspace for thermal control.
Thus change the code to enumerated all the INT340X devices,
no matter if they're referred in _TRT/_ART or not.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
9 years agoMerge tag 'powerpc-3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Linus Torvalds [Mon, 5 Jan 2015 22:49:02 +0000 (14:49 -0800)] 
Merge tag 'powerpc-3.19-3' of git://git./linux/kernel/git/mpe/linux

Pull powerpc fixes from Michael Ellerman:

 - Wire up sys_execveat(). Tested on 32 & 64 bit.

 - Fix for kdump on LE systems with cpus hot unplugged.

 - Revert Anton's fix for "kernel BUG at kernel/smpboot.c:134!", this
   broke other platforms, we'll do a proper fix for 3.20.

* tag 'powerpc-3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  Revert "powerpc: Secondary CPUs must set cpu_callin_map after setting active and online"
  powerpc/kdump: Ignore failure in enabling big endian exception during crash
  powerpc: Wire up sys_execveat() syscall

9 years agoACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()
Hanjun Guo [Sun, 4 Jan 2015 10:55:03 +0000 (18:55 +0800)] 
ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()

acpi_map_lsapic() will allocate a logical CPU number and map it to
physical CPU id (such as APIC id) for the hot-added CPU, it will also
do some mapping for NUMA node id and etc, acpi_unmap_lsapic() will
do the reverse.

We can see that the name of the function is a little bit confusing and
arch (IA64) dependent so rename them as acpi_(un)map_cpu() to make arch
agnostic and explicit.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agoACPI / processor: Convert apic_id to phys_id to make it arch agnostic
Hanjun Guo [Sun, 4 Jan 2015 10:55:02 +0000 (18:55 +0800)] 
ACPI / processor: Convert apic_id to phys_id to make it arch agnostic

apic_id in MADT table is the CPU hardware id which identify
it self in the system for x86 and ia64, OSPM will use it for
SMP init to map APIC ID to logical cpu number in the early
boot, when the DSDT/SSDT (ACPI namespace) is scanned later, the
ACPI processor driver is probed and the driver will use acpi_id
in DSDT to get the apic_id, then map to the logical cpu number
which is needed by the processor driver.

Before ACPI 5.0, only x86 and ia64 were supported in ACPI spec,
so apic_id is used both in arch code and ACPI core which is
pretty fine. Since ACPI 5.0, ARM is supported by ACPI and
APIC is not available on ARM, this will confuse people when
apic_id is both used by x86 and ARM in one function.

So convert apic_id to phys_id (which is the original meaning)
in ACPI processor dirver to make it arch agnostic, but leave the
arch dependent code unchanged, no functional change.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agoMerge tag 'please-pull-syscall' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 5 Jan 2015 22:31:20 +0000 (14:31 -0800)] 
Merge tag 'please-pull-syscall' of git://git./linux/kernel/git/aegl/linux

Pull ia64 fixlet from Tony Luck:
 "Add execveat syscall"

* tag 'please-pull-syscall' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
  [IA64] Enable execveat syscall for ia64

9 years agoACPI / PM: Fix PM initialization for devices that are not present
Rafael J. Wysocki [Thu, 1 Jan 2015 22:38:28 +0000 (23:38 +0100)] 
ACPI / PM: Fix PM initialization for devices that are not present

If an ACPI device object whose _STA returns 0 (not present and not
functional) has _PR0 or _PS0, its power_manageable flag will be set
and acpi_bus_init_power() will return 0 for it.  Consequently, if
such a device object is passed to the ACPI device PM functions, they
will attempt to carry out the requested operation on the device,
although they should not do that for devices that are not present.

To fix that problem make acpi_bus_init_power() return an error code
for devices that are not present which will cause power_manageable to
be cleared for them as appropriate in acpi_bus_get_power_flags().
However, the lists of power resources should not be freed for the
device in that case, so modify acpi_bus_get_power_flags() to keep
those lists even if acpi_bus_init_power() returns an error.
Accordingly, when deciding whether or not the lists of power
resources need to be freed, acpi_free_power_resources_lists()
should check the power.flags.power_resources flag instead of
flags.power_manageable, so make that change too.

Furthermore, if acpi_bus_attach() sees that flags.initialized is
unset for the given device, it should reset the power management
settings of the device and re-initialize them from scratch instead
of relying on the previous settings (the device may have appeared
after being not present previously, for example), so make it use
the 'valid' flag of the D0 power state as the initial value of
flags.power_manageable for it and call acpi_bus_init_power() to
discover its current power state.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
9 years ago[IA64] Enable execveat syscall for ia64
Tony Luck [Mon, 5 Jan 2015 19:25:19 +0000 (11:25 -0800)] 
[IA64] Enable execveat syscall for ia64

See commit 51f39a1f0cea1cacf8c787f652f26dfee9611874
    syscalls: implement execveat() system call

Signed-off-by: Tony Luck <tony.luck@intel.com>
9 years agoqla2xxx: fix busy wait regression
Bruno Prémont [Fri, 19 Dec 2014 09:29:16 +0000 (10:29 +0100)] 
qla2xxx: fix busy wait regression

Commit e05fe29248 (qla2xxx: Honor FCP_RSP retry delay timer field.)
causes systems to busy-wait for about 3 minutes after boot prior to
detecting SAN disks.

During this wait period one kworker is running full-time
(though /proc/<pid>/stack has no useful data). Another kworker is
waiting for IO to complete during that whole time period.

Looking at drivers/scsi/qla2xxx/qla_os.c, fcport->retry_delay_timestamp
has a special value of 0 though that 0 value forces system to wait when
jiffies is very large value (e.g. 4294952605 - "negative" value when
signed on 32bit systems).

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
9 years agodrm/radeon: integer underflow in radeon_cp_dispatch_texture()
Dan Carpenter [Tue, 23 Dec 2014 09:56:49 +0000 (12:56 +0300)] 
drm/radeon: integer underflow in radeon_cp_dispatch_texture()

The test:

if (size > RADEON_MAX_TEXTURE_SIZE) {

"size" is an integer and it's controled by the user so it can be
negative and the test can underflow.  Later we use "size" in:

dwords = size / 4;
...
RADEON_COPY_MT(buffer, data, (int)(dwords * sizeof(u32)));

It causes memory corruption to copy a negative size buffer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 years agodrm/radeon: adjust default bapm settings for KV
Alex Deucher [Mon, 15 Dec 2014 22:24:19 +0000 (17:24 -0500)] 
drm/radeon: adjust default bapm settings for KV

Enabling bapm seems to cause clocking problems on some
KV configurations.  Disable it by default for now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9 years agodrm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw
Alex Deucher [Wed, 10 Dec 2014 14:42:10 +0000 (09:42 -0500)] 
drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw

The check was already in place in the dp mode_valid check, but
radeon_dp_get_dp_link_clock() never returned the high clock
mode_valid was checking for because that function clipped the
clock based on the hw capabilities.  Add an explicit check
in the mode_valid function.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc:stable@vge.kernel.org

9 years agodrm/radeon: fix sad_count check for dce3
Alex Deucher [Tue, 9 Dec 2014 15:04:01 +0000 (10:04 -0500)] 
drm/radeon: fix sad_count check for dce3

Make it consistent with the sad code for other asics to deal
with monitors that don't report sads.

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=89461

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9 years agodrm/radeon: KV has three PPLLs (v2)
Alex Deucher [Fri, 5 Dec 2014 18:46:07 +0000 (13:46 -0500)] 
drm/radeon: KV has three PPLLs (v2)

Enable all three in the driver.  Early documentation
indicated the 3rd one was used for something else, but
that is not the case.

v2: handle disable as well

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9 years agoKEYS: close race between key lookup and freeing
Sasha Levin [Mon, 29 Dec 2014 14:39:01 +0000 (09:39 -0500)] 
KEYS: close race between key lookup and freeing

When a key is being garbage collected, it's key->user would get put before
the ->destroy() callback is called, where the key is removed from it's
respective tracking structures.

This leaves a key hanging in a semi-invalid state which leaves a window open
for a different task to try an access key->user. An example is
find_keyring_by_name() which would dereference key->user for a key that is
in the process of being garbage collected (where key->user was freed but
->destroy() wasn't called yet - so it's still present in the linked list).

This would cause either a panic, or corrupt memory.

Fixes CVE-2014-9529.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
9 years agodrm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
Ben Goz [Mon, 5 Jan 2015 13:48:28 +0000 (15:48 +0200)] 
drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)

This patch fixes a bug where deallocate_vmid() didn't actually unmap the
VMID<-->PASID mapping (in the registers).
That can cause undefined behavior.

This bug only occurs in non-HWS mode.

Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs
Takashi Iwai [Mon, 5 Jan 2015 12:27:33 +0000 (13:27 +0100)] 
ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs

stac_store_hints() does utterly wrong for masking the values for
gpio_dir and gpio_data, likely due to copy&paste errors.  Fortunately,
this feature is used very rarely, so the impact must be really small.

Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoiommu/rockchip: Drop owner assignment from platform_drivers
Wolfram Sang [Sun, 21 Dec 2014 21:14:30 +0000 (22:14 +0100)] 
iommu/rockchip: Drop owner assignment from platform_drivers

This platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
9 years agoiommu/vt-d: Remove dead code in device_notifier
Joerg Roedel [Tue, 9 Dec 2014 12:18:22 +0000 (13:18 +0100)] 
iommu/vt-d: Remove dead code in device_notifier

This code only runs when action == BUS_NOTIFY_REMOVED_DEVICE,
so it can't be BUS_NOTIFY_DEL_DEVICE.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
9 years agoiommu/vt-d: Fix dmar_domain leak in iommu_attach_device
Joerg Roedel [Tue, 9 Dec 2014 11:56:45 +0000 (12:56 +0100)] 
iommu/vt-d: Fix dmar_domain leak in iommu_attach_device

Since commit 1196c2f a domain is only destroyed in the
notifier path if it is hot-unplugged. This caused a
domain leakage in iommu_attach_device when a driver was
unbound from the device and bound to VFIO. In this case the
device is attached to a new domain and unlinked from the old
domain. At this point nothing points to the old domain
anymore and its memory is leaked.
Fix this by explicitly freeing the old domain in
iommu_attach_domain.

Fixes: 1196c2f (iommu/vt-d: Fix dmar_domain leak in iommu_attach_device)
Cc: stable@vger.kernel.org # v3.18
Tested-by: Jerry Hoemann <jerry.hoemann@hp.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
9 years agoiommu/ipmmu-vmsa: Change IOMMU_EXEC to IOMMU_NOEXEC
Laurent Pinchart [Mon, 15 Dec 2014 18:41:13 +0000 (20:41 +0200)] 
iommu/ipmmu-vmsa: Change IOMMU_EXEC to IOMMU_NOEXEC

Commit a720b41c41f5a7e4 ("iommu/arm-smmu: change IOMMU_EXEC to
IOMMU_NOEXEC") has inverted and replaced the IOMMU_EXEC flag with
IOMMU_NOEXEC. Update the driver accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
9 years agocrypto: sha-mb - Add avx2_supported check.
Vinson Lee [Tue, 30 Dec 2014 00:20:39 +0000 (16:20 -0800)] 
crypto: sha-mb - Add avx2_supported check.

This patch fixes this allyesconfig target build error with older
binutils.

  LD      arch/x86/crypto/built-in.o
ld: arch/x86/crypto/sha-mb/built-in.o: No such file: No such file or directory

Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Vinson Lee <vlee@twitter.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
9 years agocrypto: aesni - fix "by8" variant for 128 bit keys
Mathias Krause [Tue, 30 Dec 2014 21:50:54 +0000 (22:50 +0100)] 
crypto: aesni - fix "by8" variant for 128 bit keys

The "by8" counter mode optimization is broken for 128 bit keys with
input data longer than 128 bytes. It uses the wrong key material for
en- and decryption.

The key registers xkey0, xkey4, xkey8 and xkey12 need to be preserved
in case we're handling more than 128 bytes of input data -- they won't
get reloaded after the initial load. They must therefore be (a) loaded
on the first iteration and (b) be preserved for the latter ones. The
implementation for 128 bit keys does not comply with (a) nor (b).

Fix this by bringing the implementation back to its original source
and correctly load the key registers and preserve their values by
*not* re-using the registers for other purposes.

Kudos to James for reporting the issue and providing a test case
showing the discrepancies.

Reported-by: James Yonan <james@openvpn.net>
Cc: Chandramouli Narayanan <mouli@linux.intel.com>
Cc: <stable@vger.kernel.org> # v3.18
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
9 years agoext3: destroy sbi mutexes in put_super
Fabian Frederick [Sat, 27 Dec 2014 15:01:22 +0000 (16:01 +0100)] 
ext3: destroy sbi mutexes in put_super

Call mutex_destroy() on superblock mutexes in ext3_put_super().
Otherwise mutex debugging code isn't able to detect that mutex is used
after being freed.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoudf: Update Kconfig description
Jan Kara [Mon, 5 Jan 2015 10:04:37 +0000 (11:04 +0100)] 
udf: Update Kconfig description

Update description of UDF in Kconfig to mention that UDF is also
suitable for removable USB disks.

Signed-off-by: Jan Kara <jack@suse.cz>
9 years agoRevert "mac80211: Fix accounting of the tailroom-needed counter"
Johannes Berg [Mon, 5 Jan 2015 09:28:49 +0000 (10:28 +0100)] 
Revert "mac80211: Fix accounting of the tailroom-needed counter"

This reverts commit ca34e3b5c808385b175650605faa29e71e91991b.

It turns out that the p54 and cw2100 drivers assume that there's
tailroom even when they don't say they really need it. However,
there's currently no way for them to explicitly say they do need
it, so for now revert this.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=90331.

Cc: stable@vger.kernel.org
Fixes: ca34e3b5c808 ("mac80211: Fix accounting of the tailroom-needed counter")
Reported-by: Christopher Chavez <chrischavez@gmx.us>
Bisected-by: Larry Finger <Larry.Finger@lwfinger.net>
Debugged-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoALSA: snd-usb-caiaq: fix stream count check
Daniel Mack [Sun, 4 Jan 2015 18:59:29 +0000 (19:59 +0100)] 
ALSA: snd-usb-caiaq: fix stream count check

Commit 897c329bc ("ALSA: usb: caiaq: check for cdev->n_streams > 1")
introduced a safety check to protect against bogus data provided by
devices. However, the n_streams variable is already divided by
CHANNELS_PER_STREAM, so the correct check is 'n_streams > 0'.

Fix this to un-break support for stereo devices.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Cc: stable@kernel.org [v3.18+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agonet: ethernet: cpsw: fix hangs with interrupts
Felipe Balbi [Fri, 2 Jan 2015 22:15:59 +0000 (16:15 -0600)] 
net: ethernet: cpsw: fix hangs with interrupts

The CPSW IP implements pulse-signaled interrupts. Due to
that we must write a correct, pre-defined value to the
CPDMA_MACEOIVECTOR register so the controller generates
a pulse on the correct IRQ line to signal the End Of
Interrupt.

The way the driver is written today, all four IRQ lines
are requested using the same IRQ handler and, because of
that, we could fall into situations where a TX IRQ fires
but we tell the controller that we ended an RX IRQ (or
vice-versa). This situation triggers an IRQ storm on the
reserved IRQ 127 of INTC which will in turn call ack_bad_irq()
which will, then, print a ton of:

unexpected IRQ trap at vector 00

In order to fix the problem, we are moving all calls to
cpdma_ctlr_eoi() inside the IRQ handler and making sure
we *always* write the correct value to the CPDMA_MACEOIVECTOR
register. Note that the algorithm assumes that IRQ numbers and
value-to-be-written-to-EOI are proportional, meaning that a
write of value 0 would trigger an EOI pulse for the RX_THRESHOLD
Interrupt and that's the IRQ number sitting in the 0-th index
of our irqs_table array.

This, however, is safe at least for current implementations of
CPSW so we will refrain from making the check smarter (and, as
a side-effect, slower) until we actually have a platform where
IRQ lines are swapped.

This patch has been tested for several days with AM335x- and
AM437x-based platforms. AM57x was left out because there are
still pending patches to enable ethernet in mainline for that
platform. A read of the TRM confirms the statement on previous
paragraph.

Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Fixes: 510a1e7 (drivers: net: davinci_cpdma: acknowledge interrupt properly)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Linus Torvalds [Sun, 4 Jan 2015 19:46:43 +0000 (11:46 -0800)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/rw/uml

Pull UML fixes from Richard Weinberger:
 "Two fixes for UML regressions. Nothing exciting"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  x86, um: actually mark system call tables readonly
  um: Skip futex_atomic_cmpxchg_inatomic() test

9 years agoRevert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo"
Pavel Machek [Sun, 4 Jan 2015 19:01:23 +0000 (20:01 +0100)] 
Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo"

Commit 9fc2105aeaaf ("ARM: 7830/1: delay: don't bother reporting
bogomips in /proc/cpuinfo") breaks audio in python, and probably
elsewhere, with message

  FATAL: cannot locate cpu MHz in /proc/cpuinfo

I'm not the first one to hit it, see for example

  https://theredblacktree.wordpress.com/2014/08/10/fatal-cannot-locate-cpu-mhz-in-proccpuinfo/
  https://devtalk.nvidia.com/default/topic/765800/workaround-for-fatal-cannot-locate-cpu-mhz-in-proc-cpuinf/?offset=1

Reading original changelog, I have to say "Stop breaking working setups.
You know who you are!".

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agox86, um: actually mark system call tables readonly
Daniel Borkmann [Sat, 3 Jan 2015 12:11:10 +0000 (13:11 +0100)] 
x86, um: actually mark system call tables readonly

Commit a074335a370e ("x86, um: Mark system call tables readonly") was
supposed to mark the sys_call_table in UML as RO by adding the const,
but it doesn't have the desired effect as it's nevertheless being placed
into the data section since __cacheline_aligned enforces sys_call_table
being placed into .data..cacheline_aligned instead. We need to use
the ____cacheline_aligned version instead to fix this issue.

Before:

$ nm -v arch/x86/um/sys_call_table_64.o | grep -1 "sys_call_table"
                 U sys_writev
0000000000000000 D sys_call_table
0000000000000000 D syscall_table_size

After:

$ nm -v arch/x86/um/sys_call_table_64.o | grep -1 "sys_call_table"
                 U sys_writev
0000000000000000 R sys_call_table
0000000000000000 D syscall_table_size

Fixes: a074335a370e ("x86, um: Mark system call tables readonly")
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
This page took 0.057914 seconds and 5 git commands to generate.