Commit Graph

638482 Commits

Author SHA1 Message Date
Larson Jiang
3b025d7ff5 bt: add bt support
PD#138714: initial add bt support for gxl and m8b

Change-Id: Ia243a220ec87ff7bb6242f21e8372b90a4f6456b
Signed-off-by: Larson Jiang <larson.jiang@amlogic.com>
2017-04-26 01:18:30 -07:00
Jianxin Pan
9d8654673c defconfig: meson32: enable CONFIG_DEBUG_INFO
PD#141217: enable CONFIG_DEBUG_INFO to add -g to KBUILD_CFLAGS

Change-Id: I4fa030ec02729d58ff5076c3ccf1e6c50385c1a5
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-26 00:10:24 -07:00
Yun Cai
d80fa6e36d clk: add clock measure for m8b
PD#141217: clkmsr support m8baby

Change-Id: Id7e471353f235a6b8f69d46ed0250afe4479990d
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
2017-04-25 23:54:04 -07:00
Yun Cai
224e893fbb clk: m8b add clks for mpll/media/gpu/misc/store/test
PD#141217: add mpll/media/gpu/misc/store/test clks for meson8b

Change-Id: I95268d46395d78419d311f1b9a5add9c593da810
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
2017-04-26 14:19:58 +08:00
Xuhua Zhang
e6f70bd47b i2c: modify i2c config on gxl&gxm.
PD#138714: fix i2c error on gxl/gxm

Change-Id: Ic1e8685b4cf853749808707266d0cec98db99496
Signed-off-by: Xuhua Zhang <xuhua.zhang@amlogic.com>
2017-04-25 16:11:32 +08:00
Zan Peng
aa49a5ed73 remote: add remote driver to meson8b
PD#141217: enable remote driver for meson8b

Change-Id: I0c09ce5a71fdc34eb010d03efd35be683c8d224c
Signed-off-by: Zan Peng <zan.peng@amlogic.com>
2017-04-24 19:34:13 -07:00
Jian Hu
5b92a08fd6 pwm: update pwm driver
PD#138714: update pwm driver

update driver for gxtvbb/gxl/gxm/txl dts parse error

Change-Id: I673e791f1ec46aba2a1916cafeb01526dd90505d
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2017-04-23 23:40:14 -07:00
Yun Cai
9a06b057e8 dts: add gxl skt dts
PD#138714: add gxl_skt.dts

Change-Id: I0ca48f72267eed4f7f4dc2264c7e88483744740f
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
2017-04-21 20:00:02 +08:00
Frank Chen
1b3655bb46 dts: fix i2c pinmux for gxl
PD#138714: fix i2c pinmux

Change-Id: I8956c0910a643ecddea72b6585445d14810850f7
Signed-off-by: Frank Chen <frank.chen@amlogic.com>
2017-04-21 02:19:52 -07:00
Evoke Zhang
c7e263e9af vout: remove FB config for axis sysfs node
PD#138714: remove FB config for axis sysfs node

Change-Id: I2f8c657ef46d184062bb2b09fbc0f2a1ba0770e1
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2017-04-21 00:31:14 -07:00
Victor Wan
d935baa065 Merge branch 'android-4.9' into amlogic-4.9-dev
Conflicts:
	fs/ext4/inode.c
2017-04-21 15:25:31 +08:00
MingLiang Dong
2286b5158a amvecm: add amvecm driver
PD#138714: add amvecm driver

Change-Id: Ieb0be7a4b02b7a8daa549544a97ee23e0daeb6da
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
2017-04-21 14:23:19 +08:00
Evoke Zhang
73f330b0b8 hdmitx: update vmode_is_supported function to avoid invalid mode setting
PD#138714: update vmode_is_supported function to avoid invalid mode setting,
adjust hdmitx probe before vout serve.
also add NULL pointer protection in vout serve API.

Change-Id: I0815dfe35fa00ae8805d0ab6a9ae7b189a1b2af5
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2017-04-20 22:17:21 -07:00
Jianxin Pan
7fca780826 Merge "osd: free uboot logo memory when kernel loaded" into amlogic-4.9-dev 2017-04-20 22:17:10 -07:00
Pengcheng Chen
518bb18904 osd: free uboot logo memory when kernel loaded
PD#139665: free uboot logo memory when kernel loaded

Change-Id: I78c46946f3a06078a41491196a79f72e56cdc795
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-20 22:11:31 -07:00
Jin Qian
67f252c89d ANDROID: uid_sys_stats: reduce update_io_stats overhead
Replaced read_lock with rcu_read_lock to reduce time that preemption
is disabled.

Added a function to update io stats for specific uid and moved
hash table lookup, user_namespace out of loops.

Bug: 37319300
Change-Id: I2b81b5cd3b6399b40d08c3c14b42cad044556970
Signed-off-by: Jin Qian <jinqian@google.com>
2017-04-20 21:47:08 +00:00
Jiebing Li
6b4bbab071 ANDROID: usb: gadget: fix MTP enumeration issue under super speed mode
MTP function doesn't show as a drive in Windows when the device
is connected to PC's USB3 port, because device fails to respond
ACK to BULK OUT transfer request.

This patch modifies MTP OUT request length as multiple of MaxPacketSize
per databook requirement in order to fix this issue.

Patchset: mtp

Change-Id: I090d7880ff00c499dc5ba7fd644b1fe7cd87fcb5
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Wang, Yu <yu.y.wang@intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
2017-04-20 12:43:54 -07:00
Daniel Rosenberg
9560fe633f Revert "Android: sdcardfs: Don't do d_add for lower fs"
This reverts commit ab16e2fd5e.

This change caused issues for sdcardfs on top of vfat

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Change-Id: I34918eed57a8b566c58f8083de12a93a12ba5857
2017-04-20 12:15:22 -07:00
Nanxin Qin
98179834ca media: the regs r/w are removed in the module_init.
PD#138714: fixed the crash when the os booting

Change-Id: I0ffd67b9b85d06db9ffdae83a0cbc4c9bc8f6594
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
2017-04-20 06:41:18 -07:00
Jianxin Pan
283297a47f defconfig: meson64: enable CONFIG_EXTCON
PD#138714: enable CONFIG_EXTCON

Change-Id: Id4c4d118458578ea4b95516e811750bc4aeeb83f
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-20 06:23:53 -07:00
Jianxin Pan
aad3b820d9 timer: enable percpu local timer for m8b
PD#141217: enable  percpu local timer for m8b
1. TimerA ~ TimerD for CPU0 ~ CPU3
2. TimerE is clock source
3. TimerE is delay source
4. hrtimer is enabled

Change-Id: I79b0b73f5ab5ec4d2321faa8ea5cba25e28550b2
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-20 06:19:40 -07:00
Peipeng Zhao
e5ca5f86b9 dts: fix spdif_in and i2c_c_1 dtsi error
PD#138714: fix dts and pinctrl define error

1.fix i2c_c_1 dts and pinctrl define error
2.add spdif in dts and pinctrl funtion

Change-Id: I78809a0f183a55e3a90a17cc326e37fd2c8b7983
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-04-20 15:50:00 +08:00
Frank Chen
25c9d1b76a dts: disable useless devices
PD#138714: disable useless devices on p400 and p401

Change-Id: I7f0d2f4b59cae56814b3a91ceacf4aaac6058e16
Signed-off-by: Frank Chen <frank.chen@amlogic.com>
2017-04-20 12:42:54 +08:00
Daniel Rosenberg
33efe54e61 Android: sdcardfs: Don't complain in fixup_lower_ownership
Not all filesystems support changing the owner of a file.
We shouldn't complain if it doesn't happen.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37488099
Change-Id: I403e44ab7230f176e6df82f6adb4e5c82ce57f33
2017-04-19 15:25:49 -07:00
Daniel Rosenberg
ab16e2fd5e Android: sdcardfs: Don't do d_add for lower fs
For file based encryption, ext4 explicitly does not
create negative dentries for encrypted files. If you
force one over it, the decrypted file will be hidden
until the cache is cleared. Instead, just fail out.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37231161
Change-Id: Id2a9708dfa75e1c22f89915c529789caadd2ca4b
2017-04-19 15:25:49 -07:00
Daniel Rosenberg
480cd3ec0e ANDROID: sdcardfs: ->iget fixes
Adapted from wrapfs
commit 8c49eaa0sb9c ("Wrapfs: ->iget fixes")

Change where we igrab/iput to ensure we always hold a valid lower_inode.
Return ENOMEM (not EACCES) if iget5_locked returns NULL.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35766959

Change-Id: Id8d4e0c0cbc685a0a77685ce73c923e9a3ddc094
2017-04-19 15:25:49 -07:00
Daniel Rosenberg
366b8b8dcb Android: sdcardfs: Change cache GID value
Change-Id: Ieb955dd26493da26a458bc20fbbe75bca32b094f
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37193650
2017-04-19 15:25:49 -07:00
Yonghui Yu
e84d781b45 nand: fix mtd0 erase operation
PD#138714: add erase interface for mtd0(bootloader)

Change-Id: I5d6de9013d9f2c83a218d29e390df58430eeea58
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
2017-04-19 04:37:01 -07:00
Peipeng Zhao
9a2e9f09c0 audio: add i2s capture function and fix pinctrl error
PD#138714: fix i2s in error

1. add aml_i2s_copy_capture for 8 channels
2. fix i2s pinctrl define error
3. add 8channel mic board d601 function on P400/P401 dts

Change-Id: I7b289e9926bded95f2a4e9a24b756363a94ba8dd
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-04-19 15:39:16 +08:00
Jianxin Pan
577cb57584 defconfig: meson32: enable some debug configs
PD#141217: enable configs:
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
+CONFIG_WQ_WATCHDOG=y
+CONFIG_PANIC_ON_RT_THROTTLING=y
+CONFIG_SCHEDSTATS=y
+CONFIG_SCHED_STACK_END_CHECK=y
+CONFIG_TIMER_STATS=y
+CONFIG_DEBUG_ATOMIC_SLEEP=y

Change-Id: Ia3ba9b790e103d4de21d2b92bc2fd4f76f3ebffc
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-18 03:56:50 -07:00
Jianxin Pan
c50a5fcc06 defconfig: meson64: enable some kernel hacking and sync savedefconfig
PD#138714: enable configs and sync savedefconfig
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
+CONFIG_WQ_WATCHDOG=y
+CONFIG_PANIC_ON_RT_THROTTLING=y
+CONFIG_SCHED_STACK_END_CHECK=y
+CONFIG_DEBUG_ATOMIC_SLEEP=y

Change-Id: I5f697a5ebb3444c6136d9e8d91da48910da8cfcf
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-18 03:48:03 -07:00
Pengcheng Chen
ec6391838e osd: fix used kzalloc caused sleep in osd_rdma_irq
PD#138714: fix risk of sleep in atomic

Change-Id: I0af741c0837904e89cb18552fe0242745e53182a
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-18 03:12:45 -07:00
Greg Kroah-Hartman
497947879f Merge 4.9.23 into android-4.9
Changes in 4.9.23:
	drm/i915/gen9: Increase PCODE request timeout to 50ms
	drm/i915: Nuke debug messages from the pipe update critical section
	drm/i915: Avoid tweaking evaluation thresholds on Baytrail v3
	drm/i915: Only enable hotplug interrupts if the display interrupts are enabled
	drm/i915: Drop support for I915_EXEC_CONSTANTS_* execbuf parameters.
	drm/i915: Stop using RP_DOWN_EI on Baytrail
	drm/i915: Avoid rcu_barrier() from reclaim paths (shrinker)
	orangefs: fix memory leak of string 'new' on exit path
	orangefs: Dan Carpenter influenced cleanups...
	orangefs: fix buffer size mis-match between kernel space and user space.
	i2c: bcm2835: Fix hang for writing messages larger than 16 bytes
	rt2x00usb: fix anchor initialization
	rt2x00usb: do not anchor rx and tx urb's
	rt2x00: Fix incorrect usage of CONFIG_RT2X00_LIB_USB
	mtd: bcm47xxpart: fix parsing first block after aligned TRX
	MIPS: Introduce irq_stack
	MIPS: Stack unwinding while on IRQ stack
	MIPS: Only change $28 to thread_info if coming from user mode
	MIPS: Switch to the irq_stack in interrupts
	MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK
	MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch
	crypto: caam - fix RNG deinstantiation error checking
	crypto: caam - fix invalid dereference in caam_rsa_init_tfm()
	Revert "drm/i915/execlists: Reset RING registers upon resume"
	net/packet: fix overflow in check for priv area size
	blk-mq: Avoid memory reclaim when remapping queues
	usb: hub: Wait for connection to be reestablished after port reset
	net/mlx4_en: Fix bad WQE issue
	net/mlx4_core: Fix racy CQ (Completion Queue) free
	net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions
	dma-buf: add support for compat ioctl
	Linux 4.9.23

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-04-18 09:31:20 +02:00
Pengcheng Chen
94b258de6a dts: fix Q200 ion_share_dma_buf_fd failed issue
PD#138714: fix Q200 ion_share_dma_buf_fd failed issue

Change-Id: I9feed9d3190e5c5fb8f39c2c92f93bee94037291
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-17 23:47:20 -07:00
Greg Kroah-Hartman
c3582cc56e Linux 4.9.23 2017-04-18 07:12:30 +02:00
Marek Szyprowski
0ade21a2ed dma-buf: add support for compat ioctl
commit 888022c047 upstream.

Add compat ioctl support to dma-buf. This lets one to use DMA_BUF_IOCTL_SYNC
ioctl from 32bit application on 64bit kernel. Data structures for both 32
and 64bit modes are same, so there is no need for additional translation
layer.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1487683261-2655-1-git-send-email-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:50 +02:00
Jack Morgenstein
27dedde689 net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions
commit 7c3945bc20 upstream.

Save the qp context flags byte containing the flag disabling vlan stripping
in the RESET to INIT qp transition, rather than in the INIT to RTR
transition. Per the firmware spec, the flags in this byte are active
in the RESET to INIT transition.

As a result of saving the flags in the incorrect qp transition, when
switching dynamically from VGT to VST and back to VGT, the vlan
remained stripped (as is required for VST) and did not return to
not-stripped (as is required for VGT).

Fixes: f0f829bf42 ("net/mlx4_core: Add immediate activate for VGT->VST->VGT")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:50 +02:00
Jack Morgenstein
48b2f1dd57 net/mlx4_core: Fix racy CQ (Completion Queue) free
commit 291c566a28 upstream.

In function mlx4_cq_completion() and mlx4_cq_event(), the
radix_tree_lookup requires a rcu_read_lock.
This is mandatory: if another core frees the CQ, it could
run the radix_tree_node_rcu_free() call_rcu() callback while
its being used by the radix tree lookup function.

Additionally, in function mlx4_cq_event(), since we are adding
the rcu lock around the radix-tree lookup, we no longer need to take
the spinlock. Also, the synchronize_irq() call for the async event
eliminates the need for incrementing the cq reference count in
mlx4_cq_event().

Other changes:
1. In function mlx4_cq_free(), replace spin_lock_irq with spin_lock:
   we no longer take this spinlock in the interrupt context.
   The spinlock here, therefore, simply protects against different
   threads simultaneously invoking mlx4_cq_free() for different cq's.

2. In function mlx4_cq_free(), we move the radix tree delete to before
   the synchronize_irq() calls. This guarantees that we will not
   access this cq during any subsequent interrupts, and therefore can
   safely free the CQ after the synchronize_irq calls. The rcu_read_lock
   in the interrupt handlers only needs to protect against corrupting the
   radix tree; the interrupt handlers may access the cq outside the
   rcu_read_lock due to the synchronize_irq calls which protect against
   premature freeing of the cq.

3. In function mlx4_cq_event(), we change the mlx_warn message to mlx4_dbg.

4. We leave the cq reference count mechanism in place, because it is
   still needed for the cq completion tasklet mechanism.

Fixes: 6d90aa5cf1 ("net/mlx4_core: Make sure there are no pending async events when freeing CQ")
Fixes: 225c7b1fee ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:50 +02:00
Eugenia Emantayev
cee26997a6 net/mlx4_en: Fix bad WQE issue
commit 6496bbf0ec upstream.

Single send WQE in RX buffer should be stamped with software
ownership in order to prevent the flow of QP in error in FW
once UPDATE_QP is called.

Fixes: 9f519f68cf ('mlx4_en: Not using Shared Receive Queues')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:50 +02:00
Guenter Roeck
ec0c5f06db usb: hub: Wait for connection to be reestablished after port reset
commit 22547c4cc4 upstream.

On a system with a defective USB device connected to an USB hub,
an endless sequence of port connect events was observed. The sequence
of events as observed is as follows:

- Port reports connected event (port status=USB_PORT_STAT_CONNECTION).
- Event handler debounces port and resets it by calling hub_port_reset().
- hub_port_reset() calls hub_port_wait_reset() to wait for the reset
  to complete.
- The reset completes, but USB_PORT_STAT_CONNECTION is not immediately
  set in the port status register.
- hub_port_wait_reset() returns -ENOTCONN.
- Port initialization sequence is aborted.
- A few milliseconds later, the port again reports a connected event,
  and the sequence repeats.

This continues either forever or, randomly, stops if the connection
is already re-established when the port status is read. It results in
a high rate of udev events. This in turn destabilizes userspace since
the above sequence holds the device mutex pretty much continuously
and prevents userspace from actually reading the device status.

To prevent the problem from happening, let's wait for the connection
to be re-established after a port reset. If the device was actually
disconnected, the code will still return an error, but it will do so
only after the long reset timeout.

Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:50 +02:00
Gabriel Krisman Bertazi
d7045cbf4a blk-mq: Avoid memory reclaim when remapping queues
commit 36e1f3d107 upstream.

While stressing memory and IO at the same time we changed SMT settings,
we were able to consistently trigger deadlocks in the mm system, which
froze the entire machine.

I think that under memory stress conditions, the large allocations
performed by blk_mq_init_rq_map may trigger a reclaim, which stalls
waiting on the block layer remmaping completion, thus deadlocking the
system.  The trace below was collected after the machine stalled,
waiting for the hotplug event completion.

The simplest fix for this is to make allocations in this path
non-reclaimable, with GFP_NOIO.  With this patch, We couldn't hit the
issue anymore.

This should apply on top of Jens's for-next branch cleanly.

Changes since v1:
  - Use GFP_NOIO instead of GFP_NOWAIT.

 Call Trace:
[c000000f0160aaf0] [c000000f0160ab50] 0xc000000f0160ab50 (unreliable)
[c000000f0160acc0] [c000000000016624] __switch_to+0x2e4/0x430
[c000000f0160ad20] [c000000000b1a880] __schedule+0x310/0x9b0
[c000000f0160ae00] [c000000000b1af68] schedule+0x48/0xc0
[c000000f0160ae30] [c000000000b1b4b0] schedule_preempt_disabled+0x20/0x30
[c000000f0160ae50] [c000000000b1d4fc] __mutex_lock_slowpath+0xec/0x1f0
[c000000f0160aed0] [c000000000b1d678] mutex_lock+0x78/0xa0
[c000000f0160af00] [d000000019413cac] xfs_reclaim_inodes_ag+0x33c/0x380 [xfs]
[c000000f0160b0b0] [d000000019415164] xfs_reclaim_inodes_nr+0x54/0x70 [xfs]
[c000000f0160b0f0] [d0000000194297f8] xfs_fs_free_cached_objects+0x38/0x60 [xfs]
[c000000f0160b120] [c0000000003172c8] super_cache_scan+0x1f8/0x210
[c000000f0160b190] [c00000000026301c] shrink_slab.part.13+0x21c/0x4c0
[c000000f0160b2d0] [c000000000268088] shrink_zone+0x2d8/0x3c0
[c000000f0160b380] [c00000000026834c] do_try_to_free_pages+0x1dc/0x520
[c000000f0160b450] [c00000000026876c] try_to_free_pages+0xdc/0x250
[c000000f0160b4e0] [c000000000251978] __alloc_pages_nodemask+0x868/0x10d0
[c000000f0160b6f0] [c000000000567030] blk_mq_init_rq_map+0x160/0x380
[c000000f0160b7a0] [c00000000056758c] blk_mq_map_swqueue+0x33c/0x360
[c000000f0160b820] [c000000000567904] blk_mq_queue_reinit+0x64/0xb0
[c000000f0160b850] [c00000000056a16c] blk_mq_queue_reinit_notify+0x19c/0x250
[c000000f0160b8a0] [c0000000000f5d38] notifier_call_chain+0x98/0x100
[c000000f0160b8f0] [c0000000000c5fb0] __cpu_notify+0x70/0xe0
[c000000f0160b930] [c0000000000c63c4] notify_prepare+0x44/0xb0
[c000000f0160b9b0] [c0000000000c52f4] cpuhp_invoke_callback+0x84/0x250
[c000000f0160ba10] [c0000000000c570c] cpuhp_up_callbacks+0x5c/0x120
[c000000f0160ba60] [c0000000000c7cb8] _cpu_up+0xf8/0x1d0
[c000000f0160bac0] [c0000000000c7eb0] do_cpu_up+0x120/0x150
[c000000f0160bb40] [c0000000006fe024] cpu_subsys_online+0x64/0xe0
[c000000f0160bb90] [c0000000006f5124] device_online+0xb4/0x120
[c000000f0160bbd0] [c0000000006f5244] online_store+0xb4/0xc0
[c000000f0160bc20] [c0000000006f0a68] dev_attr_store+0x68/0xa0
[c000000f0160bc60] [c0000000003ccc30] sysfs_kf_write+0x80/0xb0
[c000000f0160bca0] [c0000000003cbabc] kernfs_fop_write+0x17c/0x250
[c000000f0160bcf0] [c00000000030fe6c] __vfs_write+0x6c/0x1e0
[c000000f0160bd90] [c000000000311490] vfs_write+0xd0/0x270
[c000000f0160bde0] [c0000000003131fc] SyS_write+0x6c/0x110
[c000000f0160be30] [c000000000009204] system_call+0x38/0xec

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Douglas Miller <dougmill@linux.vnet.ibm.com>
Cc: linux-block@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:49 +02:00
Andrey Konovalov
16fc98c247 net/packet: fix overflow in check for priv area size
commit 2b6867c2ce upstream.

Subtracting tp_sizeof_priv from tp_block_size and casting to int
to check whether one is less then the other doesn't always work
(both of them are unsigned ints).

Compare them as is instead.

Also cast tp_sizeof_priv to u64 before using BLK_PLUS_PRIV, as
it can overflow inside BLK_PLUS_PRIV otherwise.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:49 +02:00
Greg Kroah-Hartman
0ee72d8f9b Revert "drm/i915/execlists: Reset RING registers upon resume"
This reverts commit f2a0409a08 which is
commit bafb2f7d47 upstream.

It was reported to have problems.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Eric Blau <eblau1@gmail.com>
Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
2017-04-18 07:11:49 +02:00
Horia Geantă
69fbc505c8 crypto: caam - fix invalid dereference in caam_rsa_init_tfm()
commit 33fa46d7b3 upstream.

In case caam_jr_alloc() fails, ctx->dev carries the error code,
thus accessing it with dev_err() is incorrect.

Fixes: 8c419778ab ("crypto: caam - add support for RSA algorithm")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:49 +02:00
Horia Geantă
75964d0f19 crypto: caam - fix RNG deinstantiation error checking
commit 40c98cb57c upstream.

RNG instantiation was previously fixed by
commit 62743a4145 ("crypto: caam - fix RNG init descriptor ret. code checking")
while deinstantiation was not addressed.

Since the descriptors used are similar, in the sense that they both end
with a JUMP HALT command, checking for errors should be similar too,
i.e. status code 7000_0000h should be considered successful.

Fixes: 1005bccd7a ("crypto: caam - enable instantiation of all RNG4 state handles")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:49 +02:00
Matt Redfearn
91f9f51b18 MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch
commit c25f8064c1 upstream.

Commit dda45f701c ("MIPS: Switch to the irq_stack in interrupts")
changed both the normal and vectored interrupt handlers. Unfortunately
the vectored version, "except_vec_vi_handler", was incorrectly modified
to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to
the vectored handler that has been set up. This is ok for many platforms
which set the vectored handler to plat_irq_dispatch anyway, but will
cause problems with platforms that use other handlers.

Fixes: dda45f701c ("MIPS: Switch to the irq_stack in interrupts")
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15110/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:49 +02:00
Matt Redfearn
aa05503149 MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK
commit 3cc3434fd6 upstream.

Since do_IRQ is now invoked on a separate IRQ stack, we select
HAVE_IRQ_EXIT_ON_IRQ_STACK so that softirq's may be invoked directly
from irq_exit(), rather than requiring do_softirq_own_stack.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14744/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:48 +02:00
Matt Redfearn
e8fa51d31a MIPS: Switch to the irq_stack in interrupts
commit dda45f701c upstream.

When enterring interrupt context via handle_int or except_vec_vi, switch
to the irq_stack of the current CPU if it is not already in use.

The current stack pointer is masked with the thread size and compared to
the base or the irq stack. If it does not match then the stack pointer
is set to the top of that stack, otherwise this is a nested irq being
handled on the irq stack so the stack pointer should be left as it was.

The in-use stack pointer is placed in the callee saved register s1. It
will be saved to the stack when plat_irq_dispatch is invoked and can be
restored once control returns here.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14743/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:48 +02:00
Matt Redfearn
aa6b1dac46 MIPS: Only change $28 to thread_info if coming from user mode
commit 510d86362a upstream.

The SAVE_SOME macro is used to save the execution context on all
exceptions.
If an exception occurs while executing user code, the stack is switched
to the kernel's stack for the current task, and register $28 is switched
to point to the current_thread_info, which is at the bottom of the stack
region.
If the exception occurs while executing kernel code, the stack is left,
and this change ensures that register $28 is not updated. This is the
correct behaviour when the kernel can be executing on the separate irq
stack, because the thread_info will not be at the base of it.

With this change, register $28 is only switched to it's kernel
conventional usage of the currrent thread info pointer at the point at
which execution enters kernel space. Doing it on every exception was
redundant, but OK without an IRQ stack, but will be erroneous once that
is introduced.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14742/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:48 +02:00
Matt Redfearn
86b54e48c4 MIPS: Stack unwinding while on IRQ stack
commit d42d8d106b upstream.

Within unwind stack, check if the stack pointer being unwound is within
the CPU's irq_stack and if so use that page rather than the task's stack
page.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Acked-by: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Maciej W. Rozycki <macro@imgtec.com>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14741/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 07:11:48 +02:00