sdk/emulator/emulator-kernel.git
10 years agoYaGL: Version bump
Stanislav Vorobiov [Wed, 15 May 2013 09:02:34 +0000 (13:02 +0400)]
YaGL: Version bump

Change-Id: I29b65916421e8718dddb17f357c8b928501135d0

10 years agoVIGS: Fixed GEM reserve deadlock
Stanislav Vorobiov [Mon, 6 May 2013 16:39:28 +0000 (20:39 +0400)]
VIGS: Fixed GEM reserve deadlock

Change-Id: Ic4609ff43ea4689f13a56da41696f6a500d21a64

10 years agoVIGS: Dirty flag support in vigs_surface
Stanislav Vorobiov [Mon, 6 May 2013 14:48:07 +0000 (18:48 +0400)]
VIGS: Dirty flag support in vigs_surface

Dirty flag in vigs_surface is need in order to tell the kernel
that we want contents of VRAM to be uploaded into GPU when the surface
is evicted from VRAM. The flag is automatically cleared whenever
update_gpu command is found in execbuffer

Change-Id: I78e20f541d56ba958c5ac15d00b2ed7a2c841f2d

10 years agoVIGS: Potential deadlock fixed
Stanislav Vorobiov [Tue, 30 Apr 2013 13:10:46 +0000 (17:10 +0400)]
VIGS: Potential deadlock fixed

Change-Id: I6e7bfc824fc637bcc77896919c504da17eddfe2b

10 years agoVIGS: Command list patching implemented
Stanislav Vorobiov [Mon, 29 Apr 2013 14:02:11 +0000 (18:02 +0400)]
VIGS: Command list patching implemented

It's necessary to patch commands such as update_vram and update_gpu
in kernel since only kernel knows about VRAM offset of a surface

Change-Id: Ia4a0f53e768d40d8323cebfe101b8e86c4c21261

10 years agoVIGS: Return some more info for GEMs
Stanislav Vorobiov [Fri, 26 Apr 2013 13:46:03 +0000 (17:46 +0400)]
VIGS: Return some more info for GEMs

Change-Id: Ia7b4ce407e64f36063b21d987c602af6c5ffbc16

10 years agoVIGS: We now send commands to host again
Stanislav Vorobiov [Fri, 26 Apr 2013 10:53:59 +0000 (14:53 +0400)]
VIGS: We now send commands to host again

Host side code is fixed to work via new protocol

Change-Id: I4fd731e07e451923e649d1ba8bda3dd903b94023

10 years agoVIGS: Introduce an idr to generate surface ids
Stanislav Vorobiov [Fri, 26 Apr 2013 06:08:48 +0000 (10:08 +0400)]
VIGS: Introduce an idr to generate surface ids

Using mmap offsets as surface ids is not good since they're 64-bit

Change-Id: I03356f4f5de67153d87cdb73e4c0102b67883793

10 years agoVIGS: Refactoring for DRI2
Stanislav Vorobiov [Wed, 24 Apr 2013 06:48:55 +0000 (10:48 +0400)]
VIGS: Refactoring for DRI2

In order to support DRI2 we must move surfaces from X.Org
into kernel. This implies having additional TTM placement - GPU placement.
We must support eviction in vigs_mman in order to be able to create
surfaces that don't occupy VRAM (Now this is done in X.Org).
Also, command execution must be moved from userland to kernel as well
and we also want to add ability to batch several commands in order
to minimize user-kernel transitions and target-host transitions.

Change-Id: I0a5d3c7627b262c0011c485d8918d125775e9a53

10 years agoYaGL: bump version
Igor Mitsyanko [Fri, 18 Jan 2013 17:20:28 +0000 (21:20 +0400)]
YaGL: bump version

Change-Id: I0ce50b9a42ce26f9dabc519a06cbc4fb2cff7ed5
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
10 years agoVIGS: Protocol updated
Stanislav Vorobiov [Fri, 11 Jan 2013 08:20:10 +0000 (12:20 +0400)]
VIGS: Protocol updated

Change-Id: If8e47f16448a39d5e6e1722fe0f497c03db3d154

10 years agoVIGS: Replace "Virtual" connector with "LVDS"
Stanislav Vorobiov [Wed, 9 Jan 2013 17:09:57 +0000 (21:09 +0400)]
VIGS: Replace "Virtual" connector with "LVDS"

e17 devicemgr seems to depend on it

Change-Id: I0bbe82c5c6ea28a1af69189ab05e4189545f8b1e

10 years agoVIGS: Implemented first version
Stanislav Vorobiov [Tue, 25 Dec 2012 14:29:17 +0000 (18:29 +0400)]
VIGS: Implemented first version

Conflicts:

drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile

Change-Id: I5ef50259bb6820083274baf5088cee236f7a4bf4

10 years agoYaGL: bump version
Igor Mitsyanko [Thu, 13 Dec 2012 13:26:29 +0000 (17:26 +0400)]
YaGL: bump version

Bump version after GLES1 support was merged to QEMU and target parts.

Change-Id: I11e266c393297a9fc2f4212c46000ae77d980f92
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
10 years agoYaGL: Version bump
Stanislav Vorobiov [Wed, 12 Dec 2012 08:01:38 +0000 (12:01 +0400)]
YaGL: Version bump

Change-Id: I117206cb1ba1eae0bf86e482b41bdd52c075458e

10 years agoYaGL: We now report render type to user space
Stanislav Vorobiov [Fri, 7 Dec 2012 09:20:23 +0000 (13:20 +0400)]
YaGL: We now report render type to user space

Change-Id: Iedf70ba5452640a76b68dcbe08dc0e9cdff321ea

10 years agoYaGL: Version bump
Stanislav Vorobiov [Fri, 21 Sep 2012 08:41:53 +0000 (12:41 +0400)]
YaGL: Version bump

Change-Id: Ie977471bf45db15bce21b8fcbe1c6e937c2ef75c

10 years agoYaGL: We can now allocate more than one page for marshalling buffer
Stanislav Vorobiov [Mon, 17 Sep 2012 09:19:58 +0000 (13:19 +0400)]
YaGL: We can now allocate more than one page for marshalling buffer

Change-Id: Ic5d41b2c75248e2440c85be29ab34183d4a26849

10 years agoYaGL: Allow user to specify marshal buffer size
Stanislav Vorobiov [Thu, 13 Sep 2012 13:30:18 +0000 (17:30 +0400)]
YaGL: Allow user to specify marshal buffer size

It still has to be 1 page, to be fixed later

Change-Id: I5c1d8a276922008621a468485f61e69566abd0c6

10 years agoYaGL: version bump
Stanislav Vorobiov [Thu, 13 Sep 2012 07:05:02 +0000 (11:05 +0400)]
YaGL: version bump

Change-Id: I975a676573c24188e96d0066193233e43a9ecd03

10 years agoYaGL: passthrough device added
Stanislav Vorobiov [Mon, 10 Sep 2012 10:10:19 +0000 (14:10 +0400)]
YaGL: passthrough device added

Conflicts:

arch/arm/configs/tizen_defconfig
drivers/gpu/Makefile

Change-Id: I76daea09e8d27338b763109dbfffa674f400e626

10 years agomaru_camera : Add new camera device for Tizen emulator
jinhyung.jo [Thu, 13 Mar 2014 10:05:11 +0000 (19:05 +0900)]
maru_camera : Add new camera device for Tizen emulator

Add new camera device for Tizen emulator

Change-Id: Ie909aad4e7e4ae9009f92f76a1458a37efd93998
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agomaru_overlay : Add new overlay device for Tizen emulator
jinhyung.jo [Thu, 13 Mar 2014 09:48:28 +0000 (18:48 +0900)]
maru_overlay : Add new overlay device for Tizen emulator

Add new overlay device for Tizen emulator

Change-Id: I0bcb64e69d6152b9b1bf3cac1322ab840970ec6c
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agomaru_bl : Add new backlight device for Tizen emulator
jinhyung.jo [Thu, 13 Mar 2014 09:16:29 +0000 (18:16 +0900)]
maru_bl : Add new backlight device for Tizen emulator

Add new backlight(& lcd) device for Tizen emulator

Change-Id: I76299ceac5d347fb69d8f4c6f7c60097d95b9b2a
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
10 years agoSENSOR: removed the warning of __ATTR_RW duplication
Jinhyung Choi [Thu, 27 Feb 2014 08:17:33 +0000 (17:17 +0900)]
SENSOR: removed the warning of __ATTR_RW duplication

Change-Id: Ib77bec32159781acf034c6be8f33ab7907d163f0
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
10 years agomaru: replace virtqueue_add_buf function
GiWoong Kim [Thu, 27 Feb 2014 07:37:53 +0000 (16:37 +0900)]
maru: replace virtqueue_add_buf function

replace virtqueue_add_buf function with add_inbuf
or add_outbuf

Change-Id: I09224954e1d603ea723bc6e4b7c9d64b9f5fa3df
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
10 years agosensor driver: added virtio sensor device
Jinhyung Choi [Thu, 23 Jan 2014 07:59:42 +0000 (16:59 +0900)]
sensor driver: added virtio sensor device

Change-Id: Id68afed696a04c622c84deb1dc9f70e69fbdf355
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
10 years agovdpram: merge vdpram driver.
Sooyoung Ha [Wed, 22 Jan 2014 05:27:51 +0000 (14:27 +0900)]
vdpram: merge vdpram driver.

merge drivers/char/vdpram.c to 3.10 branch.

Change-Id: I3498343fc7811230c7911f7b219ead917938c91a
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
10 years agomaru: add NFC, EVDI driver
Munkyu Im [Tue, 21 Jan 2014 08:43:17 +0000 (17:43 +0900)]
maru: add NFC, EVDI driver

Change-Id: Ibe28c591a31039609a5ad1a10ac99cb471e0099b
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
10 years agobrillcodec: remove deprecated attributes.
Kitae Kim [Tue, 14 Jan 2014 03:09:00 +0000 (12:09 +0900)]
brillcodec: remove deprecated attributes.

The attributes such as __devinit causes compilation errors.
In addition, VM_IO flag is removed because it is set by remap_pfn_range().

Change-Id: I33d69322b304679186fb767948347929600623a4
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: changed module name and config file.
Kitae Kim [Mon, 30 Sep 2013 02:43:50 +0000 (11:43 +0900)]
brillcodec: changed module name and config file.

Change-Id: Idfd67412afcd17bef283bc08867ed409285bd79e
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: add memory disposal routine.
Kitae Kim [Thu, 28 Nov 2013 09:45:28 +0000 (18:45 +0900)]
brillcodec: add memory disposal routine.

When a process has been killed, occupied memory blocks have to be disposed.
In addition to this, add memory disposal routine in case of deinit
to check if there are unleased memory blocks or not.

Change-Id: I6396595497d760cd07290904f4c446838396e7a8
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: fix release memory routine.
Kitae Kim [Thu, 28 Nov 2013 07:27:00 +0000 (16:27 +0900)]
brillcodec: fix release memory routine.

If release memory occurs twice with the same memory offset,
it might cause an error.
semaphore for memory block should be increased in the if-statement.

Change-Id: Ic332eec1e64d5b134b8671b38552b470196e01a0
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: remove unnecessary I/O command.
Kitae Kim [Fri, 22 Nov 2013 10:53:33 +0000 (19:53 +0900)]
brillcodec: remove unnecessary I/O command.

Since file_index is not used to identify codec context,
its i/o command is removed.

Change-Id: Ied7ec997c08eabe9dd981f6bdc359eafc2df81f9
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: unified I/O commands between gst-plugins-emulator and this driver.
Kitae Kim [Wed, 20 Nov 2013 08:13:59 +0000 (17:13 +0900)]
brillcodec: unified I/O commands between gst-plugins-emulator and this driver.

Include write operation in ioctl operation as per its functionality because
using both ioctl and write operation might be confusing to understand control flow.

Change-Id: Iac5445f0e15282f40561cfb62f01db90af803c7e
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: added functions to manage context_id.
Kitae Kim [Tue, 19 Nov 2013 06:53:24 +0000 (15:53 +0900)]
brillcodec: added functions to manage context_id.

This driver does not need to use struct file pointer as a unique id,
because applications derived from gst-plugins-emulator use one file descriptor per a process,
So, it needs to manage id of codec context per a process.

Change-Id: I1a15a602674e5abe0fec9899adfa447222fbc360
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: Change a way to protect critical section.
SeokYeon Hwang [Fri, 15 Nov 2013 10:01:46 +0000 (19:01 +0900)]
brillcodec: Change a way to protect critical section.

Change-Id: Ib63f099bb6d2993da6c946bb70123e454b327b8b
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agobrillcodec: Avoid some multi-threading unsafe issue.
SeokYeon Hwang [Wed, 13 Nov 2013 06:01:51 +0000 (15:01 +0900)]
brillcodec: Avoid some multi-threading unsafe issue.

Change-Id: Idc46d39b0c5044b54ef3a2d5778d2bdb19c98a1e
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agobrillcodec: Remove unused command.
SeokYeon Hwang [Tue, 12 Nov 2013 10:34:55 +0000 (19:34 +0900)]
brillcodec: Remove unused command.

Change-Id: I5a41a14300c0028fef15798cfa272ecf351741b0
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agobrillcodec: enhancement logic about using direct buffer.
SeokYeon Hwang [Tue, 12 Nov 2013 08:15:09 +0000 (17:15 +0900)]
brillcodec: enhancement logic about using direct buffer.

Use a device buffer wisely.
Adjust numbers of buffers.

Change-Id: I726c76ddee4c99d12f7a3b6f629508e227ad4d62
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agobrillcodec: change major ioctl command.
SeokYeon Hwang [Wed, 6 Nov 2013 07:29:37 +0000 (16:29 +0900)]
brillcodec: change major ioctl command.

1. Memory block is chosen by device driver depending on buffer size.
2. Reduce number of ioctl commands.
3. Introduce "try_secure_mem" and source clean-up.

Change-Id: Ie67cb2c2e382322cc842a0bb3af5aca42286577b
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agobrillcodec: source clean-up and store each codec information
Kitae Kim [Thu, 24 Oct 2013 16:44:40 +0000 (01:44 +0900)]
brillcodec: source clean-up and store each codec information

When a process tried to use codec at first, codec device from qemu
copied codec information such as name, media type and etc.
In addtion to this, codec set is determined at libav compile time.
That's why driver stores codec information as a cache.

Change-Id: I4c4734301bc12419ee92d789ddd35d2bc3348cc3
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: disable debug messages.
Kitae Kim [Thu, 24 Oct 2013 05:30:20 +0000 (14:30 +0900)]
brillcodec: disable debug messages.

Debug messages might affect performance, especially on Windows
even if the messages are not printed into klog file.

Change-Id: I11ee2dc9d3173e64267de1c6076f0dd3b0d599e9
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: handle flush_buffer routine.
Kitae Kim [Fri, 18 Oct 2013 02:52:02 +0000 (11:52 +0900)]
brillcodec: handle flush_buffer routine.

Change-Id: I414167e8e14145a1b71d892e8492da60de8983c4
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agobrillcodec: Source clean-up and rename device name.
Kitae Kim [Wed, 11 Sep 2013 11:42:50 +0000 (20:42 +0900)]
brillcodec: Source clean-up and rename device name.

Changed the driver name from newcodec to brillcodec.

Change-Id: I5630c18507c31e79995ed29bd6a736bdcaff10ba
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: source clean-up.
Kitae Kim [Thu, 5 Sep 2013 02:39:10 +0000 (11:39 +0900)]
new_codec: source clean-up.

Change-Id: Iebc004176bef6ce96edd0aa1eba75c00f30372a7
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: modified the method of memory usage to improve performance.
Kitae Kim [Sun, 1 Sep 2013 13:32:28 +0000 (22:32 +0900)]
new_codec: modified the method of memory usage to improve performance.

Separate the memory to use effectively from several regions
when processing mutli contexts.

Change-Id: I4e4269d31aac6ad5ba53e76eedb7c4733e8e95db
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: changed a way to look up available memory block.
Kitae Kim [Thu, 22 Aug 2013 05:31:07 +0000 (14:31 +0900)]
new_codec: changed a way to look up available memory block.

Use a list instead of an array to manage device memory.
In addition, remove useless source in this moudle.

Change-Id: I2f421c8d786ae5edb623713922279d64fe9f8ba2
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: changed cmd messages and source clean-up.
Kitae Kim [Thu, 16 May 2013 01:30:30 +0000 (10:30 +0900)]
new_codec: changed cmd messages and source clean-up.

get version of device module during probing driver.
And remove or change cmd messages.

Change-Id: I09964c7b5a1bdda90b19d6b742f903245e102ef2
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: improved performance as codec reduced the number of memory copies.
SeokYeon Hwang [Wed, 15 May 2013 12:34:54 +0000 (21:34 +0900)]
new_codec: improved performance as codec reduced the number of memory copies.

When giving decoded outbuffer to plugin of user process from device,
use device memory region directly as an buffer to reduce memcpy overheads.

Change-Id: If440dcf304affc47ca4ec2d596a60e2e51963fef
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agonew_codec: change lock routine between user and kernel.
Kitae Kim [Sat, 11 May 2013 08:56:21 +0000 (17:56 +0900)]
new_codec: change lock routine between user and kernel.

Change-Id: Ic82cd689872b862c875a04368a0228313cfa9147
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: modified wrong value assignment.
Kitae Kim [Fri, 10 May 2013 05:02:04 +0000 (14:02 +0900)]
new_codec: modified wrong value assignment.

Change-Id: I6794d820c4b58538bf4ffa6d125460f4dca48f38
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: change device_id
Kitae Kim [Fri, 10 May 2013 02:55:11 +0000 (11:55 +0900)]
new_codec: change device_id

pci_device_id was wrong.

Change-Id: I79f9bb8d124cafd390d4e362a7f3087a7546ed90
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: changed a way to copy data between guest and host.
Kitae Kim [Fri, 10 May 2013 02:24:15 +0000 (11:24 +0900)]
new_codec: changed a way to copy data between guest and host.

Use mutex to reduce frequent context switching from user to kernel.
And removed a routine that occupies device memory exclusively.

Change-Id: I4cb8e0a255bafb3fec6b01307ad31ddc6666ce64
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: change log macro.
Kitae Kim [Wed, 8 May 2013 14:27:29 +0000 (23:27 +0900)]
new_codec: change log macro.

Change-Id: Ia04178bcfa80ab8904bc62c36b0d293539ec31ef
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: source clean-up
Kitae Kim [Fri, 19 Apr 2013 02:52:00 +0000 (11:52 +0900)]
new_codec: source clean-up

Removed unnecessary sources and added a way to check null pointer.

Change-Id: Ib8fef0c7d63921d31265dc12e5e9ca07b893816c
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: remove unnecessary whitespaces and code.
Kitae Kim [Thu, 28 Mar 2013 03:06:48 +0000 (12:06 +0900)]
new_codec: remove unnecessary whitespaces and code.

Change-Id: Ie5f8351ea4ee783c2e78b121326bad9e21658c12
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agonew_codec: added new codec driver module.
Kitae Kim [Tue, 12 Mar 2013 10:50:04 +0000 (19:50 +0900)]
new_codec: added new codec driver module.

Change-Id: I11f4959d4abbddd4aff33aea5812fe700aafdb72
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
10 years agokeyboard: added Maru virtio keyboard driver
GiWoong Kim [Thu, 9 Jan 2014 07:10:50 +0000 (16:10 +0900)]
keyboard: added Maru virtio keyboard driver

Change-Id: I9372dee6c75e6580cbf944e0a3c3f41610c822c3
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
10 years agohwkey: added Maru virtio hwkey driver
GiWoong Kim [Thu, 9 Jan 2014 03:14:24 +0000 (12:14 +0900)]
hwkey: added Maru virtio hwkey driver

Change-Id: I90f8409eb62c2b52f9c9787f88d3df450ca4db45
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
10 years agotouchscreen: modified input_mt_init_slots argument
GiWoong Kim [Wed, 8 Jan 2014 06:57:29 +0000 (15:57 +0900)]
touchscreen: modified input_mt_init_slots argument

Depending on the flags set, it also performs pointer
emulation and frame synchronization.

Change-Id: I600bb335a8839fdb2c9860503e2244bbfdd709ff
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
Conflicts:
drivers/maru/maru_virtio_touchscreen.c

10 years agovirtio: added Maru device ids
GiWoong Kim [Wed, 8 Jan 2014 06:56:01 +0000 (15:56 +0900)]
virtio: added Maru device ids

Change-Id: Ia6b3ae3412bb936d3302410364b211c1f629b34f
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
10 years agoAdd "maru virtio touchscreen" to build.
SeokYeon Hwang [Wed, 8 Jan 2014 05:04:48 +0000 (14:04 +0900)]
Add "maru virtio touchscreen" to build.

Change-Id: I133b224afdabc8d11de086ad19c1615bf1e719d5
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
10 years agoPrepare initial structure for maru
SeokYeon Hwang [Wed, 8 Jan 2014 04:58:06 +0000 (13:58 +0900)]
Prepare initial structure for maru

Change-Id: I4a6f9d3d862a85668917e058f28d3936dd4fed57
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Conflicts:
drivers/Kconfig
drivers/Makefile

10 years agoLinux 3.12.17
Jiri Slaby [Sat, 22 Mar 2014 21:02:40 +0000 (22:02 +0100)]
Linux 3.12.17

10 years agonetfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
Daniel Borkmann [Sun, 5 Jan 2014 23:57:54 +0000 (00:57 +0100)]
netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages

commit b22f5126a24b3b2f15448c3f2a254fc10cbc2b92 upstream.

Some occurences in the netfilter tree use skb_header_pointer() in
the following way ...

  struct dccp_hdr _dh, *dh;
  ...
  skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);

... where dh itself is a pointer that is being passed as the copy
buffer. Instead, we need to use &_dh as the forth argument so that
we're copying the data into an actual buffer that sits on the stack.

Currently, we probably could overwrite memory on the stack (e.g.
with a possibly mal-formed DCCP packet), but unintentionally, as
we only want the buffer to be placed into _dh variable.

Fixes: 2bc780499aa3 ("[NETFILTER]: nf_conntrack: add DCCP protocol support")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agomm: close PageTail race
David Rientjes [Mon, 3 Mar 2014 23:38:18 +0000 (15:38 -0800)]
mm: close PageTail race

commit 668f9abbd4334e6c29fa8acd71635c4f9101caa7 upstream.

Commit bf6bddf1924e ("mm: introduce compaction and migration for
ballooned pages") introduces page_count(page) into memory compaction
which dereferences page->first_page if PageTail(page).

This results in a very rare NULL pointer dereference on the
aforementioned page_count(page).  Indeed, anything that does
compound_head(), including page_count() is susceptible to racing with
prep_compound_page() and seeing a NULL or dangling page->first_page
pointer.

This patch uses Andrea's implementation of compound_trans_head() that
deals with such a race and makes it the default compound_head()
implementation.  This includes a read memory barrier that ensures that
if PageTail(head) is true that we return a head page that is neither
NULL nor dangling.  The patch then adds a store memory barrier to
prep_compound_page() to ensure page->first_page is set.

This is the safest way to ensure we see the head page that we are
expecting, PageTail(page) is already in the unlikely() path and the
memory barriers are unfortunately required.

Hugetlbfs is the exception, we don't enforce a store memory barrier
during init since no race is possible.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonet: mvneta: fix usage as a module on RGMII configurations
Thomas Petazzoni [Tue, 25 Mar 2014 23:25:42 +0000 (00:25 +0100)]
net: mvneta: fix usage as a module on RGMII configurations

commit e3a8786c10e75903f1269474e21fe8cb49c3a670 upstream.

Commit 5445eaf309ff ('mvneta: Try to fix mvneta when compiled as
module') fixed the mvneta driver to make it work properly when loaded
as a module in SGMII configuration, which was tested successful by the
author on the Armada XP OpenBlocks AX3, which uses SGMII.

However, it turns out that the Armada XP GP, which uses RGMII, is
affected by a similar problem: its SERDES configuration is lost when
mvneta is loaded as a module, because this configuration is set by the
bootloader, and then lost because the clock is gated by the clock
framework until the mvneta driver is loaded again and the clock is
re-enabled.

However, it turns out that for the RGMII case, setting the SERDES
configuration is not sufficient: the PCS enable bit in the
MVNETA_GMAC_CTRL_2 register must also be set, like in the SGMII
configuration.

Therefore, this commit reworks the SGMII/RGMII initialization: the
only difference between the two now is a different SERDES
configuration, all the rest is identical.

In detail, to achieve this, the commit:

 * Renames MVNETA_SGMII_SERDES_CFG to MVNETA_SERDES_CFG because it is
   not specific to SGMII, but also used on RGMII configurations.

 * Adds a MVNETA_RGMII_SERDES_PROTO definition, that must be used as
   the MVNETA_SERDES_CFG value in RGMII configurations.

 * Removes the mvneta_gmac_rgmii_set() and mvneta_port_sgmii_config()
   functions, and instead directly do the SGMII/RGMII configuration in
   mvneta_port_up(), from where those functions where called. It is
   worth mentioning that mvneta_gmac_rgmii_set() had an 'enable'
   parameter that was always passed as '1', so it was pretty useless.

 * Reworks the mvneta_port_up() function to set the MVNETA_SERDES_CFG
   register to the appropriate value depending on the RGMII vs. SGMII
   configuration. It also unconditionally set the PCS_ENABLE bit (was
   already done for SGMII, but is now also needed for RGMII), and sets
   the PORT_RGMII bit (which was already done for both SGMII and
   RGMII).

This commit was successfully tested with mvneta compiled as a module,
on both the OpenBlocks AX3 (SGMII configuration) and the Armada XP GP
(RGMII configuration).

Reported-by: Steve McIntyre <steve@einval.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonet: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE
Thomas Petazzoni [Tue, 25 Mar 2014 23:25:41 +0000 (00:25 +0100)]
net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE

commit a79121d3b57e7ad61f0b5d23eae05214054f3ccd upstream.

Bit 3 of the MVNETA_GMAC_CTRL_2 is actually used to enable the PCS,
not the PSC: there was a typo in the name of the define, which this
commit fixes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agomake prepend_name() work correctly when called with negative *buflen
Al Viro [Sun, 23 Mar 2014 04:28:40 +0000 (00:28 -0400)]
make prepend_name() work correctly when called with negative *buflen

commit e825196d48d2b89a6ec3a8eff280098d2a78207e upstream.

In all callchains leading to prepend_name(), the value left in *buflen
is eventually discarded unused if prepend_name() has returned a negative.
So we are free to do what prepend() does, and subtract from *buflen
*before* checking for underflow (which turns into checking the sign
of subtraction result, of course).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agox86: fix boot on uniprocessor systems
Artem Fetishev [Fri, 28 Mar 2014 20:33:39 +0000 (13:33 -0700)]
x86: fix boot on uniprocessor systems

commit 825600c0f20e595daaa7a6dd8970f84fa2a2ee57 upstream.

On x86 uniprocessor systems topology_physical_package_id() returns -1
which causes rapl_cpu_prepare() to leave rapl_pmu variable uninitialized
which leads to GPF in rapl_pmu_init().

See arch/x86/kernel/cpu/perf_event_intel_rapl.c.

It turns out that physical_package_id and core_id can actually be
retreived for uniprocessor systems too.  Enabling them also fixes
rapl_pmu code.

Signed-off-by: Artem Fetishev <artem_fetishev@epam.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/i915: Undo gtt scratch pte unmapping again
Daniel Vetter [Wed, 26 Mar 2014 19:10:09 +0000 (20:10 +0100)]
drm/i915: Undo gtt scratch pte unmapping again

commit 8ee661b505613ef2747b350ca2871a31b3781bee upstream.

It apparently blows up on some machines. This functionally reverts

commit 828c79087cec61eaf4c76bb32c222fbe35ac3930
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Wed Oct 16 09:21:30 2013 -0700

    drm/i915: Disable GGTT PTEs on GEN6+ suspend

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64841
Reported-and-Tested-by: Brad Jackson <bjackson0971@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Todd Previte <tprevite@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoi2c: cpm: Fix build by adding of_address.h and of_irq.h
Scott Wood [Tue, 18 Mar 2014 21:10:24 +0000 (16:10 -0500)]
i2c: cpm: Fix build by adding of_address.h and of_irq.h

commit 5f12c5eca6e6b7aeb4b2028d579f614b4fe7a81f upstream.

Fixes a build break due to the undeclared use of irq_of_parse_and_map()
and of_iomap().  This build break was apparently introduced while the
driver was unbuildable due to the bug fixed by
62c19c9d29e65086e5ae76df371ed2e6b23f00cd ("i2c: Remove usage of
orphaned symbol OF_I2C").  When 62c19c was added in v3.14-rc7,
the driver was enabled again, breaking the powerpc mpc85xx_defconfig
and mpc85xx_smp_defconfig.

62c19c is marked for stable, so this should go there as well.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoRevert "xen: properly account for _PAGE_NUMA during xen pte translations"
David Vrabel [Tue, 25 Mar 2014 10:38:37 +0000 (10:38 +0000)]
Revert "xen: properly account for _PAGE_NUMA during xen pte translations"

commit 5926f87fdaad4be3ed10cec563bf357915e55a86 upstream.

This reverts commit a9c8e4beeeb64c22b84c803747487857fe424b68.

PTEs in Xen PV guests must contain machine addresses if _PAGE_PRESENT
is set and pseudo-physical addresses is _PAGE_PRESENT is clear.

This is because during a domain save/restore (migration) the page
table entries are "canonicalised" and uncanonicalised". i.e., MFNs are
converted to PFNs during domain save so that on a restore the page
table entries may be rewritten with the new MFNs on the destination.
This canonicalisation is only done for PTEs that are present.

This change resulted in writing PTEs with MFNs if _PAGE_PROTNONE (or
_PAGE_NUMA) was set but _PAGE_PRESENT was clear.  These PTEs would be
migrated as-is which would result in unexpected behaviour in the
destination domain.  Either a) the MFN would be translated to the
wrong PFN/page; b) setting the _PAGE_PRESENT bit would clear the PTE
because the MFN is no longer owned by the domain; or c) the present
bit would not get set.

Symptoms include "Bad page" reports when munmapping after migrating a
domain.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoxen/balloon: flush persistent kmaps in correct position
Wei Liu [Sat, 15 Mar 2014 16:11:47 +0000 (16:11 +0000)]
xen/balloon: flush persistent kmaps in correct position

commit 09ed3d5ba06137913960f9c9385f71fc384193ab upstream.

Xen balloon driver will update ballooned out pages' P2M entries to point
to scratch page for PV guests. In 24f69373e2 ("xen/balloon: don't alloc
page while non-preemptible", kmap_flush_unused was moved after updating
P2M table. In that case for 32 bit PV guest we might end up with

  P2M    X -----> S  (S is mfn of balloon scratch page)
  M2P    Y -----> X  (Y is mfn in persistent kmap entry)

kmap_flush_unused() iterates through all the PTEs in the kmap address
space, using pte_to_page() to obtain the page. If the p2m and the m2p
are inconsistent the incorrect page is returned.  This will clear
page->address on the wrong page which may cause subsequent oopses if
that page is currently kmap'ed.

Move the flush back between get_page and __set_phys_to_machine to fix
this.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoInput: cypress_ps2 - don't report as a button pads
Hans de Goede [Wed, 26 Mar 2014 20:30:52 +0000 (13:30 -0700)]
Input: cypress_ps2 - don't report as a button pads

commit 6797b39e6f6f34c74177736e146406e894b9482b upstream.

The cypress PS/2 trackpad models supported by the cypress_ps2 driver
emulate BTN_RIGHT events in firmware based on the finger position, as part
of this no motion events are sent when the finger is in the button area.

The INPUT_PROP_BUTTONPAD property is there to indicate to userspace that
BTN_RIGHT events should be emulated in userspace, which is not necessary
in this case.

When INPUT_PROP_BUTTONPAD is advertised userspace will wait for a motion
event before propagating the button event higher up the stack, as it needs
current abs x + y data for its BTN_RIGHT emulation. Since in the
cypress_ps2 pads don't report motion events in the button area, this means
that clicks in the button area end up being ignored, so
INPUT_PROP_BUTTONPAD actually causes problems for these touchpads, and
removing it fixes:

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

Reported-by: Adam Williamson <awilliam@redhat.com>
Tested-by: Adam Williamson <awilliam@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoInput: synaptics - add manual min/max quirk for ThinkPad X240
Hans de Goede [Fri, 28 Mar 2014 08:01:38 +0000 (01:01 -0700)]
Input: synaptics - add manual min/max quirk for ThinkPad X240

commit 8a0435d958fb36d93b8df610124a0e91e5675c82 upstream.

This extends Benjamin Tissoires manual min/max quirk table with support for
the ThinkPad X240.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoInput: synaptics - add manual min/max quirk
Benjamin Tissoires [Fri, 28 Mar 2014 07:43:00 +0000 (00:43 -0700)]
Input: synaptics - add manual min/max quirk

commit 421e08c41fda1f0c2ff6af81a67b491389b653a5 upstream.

The new Lenovo Haswell series (-40's) contains a new Synaptics touchpad.
However, these new Synaptics devices report bad axis ranges.
Under Windows, it is not a problem because the Windows driver uses RMI4
over SMBus to talk to the device. Under Linux, we are using the PS/2
fallback interface and it occurs the reported ranges are wrong.

Of course, it would be too easy to have only one range for the whole
series, each touchpad seems to be calibrated in a different way.

We can not use SMBus to get the actual range because I suspect the firmware
will switch into the SMBus mode and stop talking through PS/2 (this is the
case for hybrid HID over I2C / PS/2 Synaptics touchpads).

So as a temporary solution (until RMI4 land into upstream), start a new
list of quirks with the min/max manually set.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoInput: mousedev - fix race when creating mixed device
Dmitry Torokhov [Thu, 6 Mar 2014 20:57:24 +0000 (12:57 -0800)]
Input: mousedev - fix race when creating mixed device

commit e4dbedc7eac7da9db363a36f2bd4366962eeefcc upstream.

We should not be using static variable mousedev_mix in methods that can be
called before that singleton gets assigned. While at it let's add open and
close methods to mousedev structure so that we do not need to test if we
are dealing with multiplexor or normal device and simply call appropriate
method directly.

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

Reported-by: GiulioDP <depasquale.giulio@gmail.com>
Tested-by: GiulioDP <depasquale.giulio@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoext4: atomically set inode->i_flags in ext4_set_inode_flags()
Theodore Ts'o [Sun, 30 Mar 2014 14:20:01 +0000 (10:20 -0400)]
ext4: atomically set inode->i_flags in ext4_set_inode_flags()

commit 00a1a053ebe5febcfc2ec498bd894f035ad2aa06 upstream.

Use cmpxchg() to atomically set i_flags instead of clearing out the
S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
where an immutable file has the immutable flag cleared for a brief
window of time.

Reported-by: John Sullivan <jsrhbz@kanargh.force9.co.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agos390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC
Martin Schwidefsky [Mon, 2 Dec 2013 17:00:36 +0000 (18:00 +0100)]
s390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC

commit ca5de58ba746b08c920b2024aaf01aa1500b110d upstream.

With git commit 79c74ecbebf76732f91b82a62ce7fc8a88326962
"s390/time,vdso: convert to the new update_vsyscall interface"
the new update_vsyscall function already does the sum of xtime
and wall_to_monotonic. The old update_vsyscall function only
copied the wall_to_monotonic offset. The vdso code needs to be
modified to take this into consideration.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoInput: wacom - add support for three new Intuos Pro devices
Ping Cheng [Thu, 27 Mar 2014 22:40:02 +0000 (15:40 -0700)]
Input: wacom - add support for three new Intuos Pro devices

commit b5fd2a3e92ca5c8c1f3c20d31ac5daed3ec4d604 upstream.

Two tablets in this series support both pen and touch. One (Intuos S)
only supports pen. This patch also updates the driver to process wireless
devices that do not support touch interface.

Tested-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoipvs: fix AF assignment in ip_vs_conn_new()
Michal Kubecek [Thu, 30 Jan 2014 07:50:20 +0000 (08:50 +0100)]
ipvs: fix AF assignment in ip_vs_conn_new()

commit 2a971354e74f3837d14b9c8d7f7983b0c9c330e4 upstream.

If a fwmark is passed to ip_vs_conn_new(), it is passed in
vaddr, not daddr. Therefore we should set AF to AF_UNSPEC in
vaddr assignment (like we do in ip_vs_ct_in_get()), otherwise we
may copy only first 4 bytes of an IPv6 address into cp->daddr.

Signed-off-by: Bogdano Arendartchuk <barendartchuk@suse.com>
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoFS-Cache: Handle removal of unadded object to the fscache_object_list rb tree
David Howells [Mon, 17 Feb 2014 15:01:47 +0000 (15:01 +0000)]
FS-Cache: Handle removal of unadded object to the fscache_object_list rb tree

commit 7026f1929e18921fd67bf478f475a8fdfdff16ae upstream.

When FS-Cache allocates an object, the following sequence of events can
occur:

 -->fscache_alloc_object()
    -->cachefiles_alloc_object() [via cache->ops->alloc_object]
    <--[returns new object]
    -->fscache_attach_object()
    <--[failed]
    -->cachefiles_put_object() [via cache->ops->put_object]
       -->fscache_object_destroy()
          -->fscache_objlist_remove()
             -->rb_erase() to remove the object from fscache_object_list.

resulting in a crash in the rbtree code.

The problem is that the object is only added to fscache_object_list on
the success path of fscache_attach_object() where it calls
fscache_objlist_add().

So if fscache_attach_object() fails, the object won't have been added to
the objlist rbtree.  We do, however, unconditionally try to remove the
object from the tree.

Thanks to NeilBrown for finding this and suggesting this solution.

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: (a customer of) NeilBrown <neilb@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodlm: set zero linger time on sctp socket
Dongmao Zhang [Tue, 10 Dec 2013 16:52:22 +0000 (10:52 -0600)]
dlm: set zero linger time on sctp socket

commit ece35848c1847cdf3dd07954578d3e99238ebbae upstream.

The recovery time for a failed node was taking a long
time because the failed node could not perform the full
shutdown process.  Removing the linger time speeds this
up.  The dlm does not care what happens to messages to
or from the failed node.

Signed-off-by: Dongmao Zhang <dmzhang@suse.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoNFSv4.1 free slot before resending I/O to MDS
Andy Adamson [Wed, 29 Jan 2014 16:34:38 +0000 (11:34 -0500)]
NFSv4.1 free slot before resending I/O to MDS

commit f9c96fcc501a43dbc292b17fc0ded4b54e63b79d upstream.

Fix a dynamic session slot leak where a slot is preallocated and I/O is
resent through the MDS.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING
Jeff Layton [Tue, 28 Jan 2014 18:47:46 +0000 (13:47 -0500)]
nfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING

commit 4db72b40fdbc706f8957e9773ae73b1574b8c694 upstream.

If the setting of NFS_INO_INVALIDATING gets reordered to before the
clearing of NFS_INO_INVALID_DATA, then another task may hit a race
window where both appear to be clear, even though the inode's pages are
still in need of invalidation. Fix this by adding the appropriate memory
barriers.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoNFS: Fix races in nfs_revalidate_mapping
Trond Myklebust [Tue, 28 Jan 2014 14:37:16 +0000 (09:37 -0500)]
NFS: Fix races in nfs_revalidate_mapping

commit 17dfeb9113397a6119091a491ef7182649f0c5a9 upstream.

Commit d529ef83c355f97027ff85298a9709fe06216a66 (NFS: fix the handling
of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping) introduces
a potential race, since it doesn't test the value of nfsi->cache_validity
and set the bitlock in nfsi->flags atomically.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoNFS: fix the handling of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping
Jeff Layton [Mon, 27 Jan 2014 18:46:15 +0000 (13:46 -0500)]
NFS: fix the handling of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping

commit d529ef83c355f97027ff85298a9709fe06216a66 upstream.

There is a possible race in how the nfs_invalidate_mapping function is
handled.  Currently, we go and invalidate the pages in the file and then
clear NFS_INO_INVALID_DATA.

The problem is that it's possible for a stale page to creep into the
mapping after the page was invalidated (i.e., via readahead). If another
writer comes along and sets the flag after that happens but before
invalidate_inode_pages2 returns then we could clear the flag
without the cache having been properly invalidated.

So, we must clear the flag first and then invalidate the pages. Doing
this however, opens another race:

It's possible to have two concurrent read() calls that end up in
nfs_revalidate_mapping at the same time. The first one clears the
NFS_INO_INVALID_DATA flag and then goes to call nfs_invalidate_mapping.

Just before calling that though, the other task races in, checks the
flag and finds it cleared. At that point, it trusts that the mapping is
good and gets the lock on the page, allowing the read() to be satisfied
from the cache even though the data is no longer valid.

These effects are easily manifested by running diotest3 from the LTP
test suite on NFS. That program does a series of DIO writes and buffered
reads. The operations are serialized and page-aligned but the existing
code fails the test since it occasionally allows a read to come out of
the cache incorrectly. While mixing direct and buffered I/O isn't
recommended, I believe it's possible to hit this in other ways that just
use buffered I/O, though that situation is much harder to reproduce.

The problem is that the checking/clearing of that flag and the
invalidation of the mapping really need to be atomic. Fix this by
serializing concurrent invalidations with a bitlock.

At the same time, we also need to allow other places that check
NFS_INO_INVALID_DATA to check whether we might be in the middle of
invalidating the file, so fix up a couple of places that do that
to look for the new NFS_INO_INVALIDATING flag.

Doing this requires us to be careful not to set the bitlock
unnecessarily, so this code only does that if it believes it will
be doing an invalidation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agopnfs: fix BUG in filelayout_recover_commit_reqs
Weston Andros Adamson [Tue, 21 Jan 2014 20:21:33 +0000 (15:21 -0500)]
pnfs: fix BUG in filelayout_recover_commit_reqs

commit 471252cd8b34b0609973740b25dcd1ff01dc1889 upstream.

cond_resched_lock(cinfo->lock) is called everywhere else while holding
the cinfo->lock spinlock.  Not holding this lock while calling
transfer_commit_list in filelayout_recover_commit_reqs causes the BUG
below.

It's true that we can't hold this lock while calling pnfs_put_lseg,
because that might try to lock the inode lock - which might be the
same lock as cinfo->lock.

To reproduce, mount a 2 DS pynfs server and run an O_DIRECT command
that crosses a stripe boundary and is not page aligned, such as:

 dd if=/dev/zero of=/mnt/f bs=17000 count=1 oflag=direct

BUG: sleeping function called from invalid context at linux/fs/nfs/nfs4filelayout.c:1161
in_atomic(): 0, irqs_disabled(): 0, pid: 27, name: kworker/0:1
2 locks held by kworker/0:1/27:
 #0:  (events){.+.+.+}, at: [<ffffffff810501d7>] process_one_work+0x175/0x3a5
 #1:  ((&dreq->work)){+.+...}, at: [<ffffffff810501d7>] process_one_work+0x175/0x3a5
CPU: 0 PID: 27 Comm: kworker/0:1 Not tainted 3.13.0-rc3-branch-dros_testing+ #21
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
Workqueue: events nfs_direct_write_schedule_work [nfs]
 0000000000000000 ffff88007a39bbb8 ffffffff81491256 ffff88007b87a130  ffff88007a39bbd8 ffffffff8105f103 ffff880079614000 ffff880079617d40  ffff88007a39bc20 ffffffffa011603e ffff880078988b98 0000000000000000
Call Trace:
 [<ffffffff81491256>] dump_stack+0x4d/0x66
 [<ffffffff8105f103>] __might_sleep+0x100/0x105
 [<ffffffffa011603e>] transfer_commit_list+0x94/0xf1 [nfs_layout_nfsv41_files]
 [<ffffffffa01160d6>] filelayout_recover_commit_reqs+0x3b/0x68 [nfs_layout_nfsv41_files]
 [<ffffffffa00ba53a>] nfs_direct_write_reschedule+0x9f/0x1d6 [nfs]
 [<ffffffff810705df>] ? mark_lock+0x1df/0x224
 [<ffffffff8106e617>] ? trace_hardirqs_off_caller+0x37/0xa4
 [<ffffffff8106e691>] ? trace_hardirqs_off+0xd/0xf
 [<ffffffffa00ba8f8>] nfs_direct_write_schedule_work+0x9d/0xb7 [nfs]
 [<ffffffff810501d7>] ? process_one_work+0x175/0x3a5
 [<ffffffff81050258>] process_one_work+0x1f6/0x3a5
 [<ffffffff810501d7>] ? process_one_work+0x175/0x3a5
 [<ffffffff8105187e>] worker_thread+0x149/0x1f5
 [<ffffffff81051735>] ? rescuer_thread+0x28d/0x28d
 [<ffffffff81056d74>] kthread+0xd2/0xda
 [<ffffffff81056ca2>] ? __kthread_parkme+0x61/0x61
 [<ffffffff8149e66c>] ret_from_fork+0x7c/0xb0
 [<ffffffff81056ca2>] ? __kthread_parkme+0x61/0x61

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: increment i_dio_count for reads, too
Christoph Hellwig [Thu, 14 Nov 2013 16:50:30 +0000 (08:50 -0800)]
nfs: increment i_dio_count for reads, too

commit 1f90ee27461e31a1c18e5d819f6ea6f5c7304b16 upstream.

i_dio_count is used to protect dio access against truncate.  We want
to make sure there are no dio reads pending either when doing a
truncate.  I suspect on plain NFS things might work even without
this, but once we use a pnfs layout driver that access backing devices
directly things will go bad without the proper synchronization.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: defer inode_dio_done call until size update is done
Christoph Hellwig [Thu, 14 Nov 2013 16:50:29 +0000 (08:50 -0800)]
nfs: defer inode_dio_done call until size update is done

commit 2a009ec98cce440c0992fc9a2353e96cdb0b048b upstream.

We need to have the I/O fully finished before telling the truncate code
that we are done.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: fix size updates for aio writes
Christoph Hellwig [Thu, 14 Nov 2013 16:50:28 +0000 (08:50 -0800)]
nfs: fix size updates for aio writes

commit 9811cd57f4c6b5b60ec104de68a88303717e3106 upstream.

nfs_file_direct_write only updates the inode size if it succeeded and
returned the number of bytes written.  But in the AIO case nfs_direct_wait
turns the return value into -EIOCBQUEUED and we skip the size update.

Instead the aio completion path should updated it, which this patch
does.  The implementation is a little hacky because there is no obvious
way to find out we are called for a write in nfs_direct_complete.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agonfs: fix dead code of ipv6_addr_scope
Alexander Aring [Sat, 21 Dec 2013 04:39:04 +0000 (05:39 +0100)]
nfs: fix dead code of ipv6_addr_scope

commit a8c2275493b866961f4429a741251c630c4fc6d7 upstream.

The correct way to check on IPV6_ADDR_SCOPE_LINKLOCAL is to check with
the ipv6_addr_src_scope function.

Currently this can't be work, because ipv6_addr_scope returns a int with
a mask of IPV6_ADDR_SCOPE_MASK (0x00f0U) and IPV6_ADDR_SCOPE_LINKLOCAL
is 0x02. So the condition is always false.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoNFSv4.1: Prevent a 3-way deadlock between layoutreturn, open and state recovery
Trond Myklebust [Wed, 4 Dec 2013 17:09:45 +0000 (12:09 -0500)]
NFSv4.1: Prevent a 3-way deadlock between layoutreturn, open and state recovery

commit f22e5edd2244609aed3906207a62223e7707a34d upstream.

Andy Adamson reports:

The state manager is recovering expired state and recovery OPENs are being
processed. If kswapd is pruning inodes at the same time, a deadlock can occur
when kswapd calls evict_inode on an NFSv4.1 inode with a layout, and the
resultant layoutreturn gets an error that the state mangager is to handle,
causing the layoutreturn to wait on the (NFS client) cl_rpcwaitq.

At the same time an open is waiting for the inode deletion to complete in
__wait_on_freeing_inode.

If the open is either the open called by the state manager, or an open from
the same open owner that is holding the NFSv4 sequence id which causes the
OPEN from the state manager to wait for the sequence id on the Seqid_waitqueue,
then the state is deadlocked with kswapd.

The fix is simply to have layoutreturn ignore all errors except NFS4ERR_DELAY.
We already know that layouts are dropped on all server reboots, and that
it has to be coded to deal with the "forgetful client model" that doesn't
send layoutreturns.

Reported-by: Andy Adamson <andros@netapp.com>
Link: http://lkml.kernel.org/r/1385402270-14284-1-git-send-email-andros@netapp.com
Signed-off-by: Trond Myklebust <Trond.Myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoSUNRPC: do not fail gss proc NULL calls with EACCES
Andy Adamson [Wed, 20 Nov 2013 18:00:17 +0000 (13:00 -0500)]
SUNRPC: do not fail gss proc NULL calls with EACCES

commit c297c8b99b07f496ff69a719cfb8e8fe852832ed upstream.

Otherwise RPCSEC_GSS_DESTROY messages are not sent.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agofbmem: really support wildcard video=options for all fbdev drivers
Olaf Hering [Sun, 15 Dec 2013 20:40:35 +0000 (21:40 +0100)]
fbmem: really support wildcard video=options for all fbdev drivers

commit f5d2b7c28b67d627646b6a0142bc201a7b1516b0 upstream.

Documentation/fb/modedb.txt states that video=option should be
considered a global option. But video_setup and fb_get_options are not
coded that way. Instead its required to boot with video=driver:option to
set a given option in drvier.  This is cumbersome because it requires to
know in advance which driver will be active for a given board/kernel.

The following patch implements the documented catchall for the fbdev
drivers. It is now possible to boot with video=XxY without the need to
know the active driver in advance. The specific case it tries to fix is
syslinux in the SUSE installer which offers a menu to set a display
resolution. Right now this just appends the vga= option the kernel. But
in addition to vga= it should be possible to pass a generic video=XxY
for all framebuffer/drm drivers. With this change forcing a certain
window size of VM displays is now much easier.

Today the video= option is stored in a global fb_mode_option. But
unfortunately only drm uses it.

Note: this change introduces a small memleak if video=option is actually
used because fb_mode_option is const. Most drivers use strsep to get to
individual options. This could be fixed in a followup patch which always
releases the option string in every caller of fb_get_options.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agoarch/x86/mm/srat: Skip NUMA_NO_NODE while parsing SLIT
Toshi Kani [Tue, 21 Jan 2014 22:33:15 +0000 (14:33 -0800)]
arch/x86/mm/srat: Skip NUMA_NO_NODE while parsing SLIT

commit a85eba8814631d0d48361c8b9a7ee0984e80c03c upstream.

When ACPI SLIT table has an I/O locality (i.e. a locality
unique to an I/O device), numa_set_distance() emits this warning
message:

 NUMA: Warning: node ids are out of bound, from=-1 to=-1 distance=10

acpi_numa_slit_init() calls numa_set_distance() with
pxm_to_node(), which assumes that all localities have been
parsed with SRAT previously.  SRAT does not list I/O localities,
where as SLIT lists all localities including I/Os.  Hence,
pxm_to_node() returns NUMA_NO_NODE (-1) for an I/O locality.

I/O localities are not supported and are ignored today, but emitting
such warning message leads to unnecessary confusion.

Change acpi_numa_slit_init() to avoid calling
numa_set_distance() with NUMA_NO_NODE.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/n/tip-dSvpjjvp8aMzs1ybkftxohlh@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agocrypto: sha256_ssse3 - also test for BMI2
Oliver Neukum [Tue, 1 Oct 2013 12:34:46 +0000 (14:34 +0200)]
crypto: sha256_ssse3 - also test for BMI2

commit 16c0c4e1656c14ef9deac189a4240b5ca19c6919 upstream.

The AVX2 implementation also uses BMI2 instructions,
but doesn't test for their availability. The assumption
that AVX2 and BMI2 always go together is false. Some
Haswells have AVX2 but not BMI2.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
10 years agodrm/nouveau: make vga_switcheroo code depend on VGA_SWITCHEROO
Jeff Mahoney [Tue, 21 Jan 2014 22:34:52 +0000 (14:34 -0800)]
drm/nouveau: make vga_switcheroo code depend on VGA_SWITCHEROO

commit d0ce7b8567ae76b8a6c0eb8361d121deb98c1b3f upstream.

Commit 8116188fdef594 ("nouveau/acpi: hook up to the MXM method for mux
switching.") broke the build on non-x86 architectures due to the new
dependency on MXM and MXM being an x86 platform driver.

It built previously since the vga switcheroo registration routines were
zereod out on !X86.  The code was built in but unused.

This patch makes all of the DSM code depend on CONFIG_VGA_SWITCHEROO,
allowing it to build on non-x86 and shrinking the module size as well.

[rdunlap@infradead.org: fix build eror when VGA_SWITCHEROO is not enabled]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>