Commit graph

722539 commits

Author SHA1 Message Date
Yu Chen
80e457699a usb: xhci: fix panic in xhci_free_virt_devices_depth_first
Check vdev->real_port 0 to avoid panic
[    9.261347] [<ffffff800884a390>] xhci_free_virt_devices_depth_first+0x58/0x108
[    9.261352] [<ffffff800884a814>] xhci_mem_cleanup+0x1bc/0x570
[    9.261355] [<ffffff8008842de8>] xhci_stop+0x140/0x1c8
[    9.261365] [<ffffff80087ed304>] usb_remove_hcd+0xfc/0x1d0
[    9.261369] [<ffffff80088551c4>] xhci_plat_remove+0x6c/0xa8
[    9.261377] [<ffffff80086e928c>] platform_drv_remove+0x2c/0x70
[    9.261384] [<ffffff80086e6ea0>] __device_release_driver+0x80/0x108
[    9.261387] [<ffffff80086e7a1c>] device_release_driver+0x2c/0x40
[    9.261392] [<ffffff80086e5f28>] bus_remove_device+0xe0/0x120
[    9.261396] [<ffffff80086e2e34>] device_del+0x114/0x210
[    9.261399] [<ffffff80086e9e00>] platform_device_del+0x30/0xa0
[    9.261403] [<ffffff8008810bdc>] dwc3_otg_work+0x204/0x488
[    9.261407] [<ffffff80088133fc>] event_work+0x304/0x5b8
[    9.261414] [<ffffff80080e31b0>] process_one_work+0x148/0x490
[    9.261417] [<ffffff80080e3548>] worker_thread+0x50/0x4a0
[    9.261421] [<ffffff80080e9ea0>] kthread+0xe8/0x100
[    9.261427] [<ffffff8008083680>] ret_from_fork+0x10/0x50

The problem can occur if xhci_plat_remove() is called shortly after
xhci_plat_probe(). While xhci_free_virt_devices_depth_first been
called before the device has been setup and get real_port initialized.
The problem occurred on Hikey960 and was reproduced by Guenter Roeck
on Kevin with chromeos-4.4.

Fixes: ee8665e28e ("xhci: free xhci virtual devices with leaf nodes first")
Cc: Guenter Roeck <groeck@google.com>
Cc: <stable@vger.kernel.org> # v4.10+
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Fan Ning <fanning4@hisilicon.com>
Signed-off-by: Li Rui <lirui39@hisilicon.com>
Signed-off-by: yangdi <yangdi10@hisilicon.com>
Signed-off-by: Yu Chen <chenyu56@huawei.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-01 15:24:59 +00:00
Mathias Nyman
e4ec40ec4b xhci: Don't show incorrect WARN message about events for empty rings
xHC can generate two events for a short transfer if the short TRB and
last TRB in the TD are not the same TRB.

The driver will handle the TD after the first short event, and remove
it from its internal list. Driver then incorrectly prints a warning
for the second event:

"WARN Event TRB for slot x ep y with no TDs queued"

Fix this by not printing a warning if we get a event on a empty list
if the previous event was a short event.

Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-01 15:24:58 +00:00
Jan Stancek
d9e427f6ab virtio_balloon: fix increment of vb->num_pfns in fill_balloon()
commit c7cdff0e86 ("virtio_balloon: fix deadlock on OOM")
changed code to increment vb->num_pfns before call to
set_page_pfns(), which used to happen only after.

This patch fixes boot hang for me on ppc64le KVM guests.

Fixes: c7cdff0e86 ("virtio_balloon: fix deadlock on OOM")
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Wei Wang <wei.w.wang@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-12-01 16:55:45 +02:00
weiping zhang
e60ea67bb6 virtio: release virtio index when fail to device_register
index can be reused by other virtio device.

Cc: stable@vger.kernel.org
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-12-01 16:55:32 +02:00
Marc-André Lureau
23f1b8d938 fw_cfg: fix driver remove
On driver remove(), all objects created during probe() should be
removed, but sysfs qemu_fw_cfg/rev file was left. Also reorder
functions to match probe() error cleanup code.

Cc: stable@vger.kernel.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-12-01 16:55:09 +02:00
Linus Torvalds
a0651c7fa2 powerpc fixes for 4.15 #3
Two fixes for nasty kexec/kdump crashes in certain configurations.
 
 A couple of minor fixes for the new TIDR code.
 
 A fix for an oops in a CXL error handling path.
 
 Thanks to:
   Andrew Donnellan, Christophe Lombard, David Gibson, Mahesh Salgaonkar, Vaibhav Jain.
 -----BEGIN PGP SIGNATURE-----
 
 iQIwBAABCAAaBQJaITuLExxtcGVAZWxsZXJtYW4uaWQuYXUACgkQUevqPMjhpYBS
 9A/+IYjSoDdTcJXqfR46xn2147RGBQIym2rqaBJd+WwZj8Br0Yap5hrPtr1zAilD
 75aj0CRR0Y91nodnfishjujsJZckyQYOHi0/WQluLbpRlWEmeQt47gDjz70Wt1T8
 BZUEVqPF2k6Mk5WJV6sSIHBtw2uKrl/lJZAUJbTobOWgsMdopO504MkFxvySWKMV
 AX7UEXrcxPLb/yVGk9Ih9iwXxm/ymvQrkljp4s3jWqkc7bWwN93CmimIQ+X6bop0
 yqmAzCiUJsPsulmkBkmsY78llPg0roUrh98R4JIe0+cUiQROa5Kvt/u0zohN/rqS
 6SkPT0ds2Fs1z5cHayyQWMN0j0A5sfwW2KRMLHCJjAwAxzoT2CdMZDv0+QLi0ETy
 RGtYvnew8eCqrfBpyBneEP1JySARJ85ML4rZvudewSHJoMzTkYDnSEKU8+wlqRIf
 KHdvHmErRMlF7OB6Om3Uxz6oIXan/Puj7HsdL8f7MazjFPqb/r+/AuTDzUov17Fs
 7Y0qVawFyJyAJ8zkUAGB1kN2FN+eYnsFxUa7ubpeJY7VX+8pUOwT24rFc803eAu4
 p/ad1CpBy+8xaq83WeaM6BpMqW80ao2BzzbQUhDcEQl4qovO/ZEZxQt0ySoQp+SY
 MqE8SnZMkL/30CasbKTAqmt+P44GCSYZVtOUwTmvLNMTjSg=
 =/LD/
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "Two fixes for nasty kexec/kdump crashes in certain configurations.

  A couple of minor fixes for the new TIDR code.

  A fix for an oops in a CXL error handling path.

  Thanks to: Andrew Donnellan, Christophe Lombard, David Gibson, Mahesh
  Salgaonkar, Vaibhav Jain"

* tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc: Do not assign thread.tidr if already assigned
  powerpc: Avoid signed to unsigned conversion in set_thread_tidr()
  powerpc/kexec: Fix kexec/kdump in P9 guest kernels
  powerpc/powernv: Fix kexec crashes caused by tlbie tracing
  cxl: Check if vphb exists before iterating over AFU devices
2017-12-01 08:40:17 -05:00
Linus Torvalds
ae753ee277 AFS fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIVAwUAWiFCXfSw1s6N8H32AQLtWg/+OWWvsRVmxw3voxdd8jZhSizm9gig40KJ
 BN+nf8eEPniTZPfHhQyoYCdMSOJXm1xfEqAETVvrrPGcatDCbxsKfohZlCMOn0v5
 WCEAdCDy8XBBW1HuCBIKZX85HY6UTNVFIVtP3E+IjoPBjsV+gqUvxUDVLSVH2VIH
 UDyLRtO0Pl9AQS5pshJ7LfCQkwBDiw9Y5lD8DSyq5eAfxgAUFYl4uwCP9/JzZYyp
 +jUW1QfWl9lKh9y//Iz89TSWkaidVYr7YtKptE9uRm0XtNUymh7t5cNJ3ao79P93
 oMZOHHgysl4j5o386str2sVmH76hiWArY56RTjXHMEvtzaMfOn1EuDeszPeAveWU
 ZwAdzeeuDW29DsdjZ/Vl6REnbgeuhsnUkjZUZ+B8k/yCTSH+X1ClP/00Z2RmDsaj
 Tc8EvCcsDCqB8rAa1qGBjDWPCNy4nMhf4yOAAW8qP9eNw7tEYNWMrbhyEh2yXWgd
 1dhcFFYjghXUlKLQvnXnRsUKUi2liOQrUk+wvKYtrL4N6XIdgZRp/hQlKgjpdYxn
 71Qop+dbn1EuOyGkcgpNxM+MPONWEqhavoQ1KawQxFJsBwo2GguzJ78BegEA5BYq
 iCVFS4adBtPGjjhmnCEP7nGqeJEP517YevcMo7Oo8o2XUOHWva5v8xaAK+CisEVM
 IJWmOvzd6rg=
 =1krM
 -----END PGP SIGNATURE-----

Merge tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull AFS fixes from David Howells:
 "Two fix patches for the AFS filesystem:

   - Fix the refcounting on permit caching.

   - AFS inode (afs_vnode) fields need resetting after allocation
     because they're only initialised when slab pages are obtained from
     the page allocator"

* tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  afs: Properly reset afs_vnode (inode) fields
  afs: Fix permit refcounting
2017-12-01 08:36:27 -05:00
Linus Torvalds
3c1c4ddffb MMC core:
- Ensure that debugfs files are removed properly
  - Fix missing blk_put_request()
  - Deal with errors from blk_get_request()
  - Rewind mmc bus suspend operations at failures
  - Prepend '0x' to ocr and pre_eol_info in sysfs to identify as hex
 
 MMC host:
  - sdhci-msm: Make it optional to wait for signal level changes
  - sdhci: Avoid swiotlb buffer being full
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJaISyrAAoJEP4mhCVzWIwp84EP/RATcINow1f9vuIT1FJJ9vUl
 tAIo52Sx/9MEulLTGrfpbPSy0ZaEuNB+o5aMadXJ1YpQlkDkn760muTWA/widr4C
 eriBiBBR6UPI6zTItfgM4JqcrkW6qocEieNTe+mCk968PV0og16hRLMRV8ewlgJO
 QXnw5PrwDYRl6ejB3h1K8LDxyKfW1I7cV8GBluwwKc05wTO1vxcjbCyG2zD16zbz
 Yj7gbN2ttDMSvo9NpvFZFHBMeWWCvfOtlvU4uF5sxbLOmeF06oEJfQgLQnBWdh+j
 wYFuP5CCpzKcaXBMt+AcE8m+Re5oss+eZ7qkojReSh9Mr1iS+41tqjhzEXeD0Ck8
 oS/tCsvNRkXuRjaRins7PQ2cDZ29822vv1kgM6RvHDGrSrTvyNc2jitWSFChjb2W
 ePue5eQQn7jM/C1ThDAt1uDWjIidovcSTCm4T7pFqV6Fy/090AMhY7HzyNjmTwc9
 VkC7umZZt7RWnMS+6hhLLjyX2Oej9XTkLQ6gbiMp2RGpiTvdStqW6ohfUo4xb+9O
 48tR24JjqCbbvTHpqX1agO5sL+R9rjGt7DRwLk+C3s6szpaAmuYyCLZXIIHQaQOY
 eH9oM8wW9iXK7LQR4tPcuuNjTmM4GOCslPMC0XfPdpcvujJwGRT8pjSI/ajPr7dP
 XVdvFhLS3kVMqvJR6rAn
 =13VJ
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - Ensure that debugfs files are removed properly
   - Fix missing blk_put_request()
   - Deal with errors from blk_get_request()
   - Rewind mmc bus suspend operations at failures
   - Prepend '0x' to ocr and pre_eol_info in sysfs to identify as hex

  MMC host:
   - sdhci-msm: Make it optional to wait for signal level changes
   - sdhci: Avoid swiotlb buffer being full"

* tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: core: prepend 0x to OCR entry in sysfs
  mmc: core: prepend 0x to pre_eol_info entry in sysfs
  mmc: sdhci: Avoid swiotlb buffer being full
  mmc: sdhci-msm: Optionally wait for signal level changes
  mmc: block: Ensure that debugfs files are removed
  mmc: core: Do not leave the block driver in a suspended state
  mmc: block: Check return value of blk_get_request()
  mmc: block: Fix missing blk_put_request()
2017-12-01 08:14:22 -05:00
Linus Torvalds
5dc9cbc4f1 amdgpu (+dc), i915, omapdrm, hdlcd, mali and bridge fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaIOVgAAoJEAx081l5xIa+yQUP/0fE//7cnSuF2OIbFIAo8qUd
 BhA3AAD1Q6Rieq0Dvrr6nSjbfmXUfiq9NadjoQutMZiLUc5GwIBImSOeMuNu+vA4
 3PEW9rAXxXrua7xyTODUgriKBSK71J+YsjJP6aGSwp9V3BDBj6O6EHNAyQayWnFW
 xMVYC2gF0gUMYghMRGUcQFOEu8WHfxZpZZtjmUkl8q+uPs0iiIAA+0nHALsz8hcp
 oC+bIeUFz6Bt6yASCzQgzV6vou1uQJwPalSL9I6NQDsDpv86Sqyg6yMFZNUZpY5F
 8706bIl4ArJSqFGXNSSdsREHkt1Vj3IeZWXr5Cf4MklmBfE056xqlxHEzFqyU2vT
 qmcuNkeQuVUCWdh6qzL3pN5GUmSnWQh353fdMLXc4TeUwLmTJu23Z+4z9s38HyJH
 WZSlbiDP1eMT32yiBjBj7o9Q3x4hLrDhfDY3BEC0atAaZ39L+muGI8/I3zrLlElq
 V+9shvzkqsEQPV8pvrIOdAL4rgAtRM0Sq1PaTNyqW8jTXyW3oXU7ygn5LExTJdfb
 Ns6T/oAXAaBgHSbuIBP7ORDa16aqaczSSDgBQYVs2mRRfj8K5ZPIaWT+AQ9Aadm1
 Eo0J1gmnKfhEmUjFAXXQbiX6e1nTbCusXo9E15j1p4oe6exMzwMLU9x439h5mbmh
 eDKAMamt/irpfQ/EZggk
 =RcDz
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes and cleanups from Dave Airlie:
 "The main thing are a bunch of fixes for the new amd display code, a
  bunch of smatch fixes.

  core:
   - Atomic helper regression fix.
   - Deferred fbdev fallout regression fix.

  amdgpu:
   - New display code (dc) dpms, suspend/resume and smatch fixes, along
     with some others
   - Some regression fixes for amdkfd/radeon.
   - Fix a ttm regression for swiotlb disabled

  bridge:
   - A bunch of fixes for the tc358767 bridge

  mali-dp + hdlcd:
   - some fixes and internal API catchups.

  imx-drm:
   -regression fix in atomic code.

  omapdrm:
   - platform detection regression fixes"

* tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux: (76 commits)
  drm/imx: always call wait_for_flip_done in commit_tail
  omapdrm: hdmi4_cec: signedness bug in hdmi4_cec_init()
  drm: omapdrm: Fix DPI on platforms using the DSI VDDS
  omapdrm: hdmi4: Correct the SoC revision matching
  drm/omap: displays: panel-dpi: add backlight dependency
  drm/omap: Fix error handling path in 'omap_dmm_probe()'
  drm/i915: Disable THP until we have a GPU read BW W/A
  drm/bridge: tc358767: fix 1-lane behavior
  drm/bridge: tc358767: fix AUXDATAn registers access
  drm/bridge: tc358767: fix timing calculations
  drm/bridge: tc358767: fix DP0_MISC register set
  drm/bridge: tc358767: filter out too high modes
  drm/bridge: tc358767: do no fail on hi-res displays
  drm/bridge: Fix lvds-encoder since the panel_bridge rework.
  drm/bridge: synopsys/dw-hdmi: Enable cec clock
  drm/bridge: adv7511/33: Fix adv7511_cec_init() failure handling
  drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
  drm/ttm: fix populate_and_map() functions once more
  drm/fb_helper: Disable all crtc's when initial setup fails.
  drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
  ...
2017-12-01 08:10:09 -05:00
Linus Torvalds
75f64f68af Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
 "A selection of fixes/changes that should make it into this series.
  This contains:

   - NVMe, two merges, containing:
        - pci-e, rdma, and fc fixes
        - Device quirks

   - Fix for a badblocks leak in null_blk

   - bcache fix from Rui Hua for a race condition regression where
     -EINTR was returned to upper layers that didn't expect it.

   - Regression fix for blktrace for a bug introduced in this series.

   - blktrace cleanup for cgroup id.

   - bdi registration error handling.

   - Small series with cleanups for blk-wbt.

   - Various little fixes for typos and the like.

  Nothing earth shattering, most important are the NVMe and bcache fixes"

* 'for-linus' of git://git.kernel.dk/linux-block: (34 commits)
  nvme-pci: fix NULL pointer dereference in nvme_free_host_mem()
  nvme-rdma: fix memory leak during queue allocation
  blktrace: fix trace mutex deadlock
  nvme-rdma: Use mr pool
  nvme-rdma: Check remotely invalidated rkey matches our expected rkey
  nvme-rdma: wait for local invalidation before completing a request
  nvme-rdma: don't complete requests before a send work request has completed
  nvme-rdma: don't suppress send completions
  bcache: check return value of register_shrinker
  bcache: recover data from backing when data is clean
  bcache: Fix building error on MIPS
  bcache: add a comment in journal bucket reading
  nvme-fc: don't use bit masks for set/test_bit() numbers
  blk-wbt: fix comments typo
  blk-wbt: move wbt_clear_stat to common place in wbt_done
  blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
  blk-wbt: remove duplicated setting in wbt_init
  nvme-pci: add quirk for delay before CHK RDY for WDC SN200
  block: remove useless assignment in bio_split
  null_blk: fix dev->badblocks leak
  ...
2017-12-01 08:05:45 -05:00
Will Deacon
3a33c76057 arm64: context: Fix comments and remove pointless smp_wmb()
The comments in the ASID allocator incorrectly hint at an MP-style idiom
using the asid_generation and the active_asids array. In fact, the
synchronisation is achieved using a combination of an xchg operation
and a spinlock, so update the comments and remove the pointless smp_wmb().

Cc: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:05:08 +00:00
Yury Norov
770ba06084 arm64: cpu_ops: Add missing 'const' qualifiers
Building the kernel with an LTO-enabled GCC spits out the following "const"
warning for the cpu_ops code:

  mm/percpu.c:2168:20: error: pcpu_fc_names causes a section type conflict
  with dt_supported_cpu_ops
  const char * const pcpu_fc_names[PCPU_FC_NR] __initconst = {
          ^
  arch/arm64/kernel/cpu_ops.c:34:37: note: ‘dt_supported_cpu_ops’ was declared here
  static const struct cpu_operations *dt_supported_cpu_ops[] __initconst = {

Fix it by adding missed const qualifiers.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:05:08 +00:00
Xu YiPing
f8ada18955 arm64: perf: remove unsupported events for Cortex-A73
bus access read/write events are not supported in A73, based on the
Cortex-A73 TRM r0p2, section 11.9 Events (pages 11-457 to 11-460).

Fixes: 5561b6c5e9 "arm64: perf: add support for Cortex-A73"
Acked-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:05:08 +00:00
Dave Martin
9de52a755c arm64: fpsimd: Fix failure to restore FPSIMD state after signals
The fpsimd_update_current_state() function is responsible for
loading the FPSIMD state from the user signal frame into the
current task during sigreturn.  When implementing support for SVE,
conditional code was added to this function in order to handle the
case where SVE state need to be loaded for the task and merged with
the FPSIMD data from the signal frame; however, the FPSIMD-only
case was unintentionally dropped.

As a result of this, sigreturn does not currently restore the
FPSIMD state of the task, except in the case where the system
supports SVE and the signal frame contains SVE state in addition to
FPSIMD state.

This patch fixes this bug by making the copy-in of the FPSIMD data
from the signal frame to thread_struct unconditional.

This remains a performance regression from v4.14, since the FPSIMD
state is now copied into thread_struct and then loaded back,
instead of _only_ being loaded into the CPU FPSIMD registers.
However, it is essential to call task_fpsimd_load() here anyway in
order to ensure that the SVE enable bit in CPACR_EL1 is set
correctly before returning to userspace.  This could use some
refactoring, but since sigreturn is not a fast path I have kept
this patch as a pure fix and left the refactoring for later.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: 8cd969d28f ("arm64/sve: Signal handling support")
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:05:05 +00:00
Jinbum Park
a349b30250 arm64: pgd: Mark pgd_cache as __ro_after_init
pgd_cache is setup once while init stage and never changed after
that, so it is good candidate for __ro_after_init

Signed-off-by: Jinbum Park <jinb.park7@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:05:04 +00:00
Ard Biesheuvel
be0f272bfc arm64: ftrace: emit ftrace-mod.o contents through code
When building the arm64 kernel with both CONFIG_ARM64_MODULE_PLTS and
CONFIG_DYNAMIC_FTRACE enabled, the ftrace-mod.o object file is built
with the kernel and contains a trampoline that is linked into each
module, so that modules can be loaded far away from the kernel and
still reach the ftrace entry point in the core kernel with an ordinary
relative branch, as is emitted by the compiler instrumentation code
dynamic ftrace relies on.

In order to be able to build out of tree modules, this object file
needs to be included into the linux-headers or linux-devel packages,
which is undesirable, as it makes arm64 a special case (although a
precedent does exist for 32-bit PPC).

Given that the trampoline essentially consists of a PLT entry, let's
not bother with a source or object file for it, and simply patch it
in whenever the trampoline is being populated, using the existing
PLT support routines.

Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 13:04:59 +00:00
Ard Biesheuvel
7e8b9c1d2e arm64: module-plts: factor out PLT generation code for ftrace
To allow the ftrace trampoline code to reuse the PLT entry routines,
factor it out and move it into asm/module.h.

Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-12-01 12:30:21 +00:00
David Howells
f8de483e74 afs: Properly reset afs_vnode (inode) fields
When an AFS inode is allocated by afs_alloc_inode(), the allocated
afs_vnode struct isn't necessarily reset from the last time it was used as
an inode because the slab constructor is only invoked once when the memory
is obtained from the page allocator.

This means that information can leak from one inode to the next because
we're not calling kmem_cache_zalloc().  Some of the information isn't
reset, in particular the permit cache pointer.

Bring the clearances up to date.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
2017-12-01 11:51:24 +00:00
David Howells
1bcab12521 afs: Fix permit refcounting
Fix four refcount bugs in afs_cache_permit():

 (1) When checking the result of the kzalloc(), we can't just return, but
     must put 'permits'.

 (2) We shouldn't put permits immediately after hashing a new permit as we
     need to keep the pointer stable so that we can check to see if
     vnode->permit_cache has changed before we decide whether to assign to
     it.

 (3) 'permits' is being put twice.

 (4) We need to put either the replacement or the thing replaced after the
     assignment to vnode->permit_cache.

Without this, lots of the following are seen:

  Kernel BUG at ffffffffa039857b [verbose debug info unavailable]
  ------------[ cut here ]------------
  Kernel BUG at ffffffffa039858a [verbose debug info unavailable]
  ------------[ cut here ]------------

The addresses are in the .text..refcount section of the kafs.ko module.
Following the relocation records for the __ex_table section shows one to be
due to the decrement in afs_put_permits() and the other to be key_get() in
afs_cache_permit().

Occasionally, the following is seen:

  refcount_t overflow at afs_cache_permit+0x57d/0x5c0 [kafs] in cc1[562], uid/euid: 0/0
  WARNING: CPU: 0 PID: 562 at kernel/panic.c:657 refcount_error_report+0x9c/0xac
  ...

Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
2017-12-01 11:40:43 +00:00
Martin Kelly
1cb35a33a2 can: mcba_usb: fix device disconnect bug
Currently, when you disconnect the device, the driver infinitely
resubmits all URBs, so you see:

Rx URB aborted (-32)

in an infinite loop.

Fix this by catching -EPIPE (what we get in urb->status when the device
disconnects) and not resubmitting.

With this patch, I can plug and unplug many times and the driver
recovers correctly.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:27:14 +01:00
Martin Kelly
3fed8dbbc4 can: mcba_usb: fix typo
Fix typo "analizer" --> "Analyzer".

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:27:13 +01:00
Marc Kleine-Budde
29c64b17a0 can: flexcan: fix VF610 state transition issue
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for VF610 to report correct state
transitions.

Tested-by: Mirza Krak <mirza.krak@gmail.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:26:14 +01:00
Marc Kleine-Budde
658f534c03 can: flexcan: Update IRQ Err Passive information
The flexcan IP cores used on MX25 and MX35 do not generate Error Passive
IRQs. Update the IP core overview table in the driver accordingly.

Suggested-by: ZHU Yi (ST-FIR/ENG1-Zhu) <Yi.Zhu5@cn.bosch.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Stephane Grosjean
5c2cb02edf can: peak/pci: fix potential bug when probe() fails
PCI/PCIe drivers for PEAK-System CAN/CAN-FD interfaces do some access to the
PCI config during probing. In case one of these accesses fails, a POSITIVE
PCIBIOS_xxx error code is returned back. This POSITIVE error code MUST be
converted into a NEGATIVE errno for the probe() function to indicate it
failed. Using the pcibios_err_to_errno() function, we make sure that the
return code will always be negative.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Oliver Stäbler
f6c23b174c can: ti_hecc: Fix napi poll return value for repoll
After commit d75b1ade56 ("net: less interrupt masking in NAPI") napi
repoll is done only when work_done == budget.
So we need to return budget if there are still packets to receive.

Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Jimmy Assarsson
8bd13bd522 can: kvaser_usb: ratelimit errors if incomplete messages are received
Avoid flooding the kernel log with "Formate error", if incomplete message
are received.

Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Jimmy Assarsson
e84f44eb55 can: kvaser_usb: Fix comparison bug in kvaser_usb_read_bulk_callback()
The conditon in the while-loop becomes true when actual_length is less than
2 (MSG_HEADER_LEN). In best case we end up with a former, already
dispatched msg, that got msg->len greater than actual_length. This will
result in a "Format error" error printout.

Problem seen when unplugging a Kvaser USB device connected to a vbox guest.

warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]

Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Jimmy Assarsson
435019b480 can: kvaser_usb: free buf in error paths
The allocated buffer was not freed if usb_submit_urb() failed.

Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-12-01 11:20:52 +01:00
Yonghong Song
0ec9552b43 samples/bpf: add error checking for perf ioctl calls in bpf loader
load_bpf_file() should fail if ioctl with command
PERF_EVENT_IOC_ENABLE and PERF_EVENT_IOC_SET_BPF fails.
When they do fail, proper error messages are printed.

With this change, the below "syscall_tp" run shows that
the maximum number of bpf progs attaching to the same
perf tracepoint is indeed enforced.
  $ ./syscall_tp -i 64
  prog #0: map ids 4 5
  ...
  prog #63: map ids 382 383
  $ ./syscall_tp -i 65
  prog #0: map ids 4 5
  ...
  prog #64: map ids 388 389
  ioctl PERF_EVENT_IOC_SET_BPF failed err Argument list too long

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-12-01 02:59:21 +01:00
Yonghong Song
c8c088ba0e bpf: set maximum number of attached progs to 64 for a single perf tp
cgropu+bpf prog array has a maximum number of 64 programs.
Let us apply the same limit here.

Fixes: e87c6bc385 ("bpf: permit multiple bpf attachments for a single perf event")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-12-01 02:56:10 +01:00
Linus Torvalds
df8ba95c57 bug fixes:
- apparmor: fix oops in audit_signal_cb hook
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCgAGBQJaICSrAAoJEAUvNnAY1cPYqJwQAJ7HevfF1/jFGHMJF7cv557H
 8+oux675tr1g5MC0QdkkjPaF/0UbIEktnJaxAId/oCzY7wU/GRiz3iFrsKZC2RVu
 pfvhZ5dqzYblwiqD1d2soIHexO0QnlAkV+monAHM9VbmPK45A6PJn8/2KTUYG7J2
 O/XPp7W5G/fdjVG8zoiX+7Y7P9a+gKLMYQOtM0lxwMhlt5jXzozyuWvFiZ8S8jvw
 F0HrymQGoNeHRfhIhsesP6rNDAW8ywH6702NtQOU/dyHO13I+4zW/PkWQNNwAu7W
 Lg/8xEv5km3eA7H1qtFMSlSSl1T67BGRdo7CQ2kkWE6O6ne+LsbO+P/bFKV1v/9l
 WrLZlPSm5AlW2kWpTInZ1CWqggLUxB7p/jrNH5EJBBuqWAqdmbdHygKThdrT51Vc
 goSPvL/WjnZoJjMyOt3nrDSVvMip0XRD24X7ey2sgdqjkVOLHcLNCWS4iLps4wcb
 4GLQguR7Hf/a6dbSqsdelStQDVw5JIYKrRffnITX9qgi4Ul+Jj99Qxwhh88CGKu/
 8/7ka0/pT5Ag2VcxWGwUbEroHNBU6mj9iBH2wLdvVXBM6TPS3CvjKlulVMXkKjZY
 66k8ZLzEfbHsU3nAW5qVHAp9mm3vmTfSJOVXh83LrKQt/o2lIdzJhZucjWm+qFxu
 Sd0wk4wp679dtWgXKIdd
 =xfD+
 -----END PGP SIGNATURE-----

Merge tag 'apparmor-pr-2017-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor

Pull apparmor bugfix from John Johansen:
 "Fix oops in audit_signal_cb hook marked for stable"

* tag 'apparmor-pr-2017-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
  apparmor: fix oops in audit_signal_cb hook
2017-11-30 18:56:41 -05:00
Linus Torvalds
42062b9882 ACPI fixes for v4.15-rc2
- Fix an ACPI EC driver regression (from the 4.9 cycle) causing
    the driver's power management operations to be omitted during
    system suspend/resume on platforms where the EC instance from the
    ECDT table is used instead of the one from the DSDT (Lv Zheng).
 
  - Prevent modalias from being exposed to user space for ACPI device
    objects with _STA returning 0 (not present and not functional) to
    prevent driver modules from being loaded automatically for
    hardware that is not actually present on some platforms (Hans
    de Goede).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJaIAgnAAoJEILEb/54YlRxiiMP/1rhzfSIAsOZUJktp3fr/fc6
 kBoAKw8sqaTLntWmZMfqMvBtJcaq1x7d+mCqMO2uArp9mppMEz8sCdSxcv2YpRuN
 TPq/Yl78NjUIGxltxPmx6mQRYHwjxLpTzgFqDGL1LwT66+zhA/o3U+gNK0CRywAF
 C36AMtY9EWkKT8hymDv0BeI1VnBLKg7bluIWJ26Ay1BglUPvplTUcCPzX89qwHqF
 061p3/9+DnMPoB6WCFiXPFuSLFQdAd/wgNn1E6EDUFfjOpBB/VHl8Cd469tJT5Np
 0DBQuRIj90Itw4ewVX78z110+LI2fqw7scer5u3mOFHYpYYUohQcGK9NJFKGK+Tb
 6HGaEm0IV4Rp6/23aRva0e8wTCZYvyBuxfrKhvAgUGuXTzehQmN+k+fQdPD688wY
 1oHYE4RoMc3mQWBxcK9Bc+bjN47H4sVVbNkP2/IcHYtAIVA2wUc35PnonmWMX/Hi
 FAKArWxV0KaP0Y6UMpvISq4FnAd6Gbzyw5MoIaANAxVFnVasgpCptOKdmxKbSIcl
 F6LVucLj60S6tNU3nbleNu7eGGBn5z3t/nXMwioR/XoSfVC6duSeCdqdxjwWRYcg
 bbTOg4Zm8S9zYOI7sFId25hR1nwoYLFqSTwzgJNq/Ln01csXh+jRixDnehsmlwWr
 Ca4oJcMImZXGbktyhcOZ
 =dmeF
 -----END PGP SIGNATURE-----

Merge tag 'acpi-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "These fix a regression related to the ACPI EC handling during system
  suspend/resume on some platforms and prevent modalias from being
  exposed to user space for ACPI device object with "not functional and
  not present" status.

  Specifics:

   - Fix an ACPI EC driver regression (from the 4.9 cycle) causing the
     driver's power management operations to be omitted during system
     suspend/resume on platforms where the EC instance from the ECDT
     table is used instead of the one from the DSDT (Lv Zheng).

   - Prevent modalias from being exposed to user space for ACPI device
     objects with _STA returning 0 (not present and not functional) to
     prevent driver modules from being loaded automatically for hardware
     that is not actually present on some platforms (Hans de Goede)"

* tag 'acpi-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / EC: Fix regression related to PM ops support in ECDT device
  ACPI / bus: Leave modalias empty for devices which are not present
2017-11-30 18:49:50 -05:00
Linus Torvalds
0cf710f8c6 Power management fixes for v4.15-rc2
These add missing module information to the Mediatek cpufreq driver
 module (Jesse Chan), fix config dependencies for the Loongson cpufreq
 driver (James Hogan) and fix two issues related to CPU offline in
 the cpupower utility (Abhishek Goel).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJaIAeoAAoJEILEb/54YlRx4wMP/1qqVZqbdIjABZcAzyWy92Rf
 dj78h3JzMY89YtegfQd4dgg+p5/JGvRMhvq7Hroz3pLryRA1EmTzLOs86453eyqp
 VY6B9ER+IaFyaW9dbDrVMpKcvaJuFgX7n2FPfsDzFY4E710NTss9kBjJGbYv+0MD
 CSy0QoK8V6erFrhToxKJsHkvkJaM+zZwCFGU36pVRz5xly4GylgWQ6rsbqlKFVwd
 6kHIm4xQ5e16eE8KROQPQwFk5myEhCg28JwpdHPwGLOwdBGNuoDrwxmIB/56pv/k
 MDUaS98YBcPLgVAjKHAqfL7FsFeli0Agxv9Q9NfkNjg7PSPizDSgJlmoQAnptrka
 WkDQez0Fz3VoTVteaGn9cdpZCSZ+Jr5hevKqMSBl/1EkxsFhcQOn4uLln52ufCsh
 9vUIjmmVc7CGWkxrHcmlyrTpWRVHuRDFw8ybzkbcejZDCs/wXTNIOhzZSyga0Fc5
 LE9+ogvzRLLjSth3PIStX0L2M8VrFoGf4kwRrpOBO/agUJjZFz2ON7mEQJkoxKjm
 iB9L+NdczfJW2vh89NFFlBYS9Gz7XrBTW5Bvc5962hGXgPvvq23yJ/3naGw+JTU1
 nPTaHBzw8S3K+ASTk+P98EPqh3kb2ZAobmR4I6UcJDqfWRj43xIkvRsArJ50H/S2
 odzEKDOggkdeinERbOq8
 =ZzZK
 -----END PGP SIGNATURE-----

Merge tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:

 - add missing module information to the Mediatek cpufreq driver module
   (Jesse Chan)

 - fix config dependencies for the Loongson cpufreq driver (James Hogan)

 - fix two issues related to CPU offline in the cpupower utility
   (Abhishek Goel).

* tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: mediatek: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
  cpufreq: Add Loongson machine dependencies
  cpupower : Fix cpupower working when cpu0 is offline
  cpupowerutils: bench - Fix cpu online check
2017-11-30 18:45:55 -05:00
Linus Torvalds
9c41180be4 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota & reiserfs changes from Jan Kara:

 - two error checking improvements for quota

 - remove bogus i_version increase for reiserfs

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: Check for register_shrinker() failure.
  quota: propagate error from __dquot_initialize
  reiserfs: remove unneeded i_version bump
2017-11-30 18:38:47 -05:00
Dave Airlie
503505bfea Merge branch 'drm-fixes-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
Fixes for 4.15.  Highlights:
- DC fixes for S3, gamma, audio, pageflipping, etc.
- fix a regression in radeon from kfd removal
- fix a ttm regression with swiotlb disabled
- misc other fixes

* 'drm-fixes-4.15' of git://people.freedesktop.org/~agd5f/linux: (36 commits)
  drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
  drm/ttm: fix populate_and_map() functions once more
  drm/amd/display: USB-C / thunderbolt dock specific workaround
  drm/amd/display: Switch to drm_atomic_helper_wait_for_flip_done
  drm/amd/display: fix gamma setting
  drm/amd/display: Do not put drm_atomic_state on resume
  drm/amd/display: Fix couple more inconsistent NULL checks in dc_resource
  drm/amd/display: Fix potential NULL and mem leak in create_links
  drm/amd/display: Fix hubp check in set_cursor_position
  drm/amd/display: Fix use before NULL check in validate_timing
  drm/amd/display: Bunch of smatch error and warning fixes in DC
  drm/amd/display: Fix amdgpu_dm bugs found by smatch
  drm/amd/display: try to find matching audio inst for enc inst first
  drm/amd/display: fix seq issue: turn on clock before programming afmt.
  drm/amd/display: fix memory leaks on error exit return
  drm/amd/display: check plane state before validating fbc
  drm/amd/display: Do DC mode-change check when adding CRTCs
  drm/amd/display: Revert noisy assert messages
  drm/amd/display: fix split viewport rounding error
  drm/amd/display: Check aux channel before MST resume
  ...
2017-12-01 09:15:57 +10:00
Dave Airlie
062076e861 Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-fixes
mali-dp interface cleanups.

* 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld:
  drm: mali-dp: Disable planes when their CRTC gets disabled.
  drm: mali-dp: Separate static internal data into a read-only structure.
  drm/arm: Replace instances of drm_dev_unref with drm_dev_put.
  drm: mali-dp: switch to drm_*_get(), drm_*_put() helpers
2017-12-01 09:15:31 +10:00
Dave Airlie
662e704007 Merge tag 'drm-amdkfd-fixes-2017-11-26' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes
This is amdkfd pull request for -rc2. It contains three small fixes to the
CIK SDMA code, compilation error fix in kfd_ioctl.h and fix to accessing
a pointer after it was released.

* tag 'drm-amdkfd-fixes-2017-11-26' of git://people.freedesktop.org/~gabbayo/linux:
  uapi: fix linux/kfd_ioctl.h userspace compilation errors
  drm/amdkfd: fix amdkfd use-after-free GP fault
  drm/amdkfd: Fix SDMA oversubsription handling
  drm/amdkfd: Fix SDMA ring buffer size calculation
  drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode
2017-12-01 09:14:46 +10:00
Dave Airlie
a42ea78f5b Merge branch 'for-upstream/hdlcd' of git://linux-arm.org/linux-ld into drm-fixes
3 hdlcd fixes/cleanups

* 'for-upstream/hdlcd' of git://linux-arm.org/linux-ld:
  drm/arm: Replace instances of drm_dev_unref with drm_dev_put.
  drm: Fix checkpatch issue: "WARNING: braces {} are not necessary for single statement blocks."
  drm: hdlcd: Update PM code to save/restore console.
2017-12-01 09:14:18 +10:00
Dave Airlie
8503a4c1e3 drm/imx: fix commit_tail for new drm_atomic_helper_setup_commit
Since commit 080de2e5be ("drm/atomic: Check for busy planes/connectors before
 setting the commit"), drm_atomic_helper_setup_commit expects that blocking
 commits have completed flipping before the commit_tail returns. Add the missing
 wait_for_flip_done to commit_tail to ensure this.
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEBsBxhV1FaKwXuCOBUMKIHHCeYOsFAlogMVIXHHAuemFiZWxA
 cGVuZ3V0cm9uaXguZGUACgkQUMKIHHCeYOt+9BAAvhLZw1SvgH/rA8CT+bMKJ9OY
 rX8oEay783wKqZYLbzcE5bEm/EFb6bu64uER53IHeAF9U7YfTrgEixhLw3+qeTJo
 AtvEVhn1nHYxoH1wwsFVVDV6YYlvpGlnirMP+4iYyhhxZDjOA4ia5f7D08pxXta/
 EdaiX7qfOzd1chvk2xkyPhpjl6YrKcm7PrWfzi9gdIrvcseRIZCmLrra6rsT1YxN
 2ind2Vg10fv6fQeCDkmtpto7UoavsWuiTsaqBMC2NOoPT58ENOxJRIZRjzMpHAS4
 Ei8/tuK5TozXTLOSRPMNcRWRDyPEFKNodhZMsjR+62AYE1VKKtCLQ+ftT6z9nrBe
 uBkJHwArTnVj7PhZFQObmrfPZpNfg2i1J00YZlcyiSW6p9Sp2tWBMUEUVnh5nJaw
 O1H0JwDYYFhSVQ6jM30IgH1NJG21MXSckAPFRZmyrEhh13wA4PRbtnjot/tp0quM
 TzAgtB6SqNlKXIwEM06afzmbHDLXkEOmjU1iJHXp8o+xH5FVMVVxupV0M8o+uC10
 G1dE2JQIO5DR9hMD+Z1dWYLSShhs7bDpjlelaNHOKyo8cMomi6K1j944XdD9ykve
 Fzfc35E/S1OGqkj13fIsaXy5li+RRt7NaEfwz0ioIUfpj2XHsmDI7s+e7aS31l2t
 22nLHu81NP+LoGyTBnA=
 =DAk8
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-fixes-2017-11-30' of git://git.pengutronix.de/git/pza/linux into drm-fixes

drm/imx: fix commit_tail for new drm_atomic_helper_setup_commit

Since commit 080de2e5be ("drm/atomic: Check for busy planes/connectors before
setting the commit"), drm_atomic_helper_setup_commit expects that blocking
commits have completed flipping before the commit_tail returns. Add the missing
wait_for_flip_done to commit_tail to ensure this.

* tag 'imx-drm-fixes-2017-11-30' of git://git.pengutronix.de/git/pza/linux:
  drm/imx: always call wait_for_flip_done in commit_tail
2017-12-01 09:11:13 +10:00
Dave Airlie
9f93b78ca9 Merge tag 'drm-intel-fixes-2017-11-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Disable transparent huge pages for now until we have a W/A
- Building fix when CONFIG_BACKLIGHT_CLASS_DEVICE is not selected
- GMBUS communication robustness
- Fbdev hotplug handling fix

gvt-fixes-2017-11-28

- regression fix for sane request alloc (Fred)
- locking fix (Changbin)
- fix invalid addr mask (Xiong)
- compression regression fix (Weinan)
- fix default pipe enable for virtual display (Xiaolin)

* tag 'drm-intel-fixes-2017-11-30' of git://anongit.freedesktop.org/drm/drm-intel:
  drm/i915: Disable THP until we have a GPU read BW W/A
  drm/i915/gvt: Correct ADDR_4K/2M/1G_MASK definition
  drm/i915/gvt: enabled pipe A default on creating vgpu
  drm/i915/gvt: Move request alloc to dispatch_workload path only
  drm/i915/gvt: remove skl_misc_ctl_write handler
  drm/i915/gvt: Fix unsafe locking caused by spin_unlock_bh
  drm/i915: fix intel_backlight_device_register declaration
  drm/i915/fbdev: Serialise early hotplug events with async fbdev config
  drm/i915: Prevent zero length "index" write
  drm/i915: Don't try indexed reads to alternate slave addresses
2017-12-01 09:10:32 +10:00
Dave Airlie
4dc0f7c2c6 omapdrm fixes for 4.15
* Fix platform detection issue causing OMAP3 DPI output to have missing color bits
 * Fix platform detection issue causing OMAP4 HDMI audio not to work
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJaH9/3AAoJEPo9qoy8lh71qb8P/iDw1hXDZEbAkg3Yo9auphKH
 robw6NqL5RHh10ZF+gBidvlGS0+KdXFKHy+rZ+9kQ6ZZr6owiO/nB6+zQsFFqT/n
 PncOgh0QdhAklovuTEbSLxmKI9moUuQVR7qUEKFRQL9UarELQFy0kHeM20B8BuTG
 Wbv/SJKK+aG9OO1roMR8rZ+CcV9Yd3+Q11mV1nvbshV7x2kt1Y00A5ErUt2KUPDh
 UFEmIULvjFQBFcfhp4SB9/X6iwOuyTXHfnAXGJ3hdcF37YbZEyqI3YAKKKusJair
 2ovzUnExDisdoaisTkeD9y+X/SN+vRQJ1tzV912WVse0Uid7G0LHiYT1y0/ZUoia
 Pn0yWmwXnxN63bHFcpR3b21ImdmYeeP6j6Nzsrs3QrYa6acA96le0CeVyBdFXMuI
 0K2nC8l6xkvRSqLUixMzrIgUizvZ3+h9ZGtckTAGPM89tL2FSQ4/dZ2zuMvpxRdt
 UkO521jjDt4ZJREk2V0CQkEjKQWViXmAHcYR2kAWYwl9WumQbOL8JlmNekuud79T
 0tVXao/jE+qdSPO/r7KlzYgydYG6LJYI9l2GcfZ6vs2/CbzudfW0PKkRlHs2XIlt
 WBmKpvKogvysU3XKnJMFeULTBYCbsheuJr9BiLQM4yWYfA9+pcK++IXpXY8tsSGb
 vLm8VifZJ31Ag8gfukIe
 =Dq/y
 -----END PGP SIGNATURE-----

Merge tag 'omapdrm-4.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-fixes

omapdrm fixes for 4.15

* Fix platform detection issue causing OMAP3 DPI output to have missing color bits
* Fix platform detection issue causing OMAP4 HDMI audio not to work

* tag 'omapdrm-4.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  omapdrm: hdmi4_cec: signedness bug in hdmi4_cec_init()
  drm: omapdrm: Fix DPI on platforms using the DSI VDDS
  omapdrm: hdmi4: Correct the SoC revision matching
  drm/omap: displays: panel-dpi: add backlight dependency
  drm/omap: Fix error handling path in 'omap_dmm_probe()'
2017-12-01 09:09:52 +10:00
Dave Airlie
e4b2eb13e0 Merge tag 'drm-misc-fixes-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
drm-misc-fixes for -rc2

- big pile of bridge driver (mostly tc358767), all handled by Archit
  and Andrez
- rockchip dsi fix
- atomic helper regression fix for spurious -EBUSY (Maarten)
- fix deferred fbdev fallout (Maarten)

* tag 'drm-misc-fixes-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/bridge: tc358767: fix 1-lane behavior
  drm/bridge: tc358767: fix AUXDATAn registers access
  drm/bridge: tc358767: fix timing calculations
  drm/bridge: tc358767: fix DP0_MISC register set
  drm/bridge: tc358767: filter out too high modes
  drm/bridge: tc358767: do no fail on hi-res displays
  drm/bridge: Fix lvds-encoder since the panel_bridge rework.
  drm/bridge: synopsys/dw-hdmi: Enable cec clock
  drm/bridge: adv7511/33: Fix adv7511_cec_init() failure handling
  drm/fb_helper: Disable all crtc's when initial setup fails.
  drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
  drm/rockchip: dw-mipi-dsi: fix possible un-balanced runtime PM enable
2017-12-01 09:09:30 +10:00
Peter Rosin
68615eb01f hwmon: (jc42) optionally try to disable the SMBUS timeout
With a nxp,se97 chip on an atmel sama5d31 board, the I2C adapter driver
is not always capable of avoiding the 25-35 ms timeout as specified by
the SMBUS protocol. This may cause silent corruption of the last bit of
any transfer, e.g. a one is read instead of a zero if the sensor chip
times out. This also affects the eeprom half of the nxp-se97 chip, where
this silent corruption was originally noticed. Other I2C adapters probably
suffer similar issues, e.g. bit-banging comes to mind as risky...

The SMBUS register in the nxp chip is not a standard Jedec register, but
it is not special to the nxp chips either, at least the atmel chips
have the same mechanism. Therefore, do not special case this on the
manufacturer, it is opt-in via the device property anyway.

Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Peter Rosin <peda@axentia.se>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-11-30 13:12:44 -08:00
Palmer Dabbelt
0e710ac652 RISC-V: Clean up an unused include
We used to have some cmpxchg syscalls.  They're no longer there, so we
no longer need the include.

CC: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 12:58:29 -08:00
Andrew Waterman
921ebd8f2c RISC-V: Allow userspace to flush the instruction cache
Despite RISC-V having a direct 'fence.i' instruction available to
userspace (which we can't trap!), that's not actually viable when
running on Linux because the kernel might schedule a process on another
hart.  There is no way for userspace to handle this without invoking the
kernel (as it doesn't know the thread->hart mappings), so we've defined
a RISC-V specific system call to flush the instruction cache.

This patch adds both a system call and a VDSO entry.  If possible, we'd
like to avoid having the system call be considered part of the
user-facing ABI and instead restrict that to the VDSO entry -- both just
in general to avoid having additional user-visible ABI to maintain, and
because we'd prefer that users just call the VDSO entry because there
might be a better way to do this in the future (ie, one that doesn't
require entering the kernel).

Signed-off-by: Andrew Waterman <andrew@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 12:58:29 -08:00
Andrew Waterman
08f051eda3 RISC-V: Flush I$ when making a dirty page executable
The RISC-V ISA allows for instruction caches that are not coherent WRT
stores, even on a single hart.  As a result, we need to explicitly flush
the instruction cache whenever marking a dirty page as executable in
order to preserve the correct system behavior.

Local instruction caches aren't that scary (our implementations actually
flush the cache, but RISC-V is defined to allow higher-performance
implementations to exist), but RISC-V defines no way to perform an
instruction cache shootdown.  When explicitly asked to do so we can
shoot down remote instruction caches via an IPI, but this is a bit on
the slow side.

Instead of requiring an IPI to all harts whenever marking a page as
executable, we simply flush the currently running harts.  In order to
maintain correct behavior, we additionally mark every other hart as
needing a deferred instruction cache which will be taken before anything
runs on it.

Signed-off-by: Andrew Waterman <andrew@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 12:58:25 -08:00
Florian Fainelli
6fef90c6b3 net: dsa: bcm_sf2: Set correct CHAIN_ID and slice number mask
When configuring an IPv6 address mask, we should use SLICE_NUM_MASK as
the mask in order to make sure all bits are masked by the hardware.
Also, we want matching entries to have a CHAIN_ID value set to the same
value as the rule index we return to user-space for convenience, so fix
that too.

Fixes: ba0696c22e ("net: dsa: bcm_sf2: Add support for IPv6 CFP rules")
Fixes: dd8eff6834 ("net: dsa: bcm_sf2: Allow matching arbitrary IPv6 masks/lengths")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-30 14:21:35 -05:00
Yonghong Song
2b27941956 tools/bpf: adjust rlimit RLIMIT_MEMLOCK for test_verifier_log
The default rlimit RLIMIT_MEMLOCK is 64KB. In certain cases,
e.g. in a test machine mimicking our production system, this test may
fail due to unable to charge the required memory for prog load:
  # ./test_verifier_log
  Test log_level 0...
  ERROR: Program load returned: ret:-1/errno:1, expected ret:-1/errno:22

Changing the default rlimit RLIMIT_MEMLOCK to unlimited makes
the test always pass.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-11-30 19:55:18 +01:00
Olof Johansson
741fc3ff3a RISC-V: Add missing include
Fixes:

include/asm-generic/mm_hooks.h:20:11: warning: 'struct vm_area_struct' declared inside parameter list will not be visible outside of this definition or declaration
include/asm-generic/mm_hooks.h:19:38: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 10:34:47 -08:00
Olof Johansson
4a41d5dbb0 RISC-V: Use define for get_cycles like other architectures
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 10:12:21 -08:00