]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
8 years agocxl: Ignore CAPI adapters misplaced in switched slots
Philippe Bergheaud [Mon, 18 Jul 2016 13:56:40 +0000 (07:56 -0600)]
cxl: Ignore CAPI adapters misplaced in switched slots

BugLink: http://bugs.launchpad.net/bugs/1602785
One should not attempt to switch a PHB into CAPI mode if there is
a switch between the PHB and the adapter. This patch modifies the
cxl driver to ignore CAPI adapters misplaced in switched slots.

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from linux-next commit 3b3dcd61fa4e3604d8f1bdfd8471fca7b7c012e4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agomisc: mic: Fix for double fetch security bug in VOP driver
Ashutosh Dixit [Wed, 20 Jul 2016 15:15:37 +0000 (16:15 +0100)]
misc: mic: Fix for double fetch security bug in VOP driver

The MIC VOP driver does two successive reads from user space to read a
variable length data structure. Kernel memory corruption can result if
the data structure changes between the two reads. This patch disallows
the chance of this happening.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116651
Reported by: Pengfei Wang <wpengfeinudt@gmail.com>
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit 9bf292bfca94694a721449e3fd752493856710f6)
[ luis: apply changes to mic_copy_dp_entry(), in file
  drivers/misc/mic/host/mic_virtio.c; adjust context ]
CVE-2016-5728
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agords: fix an infoleak in rds_inc_info_copy
Kangjie Lu [Wed, 20 Jul 2016 11:08:57 +0000 (12:08 +0100)]
rds: fix an infoleak in rds_inc_info_copy

The last field "flags" of object "minfo" is not initialized.
Copying this object out may leak kernel stack data.
Assign 0 to it to avoid leak.

Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4116def2337991b39919f3b448326e21c40e0dbb)
CVE-2016-5244
BugLink: https://bugs.launchpad.net/bugs/1589041
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: updateconfigs cleanup
Kamal Mostafa [Wed, 3 Aug 2016 14:32:31 +0000 (07:32 -0700)]
UBUNTU: updateconfigs cleanup

Ignore: yes
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: Start new release
Stefan Bader [Tue, 9 Aug 2016 13:06:20 +0000 (15:06 +0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-34.53
Seth Forshee [Wed, 27 Jul 2016 15:01:39 +0000 (10:01 -0500)]
UBUNTU: Ubuntu-4.4.0-34.53

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: SAUCE: x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont...
Peter Zijlstra [Tue, 26 Jul 2016 08:33:17 +0000 (16:33 +0800)]
UBUNTU: SAUCE: x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont based CPUs

BugLink: http://bugs.launchpad.net/bugs/1606147
Monitored cached line may not wake up from mwait on certain
Goldmont based CPUs. This patch will avoid calling
current_set_polling_and_test() and thereby not set the TIF_ flag.
The result is that we'll always send IPIs for wakeups.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1468867270-18493-1-git-send-email-jacob.jun.pan@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(backported from linux-next commit 08e237fa56a1d95c1372033bc29c4a2517b3c0fa)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agox86/cpu/intel: Introduce macros for Intel family numbers
Dave Hansen [Tue, 26 Jul 2016 08:33:16 +0000 (16:33 +0800)]
x86/cpu/intel: Introduce macros for Intel family numbers

BugLink: http://bugs.launchpad.net/bugs/1606147
Problem:

We have a boatload of open-coded family-6 model numbers.  Half of
them have these model numbers in hex and the other half in
decimal.  This makes grepping for them tons of fun, if you were
to try.

Solution:

Consolidate all the magic numbers.  Put all the definitions in
one header.

The names here are closely derived from the comments describing
the models from arch/x86/events/intel/core.c.  We could easily
make them shorter by doing things like s/SANDYBRIDGE/SNB/, but
they seemed fine even with the longer versions to me.

Do not take any of these names too literally, like "DESKTOP"
or "MOBILE".  These are all colloquial names and not precise
descriptions of everywhere a given model will show up.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Cc: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: jacob.jun.pan@intel.com
Cc: linux-acpi@vger.kernel.org
Cc: linux-edac@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Link: http://lkml.kernel.org/r/20160603001927.F2A7D828@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 970442c599b22ccd644ebfe94d1d303bf6f87c05)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: Start new release
Kamal Mostafa [Mon, 25 Jul 2016 15:52:17 +0000 (08:52 -0700)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-33.52
Seth Forshee [Fri, 22 Jul 2016 18:10:55 +0000 (13:10 -0500)]
UBUNTU: Ubuntu-4.4.0-33.52

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: SAUCE: (namespace) Bypass sget() capability check for nfs
Seth Forshee [Fri, 22 Jul 2016 12:50:21 +0000 (07:50 -0500)]
UBUNTU: SAUCE: (namespace) Bypass sget() capability check for nfs

BugLink: http://bugs.launchpad.net/bugs/1603719
302cabb "UBUNTU: SAUCE: (namespace) Sync with upstream s_user_ns
patches" added a capability check to sget() which causes a
regression for automatic submounts, which may happen in the
context of an unprivileged user. The capability check is not
necessary in this case.

The check can be bypassed by using sget_userns() instead.
init_user_namespace should be used for the user ns since nfs does
not support unprivileged mounting. This change makes the nfs
mount behavior in xenial functionally identical to upstream.

Acked-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: rebuild reconstruct and ancillary files
Andy Whitcroft [Tue, 19 Jul 2016 21:57:12 +0000 (22:57 +0100)]
UBUNTU: rebuild reconstruct and ancillary files

Ignore: yes
Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: Start new release
Kamal Mostafa [Wed, 20 Jul 2016 16:04:17 +0000 (09:04 -0700)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-32.51
Seth Forshee [Tue, 19 Jul 2016 16:19:26 +0000 (11:19 -0500)]
UBUNTU: Ubuntu-4.4.0-32.51

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoHID: wacom: Support switching from vendor-defined device mode on G9 and G11
Jason Gerecke [Tue, 19 Jul 2016 14:55:44 +0000 (09:55 -0500)]
HID: wacom: Support switching from vendor-defined device mode on G9 and G11

BugLink: http://bugs.launchpad.net/bugs/1603975
A tablet PC booted into Windows may have its pen/touch hardware switched
into "Wacom mode" similar to what we do with explicitly-supported hardware.
Some devices appear to maintain this state across reboots, preventing their
use with the generic HID driver. This patch adds support for detecting the
presence of the mode switch feature report used by devices based on the G9
and G11 chips and has the HID codepath always attempt to reset the device
back to sending standard HID reports.

Fixes: https://sourceforge.net/p/linuxwacom/bugs/307/
Fixes: https://sourceforge.net/p/linuxwacom/bugs/310/
Fixes: https://github.com/linuxwacom/input-wacom/issues/15
Co-authored-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 326ea2a90500fe4add86c5fb95d914d46910e780)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoHID: wacom: Initialize hid_data.inputmode to -1
Jason Gerecke [Tue, 19 Jul 2016 14:55:43 +0000 (09:55 -0500)]
HID: wacom: Initialize hid_data.inputmode to -1

BugLink: http://bugs.launchpad.net/bugs/1603975
Commit 5ae6e89 introduced hid_data.inputmode with a comment that it
would have the value -1 if undefined, but then forgot to actually
perform the initialization. Although this doesn't appear to have
caused any problems in practice, it should still be remedied.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit c6fa1aeba02111ed8676494ac7cd453a03efef3c)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoHID: wacom: break out parsing of device and registering of input
Benjamin Tissoires [Tue, 19 Jul 2016 14:55:42 +0000 (09:55 -0500)]
HID: wacom: break out parsing of device and registering of input

BugLink: http://bugs.launchpad.net/bugs/1603975
Simplifies the .probe() and will allow to reuse this path in the future.
Few things are reshuffled in .probe():
- init wacom struct earlier
- then retrieve the report descriptor
- then parse it and allocate/register inputs.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit c58ac3a88d1e8a44fed152e80bf525a66a5647e2)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: use CVE numbers in changelog
Andy Whitcroft [Tue, 19 Jul 2016 10:35:46 +0000 (11:35 +0100)]
UBUNTU: use CVE numbers in changelog

BugLink: http://bugs.launchpad.net/bugs/1604344
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
8 years agoUBUNTU: SAUCE: hio: Makefile and Kconfig
Kamal Mostafa [Thu, 14 Jul 2016 21:36:15 +0000 (14:36 -0700)]
UBUNTU: SAUCE: hio: Makefile and Kconfig

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: [config] enable CONFIG_HIO (Huawei ES3000_V2 PCIe SSD driver)
Kamal Mostafa [Thu, 14 Jul 2016 21:36:30 +0000 (14:36 -0700)]
UBUNTU: [config] enable CONFIG_HIO (Huawei ES3000_V2 PCIe SSD driver)

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: hio: fix mask maybe-uninitialized warning
Kamal Mostafa [Thu, 14 Jul 2016 19:47:36 +0000 (12:47 -0700)]
UBUNTU: SAUCE: hio: fix mask maybe-uninitialized warning

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: hio: use alloc_cpumask_var to avoid -Wframe-larger-than
Kamal Mostafa [Thu, 14 Jul 2016 17:57:12 +0000 (10:57 -0700)]
UBUNTU: SAUCE: hio: use alloc_cpumask_var to avoid -Wframe-larger-than

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: hio: blk_queue make_request_fn now returns a blk_qc_t
Kamal Mostafa [Thu, 14 Jul 2016 17:55:36 +0000 (10:55 -0700)]
UBUNTU: SAUCE: hio: blk_queue make_request_fn now returns a blk_qc_t

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: hio: bio_endio() no longer takes errors arg
Kamal Mostafa [Thu, 14 Jul 2016 17:52:53 +0000 (10:52 -0700)]
UBUNTU: SAUCE: hio: bio_endio() no longer takes errors arg

BugLink: http://bugs.launchpad.net/bugs/1603483
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: import Huawei ES3000_V2 (2.1.0.23)
Huawei SSD DEV Team [Thu, 14 Jul 2016 16:13:36 +0000 (09:13 -0700)]
UBUNTU: SAUCE: import Huawei ES3000_V2 (2.1.0.23)

BugLink: http://bugs.launchpad.net/bugs/1603483
Source: http://support.huawei.com/enterprisesearch/ebgSearch#sp.keyword=HUAWEI%20ES3000%20V2%20Driver%20SRC

  Huawei SSD device driver
  Copyright (c) 2016, Huawei Technologies Co., Ltd.

  This program is free software; you can redistribute it and/or modify it
  under the terms and conditions of the GNU General Public License,
  version 2, as published by the Free Software Foundation.

  This program is distributed in the hope it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  more details.

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agotipc: fix nl compat regression for link statistics
Richard Alpe [Thu, 14 Jul 2016 14:02:07 +0000 (15:02 +0100)]
tipc: fix nl compat regression for link statistics

Fix incorrect use of nla_strlcpy() where the first NLA_HDRLEN bytes
of the link name where left out.

Making the output of tipc-config -ls look something like:
Link statistics:
dcast-link
1:data0-1.1.2:data0
1:data0-1.1.3:data0

Also, for the record, the patch that introduce this regression
claims "Sending the whole object out can cause a leak". Which isn't
very likely as this is a compat layer, where the data we are parsing
is generated by us and we know the string to be NULL terminated. But
you can of course never be to secure.

Fixes: 5d2be1422e02 (tipc: fix an infoleak in tipc_nl_compat_link_dump)
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 55e77a3e8297581c919b45adcc4d0815b69afa84)
CVE-2016-5243
BugLink: https://bugs.launchpad.net/bugs/1589036
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agotipc: fix an infoleak in tipc_nl_compat_link_dump
Kangjie Lu [Thu, 14 Jul 2016 14:02:06 +0000 (15:02 +0100)]
tipc: fix an infoleak in tipc_nl_compat_link_dump

link_info.str is a char array of size 60. Memory after the NULL
byte is not initialized. Sending the whole object out can cause
a leak.

Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5d2be1422e02ccd697ccfcd45c85b4a26e6178e2)
CVE-2016-5243
BugLink: https://bugs.launchpad.net/bugs/1589036
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoKEYS: potential uninitialized variable
Dan Carpenter [Wed, 13 Jul 2016 10:43:47 +0000 (11:43 +0100)]
KEYS: potential uninitialized variable

If __key_link_begin() failed then "edit" would be uninitialized.  I've
added a check to fix that.

This allows a random user to crash the kernel, though it's quite
difficult to achieve.  There are three ways it can be done as the user
would have to cause an error to occur in __key_link():

 (1) Cause the kernel to run out of memory.  In practice, this is difficult
     to achieve without ENOMEM cropping up elsewhere and aborting the
     attempt.

 (2) Revoke the destination keyring between the keyring ID being looked up
     and it being tested for revocation.  In practice, this is difficult to
     time correctly because the KEYCTL_REJECT function can only be used
     from the request-key upcall process.  Further, users can only make use
     of what's in /sbin/request-key.conf, though this does including a
     rejection debugging test - which means that the destination keyring
     has to be the caller's session keyring in practice.

 (3) Have just enough key quota available to create a key, a new session
     keyring for the upcall and a link in the session keyring, but not then
     sufficient quota to create a link in the nominated destination keyring
     so that it fails with EDQUOT.

The bug can be triggered using option (3) above using something like the
following:

echo 80 >/proc/sys/kernel/keys/root_maxbytes
keyctl request2 user debug:fred negate @t

The above sets the quota to something much lower (80) to make the bug
easier to trigger, but this is dependent on the system.  Note also that
the name of the keyring created contains a random number that may be
between 1 and 10 characters in size, so may throw the test off by
changing the amount of quota used.

Assuming the failure occurs, something like the following will be seen:

kfree_debugcheck: out of range ptr 6b6b6b6b6b6b6b68h
------------[ cut here ]------------
kernel BUG at ../mm/slab.c:2821!
...
RIP: 0010:[<ffffffff811600f9>] kfree_debugcheck+0x20/0x25
RSP: 0018:ffff8804014a7de8  EFLAGS: 00010092
RAX: 0000000000000034 RBX: 6b6b6b6b6b6b6b68 RCX: 0000000000000000
RDX: 0000000000040001 RSI: 00000000000000f6 RDI: 0000000000000300
RBP: ffff8804014a7df0 R08: 0000000000000001 R09: 0000000000000000
R10: ffff8804014a7e68 R11: 0000000000000054 R12: 0000000000000202
R13: ffffffff81318a66 R14: 0000000000000000 R15: 0000000000000001
...
Call Trace:
  kfree+0xde/0x1bc
  assoc_array_cancel_edit+0x1f/0x36
  __key_link_end+0x55/0x63
  key_reject_and_link+0x124/0x155
  keyctl_reject_key+0xb6/0xe0
  keyctl_negate_key+0x10/0x12
  SyS_keyctl+0x9f/0xe7
  do_syscall_64+0x63/0x13a
  entry_SYSCALL64_slow_path+0x25/0x25

Fixes: f70e2e06196a ('KEYS: Do preallocation for __key_link()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 38327424b40bcebe2de92d07312c89360ac9229a)
CVE-2016-4470
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonetfilter: x_tables: check for size overflow
Florian Westphal [Wed, 13 Jul 2016 10:44:54 +0000 (11:44 +0100)]
netfilter: x_tables: check for size overflow

Ben Hawkes says:
 integer overflow in xt_alloc_table_info, which on 32-bit systems can
 lead to small structure allocation and a copy_from_user based heap
 corruption.

Reported-by: Ben Hawkes <hawkes@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit d157bd761585605b7882935ffb86286919f62ea1)
CVE-2016-3135
BugLink: https://bugs.launchpad.net/bugs/1555353
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoRevert "UBUNTU: SAUCE: (noup) netfilter: x_tables: check for size overflow"
Luis Henriques [Wed, 13 Jul 2016 10:44:53 +0000 (11:44 +0100)]
Revert "UBUNTU: SAUCE: (noup) netfilter: x_tables: check for size overflow"

This reverts commit 7da29bdecc58a7aa4ba54177170b89368ff04141.

Dropping this SAUCE patch and replacing it by the upstream fix for
CVE-2016-3135:

  d157bd761585 "netfilter: x_tables: check for size overflow"

The original fix (being reverted) was modified to keep only the 2nd check.

https://marc.info/?l=netfilter-devel&m=145778004016206&w=2

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agokvm:vmx: more complete state update on APICv on/off
Roman Kagan [Wed, 13 Jul 2016 10:44:28 +0000 (11:44 +0100)]
kvm:vmx: more complete state update on APICv on/off

The function to update APICv on/off state (in particular, to deactivate
it when enabling Hyper-V SynIC) is incomplete: it doesn't adjust
APICv-related fields among secondary processor-based VM-execution
controls.  As a result, Windows 2012 guests get stuck when SynIC-based
auto-EOI interrupt intersected with e.g. an IPI in the guest.

In addition, the MSR intercept bitmap isn't updated every time "virtualize
x2APIC mode" is toggled.  This path can only be triggered by a malicious
guest, because Windows didn't use x2APIC but rather their own synthetic
APIC access MSRs; however a guest running in a SynIC-enabled VM could
switch to x2APIC and thus obtain direct access to host APIC MSRs
(CVE-2016-4440).

The patch fixes those omissions.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Reported-by: Steve Rutherford <srutherford@google.com>
Reported-by: Yang Zhang <yang.zhang.wz@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3ce424e45411cf5a13105e0386b6ecf6eeb4f66f)
CVE-2016-4440
BugLink: https://bugs.launchpad.net/bugs/1584192
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoACPI / LPSS: override power state for LPSS DMA device
Andy Shevchenko [Wed, 13 Jul 2016 09:36:13 +0000 (17:36 +0800)]
ACPI / LPSS: override power state for LPSS DMA device

BugLink: http://bugs.launchpad.net/bugs/1602579
This is a third approach to workaround long standing issue with LPSS on
BayTrail. First one [1] was reverted since it didn't resolve the issue
comprehensively. Second one [2] was rejected by internal review.

The LPSS DMA controller does not have neither _PS0 nor _PS3 method. Moreover it
can be powered off automatically whenever the last LPSS device goes down. In
case of no power any access to the DMA controller will hang the system. The
behaviour is reproduced on some HP laptops based on Intel BayTrail [3,4] as
well as on ASuS T100TA transformer.

Power on the LPSS island through the registers accessible in a specific way.

[1] http://www.spinics.net/lists/linux-acpi/msg53963.html
[2] https://bugzilla.redhat.com/attachment.cgi?id=1066779&action=diff
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1184273
[4] http://www.spinics.net/lists/dmaengine/msg01514.html

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit eebb3e8d8aaf28f4bcaf12fd3645350bfd2f0b36)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Conflicts:
arch/x86/include/asm/iosf_mbi.h
[To fix the conflicts and guarantee the success of building after
 applying this patch, I copied _READ and _WRITE definitions from
 the commit 4077a387 into this patch].

Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodmaengine: dw: platform: power on device on shutdown
Andy Shevchenko [Wed, 13 Jul 2016 09:36:12 +0000 (17:36 +0800)]
dmaengine: dw: platform: power on device on shutdown

BugLink: http://bugs.launchpad.net/bugs/1602579
We have to call dw_dma_disable() to stop any ongoing transfer. On some
platforms we can't do that since DMA device is powered off. Moreover we have no
possibility at that point to check if the platform is affected or not. That's
why we call pm_runtime_get_sync() / pm_runtime_put() unconditionally. On the
other hand we can't use pm_runtime_suspended() because runtime PM framework is
not fully used by the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 3214658855c01a0dd62f02feb2ce79846524c6a0)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoHID: multitouch: enable palm rejection for Windows Precision Touchpad
Allen Hung [Wed, 13 Jul 2016 08:45:34 +0000 (16:45 +0800)]
HID: multitouch: enable palm rejection for Windows Precision Touchpad

BugLink: http://bugs.launchpad.net/bugs/1593124
The usage Confidence is mandary to Windows Precision Touchpad devices. If
it is examined in input_mapping on a WIndows Precision Touchpad, a new add
quirk MT_QUIRK_CONFIDENCE desgned for such devices will be applied to the
device. A touch with the confidence bit is not set is determined as
invalid.

Tested on Dell XPS13 9343

Cc: stable@vger.kernel.org # v4.5+
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Andy Lutomirski <luto@kernel.org> # XPS 13 9350, BIOS 1.4.3
Signed-off-by: Allen Hung <allen_hung@dell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 6dd2e27a103d716921cc4a1a96a9adc0a8e3ab57)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoRevert "HID: multitouch: enable palm rejection if device implements confidence usage"
Allen Hung [Wed, 13 Jul 2016 08:45:33 +0000 (16:45 +0800)]
Revert "HID: multitouch: enable palm rejection if device implements confidence usage"

BugLink: http://bugs.launchpad.net/bugs/1593124
This reverts commit 25a84db15b3f ("HID: multitouch: enable palm rejection
if device implements confidence usage")

The commit enables palm rejection for Win8 Precision Touchpad devices but
the quirk MT_QUIRK_VALID_IS_CONFIDENCE it is using is not working very
properly. This quirk is originally designed for some WIn7 touchscreens. Use
of this for a Win8 Precision Touchpad will cause unexpected pointer jumping
problem.

Cc: stable@vger.kernel.org # v4.5+
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Andy Lutomirski <luto@kernel.org> # XPS 13 9350, BIOS 1.4.3
Signed-off-by: Allen Hung <allen_hung@dell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 62630ea768869beeb1e514b0bf5607a0c9b93d12)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoBluetooth: Add support for Intel Bluetooth device 8265 [8087:0a2b]
Tedd Ho-Jeong An [Wed, 13 Jul 2016 08:13:23 +0000 (16:13 +0800)]
Bluetooth: Add support for Intel Bluetooth device 8265 [8087:0a2b]

BugLink: http://bugs.launchpad.net/bugs/1599068
This patch adds support for Intel Bluetooth device 8265 also known
as Windstorm Peak (WsP).

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  6 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=0a2b Rev= 0.10
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(backported from commit a0af53b511423cca93900066512379e21586d7dd)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agopercpu: fix synchronization between synchronous map extension and chunk destruction
Tejun Heo [Tue, 12 Jul 2016 16:03:16 +0000 (17:03 +0100)]
percpu: fix synchronization between synchronous map extension and chunk destruction

For non-atomic allocations, pcpu_alloc() can try to extend the area
map synchronously after dropping pcpu_lock; however, the extension
wasn't synchronized against chunk destruction and the chunk might get
freed while extension is in progress.

This patch fixes the bug by putting most of non-atomic allocations
under pcpu_alloc_mutex to synchronize against pcpu_balance_work which
is responsible for async chunk management including destruction.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # v3.18+
Fixes: 1a4d76076cda ("percpu: implement asynchronous chunk population")
(cherry picked from commit 6710e594f71ccaad8101bc64321152af7cd9ea28)
CVE-2016-4794
BugLink: https://bugs.launchpad.net/bugs/1581871
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Christopher Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agopercpu: fix synchronization between chunk->map_extend_work and chunk destruction
Tejun Heo [Tue, 12 Jul 2016 16:03:15 +0000 (17:03 +0100)]
percpu: fix synchronization between chunk->map_extend_work and chunk destruction

Atomic allocations can trigger async map extensions which is serviced
by chunk->map_extend_work.  pcpu_balance_work which is responsible for
destroying idle chunks wasn't synchronizing properly against
chunk->map_extend_work and may end up freeing the chunk while the work
item is still in flight.

This patch fixes the bug by rolling async map extension operations
into pcpu_balance_work.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # v3.18+
Fixes: 9c824b6a172c ("percpu: make sure chunk->map array has available space")
(cherry picked from commit 4f996e234dad488e5d9ba0858bc1bae12eff82c3)
CVE-2016-4794
BugLink: https://bugs.launchpad.net/bugs/1581871
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Christopher Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoLinux 4.4.15
Greg Kroah-Hartman [Mon, 11 Jul 2016 16:31:24 +0000 (09:31 -0700)]
Linux 4.4.15

BugLink: http://bugs.launchpad.net/bugs/1601952
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: dwc3: exynos: Fix deferred probing storm.
Steinar H. Gunderson [Tue, 24 May 2016 18:13:15 +0000 (20:13 +0200)]
usb: dwc3: exynos: Fix deferred probing storm.

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 4879efb34f7d49235fac334d76d9c6a77a021413 upstream.

dwc3-exynos has two problems during init if the regulators are slow
to come up (for instance if the I2C bus driver is not on the initramfs)
and return probe deferral. First, every time this happens, the driver
leaks the USB phys created; they need to be deallocated on error.

Second, since the phy devices are created before the regulators fail,
this means that there's a new device to re-trigger deferred probing,
which causes it to essentially go into a busy loop of re-probing the
device until the regulators come up.

Move the phy creation to after the regulators have succeeded, and also
fix cleanup on failure. On my ODROID XU4 system (with Debian's initramfs
which doesn't contain the I2C driver), this reduces the number of probe
attempts (for each of the two controllers) from more than 2000 to eight.

Signed-off-by: Steinar H. Gunderson <sesse@google.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Vivek Gautam <gautam.vivek@samsung.com>
Fixes: d720f057fda4 ("usb: dwc3: exynos: add nop transceiver support")
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: host: ehci-tegra: Grab the correct UTMI pads reset
Thierry Reding [Thu, 26 May 2016 15:23:29 +0000 (17:23 +0200)]
usb: host: ehci-tegra: Grab the correct UTMI pads reset

BugLink: http://bugs.launchpad.net/bugs/1601952
commit f8a15a9650694feaa0dabf197b0c94d37cd3fb42 upstream.

There are three EHCI controllers on Tegra SoCs, each with its own reset
line. However, the first controller contains a set of UTMI configuration
registers that are shared with its siblings. These registers will only
be reset as part of the first controller's reset. For proper operation
it must be ensured that the UTMI configuration registers are reset
before any of the EHCI controllers are enabled, irrespective of the
probe order.

Commit a47cc24cd1e5 ("USB: EHCI: tegra: Fix probe order issue leading to
broken USB") introduced code that ensures the first controller is always
reset before setting up any of the controllers, and is never again reset
afterwards.

This code, however, grabs the wrong reset. Each EHCI controller has two
reset controls attached: 1) the USB controller reset and 2) the UTMI
pads reset (really the first controller's reset). In order to reset the
UTMI pads registers the code must grab the second reset, but instead it
grabbing the first.

Fixes: a47cc24cd1e5 ("USB: EHCI: tegra: Fix probe order issue leading to broken USB")
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: gadget: fix spinlock dead lock in gadgetfs
Bin Liu [Thu, 26 May 2016 16:43:45 +0000 (11:43 -0500)]
usb: gadget: fix spinlock dead lock in gadgetfs

BugLink: http://bugs.launchpad.net/bugs/1601952
commit d246dcb2331c5783743720e6510892eb1d2801d9 upstream.

[   40.467381] =============================================
[   40.473013] [ INFO: possible recursive locking detected ]
[   40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted
[   40.483466] ---------------------------------------------
[   40.489098] usb/733 is trying to acquire lock:
[   40.493734]  (&(&dev->lock)->rlock){-.....}, at: [<bf129288>] ep0_complete+0x18/0xdc [gadgetfs]
[   40.502882]
[   40.502882] but task is already holding lock:
[   40.508967]  (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[   40.517811]
[   40.517811] other info that might help us debug this:
[   40.524623]  Possible unsafe locking scenario:
[   40.524623]
[   40.530798]        CPU0
[   40.533346]        ----
[   40.535894]   lock(&(&dev->lock)->rlock);
[   40.540088]   lock(&(&dev->lock)->rlock);
[   40.544284]
[   40.544284]  *** DEADLOCK ***
[   40.544284]
[   40.550461]  May be due to missing lock nesting notation
[   40.550461]
[   40.557544] 2 locks held by usb/733:
[   40.561271]  #0:  (&f->f_pos_lock){+.+.+.}, at: [<c02a6114>] __fdget_pos+0x40/0x48
[   40.569219]  #1:  (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[   40.578523]
[   40.578523] stack backtrace:
[   40.583075] CPU: 0 PID: 733 Comm: usb Not tainted 4.6.0-08691-g7f3db9a #37
[   40.590246] Hardware name: Generic AM33XX (Flattened Device Tree)
[   40.596625] [<c010ffbc>] (unwind_backtrace) from [<c010c1bc>] (show_stack+0x10/0x14)
[   40.604718] [<c010c1bc>] (show_stack) from [<c04207fc>] (dump_stack+0xb0/0xe4)
[   40.612267] [<c04207fc>] (dump_stack) from [<c01886ec>] (__lock_acquire+0xf68/0x1994)
[   40.620440] [<c01886ec>] (__lock_acquire) from [<c0189528>] (lock_acquire+0xd8/0x238)
[   40.628621] [<c0189528>] (lock_acquire) from [<c06ad6b4>] (_raw_spin_lock_irqsave+0x38/0x4c)
[   40.637440] [<c06ad6b4>] (_raw_spin_lock_irqsave) from [<bf129288>] (ep0_complete+0x18/0xdc [gadgetfs])
[   40.647339] [<bf129288>] (ep0_complete [gadgetfs]) from [<bf10a728>] (musb_g_giveback+0x118/0x1b0 [musb_hdrc])
[   40.657842] [<bf10a728>] (musb_g_giveback [musb_hdrc]) from [<bf108768>] (musb_g_ep0_queue+0x16c/0x188 [musb_hdrc])
[   40.668772] [<bf108768>] (musb_g_ep0_queue [musb_hdrc]) from [<bf12a944>] (ep0_read+0x544/0x5e0 [gadgetfs])
[   40.678963] [<bf12a944>] (ep0_read [gadgetfs]) from [<c0284470>] (__vfs_read+0x20/0x110)
[   40.687414] [<c0284470>] (__vfs_read) from [<c0285324>] (vfs_read+0x88/0x114)
[   40.694864] [<c0285324>] (vfs_read) from [<c0286150>] (SyS_read+0x44/0x9c)
[   40.702051] [<c0286150>] (SyS_read) from [<c0107820>] (ret_fast_syscall+0x0/0x1c)

This is caused by the spinlock bug in ep0_read().
Fix the two other deadlock sources in gadgetfs_setup() too.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUSB: mos7720: delete parport
Sudip Mukherjee [Mon, 30 May 2016 13:46:33 +0000 (19:16 +0530)]
USB: mos7720: delete parport

BugLink: http://bugs.launchpad.net/bugs/1601952
commit dcb21ad4385731b7fc3ef39d255685f2f63c8c5d upstream.

parport subsystem has introduced parport_del_port() to delete a port
when it is going away. Without parport_del_port() the registered port
will not be unregistered.
To reproduce and verify the error:
Command to be used is : ls /sys/bus/parport/devices
1) without the device attached there is no output as there is no
registered parport.
2) Attach the device, and the command will show "parport0".
3) Remove the device and the command still shows "parport0".
4) Attach the device again and we get "parport1".

With the patch applied:
1) without the device attached there is no output as there is no
registered parport.
2) Attach the device, and the command will show "parport0".
3) Remove the device and there is no output as "parport0" is now
removed.
4) Attach device again to get "parport0" again.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoxhci: Fix handling timeouted commands on hosts in weird states.
Mathias Nyman [Wed, 1 Jun 2016 15:09:08 +0000 (18:09 +0300)]
xhci: Fix handling timeouted commands on hosts in weird states.

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 3425aa03f484d45dc21e0e791c2f6c74ea656421 upstream.

If commands timeout we mark them for abortion, then stop the command
ring, and turn the commands to no-ops and finally restart the command
ring.

If the host is working properly the no-op commands will finish and
pending completions are called.
If we notice the host is failing, driver clears the command ring and
completes, deletes and frees all pending commands.

There are two separate cases reported where host is believed to work
properly but is not. In the first case we successfully stop the ring
but no abort or stop command ring event is ever sent and host locks up.

The second case is if a host is removed, command times out and driver
believes the ring is stopped, and assumes it will be restarted, but
actually ends up timing out on the same command forever.
If one of the pending commands has the xhci->mutex held it will block
xhci_stop() in the remove codepath which otherwise would cleanup pending
commands.

Add a check that clears all pending commands in case host is removed,
or we are stuck timing out on the same command. Also restart the
command timeout timer when stopping the command ring to ensure we
recive an ring stop/abort event.

Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUSB: xhci: Add broken streams quirk for Frescologic device id 1009
Hans de Goede [Wed, 1 Jun 2016 19:01:29 +0000 (21:01 +0200)]
USB: xhci: Add broken streams quirk for Frescologic device id 1009

BugLink: http://bugs.launchpad.net/bugs/1601952
commit d95815ba6a0f287213118c136e64d8c56daeaeab upstream.

I got one of these cards for testing uas with, it seems that with streams
it dma-s all over the place, corrupting memory. On my first tests it
managed to dma over the BIOS of the motherboard somehow and completely
bricked it.

Tests on another motherboard show that it does work with streams disabled.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: xhci-plat: properly handle probe deferral for devm_clk_get()
Thomas Petazzoni [Wed, 1 Jun 2016 15:09:09 +0000 (18:09 +0300)]
usb: xhci-plat: properly handle probe deferral for devm_clk_get()

BugLink: http://bugs.launchpad.net/bugs/1601952
commit de95c40d5beaa47f6dc8fe9ac4159b4672b51523 upstream.

On some platforms, the clocks might be registered by a platform
driver. When this is the case, the clock platform driver may very well
be probed after xhci-plat, in which case the first probe() invocation
of xhci-plat will receive -EPROBE_DEFER as the return value of
devm_clk_get().

The current code handles that as a normal error, and simply assumes
that this means that the system doesn't have a clock for the XHCI
controller, and continues probing without calling
clk_prepare_enable(). Unfortunately, this doesn't work on systems
where the XHCI controller does have a clock, but that clock is
provided by another platform driver. In order to fix this situation,
we handle the -EPROBE_DEFER error condition specially, and abort the
XHCI controller probe(). It will be retried later automatically, the
clock will be available, devm_clk_get() will succeed, and the probe()
will continue with the clock prepared and enabled as expected.

In practice, such issue is seen on the ARM64 Marvell 7K/8K platform,
where the clocks are registered by a platform driver.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: musb: host: correct cppi dma channel for isoch transfer
Bin Liu [Tue, 31 May 2016 15:05:25 +0000 (10:05 -0500)]
usb: musb: host: correct cppi dma channel for isoch transfer

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 04471eb8c3158c0ad9df4b24da845a63b2e8f23a upstream.

Incorrect cppi dma channel is referenced in musb_rx_dma_iso_cppi41(),
which causes kernel NULL pointer reference oops later when calling
cppi41_dma_channel_program().

Fixes: 069a3fd (usb: musb: Remove ifdefs for musb_host_rx in musb_host.c
part1)

Reported-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: musb: Ensure rx reinit occurs for shared_fifo endpoints
Andrew Goodbody [Tue, 31 May 2016 15:05:26 +0000 (10:05 -0500)]
usb: musb: Ensure rx reinit occurs for shared_fifo endpoints

BugLink: http://bugs.launchpad.net/bugs/1601952
commit f3eec0cf784e0d6c47822ca6b66df3d5812af7e6 upstream.

shared_fifo endpoints would only get a previous tx state cleared
out, the rx state was only cleared for non shared_fifo endpoints
Change this so that the rx state is cleared for all endpoints.
This addresses an issue that resulted in rx packets being dropped
silently.

Signed-off-by: Andrew Goodbody <andrew.goodbody@cambrionix.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: musb: Stop bulk endpoint while queue is rotated
Andrew Goodbody [Tue, 31 May 2016 15:05:27 +0000 (10:05 -0500)]
usb: musb: Stop bulk endpoint while queue is rotated

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 7b2c17f829545df27a910e8d82e133c21c9a8c9c upstream.

Ensure that the endpoint is stopped by clearing REQPKT before
clearing DATAERR_NAKTIMEOUT before rotating the queue on the
dedicated bulk endpoint.
This addresses an issue where a race could result in the endpoint
receiving data before it was reprogrammed resulting in a warning
about such data from musb_rx_reinit before it was thrown away.
The data thrown away was a valid packet that had been correctly
ACKed which meant the host and device got out of sync.

Signed-off-by: Andrew Goodbody <andrew.goodbody@cambrionix.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: musb: only restore devctl when session was set in backup
Bin Liu [Tue, 31 May 2016 15:05:24 +0000 (10:05 -0500)]
usb: musb: only restore devctl when session was set in backup

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 84ac5d1140f716a616522f952734e850448d2556 upstream.

If the session bit was not set in the backup of devctl register,
restoring devctl would clear the session bit. Therefor, only restore
devctl register when the session bit was set in the backup.

This solves the device enumeration failure in otg mode exposed by commit
56f487c (PM / Runtime: Update last_busy in rpm_resume).

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: quirks: Add no-lpm quirk for Acer C120 LED Projector
Hans de Goede [Thu, 19 May 2016 15:12:20 +0000 (17:12 +0200)]
usb: quirks: Add no-lpm quirk for Acer C120 LED Projector

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 32cb0b37098f4beeff5ad9e325f11b42a6ede56c upstream.

The Acer C120 LED Projector is a USB-3 connected pico projector which
takes both its power and video data from USB-3.

In combination with some hubs this device does not play well with
lpm, so disable lpm for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agousb: quirks: Fix sorting
Hans de Goede [Thu, 19 May 2016 15:12:19 +0000 (17:12 +0200)]
usb: quirks: Fix sorting

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 81099f97bd31e25ff2719a435b1860fc3876122f upstream.

Properly sort all the entries by vendor id.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUSB: uas: Fix slave queue_depth not being set
Hans de Goede [Tue, 31 May 2016 07:18:03 +0000 (09:18 +0200)]
USB: uas: Fix slave queue_depth not being set

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 593224ea77b1ca842f45cf76f4deeef44dfbacd1 upstream.

Commit 198de51dbc34 ("USB: uas: Limit qdepth at the scsi-host level")
removed the scsi_change_queue_depth() call from uas_slave_configure()
assuming that the slave would inherit the host's queue_depth, which
that commit sets to the same value.

This is incorrect, without the scsi_change_queue_depth() call the slave's
queue_depth defaults to 1, introducing a performance regression.

This commit restores the call, fixing the performance regression.

Fixes: 198de51dbc34 ("USB: uas: Limit qdepth at the scsi-host level")
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agocrypto: user - re-add size check for CRYPTO_MSG_GETALG
Mathias Krause [Wed, 22 Jun 2016 18:29:37 +0000 (20:29 +0200)]
crypto: user - re-add size check for CRYPTO_MSG_GETALG

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 055ddaace03580455a7b7dbea8e93d62acee61fc upstream.

Commit 9aa867e46565 ("crypto: user - Add CRYPTO_MSG_DELRNG")
accidentally removed the minimum size check for CRYPTO_MSG_GETALG
netlink messages. This allows userland to send a truncated
CRYPTO_MSG_GETALG message as short as a netlink header only making
crypto_report() operate on uninitialized memory by accessing data
beyond the end of the netlink message.

Fix this be re-adding the minimum required size of CRYPTO_MSG_GETALG
messages to the crypto_msg_min[] array.

Fixes: 9aa867e46565 ("crypto: user - Add CRYPTO_MSG_DELRNG")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agocrypto: ux500 - memmove the right size
Linus Walleij [Wed, 8 Jun 2016 12:56:39 +0000 (14:56 +0200)]
crypto: ux500 - memmove the right size

BugLink: http://bugs.launchpad.net/bugs/1601952
commit 19ced623db2fe91604d69f7d86b03144c5107739 upstream.

The hash buffer is really HASH_BLOCK_SIZE bytes, someone
must have thought that memmove takes n*u32 words by mistake.
Tests work as good/bad as before after this patch.

Cc: Joakim Bech <joakim.bech@linaro.org>
Reported-by: David Binderman <linuxdev.baldrick@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoAX.25: Close socket connection on session completion
Basil Gunn [Thu, 16 Jun 2016 16:42:30 +0000 (09:42 -0700)]
AX.25: Close socket connection on session completion

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 4a7d99ea1b27734558feb6833f180cd38a159940 ]

A socket connection made in ax.25 is not closed when session is
completed.  The heartbeat timer is stopped prematurely and this is
where the socket gets closed. Allow heatbeat timer to run to close
socket. Symptom occurs in kernels >= 4.2.0

Originally sent 6/15/2016. Resend with distribution list matching
scripts/maintainer.pl output.

Signed-off-by: Basil Gunn <basil@pacabunga.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agobpf: try harder on clones when writing into skb
Daniel Borkmann [Fri, 19 Feb 2016 22:05:25 +0000 (23:05 +0100)]
bpf: try harder on clones when writing into skb

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 3697649ff29e0f647565eed04b27a7779c646a22 ]

When we're dealing with clones and the area is not writeable, try
harder and get a copy via pskb_expand_head(). Replace also other
occurences in tc actions with the new skb_try_make_writable().

Reported-by: Ashhad Sheikh <ashhadsheikh394@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonet: alx: Work around the DMA RX overflow issue
Feng Tang [Fri, 24 Jun 2016 07:26:05 +0000 (15:26 +0800)]
net: alx: Work around the DMA RX overflow issue

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 881d0327db37ad917a367c77aff1afa1ee41e0a9 ]

Note: This is a verified backported patch for stable 4.4 kernel, and it
could also be applied to 4.3/4.2/4.1/3.18/3.16

There is a problem with alx devices, that the network link will be
lost in 1-5 minutes after the device is up.

>From debugging without datasheet, we found the error always
happen when the DMA RX address is set to 0x....fc0, which is very
likely to be a HW/silicon problem.

This patch will apply rx skb with 64 bytes longer space, and if the
allocated skb has a 0x...fc0 address, it will use skb_resever(skb, 64)
to advance the address, so that the RX overflow can be avoided.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761
Signed-off-by: Feng Tang <feng.tang@intel.com>
Suggested-by: Eric Dumazet <edumazet@google.com>
Tested-by: Ole Lukoie <olelukoie@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonet: macb: fix default configuration for GMAC on AT91
Nicolas Ferre [Thu, 10 Mar 2016 15:44:32 +0000 (16:44 +0100)]
net: macb: fix default configuration for GMAC on AT91

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 6bdaa5e9ed39b3b3328f35d218e8ad5a99cfc4d2 ]

On AT91 SoCs, the User Register (USRIO) exposes a switch to configure the
"Reduced" or "Traditional" version of the Media Independent Interface
(RMII vs. MII or RGMII vs. GMII).
As on the older EMAC version, on GMAC, this switch is set by default to the
non-reduced type of interface, so use the existing capability and extend it to
GMII as well. We then keep the current logic in the macb_init() function.

The capabilities of sama5d2, sama5d4 and sama5d3 GEM interface are updated in
the macb_config structure to be able to properly enable them with a traditional
interface (GMII or MII).

Reported-by: Romain HENRIET <romain.henriet@l-acoustics.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[cyrille.pitchen@atmel.com: backported to 4.4.y]
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoneigh: Explicitly declare RCU-bh read side critical section in neigh_xmit()
David Barroso [Tue, 28 Jun 2016 08:16:43 +0000 (11:16 +0300)]
neigh: Explicitly declare RCU-bh read side critical section in neigh_xmit()

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit b560f03ddfb072bca65e9440ff0dc4f9b1d1f056 ]

neigh_xmit() expects to be called inside an RCU-bh read side critical
section, and while one of its two current callers gets this right, the
other one doesn't.

More specifically, neigh_xmit() has two callers, mpls_forward() and
mpls_output(), and while both callers call neigh_xmit() under
rcu_read_lock(), this provides sufficient protection for neigh_xmit()
only in the case of mpls_forward(), as that is always called from
softirq context and therefore doesn't need explicit BH protection,
while mpls_output() can be called from process context with softirqs
enabled.

When mpls_output() is called from process context, with softirqs
enabled, we can be preempted by a softirq at any time, and RCU-bh
considers the completion of a softirq as signaling the end of any
pending read-side critical sections, so if we do get a softirq
while we are in the part of neigh_xmit() that expects to be run inside
an RCU-bh read side critical section, we can end up with an unexpected
RCU grace period running right in the middle of that critical section,
making things go boom.

This patch fixes this impedance mismatch in the callee, by making
neigh_xmit() always take rcu_read_{,un}lock_bh() around the code that
expects to be treated as an RCU-bh read side critical section, as this
seems a safer option than fixing it in the callers.

Fixes: 4fd3d7d9e868f ("neigh: Add helper function neigh_xmit")
Signed-off-by: David Barroso <dbarroso@fastly.com>
Signed-off-by: Lennert Buytenhek <lbuytenhek@fastly.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agobpf, perf: delay release of BPF prog after grace period
Daniel Borkmann [Mon, 27 Jun 2016 19:38:11 +0000 (21:38 +0200)]
bpf, perf: delay release of BPF prog after grace period

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit ceb56070359b7329b5678b5d95a376fcb24767be ]

Commit dead9f29ddcc ("perf: Fix race in BPF program unregister") moved
destruction of BPF program from free_event_rcu() callback to __free_event(),
which is problematic if used with tail calls: if prog A is attached as
trace event directly, but at the same time present in a tail call map used
by another trace event program elsewhere, then we need to delay destruction
via RCU grace period since it can still be in use by the program doing the
tail call (the prog first needs to be dropped from the tail call map, then
trace event with prog A attached destroyed, so we get immediate destruction).

Fixes: dead9f29ddcc ("perf: Fix race in BPF program unregister")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Jann Horn <jann@thejh.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agosock_diag: do not broadcast raw socket destruction
Willem de Bruijn [Fri, 24 Jun 2016 20:02:35 +0000 (16:02 -0400)]
sock_diag: do not broadcast raw socket destruction

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 9a0fee2b552b1235fb1706ae1fc664ae74573be8 ]

Diag intends to broadcast tcp_sk and udp_sk socket destruction.
Testing sk->sk_protocol for IPPROTO_TCP/IPPROTO_UDP alone is not
sufficient for this. Raw sockets can have the same type.

Add a test for sk->sk_type.

Fixes: eb4cb008529c ("sock_diag: define destruction multicast groups")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoBridge: Fix ipv6 mc snooping if bridge has no ipv6 address
daniel [Fri, 24 Jun 2016 10:35:18 +0000 (12:35 +0200)]
Bridge: Fix ipv6 mc snooping if bridge has no ipv6 address

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 0888d5f3c0f183ea6177355752ada433d370ac89 ]

The bridge is falsly dropping ipv6 mulitcast packets if there is:
 1. No ipv6 address assigned on the brigde.
 2. No external mld querier present.
 3. The internal querier enabled.

When the bridge fails to build mld queries, because it has no
ipv6 address, it slilently returns, but keeps the local querier enabled.
This specific case causes confusing packet loss.

Ipv6 multicast snooping can only work if:
 a) An external querier is present
 OR
 b) The bridge has an ipv6 address an is capable of sending own queries

Otherwise it has to forward/flood the ipv6 multicast traffic,
because snooping cannot work.

This patch fixes the issue by adding a flag to the bridge struct that
indicates that there is currently no ipv6 address assinged to the bridge
and returns a false state for the local querier in
__br_multicast_querier_exists().

Special thanks to Linus Lüssing.

Fixes: d1d81d4c3dd8 ("bridge: check return value of ipv6_dev_get_saddr()")
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoipmr/ip6mr: Initialize the last assert time of mfc entries.
Tom Goff [Thu, 23 Jun 2016 20:11:57 +0000 (16:11 -0400)]
ipmr/ip6mr: Initialize the last assert time of mfc entries.

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 70a0dec45174c976c64b4c8c1d0898581f759948 ]

This fixes wrong-interface signaling on 32-bit platforms for entries
created when jiffies > 2^31 + MFC_ASSERT_THRESH.

Signed-off-by: Tom Goff <thomas.goff@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonetem: fix a use after free
Eric Dumazet [Mon, 20 Jun 2016 22:00:43 +0000 (15:00 -0700)]
netem: fix a use after free

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 21de12ee5568fd1aec47890c72967abf791ac80a ]

If the packet was dropped by lower qdisc, then we must not
access it later.

Save qdisc_pkt_len(skb) in a temp variable.

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoesp: Fix ESN generation under UDP encapsulation
Herbert Xu [Sat, 18 Jun 2016 05:03:36 +0000 (13:03 +0800)]
esp: Fix ESN generation under UDP encapsulation

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 962fcef33b03395051367181a0549d29d109d9a4 ]

Blair Steven noticed that ESN in conjunction with UDP encapsulation
is broken because we set the temporary ESP header to the wrong spot.

This patch fixes this by first of all using the right spot, i.e.,
4 bytes off the real ESP header, and then saving this information
so that after encryption we can restore it properly.

Fixes: 7021b2e1cddd ("esp4: Switch to new AEAD interface")
Reported-by: Blair Steven <Blair.Steven@alliedtelesis.co.nz>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agosit: correct IP protocol used in ipip6_err
Simon Horman [Thu, 16 Jun 2016 08:06:19 +0000 (17:06 +0900)]
sit: correct IP protocol used in ipip6_err

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit d5d8760b78d0cfafe292f965f599988138b06a70 ]

Since 32b8a8e59c9c ("sit: add IPv4 over IPv4 support")
ipip6_err() may be called for packets whose IP protocol is
IPPROTO_IPIP as well as those whose IP protocol is IPPROTO_IPV6.

In the case of IPPROTO_IPIP packets the correct protocol value is not
passed to ipv4_update_pmtu() or ipv4_redirect().

This patch resolves this problem by using the IP protocol of the packet
rather than a hard-coded value. This appears to be consistent
with the usage of the protocol of a packet by icmp_socket_deliver()
the caller of ipip6_err().

I was able to exercise the redirect case by using a setup where an ICMP
redirect was received for the destination of the encapsulated packet.
However, it appears that although incorrect the protocol field is not used
in this case and thus no problem manifests.  On inspection it does not
appear that a problem will manifest in the fragmentation needed/update pmtu
case either.

In short I believe this is a cosmetic fix. None the less, the use of
IPPROTO_IPV6 seems wrong and confusing.

Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonet: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG
Jason A. Donenfeld [Wed, 15 Jun 2016 09:14:53 +0000 (11:14 +0200)]
net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit daddef76c3deaaa7922f9d7b18edbf0a061215c3 ]

The implementation of net_dbg_ratelimited in the CONFIG_DYNAMIC_DEBUG
case was added with 2c94b5373 ("net: Implement net_dbg_ratelimited() for
CONFIG_DYNAMIC_DEBUG case"). The implementation strategy was to take the
usual definition of the dynamic_pr_debug macro, but alter it by adding a
call to "net_ratelimit()" in the if statement. This is, in fact, the
correct approach.

However, while doing this, the author of the commit forgot to surround
fmt by pr_fmt, resulting in unprefixed log messages appearing in the
console. So, this commit adds back the pr_fmt(fmt) invocation, making
net_dbg_ratelimited properly consistent across DEBUG, no DEBUG, and
DYNAMIC_DEBUG cases, and bringing parity with the behavior of
dynamic_pr_debug as well.

Fixes: 2c94b5373 ("net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Tim Bingham <tbingham@akamai.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonet_sched: fix pfifo_head_drop behavior vs backlog
Eric Dumazet [Mon, 13 Jun 2016 03:01:25 +0000 (20:01 -0700)]
net_sched: fix pfifo_head_drop behavior vs backlog

BugLink: http://bugs.launchpad.net/bugs/1601952
[ Upstream commit 6c0d54f1897d229748d4f41ef919078db6db2123 ]

When the qdisc is full, we drop a packet at the head of the queue,
queue the current skb and return NET_XMIT_CN

Now we track backlog on upper qdiscs, we need to call
qdisc_tree_reduce_backlog(), even if the qlen did not change.

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoqeth: delete napi struct when removing a qeth device
Ursula Braun [Mon, 11 Jul 2016 14:25:20 +0000 (08:25 -0600)]
qeth: delete napi struct when removing a qeth device

BugLink: http://bugs.launchpad.net/bugs/1601831
A qeth_card contains a napi_struct linked to the net_device during
device probing. This struct must be deleted when removing the qeth
device, otherwise Panic on oops can occur when qeth devices are
repeatedly removed and added.

Fixes: a1c3ed4c9ca ("qeth: NAPI support for l2 and l3 discipline")
Cc: stable@vger.kernel.org # v2.6.37+
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Tested-by: Alexander Klein <ALKL@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7831b4ff0d926e0deeaabef9db8800ed069a2757)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Christopher Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/i915: Removing PCI IDs that are no longer listed as Kabylake.
Rodrigo Vivi [Thu, 23 Jun 2016 21:50:36 +0000 (14:50 -0700)]
drm/i915: Removing PCI IDs that are no longer listed as Kabylake.

BugLink: http://bugs.launchpad.net/bugs/1600124
This is unusual. Usually IDs listed on early stages of platform
definition are kept there as reserved for later use.

However these IDs here are not listed anymore in any of steppings
and devices IDs tables for Kabylake on configurations overview
section of BSpec.

So it is better removing them before they become used in any
other future platform.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466718636-19675-2-git-send-email-rodrigo.vivi@intel.com
(cherry picked from drm-intel-next-queued commit a922eb8d4581c883c37ce6e12dca9ff2cb1ea723)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/i915: Add more Kabylake PCI IDs.
Rodrigo Vivi [Thu, 23 Jun 2016 21:50:35 +0000 (14:50 -0700)]
drm/i915: Add more Kabylake PCI IDs.

BugLink: http://bugs.launchpad.net/bugs/1600124
The spec has been updated adding new PCI IDs.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466718636-19675-1-git-send-email-rodrigo.vivi@intel.com
(cherry picked from drm-intel-next-queued commit 33d9391d3020e069dca98fa87a604c037beb2b9e)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: Introduce Kabypoint PCH for Kabylake H/DT.
Rodrigo Vivi [Sat, 2 Jul 2016 00:07:00 +0000 (03:07 +0300)]
UBUNTU: SAUCE: i915_bpo: Introduce Kabypoint PCH for Kabylake H/DT.

BugLink: http://bugs.launchpad.net/bugs/1599109
Some Kabylake SKUs are going to use Kabypoint PCH.
It is mainly for Halo and DT ones.

From our specs it doesn't seem that KBP brings
any change on the display south engine. So let's consider
this as a continuation of SunrisePoint, i.e., SPT+.

Since it is easy to get confused by a letter change:
KBL = Kabylake - CPU/GPU codename.
KBP = Kabypoint - PCH codename.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry-picked from drm-intel-next-queued commit 22dea0be50b2eb0)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: Revert "drm/i915: Get panel_type from OpRegion panel details"
Timo Aaltonen [Fri, 8 Jul 2016 07:47:22 +0000 (10:47 +0300)]
UBUNTU: SAUCE: i915_bpo: Revert "drm/i915: Get panel_type from OpRegion panel details"

BugLink: http://bugs.launchpad.net/bugs/1599109
This commit has been reported to cause some flicker issues on a specific
Skylake machine

https://lists.freedesktop.org/archives/intel-gfx/2016-June/098826.html

So revert this for now until a proper fix for the issue is provided:

commit a05628195a0d9f3173dd9aa76f482aef692e46ee
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Mon Apr 11 10:23:51 2016 +0300

    drm/i915: Get panel_type from OpRegion panel details

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: Add backported workarounds for gen9
Timo Aaltonen [Fri, 8 Jul 2016 07:14:56 +0000 (10:14 +0300)]
UBUNTU: SAUCE: i915_bpo: Add backported workarounds for gen9

BugLink: http://bugs.launchpad.net/bugs/1599109
This commit squashes together the following commits backported from
drm-intel-next-queued so that they apply on top of v4.7:

d1b4eefdea6d63a drm/i915/gen9: Add WaFbcHighMemBwCorruptionAvoidance
031cd8c85aefad3 drm/i195/fbc: Add WaFbcNukeOnHostModify
303d4ea522e8672 drm/i915/gen9: Add WaFbcWakeMemOn
0f78dee6f06a939 drm/i915/gen9: Add WaFbcTurnOffFbcWatermark
066d462888514af drm/i915/kbl: Add WaClearSlmSpaceAtContextSwitch
71dce58c8e90872 drm/i915/skl: Extend WaDisableChickenBitTSGBarrierAckForFFSliceCS
590e8ff04bc0182 drm/i915/gen9: Add WaEnableChickenDCPR
954337aa96a31f6 drm/i915/kbl: Add WaDisableSbeCacheDispatchPortSharing
4de5d7ccbccc88d drm/i915/kbl: Add WaDisableGafsUnitClkGating
0b2d0934edceff9 drm/i915/kbl: Add WaForGAMHang
44fff99ff25f1dd drm/i915/skl: Add WAC6entrylatency
6fc29133eafb9eb drm/i915/gen9: Add WaDisableSkipCaching
ad2bdb44b19529b drm/i915: Add WaInsertDummyPushConstP for bxt and kbl
c0b730d572ea00d drm/i915/kbl: Add WaDisableDynamicCreditSharing
8aeb7f624fbf8a6 drm/i915/kbl: Add WaDisableGamClockGating
b033bb6d5d3a0e5 drm/i915/gen9: Enable must set chicken bits in config0 reg
fe90581987cd5fa drm/i915/kbl: Add WaDisableLSQCROPERFforOCL
17e0adf079a3bf2 drm/i915/edp: Add WaKVMNotificationOnConfigChange:bdw
9498dba7b4ffe40 drm/i915/kbl: Add WaDisableSDEUnitClockGating
8401d42fd5adf70 drm/i915/kbl: Add WaDisableFenceDestinationToSLM for A0
e587f6cb0af140f drm/i915/kbl: Add WaEnableGapsTsvCreditFix
bbaefe72a00c93c drm/i915: Mimic skl with WaForceEnableNonCoherent
5b0e3659296cc4a drm/i915/gen9: Always apply WaForceContextSaveRestoreNonCohe
6e4f10c33a8bd0d drm/i915/kbl: Add WaSkipStolenMemoryFirstPage for A0
c033a37cd42c1b5 drm/i915/kbl: Add REVID macro
e5f81d65ac5a040 drm/i915/kbl: Init gen9 workarounds
eee8efb02a0f928 drm/i915/skl: Add WaDisableGafsUnitClkGating
6bb6285582e0cf9 drm/i915/gen9: Add WaVFEStateAfterPipeControlwithMediaStateClear

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: i915_bpo: Rebase to v4.7-rc6
Timo Aaltonen [Tue, 5 Jul 2016 11:01:04 +0000 (14:01 +0300)]
UBUNTU: SAUCE: i915_bpo: Rebase to v4.7-rc6

BugLink: http://bugs.launchpad.net/bugs/1599109
Sync i915_bpo with v4.7-rc6. Revert a bunch of commits from it to let it build
without pulling a ton of core drm changes.

3ed605bc8a0a688d kernel.h: add u64_to_user_ptr()
2347aa7c34be284b drm: i915: Explicitly apply PWM config extracted from pwm_args
0552f7651bc233e5 drm/i915/mst: use reference counted connectors. (v3)
8863dc7f5642737e drm/i915: Correctly refcount connectors in hw state readou"
ec2dc6a0fe38de8d drm: Drop crtc argument from __drm_atomic_helper_crtc_destroy_state
80a89a5e8513c6a1 drm/i915: make i915_gem_mmap_ioctl wait for mmap_sem killable
e87666b52f00fdb3 drm/i915/shrinker: Hook up vmap allocation failure notifier
168cf367d7017a9d drm/i915/shrinker: Refactor common uninterruptible locking
eae2c43b1233f81f drm/i915/shrinker: Restrict vmap purge to objects with vmaps
1768d4550c055bfd drm/i915/shrinker: Report "unevictable" pages
1bec9b0bda3d570c drm/i915/shrinker: Only shmemfs objects are backed by swap
747a598ffa7dff49 drm/mode: introduce wrapper to read framebuffer refcount.
1d2ac403ae3bfde7 drm: Protect dev->filelist with its own mutex
cab103274352721b drm/i915: Fix missing unlock on error in i915_ppgtt_info()
a8ad0bd84f986072 drm: Remove unused drm_device from drm_gem_object_lookup()

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: drm: Introduce drm_malloc_gfp()
Timo Aaltonen [Tue, 5 Jul 2016 12:02:46 +0000 (15:02 +0300)]
UBUNTU: SAUCE: drm: Introduce drm_malloc_gfp()

BugLink: http://bugs.launchpad.net/bugs/1599109
Backport header bits of

commit f2a85e1975d80d1b535b4c21517ed15226b96c87
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 8 12:11:13 2016 +0100

    drm,i915: Introduce drm_malloc_gfp()

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Liu Ying [Fri, 20 Nov 2015 08:15:30 +0000 (16:15 +0800)]
drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format

BugLink: http://bugs.launchpad.net/bugs/1599109
Add a helper that can be used to obtain the number of bits per pixel
corresponding to a given MIPI DSI pixel format. This is useful in
bandwidth calculations, for example.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
[treding@nvidia.com: add kerneldoc comment and commit message]
Signed-off-by: Thierry Reding <treding@nvidia.com>
(cherry picked from commit ec26d9e9382f432225d76b3ff1c7f72e21192f7f)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm: fix lut value extraction function
Lionel Landwerlin [Tue, 22 Mar 2016 14:10:33 +0000 (14:10 +0000)]
drm: fix lut value extraction function

BugLink: http://bugs.launchpad.net/bugs/1599109
When extracting the value at full precision (16 bits), no need to
round the value.

This was spotted by Jani when running sparse. Unfortunately this fix
doesn't get rid of the warning.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: dri-devel@lists.freedesktop.org
Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1458655833-19547-1-git-send-email-lionel.g.landwerlin@intel.com
(cherry picked from commit 644a80508f918e488aad70814b65b7007438ef4c)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm: atomic helper: do not unreference error pointer
Lionel Landwerlin [Fri, 11 Mar 2016 12:17:26 +0000 (12:17 +0000)]
drm: atomic helper: do not unreference error pointer

BugLink: http://bugs.launchpad.net/bugs/1599109
562c5b4d8986 didn't quite fix the issue of dealing with an error
pointer. We can't free/unref an error pointer so reset it to NULL.

Many thanks to Dan Carpenter for pointing this out again.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: dri-devel@lists.freedesktop.org
Fixes: 562c5b4d8986 ("drm: fix blob pointer check")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1457698646-22231-1-git-send-email-lionel.g.landwerlin@intel.com
(cherry picked from commit c1f415c9acb5877c408d9311eb837d7d50636a68)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm: fix blob pointer check
Lionel Landwerlin [Thu, 10 Mar 2016 12:04:21 +0000 (12:04 +0000)]
drm: fix blob pointer check

BugLink: http://bugs.launchpad.net/bugs/1599109
Check properly that the allocated blob's pointer is valid.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Daniel Stone <daniels@collabora.com>
Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1457611461-9116-1-git-send-email-lionel.g.landwerlin@intel.com
(cherry picked from commit 562c5b4d898613bec97f482098e7507f52c914cb)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm: introduce pipe color correction properties
Lionel Landwerlin [Fri, 26 Feb 2016 17:05:00 +0000 (17:05 +0000)]
drm: introduce pipe color correction properties

BugLink: http://bugs.launchpad.net/bugs/1599109
Patch based on a previous series by Shashank Sharma.

This introduces optional properties to enable color correction at the
pipe level. It relies on 3 transformations applied to every pixels
displayed. First a lookup into a degamma table, then a multiplication
of the rgb components by a 3x3 matrix and finally another lookup into
a gamma table.

The following properties can be added to a pipe :
  - DEGAMMA_LUT : blob containing degamma LUT
  - DEGAMMA_LUT_SIZE : number of elements in DEGAMMA_LUT
  - CTM : transformation matrix applied after the degamma LUT
  - GAMMA_LUT : blob containing gamma LUT
  - GAMMA_LUT_SIZE : number of elements in GAMMA_LUT

DEGAMMA_LUT_SIZE and GAMMA_LUT_SIZE are read only properties, set by
the driver to tell userspace applications what sizes should be the
lookup tables in DEGAMMA_LUT and GAMMA_LUT.

A helper is also provided so legacy gamma correction is redirected
through these new properties.

v2: Register LUT size properties as range

v3: Fix round in drm_color_lut_get_value() helper
    More docs on how degamma/gamma properties are used

v4: Update contributors

v5: Rename CTM_MATRIX property to CTM (Doh!)
    Add legacy gamma_set atomic helper
    Describe CTM/LUT acronyms in the kernel doc

v6: Fix missing blob unref in drm_atomic_helper_crtc_reset

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Kumar, Kiran S <kiran.s.kumar@intel.com>
Signed-off-by: Kausal Malladi <kausalmalladi@gmail.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Acked-by: Rob Bradford <robert.bradford@intel.com>
[danvet: CrOS maintainers are also happy with the userspacde side:
https://codereview.chromium.org/1182063002/ ]
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1456506302-640-4-git-send-email-lionel.g.landwerlin@intel.com
(cherry picked from commit 5488dc16fde74595a40c5d20ae52d978313f0b4e)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoGPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()
Markus Elfring [Fri, 6 Nov 2015 11:03:46 +0000 (12:03 +0100)]
GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()

BugLink: http://bugs.launchpad.net/bugs/1599109
The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns immediately.
Thus the tests around the calls are not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: http://patchwork.freedesktop.org/patch/msgid/563C8B3E.405@users.sourceforge.net
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 5f911905054a64cf8c7871fddd33f4af74f07a17)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm: Add helper for DP++ adaptors
Ville Syrjälä [Fri, 6 May 2016 13:46:52 +0000 (16:46 +0300)]
drm: Add helper for DP++ adaptors

BugLink: http://bugs.launchpad.net/bugs/1599109
Add a helper which aids in the identification of DP dual mode
(aka. DP++) adaptors. There are several types of adaptors
specified: type 1 DVI, type 1 HDMI, type 2 DVI, type 2 HDMI

Type 1 adaptors have a max TMDS clock limit of 165MHz, type 2 adaptors
may go as high as 300MHz and they provide a register informing the
source device what the actual limit is. Supposedly also type 1 adaptors
may optionally implement this register. This TMDS clock limit is the
main reason why we need to identify these adaptors.

Type 1 adaptors provide access to their internal registers and the sink
DDC bus through I2C. Type 2 adaptors provide this access both via I2C
and I2C-over-AUX. A type 2 source device may choose to implement either
of these methods. If a source device implements the I2C-over-AUX
method, then the driver will obviously need specific support for such
adaptors since the port is driven like an HDMI port, but DDC
communication happes over the AUX channel.

This helper should be enough to identify the adaptor type (some
type 1 DVI adaptors may be a slight exception) and the maximum TMDS
clock limit. Another feature that may be available is control over
the TMDS output buffers on the adaptor, possibly allowing for some
power saving when the TMDS link is down.

Other user controllable features that may be available in the adaptors
are downstream i2c bus speed control when using i2c-over-aux, and
some control over the CEC pin. I chose not to provide any helper
functions for those since I have no use for them in i915 at this time.
The rest of the registers in the adaptor are mostly just information,
eg. IEEE OUI, hardware and firmware revision, etc.

v2: Pass adaptor type to helper functions to ease driver implementation
    Fix a bunch of typoes (Paulo)
    Add DRM_DP_DUAL_MODE_UNKNOWN for the case where we don't (yet) know
    the type (Paulo)
    Reject 0x00 and 0xff DP_DUAL_MODE_MAX_TMDS_CLOCK values (Paulo)
    Adjust drm_dp_dual_mode_detect() type2 vs. type1 detection to
    ease future LSPCON enabling
    Remove the unused DP_DUAL_MODE_LAST_RESERVED define
v3: Fix kernel doc function argument descriptions (Jani)
    s/NONE/UNKNOWN/ in drm_dp_dual_mode_detect() docs
    Add kernel doc for enum drm_dp_dual_mode_type
    Actually build the docs
    Fix more typoes
v4: Adjust code indentation of type2 adaptor detection (Shashank)
    Add debug messages for failurs cases (Shashank)
v5: EXPORT_SYMBOL(drm_dp_dual_mode_read) (Paulo)

Cc: stable@vger.kernel.org
Cc: Tore Anderson <tore@fud.no>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com> (v4)
Link: http://patchwork.freedesktop.org/patch/msgid/1462542412-25533-1-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit ede53344dbfd1dd43bfd73eb6af743d37c56a7c3)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit b3daa5ef52c26acd7432c787989bd92d48070c76)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/kms_helper: Add a common place to call init and exit functions.
Rafael Antognolli [Thu, 21 Jan 2016 23:10:18 +0000 (15:10 -0800)]
drm/kms_helper: Add a common place to call init and exit functions.

BugLink: http://bugs.launchpad.net/bugs/1599109
The module_init and module_exit functions will start here, and call the
subsequent init's and exit's.

v10:
 - Keep __init on drm_fb_helper init function.
 - Move MODULE_* macros to the common file.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1453417821-2811-2-git-send-email-rafael.antognolli@intel.com
(cherry picked from commit 70412cfa6ddebcc01e6b01b3fccb6068e48596ac)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/i915: Check VBT for port presence in addition to the strap on VLV/CHV
Ville Syrjälä [Thu, 7 Jul 2016 08:24:29 +0000 (16:24 +0800)]
drm/i915: Check VBT for port presence in addition to the strap on VLV/CHV

BugLink: http://bugs.launchpad.net/bugs/1599379
Apparently some CHV boards failed to hook up the port presence straps
for HDMI ports as well (earlier we assumed this problem only affected
eDP ports). So let's check the VBT in addition to the strap, and if
either one claims that the port is present go ahead and register the
relevant connector.

While at it, change port D to register DP before HDMI as we do for ports
B and C since
commit 457c52d87e5d ("drm/i915: Only ignore eDP ports that are connected")

Also print a debug message when we register a HDMI connector to aid
in diagnosing missing/incorrect ports. We already had such a print for
DP/eDP.

v2: Improve the comment in the code a bit, note the port D change in
    the commit message

Cc: Radoslav Duda <radosd@radosd.com>
Tested-by: Radoslav Duda <radosd@radosd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96321
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464945463-14364-1-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 22f35042593c2b369861f0b9740efb8065a42db0)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(backported from commit a5aac5ab876ad95b7f5e8d862afb07248ee9cae2)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agodrm/i915: Only ignore eDP ports that are connected
Chris Wilson [Thu, 7 Jul 2016 08:24:28 +0000 (16:24 +0800)]
drm/i915: Only ignore eDP ports that are connected

BugLink: http://bugs.launchpad.net/bugs/1599379
If the VBT says that a certain port should be eDP (and hence fused off
from HDMI), but in reality it isn't, we need to try and acquire the HDMI
connection instead. So only trust the VBT edp setting if we can connect
to an eDP device on that port.

Fixes: d2182a6608 (drm/i915: Don't register HDMI connectors for eDP ports on VLV/CHV)
References: https://bugs.freedesktop.org/show_bug.cgi?id=96288
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Phidias Chiang <phidias.chiang@canonical.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464766070-31623-1-git-send-email-chris@chris-wilson.co.uk
(cherry picked from commit 457c52d87e5dac9a4cf1a6a287e60ea7645067d4)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(backported from commit fff7660d1e4f47dc6372ce2bd31a7b8cba0da340)
Signed-off-by: Phidias Chiang <phidias.chiang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: (no-up) scsi: storvsc: Filter out storvsc messages CD-ROM medium not...
Cathy Avery [Sat, 2 Jul 2016 01:44:14 +0000 (21:44 -0400)]
UBUNTU: SAUCE: (no-up) scsi: storvsc: Filter out storvsc messages CD-ROM medium not present

BugLink: http://bugs.launchpad.net/bugs/1590655
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agopowerpc/pseries: Fix PCI config address for DDW
Gavin Shan [Tue, 5 Jul 2016 19:57:46 +0000 (13:57 -0600)]
powerpc/pseries: Fix PCI config address for DDW

BugLink: http://bugs.launchpad.net/bugs/1599250
In commit 8445a87f7092 "powerpc/iommu: Remove the dependency on EEH
struct in DDW mechanism", the PE address was replaced with the PCI
config address in order to remove dependency on EEH. According to PAPR
spec, firmware (pHyp or QEMU) should accept "xxBBSSxx" format PCI config
address, not "xxxxBBSS" provided by the patch. Note that "BB" is PCI bus
number and "SS" is the combination of slot and function number.

This fixes the PCI address passed to DDW RTAS calls.

Fixes: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
Cc: stable@vger.kernel.org # v3.4+
Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 8a934efe94347eee843aeea65bdec8077a79e259)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agopowerpc/iommu: Remove the dependency on EEH struct in DDW mechanism
Guilherme G. Piccoli [Tue, 5 Jul 2016 19:57:45 +0000 (13:57 -0600)]
powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism

BugLink: http://bugs.launchpad.net/bugs/1599250
Commit 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
changed the pci_dn struct by removing its EEH-related members.
As part of this clean-up, DDW mechanism was modified to read the device
configuration address from eeh_dev struct.

As a consequence, now if we disable EEH mechanism on kernel command-line
for example, the DDW mechanism will fail, generating a kernel oops by
dereferencing a NULL pointer (which turns to be the eeh_dev pointer).

This patch just changes the configuration address calculation on DDW
functions to a manual calculation based on pci_dn members instead of
using eeh_dev-based address.

No functional changes were made. This was tested on pSeries, both
in PHyp and qemu guest.

Fixes: 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
Cc: stable@vger.kernel.org # v3.4+
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 8445a87f7092bc8336ea1305be9306f26b846d93)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoRevert "powerpc/eeh: Fix crash in eeh_add_device_early() on Cell"
Guilherme G. Piccoli [Tue, 5 Jul 2016 19:57:44 +0000 (13:57 -0600)]
Revert "powerpc/eeh: Fix crash in eeh_add_device_early() on Cell"

BugLink: http://bugs.launchpad.net/bugs/1599250
This reverts commit 89a51df5ab1d38b257300b8ac940bbac3bb0eb9b.

The function eeh_add_device_early() is used to perform EEH
initialization in devices added later on the system, like in
hotplug/DLPAR scenarios. Since the commit 89a51df5ab1d ("powerpc/eeh:
Fix crash in eeh_add_device_early() on Cell") a new check was introduced
in this function - Cell has no EEH capabilities which led to kernel oops
if hotplug was performed, so checking for eeh_enabled() was introduced
to avoid the issue.

However, in architectures that EEH is present like pSeries or PowerNV,
we might reach a case in which no PCI devices are present on boot time
and so EEH is not initialized. Then, if a device is added via DLPAR for
example, eeh_add_device_early() fails because eeh_enabled() is false,
and EEH end up not being enabled at all.

This reverts the aforementioned patch since a new verification was
introduced by the commit d91dafc02f42 ("powerpc/eeh: Delay probing EEH
device during hotplug") and so the original Cell issue does not happen
anymore.

Cc: stable@vger.kernel.org # v4.1+
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit c2078d9ef600bdbe568c89e5ddc2c6f15b7982c8)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoRevert "UBUNTU: SAUCE: powerpc/eeh: Validate arch in eeh_add_device_early()"
Tim Gardner [Tue, 5 Jul 2016 19:57:43 +0000 (13:57 -0600)]
Revert "UBUNTU: SAUCE: powerpc/eeh: Validate arch in eeh_add_device_early()"

BugLink: http://bugs.launchpad.net/bugs/1599250
This reverts commit 623aabd5d68d9d7c1ed94da92e70d413815a126a.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agos390: fix test_fp_ctl inline assembly contraints
Martin Schwidefsky [Tue, 5 Jul 2016 17:43:27 +0000 (11:43 -0600)]
s390: fix test_fp_ctl inline assembly contraints

BugLink: http://bugs.launchpad.net/bugs/1597971
The test_fp_ctl function is used to test if a given value is a valid
floating-point control. The inline assembly in test_fp_ctl uses an
incorrect constraint for the 'orig_fpc' variable. If the compiler
chooses the same register for 'fpc' and 'orig_fpc' the test_fp_ctl()
function always returns true. This allows user space to trigger
kernel oopses with invalid floating-point control values on the
signal stack.

This problem has been introduced with git commit 4725c86055f5bbdcdf
"s390: fix save and restore of the floating-point-control register"

Cc: stable@vger.kernel.org # v3.13+
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit bcf4dd5f9ee096bd1510f838dd4750c35df4e38b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: (no-up) usb: quirks: Add no-lpm quirk for Elan Microelectronics Touchpad
Joseph Salisbury [Thu, 7 Jul 2016 01:27:27 +0000 (21:27 -0400)]
UBUNTU: SAUCE: (no-up) usb: quirks: Add no-lpm quirk for Elan Microelectronics Touchpad

BugLink: http://bugs.launchpad.net/bugs/1498667
As reported in BugLink, this device has an issue with Linux Power Management so
adding a quirk.  This quirk was reccomended by Alan Stern:

http://lkml.iu.edu/hypermail/linux/kernel/1606.2/05590.html

Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: d-i: Add ehci_msm to usb-modules
Manoj Iyer [Wed, 6 Jul 2016 02:53:22 +0000 (21:53 -0500)]
UBUNTU: d-i: Add ehci_msm to usb-modules

BugLink: http://bugs.launchpad.net/bugs/1599347
Add echi_msm to usb-modules to enable DI to detect USB on Qualcomm
EHCI host controller.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoALSA: hda - hdmi defer to register acomp eld notifier
Libin Yang [Wed, 6 Jul 2016 01:48:07 +0000 (09:48 +0800)]
ALSA: hda - hdmi defer to register acomp eld notifier

BugLink: http://bugs.launchpad.net/bugs/1596871
Defer to register acomp eld notifier until hdmi audio driver
is fully ready.

After registering eld notifier, gfx driver can use this
callback function to notify audio driver the monitor
connection event. However this action may happen when
audio driver is adding the pins or doing other initialization.
This is not always safe, however. For example, using
per_pin->lock before the lock is initialized.

Let's register the eld notifier after the initialization is done.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backport from commit 790b415c98de62602810b0eedce26f0f9d6ddd78)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoALSA: hda - hdmi add wmb barrier for audio component
Libin Yang [Wed, 6 Jul 2016 01:48:06 +0000 (09:48 +0800)]
ALSA: hda - hdmi add wmb barrier for audio component

BugLink: http://bugs.launchpad.net/bugs/1596871
To make sure audio_ptr is set before intel_audio_codec_enable()
or intel_audio_codec_disable() calling pin_eld_notify(),
this patch adds wmb barrier to prevent optimizing.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit ec75a940b1037e877efd9a5a9e94eab1e464f73b)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoALSA: hda - Skip ELD notification during PM process
Takashi Iwai [Wed, 6 Jul 2016 01:48:05 +0000 (09:48 +0800)]
ALSA: hda - Skip ELD notification during PM process

BugLink: http://bugs.launchpad.net/bugs/1596871
The ELD notification can be received asynchronously from the graphics
side, and this may happen just at the moment the sound driver is
processing the suspend or the resume, and it would confuse the whole
procedure.  Since the ELD and connection states are updated in anyway
at the end of the resume, we can skip it when received during PM
process.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit eb399d3c99d8b411bfc46e67ea329ddc1ca64e87)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) Update spl to 0.6.5.6-0ubuntu4
Colin Ian King [Tue, 5 Jul 2016 18:25:03 +0000 (19:25 +0100)]
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.6-0ubuntu4

BugLink: https://bugs.launchpad.net/bugs/1599257
Sync kernel with changes in spl 0.6.5.6-0ubuntu4

This delta just updates the spl splat test module (which is just
used for regression testing), no core spl functionality is changed.
The sync also pulls in some redhat spec files that landed in spl
since the last sync, this are not used either but are included by
the automated sync scripts.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agoUBUNTU: [Config] Enable the AMD Seattle platform
Ricardo Salveti [Tue, 5 Jul 2016 17:28:15 +0000 (11:28 -0600)]
UBUNTU: [Config] Enable the AMD Seattle platform

BugLink: http://bugs.launchpad.net/bugs/1597574
Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Christopher Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>