platform/kernel/linux-3.10.git
9 years agozram: don't grab mutex in zram_slot_free_noity
Minchan Kim [Mon, 12 Aug 2013 06:13:56 +0000 (15:13 +0900)]
zram: don't grab mutex in zram_slot_free_noity

[1] introduced down_write in zram_slot_free_notify to prevent race
between zram_slot_free_notify and zram_bvec_[read|write]. The race
could happen if somebody who has right permission to open swap device
is reading swap device while it is used by swap in parallel.

However, zram_slot_free_notify is called with holding spin_lock of
swap layer so we shouldn't avoid holing mutex. Otherwise, lockdep
warns it.

This patch adds new list to handle free slot and workqueue
so zram_slot_free_notify just registers slot index to be freed and
registers the request to workqueue. If workqueue is expired,
it holds mutex_lock so there is no problem any more.

If any I/O is issued, zram handles pending slot-free request
caused by zram_slot_free_notify right before handling issued
request because workqueue wouldn't be expired yet so zram I/O
request handling function can miss it.

Lastly, when zram is reset, flush_work could handle all of pending
free request so we shouldn't have memory leak.

NOTE: If zram_slot_free_notify's kmalloc with GFP_ATOMIC would be
failed, the slot will be freed when next write I/O write the slot.

[1] [57ab0485, zram: use zram->lock to protect zram_free_page()
    in swap free notify path]

* from v2
  * refactoring

* from v1
  * totally redesign

Change-Id: I7f478fa9b00215eb0a3e16433e607a2f73151f27
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: fix invalid memory access
Minchan Kim [Mon, 12 Aug 2013 06:13:55 +0000 (15:13 +0900)]
zram: fix invalid memory access

[1] tried to fix invalid memory access on zram->disk but it didn't
fix properly because get_disk failed during module exit path.

Actually, we don't need to reset zram->disk's capacity to zero
in module exit path so that this patch introduces new argument
"reset_capacity" on zram_reset_divice and it only reset it when
reset_store is called.

[1] 6030ea9b,  zram: avoid invalid memory access in zram_exit()

Change-Id: Ibc554559bbd533bd986c6001ffb9cfb22f8c9f49
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: zram: zram_drv.c: Fixed Error of trailing whitespace
Kumar Gaurav [Thu, 8 Aug 2013 18:23:24 +0000 (23:53 +0530)]
Staging: zram: zram_drv.c: Fixed Error of trailing whitespace

Fixed by removing trailing whitespace

Change-Id: Ia789db213c6917b2f9eeb795d573d9d2ae4c19cd
Signed-off-by: Kumar Gaurav <kumargauravgupta3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: zram: protect zram_reset_device() call
Sergey Senozhatsky [Wed, 26 Jun 2013 12:28:39 +0000 (15:28 +0300)]
staging: zram: protect zram_reset_device() call

Commit 9b3bb7abcdf2df0f1b2657e6cbc9d06bc2b3b36f (remove
zram_sysfs file (v2)) accidentally made zram_reset_device()
racy. Protect zram_reset_device() call with zram->lock.

Change-Id: Ia8cd8eb9eae37ccc142efc1c21980076f2aa007d
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Jerome Marchand <jmarchand@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: prevent data loss in error cases of function zram_bvec_write()
Sunghan Suh [Wed, 3 Jul 2013 11:10:05 +0000 (20:10 +0900)]
zram: prevent data loss in error cases of function zram_bvec_write()

In function zram_bvec_write(), previous data at the index is
already freed by function zram_free_page().
When failed to compress or zs_malloc, there is no way to restore old data.
Therefore, free previous data when it's about to update.

Also, no need to check whether table is not empty outside of
function zram_free_page(), because the function properly checks inside.

Change-Id: Ieeecfa00839cd4440781ece7f9bbed123e3651d5
Signed-off-by: Sunghan Suh <sunghan.suh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: zram: Add auto loading of module if user opens /dev/zram.
Konrad Rzeszutek Wilk [Fri, 12 Jul 2013 18:20:52 +0000 (14:20 -0400)]
staging: zram: Add auto loading of module if user opens /dev/zram.

Greg spotted that said driver is not subscribing to the automagic
mechanism of auto-loading if a user tries to open /dev/zram.

This fixes it.

Change-Id: I934d034752f1c677076f439b95da178b45384243
CC: Minchan Kim <minchan@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: zsmalloc: access page->private by using page_private macro
Sunghan Suh [Fri, 12 Jul 2013 07:08:13 +0000 (16:08 +0900)]
staging: zsmalloc: access page->private by using page_private macro

Change-Id: I3fb9c7c58baeac6268961750ed859518c421b770
Signed-off-by: Sunghan Suh <sunghan.suh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: allow request end to coincide with disksize
Sergey Senozhatsky [Sat, 22 Jun 2013 14:21:00 +0000 (17:21 +0300)]
zram: allow request end to coincide with disksize

Pass valid_io_request() checks if request end coincides with disksize
(end equals bound), only fail if we attempt to read beyond the bound.

mkfs.ext2 produces numerous errors:
[ 2164.632747] quiet_error: 1 callbacks suppressed
[ 2164.633260] Buffer I/O error on device zram0, logical block 153599
[ 2164.633265] lost page write due to I/O error on zram0

Change-Id: Ife5ddef82610e1470d233ce4bdf042ed738064b6
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: remove zram_sysfs file (v2)
Sergey Senozhatsky [Sat, 22 Jun 2013 00:21:18 +0000 (03:21 +0300)]
zram: remove zram_sysfs file (v2)

Move zram sysfs code to zram drv and remove zram_sysfs.c
file. This gives ability to make static a number of previously
exported zram functions, used from zram sysfs, e.g. internal zram
zram_meta_alloc/free(). We also can drop zram_drv wrapper
functions, used from zram sysfs:
e.g. zram_reset_device()/__zram_reset_device() pair.

v2: as suggested by Greg K-H, move MODULE description to the
bottom of the file.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts:
drivers/staging/zram/zram_drv.c

Change-Id: Icb484d81dde622e474a097f7ad7a2b7dfa016cdb

9 years agozram: use atomic64_xxx() to replace zram_stat64_xxx()
Jiang Liu [Thu, 6 Jun 2013 16:07:31 +0000 (00:07 +0800)]
zram: use atomic64_xxx() to replace zram_stat64_xxx()

Use atomic64_xxx() to replace open-coded zram_stat64_xxx().
Some architectures have native support of atomic64 operations,
so we can get rid of the spin_lock() in zram_stat64_xxx().
On the other hand, for platforms use generic version of atomic64
implement, it may cause an extra save/restore of the interrupt
flag.  So it's a tradeoff.

Change-Id: Ie2582688a71f89b457b006c9d2f3cda1d24c93ec
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: optimize memory operations with clear_page()/copy_page()
Jiang Liu [Thu, 6 Jun 2013 16:07:30 +0000 (00:07 +0800)]
zram: optimize memory operations with clear_page()/copy_page()

Some architectures provides architecture-specific, optimized version of
clear_page()/copy_page(), which may have better performance than
memset()/memcpy(). So use clear_page()/copy_page() to optimize zram
performance if possible.

Change-Id: If33e01891f1bc3790144f85c02e0869a02d0faae
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: kill unused zram_get_num_devices()
Jiang Liu [Thu, 6 Jun 2013 16:07:29 +0000 (00:07 +0800)]
zram: kill unused zram_get_num_devices()

Now there's no caller of zram_get_num_devices(), so kill it.
And change zram_devices to static because it's only used in zram_drv.c.

Change-Id: Iffd94b2456d86692703b3aff02b6e6d7a3ac5957
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agozram: simplify and optimize dev_to_zram()
Jiang Liu [Thu, 6 Jun 2013 16:07:28 +0000 (00:07 +0800)]
zram: simplify and optimize dev_to_zram()

Simplify and optimize dev_to_zram() without walking the zram_devices
array.

Change-Id: Ib1ee8afe8fc0596f57c4cc7b8e41a817b405c263
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/zsmalloc: Fixed up incorrect formatted comments
Sara Bird [Mon, 20 May 2013 19:18:14 +0000 (15:18 -0400)]
staging/zsmalloc: Fixed up incorrect formatted comments

The existing comments are using an odd style. Fixed them up to adhere
to the StyleGuide. No code changes.

Change-Id: I8e6d8cfa84fa87fb79f5ffc6973d7ab12287ba67
Signed-off-by: Sara Bird <sara.bird.iar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: Fixes string split across lines in zram
Marlies Ruck [Thu, 16 May 2013 18:30:39 +0000 (14:30 -0400)]
Staging: Fixes string split across lines in zram

Fixes the following checkpatch warning in zram_drv.c:
WARNING: quoted string split across lines

Change-Id: Icd77f2e0465dc821b3af5b27178029194e67ff70
Signed-off-by: Marlies Ruck <marlies.ruck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: Fixes string split across lines in zsmalloc zsmalloc-main
Marlies Ruck [Wed, 15 May 2013 20:56:49 +0000 (16:56 -0400)]
Staging: Fixes string split across lines in zsmalloc zsmalloc-main

Fixes the following checkpatch warning:
WARNING: quoted string split across lines

Change-Id: Ib5855942b855de05743b974cb842fa2127ff07da
Signed-off-by: Marlies Ruck <marlies.ruck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoextcon: max77693: Fix a bug occured at changing ADC debounce time.
Jonghwa Lee [Tue, 18 Mar 2014 15:55:10 +0000 (00:55 +0900)]
extcon: max77693: Fix a bug occured at changing ADC debounce time.

During the initialzation of max77693 muic device, it has been suffered from
abnormal interrupt and accidental reset of certain register when it changes
ADC debounce time. All these happens occured by mistakenly writing some value
to BLTDset and JIGset from CONTROL3 register.
BLTDset and JIGset are not configurable and only reflect actual pin status.
If you write some value other than 0 to them, muic device will return false
information.

To set ADC debounce time properly, give 0 to BLTDset and JIGset when writing
CONTORL3 register.

Previous workaround patches are now purged.

Change-Id: If87e01785115d460b1153e24271a50125d1631fb
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoRevert "extcon: max77693: Fix bug related to MAX77693 irq when set ADC debounce time"
Jonghwa Lee [Tue, 18 Mar 2014 15:41:36 +0000 (00:41 +0900)]
Revert "extcon: max77693: Fix bug related to MAX77693 irq when set ADC debounce time"

This reverts commit b64315125400f4eec9f74f7536acca3e8eeca720.
Upcoming patch will fix a bug thus all related workaournds are now purged.

Change-Id: Iab88c25ef9470a5167be73990ceb7859e076ddd8
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoRevert "extcon: max77693: Force using UART path for jig"
Jonghwa Lee [Tue, 18 Mar 2014 15:41:20 +0000 (00:41 +0900)]
Revert "extcon: max77693: Force using UART path for jig"

This reverts commit ec05e8de55043b87a1dafccec5477db9a6ecf9a1.
Upcoming patch will fix a bug thus all related workaournds are now purged.

Change-Id: I52b4456867dd887c7d29a4f485c952860c6dc45c
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoRevert "extcon: max77693: Fix inaccurate extcon event for JIG with USB cable"
Jonghwa Lee [Tue, 18 Mar 2014 15:41:04 +0000 (00:41 +0900)]
Revert "extcon: max77693: Fix inaccurate extcon event for JIG with USB cable"

This reverts commit 36bdb901c8c61448d9e1320641c3debebde03321.
Upcoming patch will fix a bug thus all related workaournds are now purged.

Change-Id: Idafdbcadff0d99320502676ef371d6bc0bd1fcf7
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoextcon: max77693: Fix inaccurate extcon event for JIG with USB cable
Jonghwa Lee [Mon, 17 Mar 2014 08:44:06 +0000 (17:44 +0900)]
extcon: max77693: Fix inaccurate extcon event for JIG with USB cable

Dmitry's patch 'extcon: max77693: Force using UART~' fixes problem when
device is connected JIG with USB cable. However, with the patch, driver
sends inaccurate event "USB" even muic keeps path to UART not USB. This
would make users confused.

This patch keeps Dmitry's modification working and also bypasses signaling
event "USB" when device is connected to JIG with USB cable.

Change-Id: Ia5f3328e5b0827378178502c70cb90da48e9e3f7
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoARM: dts: odroidx2: remove fimd node
Joonyoung Shim [Tue, 11 Mar 2014 05:07:29 +0000 (14:07 +0900)]
ARM: dts: odroidx2: remove fimd node

Our odroidx2 board doesn't have any LCD panel, so it is unnecessary to
use fimd.

Change-Id: I1924ee52cd34d5763aab989035c51b387de98311
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: EXYNOS: register master power domain for genpd from DT
Joonyoung Shim [Tue, 11 Mar 2014 04:44:20 +0000 (13:44 +0900)]
ARM: EXYNOS: register master power domain for genpd from DT

There is one case for EXYNOS4412 that mixer needs LCD0 power domain as
well as TV power domain. If disable LCD0 power domain, mixer occurs
underflow of mixer graphic layer0 line buffer and we can't output normal
data from hdmi. I don't know why mixer has dependency of LCD0 power
domain.

We can control the dependency as LCD0 power domain register to master of
TV power domain on genpd framework.

Change-Id: I71ef5bba37393d2e00c4dd7ea3f7da09d72e8db7
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidx2: update defconfig to enable DRM_EXYNOS_FIMC
Joonyoung Shim [Tue, 11 Mar 2014 02:49:32 +0000 (11:49 +0900)]
ARM: odroidx2: update defconfig to enable DRM_EXYNOS_FIMC

DRM_EXYNOS_FIMC needs to use FIMC from DRM.

Change-Id: I854807ae13d356761b68a19860a0d618eb4f14fc
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agomedia: s5p-mfc: Add support for V4L2_MEMORY_DMABUF type
Seung-Woo Kim [Fri, 29 Nov 2013 07:57:34 +0000 (16:57 +0900)]
media: s5p-mfc: Add support for V4L2_MEMORY_DMABUF type

There is memory constraint that it should be within 128MB from
firmware address. But if IOMMU is supported, then this constraint
is meaningless and DMABUF importing can be used.
So this patch adds V4L2_MEMORY_DMABUF type support for both decoder
and encoder.

Change-Id: I2c893da31f906fcd3f26edeed67ad1e4667e6081
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
9 years agoARM: odroidx2: update defconfig to enable ANDROID_LOGGER
Joonyoung Shim [Sat, 8 Mar 2014 05:04:57 +0000 (14:04 +0900)]
ARM: odroidx2: update defconfig to enable ANDROID_LOGGER

ANDROID_LOGGER needs to use dlogutil at tizen.

Change-Id: Ibcad389c6edf8216441948931e9733aa45b04aa1
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: dts: fix base address of sysmmu_tv for exynos4
Joonyoung Shim [Sat, 8 Mar 2014 04:55:56 +0000 (13:55 +0900)]
ARM: dts: fix base address of sysmmu_tv for exynos4

The base address of sysmmu_tv is 0x12E20000, not 0x13E20000. Wrong base
address problem causes below error when kernel boots.

[    2.450988] Unhandled fault: imprecise external abort (0xc06) at 0xb6fd2068

Change-Id: Icc896d02e25800b18659c66cad853fdbf54cae9c
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agodts: exynos4412-trats2: Remove unused device node on trats2 board
Beomho Seo [Thu, 6 Mar 2014 02:44:40 +0000 (11:44 +0900)]
dts: exynos4412-trats2: Remove unused  device node on trats2 board

GP2AP002A00F ligth/proximity sensor is unused on trats2 board.

Change-Id: I4ef414eea4aaf336200ec0b97485fcfde2645c2f
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
9 years agocpufreq:LAB: Remove MODULE_* macros since it is not possible to compile LAB as a...
Lukasz Majewski [Tue, 4 Mar 2014 11:29:04 +0000 (12:29 +0100)]
cpufreq:LAB: Remove MODULE_* macros since it is not possible to compile LAB as a module

LAB cannot be compiled as a module, so MODULE_* macros are in fact a dead
code.

Change-Id: I10f8e5650631b00850631aea1295c1d88e53104a
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoARM: odroidx2: update defconfig to fix the number of cores
Hyungwon Hwang [Wed, 5 Mar 2014 06:37:26 +0000 (15:37 +0900)]
ARM: odroidx2: update defconfig to fix the number of cores

The processor on Odroid X2 is Exynos4412 which has 4 processing cores.
The number of cores on the config file was 2, not 4.

Change-Id: Ia153c28e5c00a7a8cec2cda9ee0d24caa0d0c1ba
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agodts: arm: odroidx2: add support for external buttons
Hyungwon Hwang [Wed, 5 Mar 2014 05:44:41 +0000 (14:44 +0900)]
dts: arm: odroidx2: add support for external buttons

Add support for two external buttons (power & home buttons)

Change-Id: I90544bf89c804329dfc78709d48d9eedc2c4a181
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
9 years agoARM: odroidx2: update defconfig
Marek Szyprowski [Tue, 4 Mar 2014 11:30:01 +0000 (12:30 +0100)]
ARM: odroidx2: update defconfig

Added drivers for MALI GPU, DMAbuf, DMAbuf-sync, exynos drm iommu and
cpufreq.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I427332db24aa52daf4d4addbf9fbad8bc116b62e

9 years agoARM: dts: odroidx2: add mali gpu and cpu freq
Marek Szyprowski [Tue, 4 Mar 2014 11:28:51 +0000 (12:28 +0100)]
ARM: dts: odroidx2: add mali gpu and cpu freq

Add nodes to enable MALI gpu and CPU freq drivers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id1cc80e7b4278698603422da8e8a7a07fca38904

9 years agoARM: dts: odroidx2: remove obsoleted register debug node
Marek Szyprowski [Tue, 4 Mar 2014 11:27:53 +0000 (12:27 +0100)]
ARM: dts: odroidx2: remove obsoleted register debug node

Register-debug node was used for some internal debug, it is not needed
at in release code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3cefb94755850a9c3caa609ed0fb5c5e56d1fc94

9 years agocpufreq:LAB: Replace NR_CPUS with num_possible_cpus() function
Lukasz Majewski [Tue, 4 Mar 2014 11:27:50 +0000 (12:27 +0100)]
cpufreq:LAB: Replace NR_CPUS with num_possible_cpus() function

The usage of NR_CPUS constant is deprecated, since this value can be the
maximal possible number of cores on a SMP machine.

The num_possible_cpus() represents the number of available cores on the
system.
This change has caused replacement of global tables by ones allocated with
kzalloc().

Change-Id: Ib0bfa27296740a91a25b1af0ece0e573a9756846
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:cosmetic: Cosmetic code cleanup
Lukasz Majewski [Tue, 4 Mar 2014 11:20:34 +0000 (12:20 +0100)]
cpufreq:LAB:cosmetic: Cosmetic code cleanup

Initialization of static variable is not necessary, since it will be placed
at BSS section.

Also proper format comments have been added.

Change-Id: Id5e30a97d7d3cdb851f09a69e944c77223fa8a82
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:dts:trats2: Add attributes necessary for correct LAB operation
Lukasz Majewski [Wed, 26 Feb 2014 12:12:36 +0000 (13:12 +0100)]
cpufreq:LAB:dts:trats2: Add attributes necessary for correct LAB operation

Two extra attributes have been added. The "lab-num-of-states" describes how
many ranges will be used during LAB operation. Now the span of it equals to
20 (100 / 5).
The lab-ctrl-freq attribute maps number of idle CPUs and workload (from
scheduler) to LAB operations.

It is possible to specify exact freq (e.g. 1300000), enable boost
(e.g. 0xFFFFFFFF), set frequency to minimum (0xFFFFFFFE) or rely on
ONDEMAND governor to find suitable frequency.

Change-Id: I0ea6ffd8626aded5bed34166c59b9d34278feef2
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:ondemand: Enable usage of ONDEMAND specific methods at LAB governor
Lukasz Majewski [Thu, 27 Feb 2014 12:35:03 +0000 (13:35 +0100)]
cpufreq:LAB:ondemand: Enable usage of ONDEMAND specific methods at LAB governor

Two methods from ondemand, namely store_sampling_rate() and od_check_cpu()
are now utilized in LAB governor.

Moreover the od_cpu_dbs_info_s structure shall be regarded as a common one.
Therefore in LAB only its declaration is necessary.

Change-Id: I3408b2f8cfdb292cd69568c931da46d8f957099c
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:cpufreq_governor: Remove redundant LAB code from cpufreq_governor.[h|c]
Lukasz Majewski [Wed, 26 Feb 2014 14:50:05 +0000 (15:50 +0100)]
cpufreq:LAB:cpufreq_governor: Remove redundant LAB code from cpufreq_governor.[h|c]

Since the Ondemand code has been reused for LAB, it is now possible to remove
code specially defined for LAB governor at the cpufreq_governor.[h|c] code.

Change-Id: I9c48eade8ffe6a94efd0145b7d48afb405961155
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:ondemand: Ondemand governor adjustments necessary for correct LAB operation
Lukasz Majewski [Wed, 26 Feb 2014 12:42:04 +0000 (13:42 +0100)]
cpufreq:LAB:ondemand: Ondemand governor adjustments necessary for correct LAB operation

Ondemand code needs to be slightly modified for LAB governor operation.
The biggest problem is with the update_sampling_rate function, which shall
not be executed with wrong governor.

Change-Id: I149204bda15b11546c57a77a75a51c4f4f8522b8
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:core: Redesign of LAB code to work on top of ONDEMAND governor
Lukasz Majewski [Thu, 27 Feb 2014 12:30:06 +0000 (13:30 +0100)]
cpufreq:LAB:core: Redesign of LAB code to work on top of ONDEMAND governor

The code for LAB has been redesigned to be able to work on top of Ondemand
governor.
Previous version of LAB - the one which used the polynomial approximation
has been replaced with more readable approach.
The LAB control approach is now read from device tree.

User is allowed to specify following operations (based on load and number of
idle CPUs):
- Force a particular frequency
- Explicitly enable boost for a specific kind of load
- Use ondemand governor

By using ondemand one can be sure that for non critical frequencies correct
value will be chosen.
LAB, which works on top of it, can clamp the freq (an thereof power management)
or explicitly enable boost.

Change-Id: Ieaf84d245463edf90fb2baaf825c0534970eab7e
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:ondemand: REMOVE from LAB governor code duplicated at ondemand
Lukasz Majewski [Wed, 26 Feb 2014 13:07:17 +0000 (14:07 +0100)]
cpufreq:LAB:ondemand: REMOVE from LAB governor code duplicated at ondemand

LAB is very similar to ondemand governor in its structure.
Both use the same code for:
- governor init and exit
- demand based switching timer code
- governor specific ops

In this way the LAB can be stacked on top of ondemand governor and hence it
is possible to reuse its logic when needed.

Change-Id: I78e0da90bb2f07677fe6f8d451139107994f5a6f
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:core: Remove code responsible for removing LAB module
Lukasz Majewski [Thu, 27 Feb 2014 09:01:03 +0000 (10:01 +0100)]
cpufreq:LAB:core: Remove code responsible for removing LAB module

Since we don't support LAB compiled in as module this code shall be
regarded as a dead one.

Change-Id: I8aba33449e08aabed38393e15519f30ccf27ab0f
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:Kconfig: Do not allow LAB to be build as a module
Lukasz Majewski [Thu, 27 Feb 2014 12:38:51 +0000 (13:38 +0100)]
cpufreq:LAB:Kconfig: Do not allow LAB to be build as a module

Since LAB depends on ONDEMAND, one needs to prevent situation when both
governors are compiled as modules.

Change-Id: I5e4f65a856d548397ef53338a8949879bd34051c
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq:LAB:Kconfig: Make LAB dependent on the ONDEMAND governor
Lukasz Majewski [Wed, 26 Feb 2014 12:53:23 +0000 (13:53 +0100)]
cpufreq:LAB:Kconfig: Make LAB dependent on the ONDEMAND governor

The LAB is supposed to be an extension of the ONDEMAND governor.
For this reason it shall be not possible to compile in LAB without
ONDEMAND in the system.

Change-Id: I8c9e46b535bb7452782c21163703a4e73bdaf96d
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoiio:common:st: Prevent disable after read info raw data
Lukasz Czerwinski [Wed, 5 Mar 2014 07:52:56 +0000 (08:52 +0100)]
iio:common:st: Prevent disable after read info raw data

This patch prevents disable sensor after read info raw data when
events are enabled.

Change-Id: Ifc160e7aa5a633c5dc976ea8b775a790a0efaf69
Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
9 years agodrivers: power: hide some excessive debugs
Marek Szyprowski [Tue, 4 Mar 2014 07:17:46 +0000 (08:17 +0100)]
drivers: power: hide some excessive debugs

Hide following excessive debug messages, which are really not helpful
for anything:
device xyz: start latency exceeded, new value XXX ns
device xyz: state restore latency exceeded, new value YYY ns

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Idab765ebd307ac40af1a556c0b08e26938a1c9cf

9 years agousb: misc: usb3503: Support operation with no I2C control
Mark Brown [Fri, 9 Aug 2013 10:41:58 +0000 (11:41 +0100)]
usb: misc: usb3503: Support operation with no I2C control

Refactor so that register writes for configuration are only performed if
the device has a regmap provided and also register as a platform driver.
This allows the driver to be used to manage GPIO based control of the
device.

Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: devicetree@vger.kernel.org
Reviewed-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 3f0d1c67fa20d524fdcb4a7dcda19ed76c59be44]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3f0d1c67fa20d524fdcb4a7dcda19ed76c59be44

9 years agousb: misc: usb3503: Add USB3503A to the compatible list
Mark Brown [Fri, 9 Aug 2013 10:41:56 +0000 (11:41 +0100)]
usb: misc: usb3503: Add USB3503A to the compatible list

There are no software visible differences that I am aware of but in case
any are discovered allow the DTS to specify exactly which device is
present.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 5bdd1f4a1daf398042203b72430891dfc40c0fa6]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I5bdd1f4a1daf398042203b72430891dfc40c0fa6

9 years agousb: misc: usb3503: Default to hub mode
Mark Brown [Fri, 9 Aug 2013 10:41:55 +0000 (11:41 +0100)]
usb: misc: usb3503: Default to hub mode

Since there is no runtime interface for changing modes this is probably
the most sensible default.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit e5a0c874ec7babc1931a67489b292de152d2a641]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie5a0c874ec7babc1931a67489b292de152d2a641

9 years agousb: misc: usb3503: Fix typos in error messages
Mark Brown [Fri, 9 Aug 2013 10:41:54 +0000 (11:41 +0100)]
usb: misc: usb3503: Fix typos in error messages

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit dd8e670d2775c02169a3b9e4c8d84c8652342836]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Idd8e670d2775c02169a3b9e4c8d84c8652342836

9 years agousb: misc: usb3503: Factor out I2C probe
Mark Brown [Fri, 9 Aug 2013 10:41:53 +0000 (11:41 +0100)]
usb: misc: usb3503: Factor out I2C probe

In preparation for supporting operation without an I2C control interface
factor out the I2C-specific parts of the probe routine from those that
don't do any register I/O.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 2487e3ee33dd6c4fa3dabbe11bc988883be81f1e]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I2487e3ee33dd6c4fa3dabbe11bc988883be81f1e

9 years agousb: misc: usb3503: Convert to regmap
Mark Brown [Fri, 9 Aug 2013 10:41:52 +0000 (11:41 +0100)]
usb: misc: usb3503: Convert to regmap

This will give access to the diagnostic infrastructure regmap has but
the main point is to support future refactoring.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 68b14134be55eca7340b9a8b3ec4cb8f79622a3c]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I68b14134be55eca7340b9a8b3ec4cb8f79622a3c

9 years agousb: misc: usb3503: Actively manage Hub Connect GPIO
Mark Brown [Fri, 9 Aug 2013 10:41:51 +0000 (11:41 +0100)]
usb: misc: usb3503: Actively manage Hub Connect GPIO

If the connect signal is pulled high then the device will start up meaning
that if we just pull it high on probe then the device will start running
prior to the configuration being written out. Fix this by pulling the GPIO
low when we reset and only pulling it high when configuration is finished.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 8e7245b8386cb1dc941e10a4c97307e3f48da5da]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I8e7245b8386cb1dc941e10a4c97307e3f48da5da

9 years agousb: misc: usb3503: Use gpio_set_value_cansleep()
Mark Brown [Fri, 9 Aug 2013 10:41:49 +0000 (11:41 +0100)]
usb: misc: usb3503: Use gpio_set_value_cansleep()

The /RESET GPIO is not manipulated from atomic context so support GPIOs
that can't be written from atomic context by using _cansleep().

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 24455b09b4838cdc0165af0f24ca63ec9ad54e44]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I24455b09b4838cdc0165af0f24ca63ec9ad54e44

9 years agousb: misc: usb3503: Convert to devm_ APIs
Mark Brown [Wed, 7 Aug 2013 21:02:54 +0000 (22:02 +0100)]
usb: misc: usb3503: Convert to devm_ APIs

Saves us a bit of code.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit cffedd6794bb32c4fbc03600fac61beca7950f08]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Icffedd6794bb32c4fbc03600fac61beca7950f08

9 years agoARM: dts: exynos4412: fix usb3503 swapped gpio properties
Marek Szyprowski [Tue, 4 Mar 2014 07:18:06 +0000 (08:18 +0100)]
ARM: dts: exynos4412: fix usb3503 swapped gpio properties

GPIO properties were swapped in the USB3503 driver. This has been fixed
by mainline commit 42416cc81f4990ad8d425b41a0fc8cd985eb5fa5, so now also
fix the DTS using this driver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I42416cc81f4990ad8d425b41a0fc8cd985eb5fa6

9 years agousb: misc: Fix swapped properties in usb3503 DT parsing
Mark Brown [Wed, 7 Aug 2013 19:28:24 +0000 (20:28 +0100)]
usb: misc: Fix swapped properties in usb3503 DT parsing

The intn and connect GPIO properties are swapped in the code which will
cause failures at runtime if these are connected, fix the code.

There are currently no in-tree users of this device to check or update.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 42416cc81f4990ad8d425b41a0fc8cd985eb5fa5]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I42416cc81f4990ad8d425b41a0fc8cd985eb5fa5

9 years agousb: misc: usb3503: use dev_get_platdata()
Jingoo Han [Tue, 30 Jul 2013 08:05:28 +0000 (17:05 +0900)]
usb: misc: usb3503: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit b977a3068a284b2ad4612cdb8ca326cbd2a7ffc9]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib977a3068a284b2ad4612cdb8ca326cbd2a7ffc9

9 years agousb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet
Julius Werner [Sat, 1 Jun 2013 01:34:52 +0000 (18:34 -0700)]
usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet

The usb3503 driver sleeps a flat 100ms when resetting the chip, with a
comment about waiting for the reference clock. This seems to be a
board-specific detail that should not hold up boot across all platforms.
This patch reduces the sleep to the 4ms initialization delay that the
chip itself actually requires (as per its data sheet). If certain boards
require more time to set up the reference clock, they should change this
through local patches or add a proper, configurable synchronization
mechanism.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit 06a962fa7f9bf068eb1238d7aa20453b9e11a9fd]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I06a962fa7f9bf068eb1238d7aa20453b9e11a9fd

9 years agousb: misc: usb3503: Fix up whitespace
Julius Werner [Sat, 1 Jun 2013 01:34:50 +0000 (18:34 -0700)]
usb: misc: usb3503: Fix up whitespace

Remove an erroneous tab that should be a space.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit ccf92c94135059c2fa7ee67bbd19af5103547510]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Iccf92c94135059c2fa7ee67bbd19af5103547510

9 years agousb: misc: usb3503: Adding device tree entry 'disabled-ports'
Dongjin Kim [Tue, 21 May 2013 20:20:09 +0000 (05:20 +0900)]
usb: misc: usb3503: Adding device tree entry 'disabled-ports'

This patch is to add a property 'disabled-ports' representing the unused port
of USB3503. USB3503 can support up to 3 USB host port and each ports can be
controlled to be enabled or disabled. Do not describe this property if all
ports must be enabled.

You can represent the ports to disable in the device tree.

usb3503@08{
...
disabled-ports = <2 3>;
...
};

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit e8b58b49130f40c29bb95cd5d9b36955ff703822]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie8b58b49130f40c29bb95cd5d9b36955ff703822

9 years agousb: misc: usb3503: Add to select the ports to disable
Dongjin Kim [Tue, 21 May 2013 20:20:08 +0000 (05:20 +0900)]
usb: misc: usb3503: Add to select the ports to disable

This patch is to disable the USB ports unconnected to USB3503. In order to
disable the port, 'port_off_mask' must be set.

* Disable PORT1 only
.port_off_mask = USB3503_OFF_PORT1;

* Disable PORT1 and PORT3 only
.port_off_mask = USB3503_OFF_PORT1 | USB3503_OFF_PORT3;

* Enables all ports
.port_off_mask = 0;

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[mszyprow: mainline commit e8e44a4896a5f0bde1af36a31b7ec662bdaa44ef]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie8e44a4896a5f0bde1af36a31b7ec662bdaa44ef

9 years agophy: exynos : add delay after reset phy for usb host
Joonyoung Shim [Tue, 4 Mar 2014 06:38:14 +0000 (15:38 +0900)]
phy: exynos : add delay after reset phy for usb host

The commit 2b431ff74a850db3d5b804be3ac466b6ed7f516d(ARM: EXYNOS4:
Increase reset delay for USB HOST PHY) uses 80 usec delay time after
reset phy for usb host, so this adds delay for reset. If isn't this
delay, it will cause any problem to set usb host register.

Change-Id: I1410dacc6939218bc26510cd45ebd4c0d37dbc62
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidx2: update defconfig for DViCO FusionHDTV USB
Joonyoung Shim [Mon, 3 Mar 2014 11:43:06 +0000 (20:43 +0900)]
ARM: odroidx2: update defconfig for DViCO FusionHDTV USB

This enables au0828 bridge, au8522 dvb frontend and xc5000 tuner for
DViCO FusionHDTV USB.

Change-Id: I2dcac4f9d543da95de6fe07e80088684b5ae8ad9
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoau0828: fix i2c clock speed for DViCO FusionHDTV7
Joonyoung Shim [Tue, 11 Feb 2014 01:54:34 +0000 (10:54 +0900)]
au0828: fix i2c clock speed for DViCO FusionHDTV7

DViCO FusionHDTV7 device that use au0828 can fail to communicate with
xc5000 using i2c interface because of high i2c clock speed - i2c clock
stretching bug. It causes to fail xc5000 firmware loading normally at
the current driver.

Already this problem fixed as changing to low i2c clock speed at
HVR-950q device, also DViCO FusionHDTV7 device can solve it as using low
i2c clock speed - 20KHz.

Change-Id: Ie6fed3673081970a7d6aceeda584433f95c092a2
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidx2: update defconfig
Joonyoung Shim [Fri, 28 Feb 2014 07:00:39 +0000 (16:00 +0900)]
ARM: odroidx2: update defconfig

Enable cgroup, ipv6, nfs and disable serial8250. This will enable to
boot until console login prompt on tizen platform.

Change-Id: Ie29ee730c4a1f30d1fe201b16aab689f03453d5b
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: odroidx2: enable P3V3 fixed regulator to always on
Joonyoung Shim [Fri, 28 Feb 2014 06:38:00 +0000 (15:38 +0900)]
ARM: odroidx2: enable P3V3 fixed regulator to always on

This fixed regulator is used at usb module mainly, not mmc. Just use to
always on it.

Change-Id: Ib43ea87aa85cd21aca9f44937c7c7a70c0e916f4
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
9 years agoARM: defconfig: update tizen_odroidx2_defconfig
Marek Szyprowski [Thu, 27 Feb 2014 10:40:41 +0000 (11:40 +0100)]
ARM: defconfig: update tizen_odroidx2_defconfig

Add missing USB3503 HSIC chip driver (enables host usb support) and
disable UART debug.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-id: I5ba5ef112a0fb02c8a38673a3bf3dfcefa28f696

9 years agoEnable FHANDLE, needed by systemd >= 209
Maciej Wereski [Wed, 26 Feb 2014 16:14:34 +0000 (17:14 +0100)]
Enable FHANDLE, needed by systemd >= 209

Change-Id: Ic01e9ad45ff6241ba451742857f5808f56deb970
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
9 years agomath64: New separate div64_u64_rem helper
Mike Snitzer [Tue, 20 Aug 2013 19:05:17 +0000 (15:05 -0400)]
math64: New separate div64_u64_rem helper

Commit f792685006274a850e6cc0ea9ade275ccdfc90bc ("math64: New
div64_u64_rem helper") implemented div64_u64 in terms of div64_u64_rem.
But div64_u64_rem was removed because it slowed down div64_u64 (and
there were no other users of div64_u64_rem).

Device Mapper's I/O statistics support has a need for div64_u64_rem;
reintroduce this helper as a separate method that doesn't slow down
div64_u64, especially on 32-bit systems.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
[backport]
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Change-Id: Icd721ff57c6d127e7acb0bf17d233d0a50ff24da

9 years agoFix building RPM with tar 1.27 and renamed m0 dtb
Maciej Wereski [Tue, 25 Feb 2014 10:23:55 +0000 (11:23 +0100)]
Fix building RPM with tar 1.27 and renamed m0 dtb

Change-Id: I50a01f8a005ed958e0d2d00f8033eb1a9a2340ec
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
9 years agoexynos4-is: Register v4l2_async notifier only when sensors are available
Sylwester Nawrocki [Mon, 24 Feb 2014 12:48:41 +0000 (13:48 +0100)]
exynos4-is: Register v4l2_async notifier only when sensors are available

This allows driver initialization again if no camera sensors are
specified. It fixes regression introduced in commit 9cb4cf023f4d793ca
"exynos4-is: Add support for asynchronous sensor subddevs registration"

Change-Id: I02379781ff51142f02dc3a4c3f0bc7b0da999e1f
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: defconfig: Add tizen_odroidx2_defconfig
Marek Szyprowski [Mon, 24 Feb 2014 11:40:02 +0000 (12:40 +0100)]
ARM: defconfig: Add tizen_odroidx2_defconfig

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic1fb103c9620aedc1bfee0de5906f58d437db19c

9 years agoarm: dts: exynos4412-odroidx2: add HDMI devices
Tomasz Stanislawski [Thu, 20 Feb 2014 14:47:44 +0000 (15:47 +0100)]
arm: dts: exynos4412-odroidx2: add HDMI devices

This patch adds configuration of HDMI devices on OdroidX2 board.
Moreover, FIMD is enabled as workaround for ia bug caused by
unintialized size of framebuffer.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I8fa76980f35644f886ffc971a4ced1ae03300d12

9 years agodts: odroid x2: add support for multimedia blocks
Marek Szyprowski [Tue, 18 Feb 2014 08:07:33 +0000 (09:07 +0100)]
dts: odroid x2: add support for multimedia blocks

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-id: I7332d504ad79e866ee5e12cca09f8da3416101d5

9 years agocpufreq: conservative: Provide correct pointer for conservative governor
Lukasz Majewski [Fri, 21 Feb 2014 16:42:57 +0000 (17:42 +0100)]
cpufreq: conservative: Provide correct pointer for conservative governor

This patch restores correct value of cs_dbs_info pointer for conservative
governor at CPUFREQ_GOV_STOP event.

Without this patch the NULL pointer dereference error shows up and cpufreq
subsystem hangs.
To trigger the behavior one needs to compile ondemand as default one. Then
enable conservative governor and afterwards enable ondemand again.

Change-Id: Iefd933f5984abb1a46d15357b9ea5f8492deeb08
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agoboost: dts: trats2: Define boost_freq attribute for cpufreq node
Lukasz Majewski [Wed, 19 Feb 2014 12:02:58 +0000 (13:02 +0100)]
boost: dts: trats2: Define boost_freq attribute for cpufreq node

This commit explicitly enables the boost frequency support for Exynos4412
based Trats2 board.

Change-Id: Ie51ad5c5d983578c33ede442d3f9d67ee9dfb4f7
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq: dts: trats2: Remove redundant definitions of cpufreq node
Lukasz Majewski [Wed, 19 Feb 2014 11:56:13 +0000 (12:56 +0100)]
cpufreq: dts: trats2: Remove redundant definitions of cpufreq node

After the dts cleanup the cpufreq nodes were duplicated for trats2.
As a result the trats2 had freq_table definition corresponding to
SLP_PQ (Proxima PQ) target.

Change-Id: I63a7f627c448caa163df5e915b91cd0979da468e
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
9 years agocpufreq: ondemand: Change the calculation of target frequency
Stratos Karafotis [Wed, 5 Jun 2013 16:01:25 +0000 (19:01 +0300)]
cpufreq: ondemand: Change the calculation of target frequency

The ondemand governor calculates load in terms of frequency and
increases it only if load_freq is greater than up_threshold
multiplied by the current or average frequency.  This appears to
produce oscillations of frequency between min and max because,
for example, a relatively small load can easily saturate minimum
frequency and lead the CPU to the max.  Then, it will decrease
back to the min due to small load_freq.

Change the calculation method of load and target frequency on the
basis of the following two observations:

 - Load computation should not depend on the current or average
   measured frequency.  For example, absolute load of 80% at 100MHz
   is not necessarily equivalent to 8% at 1000MHz in the next
   sampling interval.

 - It should be possible to increase the target frequency to any
   value present in the frequency table proportional to the absolute
   load, rather than to the max only, so that:

   Target frequency = C * load

   where we take C = policy->cpuinfo.max_freq / 100.

Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait.
Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an
increase ~1.5% in performance. cpufreq_stats (time_in_state) shows
that middle frequencies are used more, with this patch.  Highest
and lowest frequencies were used less by ~9%.

[rjw: We have run multiple other tests on kernels with this
 change applied and in the vast majority of cases it turns out
 that the resulting performance improvement also leads to reduced
 consumption of energy.  The change is additionally justified by
 the overall simplification of the code in question.]

Change-Id: I26399d5d61616ee9157baa7eb8b337bacab5b892
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agoclocksource: exynos4: Fix wrong bit operation in exynos4_mct_write()
Jonghwa Lee [Tue, 4 Feb 2014 09:54:23 +0000 (18:54 +0900)]
clocksource: exynos4: Fix wrong bit operation in exynos4_mct_write()

There is a faulty bit operation during checking offset in exyno4_mct_write().
This patch fixes it correctly.

Change-Id: Ifbe30007bc378d8ab0585a70c0c343dbbc350415
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agouserns: Allow PR_CAPBSET_DROP in a user namespace.
Eric W. Biederman [Tue, 2 Jul 2013 17:04:54 +0000 (10:04 -0700)]
userns: Allow PR_CAPBSET_DROP in a user namespace.

As the capabilites and capability bounding set are per user namespace
properties it is safe to allow changing them with just CAP_SETPCAP
permission in the user namespace.

Change-Id: I65d5c6ef80d4196cc6b8cbc86a9661764c5b3ab1
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Tested-by: Richard Weinberger <richard@nod.at>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
9 years agomm/page_alloc: fix freeing of MIGRATE_RESERVE migratetype pages
Bartlomiej Zolnierkiewicz [Fri, 14 Feb 2014 18:34:17 +0000 (19:34 +0100)]
mm/page_alloc: fix freeing of MIGRATE_RESERVE migratetype pages

Pages allocated from MIGRATE_RESERVE migratetype pageblocks
are not freed back to MIGRATE_RESERVE migratetype free
lists in free_pcppages_bulk()->__free_one_page() if we got
to free_pcppages_bulk() through drain_[zone_]pages().
The freeing through free_hot_cold_page() is okay because
freepage migratetype is set to pageblock migratetype before
calling free_pcppages_bulk().  If pages of MIGRATE_RESERVE
migratetype end up on the free lists of other migratetype
whole Reserved pageblock may be later changed to the other
migratetype in __rmqueue_fallback() and it will be never
changed back to be a Reserved pageblock.  Fix the issue by
preserving freepage migratetype as a pageblock migratetype
(instead of overriding it to the requested migratetype)
for MIGRATE_RESERVE migratetype pages in rmqueue_bulk().

The problem was introduced in v2.6.31 by commit ed0ae21
("page allocator: do not call get_pageblock_migratetype()
more than necessary").

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reported-by: Yong-Taek Lee <ytk.lee@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I1d4ab2a3241387160dd376b0ead864cd2b0c59f0

9 years agoARM: exynos: dts: cleanup the dts file for trats2
Jaehoon Chung [Mon, 17 Feb 2014 08:28:43 +0000 (17:28 +0900)]
ARM: exynos: dts: cleanup the dts file for trats2

Unused dts file is removed, and trats2.dts file is created.
It's maintained more better than before.

Change-Id: Ie51a02044a988fd0e2c8deac2c5fd407f5e374da
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
9 years agoarm: dts: cleanup entries for usb phy for Exynos4
Marek Szyprowski [Tue, 18 Feb 2014 08:07:09 +0000 (09:07 +0100)]
arm: dts: cleanup entries for usb phy for Exynos4

Remove old, obsoleted entries for usb phy and move new common nodes to
exynos4x12/exynos4.dtsi files.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie73f5d365dd72ee4cf4f39c7b07706ec286356fe

9 years agousb: gadget: Enable rndis in the slp gadget driver
Jacek Bukarewicz [Fri, 14 Feb 2014 14:22:16 +0000 (15:22 +0100)]
usb: gadget: Enable rndis in the slp gadget driver

Rndis was disabled temporarily in commit 7ca93af to fix build break.
It can be enabled now as commit 65c9d04 adapted slp driver to the new interface
of rndis.

Change-Id: Id28413de771818cf1a358664d637aa989615fe26
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
9 years agoarm: config: tizen: enable HDMI drivers
Tomasz Stanislawski [Wed, 12 Feb 2014 15:03:51 +0000 (16:03 +0100)]
arm: config: tizen: enable HDMI drivers

This patch enables HDMI drivers including:
- DRM HDMI
- SII9234 HDMI-to-MHL bridge
- Exynos PHY

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I8d9d6d6163bdda2c8d299bcd8048b10fa7bb2f35

9 years agoarm: dts: exynos4412-slp-pq: add HDMI devices
Tomasz Stanislawski [Fri, 20 Dec 2013 11:33:58 +0000 (12:33 +0100)]
arm: dts: exynos4412-slp-pq: add HDMI devices

This patch adds configuration of HDMI devices on SLP-PQ board.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: Ib2992887d3e0054d14dfba1872a575a707249849

9 years agoarm: dts: universal_c210: add HDMI devices
Tomasz Stanislawski [Thu, 17 Oct 2013 12:58:06 +0000 (14:58 +0200)]
arm: dts: universal_c210: add HDMI devices

This patch adds configuration of HDMI devices on Universal C210 board.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: Ic391e351309d99dc5f7fef48f78ec08a89819cc9

9 years agoarm: dts: exynos4: add HDMI devices
Tomasz Stanislawski [Thu, 17 Oct 2013 11:56:04 +0000 (13:56 +0200)]
arm: dts: exynos4: add HDMI devices

This patch adds DT nodes for HDMI related devices on SoCs from Exynos4 family.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I92462470abd05ce14635b33a37b3f1e50e463085

9 years agoarm: dts: exynos4: add i2c controller for HDMIPHY
Tomasz Stanislawski [Thu, 17 Oct 2013 11:56:04 +0000 (13:56 +0200)]
arm: dts: exynos4: add i2c controller for HDMIPHY

This patch adds DT nodes for I2C controller dedicated for HDMIPHY.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: Ia45c9fc0594b534036175deaee5562ca66dcbcc0

9 years agodrm: exynos: hdmi: add support for pixel clock limitation
Tomasz Stanislawski [Thu, 19 Dec 2013 15:24:07 +0000 (16:24 +0100)]
drm: exynos: hdmi: add support for pixel clock limitation

Adds support for limitation of maximal pixel clock of HDMI
signal. This feature is needed on boards that contains
lines or bridges with frequency limitations.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I4cc38e995feeaca77b73e9ea0197d67f99d57715

9 years agodrm: exynos: add compatibles for HDMI and Mixer chips and exynos4210 SoC
Tomasz Stanislawski [Wed, 16 Oct 2013 11:41:14 +0000 (13:41 +0200)]
drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210 SoC

This patch add proper compatibles for Mixer and HDMI chip
available on exynos4210 SoCs.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I5ca49ea9f95b139834de9ed8bba79b37b685bf3a

9 years agodrm: exynos: migrate to Common Clock Framework
Tomasz Stanislawski [Wed, 9 Oct 2013 13:51:00 +0000 (15:51 +0200)]
drm: exynos: migrate to Common Clock Framework

Transform all clk_enable() to clk_prepare_enable() and
all clk_disable() to clk_disable_unprepare().

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: Iaf66f2229677234273c7b66f6d9f0f17c74bf2ff

9 years agodrm: exynos: hdmi: simplify extracting hpd-gpio from DT
Tomasz Stanislawski [Tue, 15 Oct 2013 14:40:07 +0000 (16:40 +0200)]
drm: exynos: hdmi: simplify extracting hpd-gpio from DT

This patch eliminates redundant checks while retrieving HPD gpio from DT during
HDMI's probe().

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I1f2312291bd7c2334783c8067889b95db305377f

9 years agodrm: exynos: hdmi: use hdmiphy as PHY
Tomasz Stanislawski [Thu, 3 Oct 2013 14:04:53 +0000 (16:04 +0200)]
drm: exynos: hdmi: use hdmiphy as PHY

The HDMIPHY (physical interface) is controlled by a single
bit in a power controller's regiter. It was implemented
as clock. It was a simple but effective hack.

This patch makes HDMI driver to control HDMIPHY via PHY interface.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I7e4729b61c7e71f7e411d423794420893f99f384

9 years agoclk: exynos4: enable clk_set_parent() propagation for sclk_hdmi and sclk_mixer clocks
Tomasz Stanislawski [Wed, 16 Oct 2013 11:08:55 +0000 (13:08 +0200)]
clk: exynos4: enable clk_set_parent() propagation for sclk_hdmi and sclk_mixer clocks

This patch enables clk_set_parent() propagation for clocks used
by s5p-tv and exynos-drm drivers.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I8f91dcd73a43291297def7f69eb35950afd45c55

9 years agoclk: propagate parent change up one level
Tomasz Stanislawski [Tue, 15 Oct 2013 15:59:11 +0000 (17:59 +0200)]
clk: propagate parent change up one level

This patch adds support for propagation of setup of clock's parent one level
up.

This feature is helpful when a driver changes topology of its clocks using
clk_set_parent().  The problem occurs when on one platform/SoC driver's clock
is located at MUX output but on the other platform/SoC there is a gated proxy
clock between the MUX and driver's clock.  In such a case, driver's code has to
be modified to use one clock for enabling and the other clock for setup of a
parent.

The code updates are avoided by propagating setup of a parent up one level.

Additionally, this patch adds CLK_SET_PARENT_PARENT (sorry for naming) flag to
inform clk-core that clk_set_parent() should be propagated.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I206d23fb86cc09bce943ef9971a710876e3a7744

9 years agoclk: exynos4: export sclk_hdmiphy clock
Tomasz Stanislawski [Mon, 7 Oct 2013 12:27:52 +0000 (14:27 +0200)]
clk: exynos4: export sclk_hdmiphy clock

Export sclk_hdmiphy clock to be usable from DT.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I0d1c8d0c2e2e93bd34f9fcdf82154208c2381a73

9 years agomisc: add sii9234 driver
Tomasz Stanislawski [Fri, 20 Dec 2013 11:30:43 +0000 (12:30 +0100)]
misc: add sii9234 driver

Add driver for HDMI bridge usnig MHL connection.
Contains refactored MHL driver developed by:

Adam Hampson <ahampson@sta.samsung.com>
Erik Gilling <konkers@android.com>
Shankar Bandal <shankar.b@samsung.com>
Dharam Kumar <dharam.kr@samsung.com>

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I7fed88ab786a4fef8fb97dca6c7336d11eb806c5