platform/kernel/linux-exynos.git
5 years agoARM: tizen_odroid_defconfig: Change the default cpufreq governor 82/194682/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181217.064503 submit/tizen_5.0/20181214.050301
Junghoon Kim [Fri, 7 Dec 2018 03:47:54 +0000 (12:47 +0900)]
ARM: tizen_odroid_defconfig: Change the default cpufreq governor

This patch changes the default cpufreq governor from Performance to
Ondemand.

Change-Id: Iaf881123bced27b2cfe8d8bb60e6dec266240fc9
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
5 years agoARM: configs: tizen_odroid: enable configs relevant to network feature 26/191926/1 accepted/tizen/5.0/unified/20181106.070432 accepted/tizen/unified/20181106.070500 submit/tizen/20181102.014010 submit/tizen_5.0/20181105.231423
Jaehoon Chung [Thu, 25 Oct 2018 10:50:08 +0000 (19:50 +0900)]
ARM: configs: tizen_odroid: enable configs relevant to network feature

Enable configs relevant to network feature.
In Tizen, stc-manager needs to enable these configurations to work fine.

Change-Id: I8e529f6f8151819a0a65501b9b2035343838d268
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoRevert "drm/exynos/hdmi: dis-join pipeline on power-off" 88/191088/1 submit/tizen/20181016.044111
Hoegeun Kwon [Thu, 11 Oct 2018 07:23:24 +0000 (16:23 +0900)]
Revert "drm/exynos/hdmi: dis-join pipeline on power-off"

This reverts commit dfcdaaf118866f4ac77b8962e1b1e1e91503e1b4.

If encoder is removed from hdmi_poweroff(), vblank is not enabled when
dpms is turned on after off. So do not remove the encoder from
hdmi_poweroff(). For another reason, the encoder is created when it
binds, and it is released when destory.

Change-Id: I242eddf4842cb005bc1d21e37d30b5588bd532d1
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
5 years agoUVC: Add support for R200 depth camera 00/189700/1
Aviv Greenberg [Tue, 24 Jul 2018 04:59:07 +0000 (13:59 +0900)]
UVC: Add support for R200 depth camera

Add support for Intel R200 depth camera in uvc driver.
This includes adding new uvc GUIDs for the new pixel formats,
adding new V4L pixel format definition to user api headers,
and updating the uvc driver GUID-to-4cc tables with the new formats.

Tested-by: Greenberg, Aviv D <aviv.d.greenberg@intel.com>
Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
back-ported by Inki from mainline, commit-id : 5d8d8db851ef81337e
Signed-off-by: Inki Dae <inki.dae@samsung.com>
[sw0312.kim: fix conflict with already applied r200 commit]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifda9fa76cb7fc603d039adcc00b95f13ea92de13

5 years agoBug fix for inclomplete PowerLineFrequency enumeration map 99/189699/1
Evgeni Raikhel [Tue, 24 Jul 2018 04:54:10 +0000 (13:54 +0900)]
Bug fix for inclomplete PowerLineFrequency enumeration map

Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
Back-ported by Inki from : https://github.com/IntelRealSense/librealsense/tree/master/scripts
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I5712a988ef2038ae12e2a7e82425543c1d8b60a7

5 years agoEnabling UVC Metadata attributes with Ubuntu 18.04 98/189698/1
Evgeni Raikhel [Tue, 24 Jul 2018 04:53:19 +0000 (13:53 +0900)]
Enabling UVC Metadata attributes with Ubuntu 18.04

(Bionic Beaver) and Kernel version 4.15

Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
back-ported by Inki from : https://github.com/IntelRealSense/librealsense/tree/master/scripts
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I604d7bccd0a40cdfe584d7d7991bf1d9d171fea3

5 years agousb/uvc: add new format support 97/189697/1
Inki Dae [Tue, 24 Jul 2018 04:47:14 +0000 (13:47 +0900)]
usb/uvc: add new format support

Back-ported by Inki from : https://github.com/IntelRealSense/librealsense/tree/master/scripts
Signed-off-by: Inki Dae <inki.dae@samsung.com>
[sw0312.kim: fix conflict with previously applied depth camera support patch]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I9bb8cd18da77804171c0e2c753792b10c4c78618

5 years agos5p-jpeg: don't return a random width/height 96/189696/1
Mauro Carvalho Chehab [Thu, 18 May 2017 13:40:00 +0000 (10:40 -0300)]
s5p-jpeg: don't return a random width/height

Gcc 7.1 complains about:

drivers/media/platform/s5p-jpeg/jpeg-core.c: In function 's5p_jpeg_parse_hdr.isra.9':
drivers/media/platform/s5p-jpeg/jpeg-core.c:1207:12: warning: 'width' may be used uninitialized in this function [-Wmaybe-uninitialized]
  result->w = width;
  ~~~~~~~~~~^~~~~~~
drivers/media/platform/s5p-jpeg/jpeg-core.c:1208:12: warning: 'height' may be used uninitialized in this function [-Wmaybe-uninitialized]
  result->h = height;
  ~~~~~~~~~~^~~~~~~~

Indeed the code would allow it to return a random value (although
it shouldn't happen, in practice). So, explicitly set both to zero,
just in case.

Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[sw0312.kim: backport from mainline to fix gcc 7 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: If9d86efffa587c7fcab4b9683e52717d7ed1c887

5 years agoARM: config: tizen_odroid: enable Atheros USB driver 34/189534/1 accepted/tizen/5.0/unified/20181102.023803 accepted/tizen/unified/20180919.141904 submit/tizen/20180919.044027 submit/tizen_5.0/20181101.000005
Jaehoon Chung [Tue, 18 Sep 2018 07:14:47 +0000 (16:14 +0900)]
ARM: config: tizen_odroid: enable Atheros USB driver

Enable Atheros USB driver to test WiFi Mesh.

Change-Id: I5b8b804dcd428b548d9ed6178929cb81abb72424
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agousb:f_mtp: Prevent NULL pointer deferences in ioctl 21/188021/1
Paweł Szewczyk [Wed, 29 Aug 2018 15:11:48 +0000 (17:11 +0200)]
usb:f_mtp: Prevent NULL pointer deferences in ioctl

It's possible that user will call mtpg_ioctl while mtp function is not
properly initialized. However this is an erroneous behavior, this change
takes it into consideration and prevents null-pointer dereferences.

Change-Id: I47d88c7cf526064a4d028b851216344c9634439d
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
5 years agoBluetooth: Report RPA changed event 92/186492/2
injun.yang [Mon, 21 May 2018 08:32:16 +0000 (17:32 +0900)]
Bluetooth: Report RPA changed event

When RPA changed, The updated RPA is not applied on
VSC advertising. This patchset generates new event
and resolves the problem.

Change-Id: Icc3dd74da0449cb8e456c27bc34995f43326efe1
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agodrm/exynos: decon5433: Fix WINCONx reset value 32/180532/2 accepted/tizen/unified/20180619.141833 submit/tizen/20180615.023254
Marek Szyprowski [Wed, 30 May 2018 10:48:10 +0000 (12:48 +0200)]
drm/exynos: decon5433: Fix WINCONx reset value

The only bits that should be preserved in decon_win_set_fmt() is
WINCONx_ENWIN_F. All other bits depends on the selected pixel formats and
are set by the mentioned function.

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

5 years agodrm/exynos: decon5433: Fix per-plane global alpha for XRGB modes 31/180531/2
Marek Szyprowski [Wed, 30 May 2018 10:44:25 +0000 (12:44 +0200)]
drm/exynos: decon5433: Fix per-plane global alpha for XRGB modes

Set per-plane global alpha to maximum value to get proper blending of
XRGB together with ARGB planes. This fixes the strange order of
overlapping planes, especially when XRGB planes are displayed together
with ARGB planes.

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

5 years agodrm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes 21/180421/1
Marek Szyprowski [Tue, 29 May 2018 09:15:38 +0000 (11:15 +0200)]
drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes

Fix following issues related to planar YUV pixel format configuration:
- NV16/61 modes were incorrectly programmed as NV12/21,
- YVU420 was programmed as YUV420 on source,
- YVU420 and YUV422 were programmed as YUV420 on output.

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

5 years agodrm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes 20/180420/1
Marek Szyprowski [Tue, 29 May 2018 08:18:47 +0000 (10:18 +0200)]
drm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes

Fix Cb/CR components order in two-planar YUV420, YUV422 and YUV444 modes.

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

5 years agodrm/exynos: scaler: Reset hardware before starting the operation 99/180199/4
Andrzej Pietrasiewicz [Mon, 5 Feb 2018 15:41:54 +0000 (16:41 +0100)]
drm/exynos: scaler: Reset hardware before starting the operation

Ensure that Scaler hardware is properly reset and interrupts are cleared
before processing next image.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ia06b7cae7542fad1b3ccc6da78fa0b9a66a9e6ce

5 years agoarm64: dts: exynos: Add mem-2-mem Scaler devices 98/180198/4
Andrzej Pietrasiewicz [Fri, 25 May 2018 08:33:48 +0000 (10:33 +0200)]
arm64: dts: exynos: Add mem-2-mem Scaler devices

There are two Scaler devices in Exynos5433 SoCs. Add nodes for them and
their SYSMMU controllers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3fe7aa7fc8e48a7da3110962a723b2a84a2c34a7

5 years agodrm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation 18/180218/3
Marek Szyprowski [Fri, 25 May 2018 11:02:55 +0000 (13:02 +0200)]
drm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in Rotator driver. Fix this by swapping code for interpreting
them.

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

5 years agodrm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation 17/180217/3
Marek Szyprowski [Fri, 25 May 2018 11:02:26 +0000 (13:02 +0200)]
drm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation

Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip
were swapped in GScaler driver. Fix this by swapping code for interpreting
them.

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

5 years agodrm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels 48/180348/2
Marek Szyprowski [Mon, 28 May 2018 12:34:39 +0000 (14:34 +0200)]
drm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels

Investigation revealed that GScaler hardware requires the real buffer width
(pitch) to be aligned to 16 pixels.

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

5 years agodrm/exynos: gsc: Use real buffer width for configuring the hardware 47/180347/2
Marek Szyprowski [Mon, 28 May 2018 12:10:14 +0000 (14:10 +0200)]
drm/exynos: gsc: Use real buffer width for configuring the hardware

DMA hardware should respect buffer pitch, so use the width calculated from
the buffer pitch instead of the virtual one.

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

5 years agodrm/exynos: ipp: Rework checking for the correct buffer formats 46/180346/2
Marek Szyprowski [Mon, 28 May 2018 12:03:20 +0000 (14:03 +0200)]
drm/exynos: ipp: Rework checking for the correct buffer formats

Prepare a common function for size and scale checks and call it for
source and destination buffers. Then also move there the state-less checks
from exynos_drm_ipp_task_setup_buffer, so the format information is already
available in limits processing. Finally perform the IPP_LIMIT_BUFFER check
on the real width of the buffer (the width calculated from the provided
buffer pitch).

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

6 years agopackaging: odroid: install only dt files relevant to odroid 83/178783/1
Jaehoon Chung [Mon, 14 May 2018 04:23:41 +0000 (13:23 +0900)]
packaging: odroid: install only dt files relevant to odroid

Current spec file is tryed to install all dtb files that is built.
It's wasted the storage capacity.
Install only dt files relevant to odroid.

Change-Id: I20cb65a4d26f17f348dd3f3783062fb07576257a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 years agoARM: tizen_{odroid,tm2}_defconfig: enable AUDITSYSCALL 15/174815/1 accepted/tizen/unified/20180417.173227 submit/tizen/20180417.022005
Inki Dae [Wed, 4 Apr 2018 08:48:11 +0000 (17:48 +0900)]
ARM: tizen_{odroid,tm2}_defconfig: enable AUDITSYSCALL

Enabled AUDITSYSCALL for the use of audit subsystem.
A new security feature for Tizen 5.0 requires the subsystem
in default.

Change-Id: Idd14966d721948996a6db40c276e905787e25a92
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoarm64: tizen_tm2_defcofig: synchronize defconfig file 14/174814/1
Inki Dae [Wed, 4 Apr 2018 08:46:48 +0000 (17:46 +0900)]
arm64: tizen_tm2_defcofig: synchronize defconfig file

Just synchronized defconfig file for tm2.

Change-Id: Iab74ccd6fdbe3fd93fe581b5e9e07fd53734abf0
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agoARM: tizen_odroid_defconfig: disable V4L2 GSC 23/174323/1 accepted/tizen/unified/20180404.063402 submit/tizen/20180330.043331 submit/tizen/20180403.011904
Inki Dae [Fri, 30 Mar 2018 05:34:48 +0000 (14:34 +0900)]
ARM: tizen_odroid_defconfig: disable V4L2 GSC

Exynos DRM IPPv2 doesn't share GSC device with V4L2,
so disable V4L2 GSC for now.

Change-Id: I4dc625d575ec96bc2eabcacb869a06787d8964c6
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agodrm/exynos: update minor version 22/174322/1
Inki Dae [Thu, 29 Mar 2018 08:33:25 +0000 (17:33 +0900)]
drm/exynos: update minor version

Updated minor version according to IPPv2 support.

Change-Id: I8c05138f0704c3848e2a080388d9b48543dec6fa
Signed-off-by: Inki Dae <inki.dae@samsung.com>
6 years agotizen_tm2_defconfig: use only Exynos DRM IPPv2 GScaler 51/172751/2
Marek Szyprowski [Thu, 15 Mar 2018 12:56:31 +0000 (13:56 +0100)]
tizen_tm2_defconfig: use only Exynos DRM IPPv2 GScaler

Exynos DRM IPPv2 doesn't share GSC device with V4L2, so disable V4L2 GSC
for now.

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

6 years agodrm/exynos: gsc: Add limited support for ARGB8888 format 64/173064/2
Marek Szyprowski [Mon, 19 Mar 2018 10:06:57 +0000 (11:06 +0100)]
drm/exynos: gsc: Add limited support for ARGB8888 format

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

6 years agodrm/exynos: gsc: relax limits for exynos5433 variant 50/171650/3
Marek Szyprowski [Fri, 2 Mar 2018 14:00:48 +0000 (15:00 +0100)]
drm/exynos: gsc: relax limits for exynos5433 variant

It turned out that GSC module is able to process images with less strict
alignment.

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

6 years agodrm/exynos: ipp: Move buffer setup to separate function 73/173873/1
Marek Szyprowski [Mon, 26 Mar 2018 13:09:48 +0000 (15:09 +0200)]
drm/exynos: ipp: Move buffer setup to separate function

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

6 years agodrm/exynos: ipp: Fix support for image rotation and buffer offset 49/171649/2
Marek Szyprowski [Thu, 25 Jan 2018 14:00:25 +0000 (15:00 +0100)]
drm/exynos: ipp: Fix support for image rotation and buffer offset

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

6 years agodrm/exynos: ipp: Adapt IPPv2 code to older exynos & DRM frameworks 48/171648/2
Marek Szyprowski [Thu, 25 Jan 2018 11:43:42 +0000 (12:43 +0100)]
drm/exynos: ipp: Adapt IPPv2 code to older exynos & DRM frameworks

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

6 years agodrm/exynos: ipp: Port IPPv2 from mainline 47/171647/2
Marek Szyprowski [Thu, 25 Jan 2018 09:12:35 +0000 (10:12 +0100)]
drm/exynos: ipp: Port IPPv2 from mainline

Port Exynos DRM IPPv2 support from mainline V6 patchset:
"Exynos DRM: rewrite IPP subsystem and userspace API"
https://lists.freedesktop.org/archives/dri-devel/2017-November/157130.html

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

6 years agoof: add helper function to retrive match data 46/171646/2
Joachim Eastwood [Wed, 6 May 2015 18:09:09 +0000 (20:09 +0200)]
of: add helper function to retrive match data

It's a common operation for device drivers to retrive the data
member from of_device_id struct in their probe function.

Most driver end up doing:
    const struct of_device_id *match;
    match = of_match_device(driver_of_match, &pdev->dev);
    driver->data = match->data;

With the of_device_get_match_data helper function all this can
done in one go.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
[robh: add missing inline to dummmy declaration]
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 3386e0fa905c31bf1dafa2cbe2ecceb7e5ce2e66)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I75322ec4636f4e151336524241ee7536cc3405ba

6 years agopackaging: change modules packaging with each file instead of directory 30/172030/1 accepted/tizen/unified/20180312.060432 submit/tizen/20180309.065130
Seung-Woo Kim [Fri, 9 Mar 2018 05:12:08 +0000 (14:12 +0900)]
packaging: change modules packaging with each file instead of directory

There is a requirement to use other package with /lib/modules
directory and it causes conflict with kernel modules package.
Change modules packaging with each file instead of the directory.

Change-Id: I991e1874c6e8b232f0fe01eddb67cd5225d99293
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agonetfilter: nfnetlink_queue: fix secctx memory leak 11/170911/1 accepted/tizen/unified/20180227.063118 submit/tizen/20180227.012056
Liping Zhang [Tue, 28 Mar 2017 14:59:25 +0000 (22:59 +0800)]
netfilter: nfnetlink_queue: fix secctx memory leak

We must call security_release_secctx to free the memory returned by
security_secid_to_secctx, otherwise memory may be leaked forever.

Fixes: ef493bd930ae ("netfilter: nfnetlink_queue: add security context information")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[sw0312.kim: cherry-pick the commit 77c1c03c5b8 from mainline to fix already backported commit
 - the commit ef493bd930ae ("netfilter: nfnetlink_queue: add security context information") was backported for nether.service in tizen
 - change in net/netfilter/nfnetlink_queue.c is applied to net/netfilter/nfnetlink_queue_core.c]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifbc5f96bb6039503b7390864936fe6eda2e53acb

6 years agoarm: dts: odroidxu3: Remove extcon node for a host-only USB 3.0 port 62/168362/4 accepted/tizen/unified/20180130.144410 submit/tizen/20180130.013321
Dongwoo Lee [Thu, 25 Jan 2018 05:33:27 +0000 (14:33 +0900)]
arm: dts: odroidxu3: Remove extcon node for a host-only USB 3.0 port

The host-only USB 3.0 port on odroid-xu3 doesn't provide connection
detection through GPIO, but extcon node is configured for this port.
This unnecessary extcon node just represents wrong state for USB
connection. Thus, this patch removes extcon node for a host-only USB
port and configures USB controller in odroid-xu3 specific device tree.

Change-Id: I4be1ae7e8a8a4ca80e53cc6a8b408f7f57a89ea1
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agoproc, coredump: add CoreDumping flag to /proc/pid/status 64/168264/1
Roman Gushchin [Fri, 17 Nov 2017 23:26:45 +0000 (15:26 -0800)]
proc, coredump: add CoreDumping flag to /proc/pid/status

Right now there is no convenient way to check if a process is being
coredumped at the moment.

It might be necessary to recognize such state to prevent killing the
process and getting a broken coredump.  Writing a large core might take
significant time, and the process is unresponsive during it, so it might
be killed by timeout, if another process is monitoring and
killing/restarting hanging tasks.

We're getting a significant number of corrupted coredump files on
machines in our fleet, just because processes are being killed by
timeout in the middle of the core writing process.

We do have a process health check, and some agent is responsible for
restarting processes which are not responding for health check requests.
Writing a large coredump to the disk can easily exceed the reasonable
timeout (especially on an overloaded machine).

This flag will allow the agent to distinguish processes which are being
coredumped, extend the timeout for them, and let them produce a full
coredump file.

To provide an ability to detect if a process is in the state of being
coredumped, we can expose a boolean CoreDumping flag in
/proc/pid/status.

Example:
$ cat core.sh
  #!/bin/sh

  echo "|/usr/bin/sleep 10" > /proc/sys/kernel/core_pattern
  sleep 1000 &
  PID=$!

  cat /proc/$PID/status | grep CoreDumping
  kill -ABRT $PID
  sleep 1
  cat /proc/$PID/status | grep CoreDumping

$ ./core.sh
  CoreDumping: 0
  CoreDumping: 1

[guro@fb.com: document CoreDumping flag in /proc/<pid>/status]
Link: http://lkml.kernel.org/r/20170928135357.GA8470@castle.DHCP.thefacebook.com
Link: http://lkml.kernel.org/r/20170920230634.31572-1-guro@fb.com
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[inki.dae: backported from mainline - commit : c643401218be
  On Tizen, there is one issue that a process doing coredump can be killed.
  This patch allows a process to detect if given process is being dumped.
  With this, Tizen can exclude such process from 'kill list' so that
  coredump process can finish coredump work.]
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Change-Id: I4f21bdcbbf1451f04e2083621925953823bd1164

6 years agodrm/exynos/gsc: Fix to check memory address and size separately 27/165627/1 accepted/tizen/unified/20180105.065533 submit/tizen/20180104.063507
Hoegeun Kwon [Tue, 2 Jan 2018 08:31:39 +0000 (17:31 +0900)]
drm/exynos/gsc: Fix to check memory address and size separately

If there is no Y, CB or CR address, memory size is not checked.
Checking the address and size of the memory should be checked
separately.

Change-Id: I196090b0b390fb4474c56bdf6ba6b6cb9c450f5c
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
6 years agoarm64: dts: exynos5433: Modify exynos-avs device node 16/160816/6
Wook Song [Mon, 20 Nov 2017 06:50:39 +0000 (15:50 +0900)]
arm64: dts: exynos5433: Modify exynos-avs device node

This patch modifies the exynos AVS device tree node for Exynos5433.
Since the operating-points node is no longer required by the AVS device
driver, it is removed from the each of the exynos-avs nodes.

Change-Id: I9f46afd0f98f8fe6ceb7d7e18d1d8dbb10db96fa
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoPM / AVS: exynos-avs: Support all ASV groups for Exynos 5433 CPU cores 15/160815/6
Wook Song [Mon, 20 Nov 2017 06:48:30 +0000 (15:48 +0900)]
PM / AVS: exynos-avs: Support all ASV groups for Exynos 5433 CPU cores

Since multiple supply voltages for a operating frequency and the
'supported-hw' property are not supported by OPPv1, there is no way to
support all the frequency-voltage tables under the dt-based common
device driver. Therefore, the previous version of Exynos5433-specific
device driver only supports the optimized OPP table for the ASV group
number of 8 in version 2 of the OPP table (which means that the driver
supports only one case of all).

However, since there is a requirement to improve the performance under
the given thermal budget for TM2 boards, it is required to support all
frequency-voltage tables corresponding to their ASV groups and table
versions for the Exynos 5433 CPU cores.

This patch modifies the common and Exynos5433 SoC specific AVS device
driver to use static frequency-voltage tables rather than a OPP table
from the DT file.

Change-Id: I74c21403635fc63143d60461b534828fc87cb3f4
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agodrm/bridge/sii8620: add DVI mode support 57/159357/2
Maciej Purski [Thu, 9 Nov 2017 10:31:32 +0000 (11:31 +0100)]
drm/bridge/sii8620: add DVI mode support

If the sink device is in HDMI mode, enable infoframe interrupt in scdt
irq handle function else call start_video function immediately, because
in DVI mode, there is no infoframe interrupt provided.

Rename start_hdmi function to start_video and get rid of the old
start_video function. In start_video, if the sink is DVI and mode is
MHL1 or MHl2, write appropriate values to registers else the path
should remain the same as in HDMI mode.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Change-Id: Iac0f76fd1d974fde8bf5c107b7f63b7aa584198d

6 years agogpu: drm: exynos: Notify the plugged state while probing 05/157305/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20171101.064815 accepted/tizen/unified/20171031.055643 submit/tizen/20171031.014243 submit/tizen_4.0/20171101.031710 tizen_4.0.IoT.p2_release
Dongwoo Lee [Mon, 23 Oct 2017 00:47:19 +0000 (09:47 +0900)]
gpu: drm: exynos: Notify the plugged state while probing

Since commit 38b49e08, hdmi driver can notify the connection state
via extcon framework. However, if hdmi cable is already connected
before the system boot, there is no interrupt for hdmi connection,
and thus it cannot be informed to userspace. To prevent the situation
that cable is connected, but uninformed in userspace, this patch
makes hdmi driver check the plugged state and notifies it explicitly
at probing.

Change-Id: I432f30df4effef27c7f393a4659c02cc035d5e6d
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agodisable new gcc-7.1.1 warnings for now 97/157097/1
Linus Torvalds [Thu, 13 Jul 2017 02:25:47 +0000 (19:25 -0700)]
disable new gcc-7.1.1 warnings for now

I made the mistake of upgrading my desktop to the new Fedora 26 that
comes with gcc-7.1.1.

There's nothing wrong per se that I've noticed, but I now have 1500
lines of warnings, mostly from the new format-truncation warning
triggering all over the tree.

We use 'snprintf()' and friends in a lot of places, and often know that
the numbers are fairly small (ie a controller index or similar), but gcc
doesn't know that, and sees an 'int', and thinks that it could be some
huge number.  And then complains when our buffers are not able to fit
the name for the ten millionth controller.

These warnings aren't necessarily bad per se, and we probably want to
look through them subsystem by subsystem, but at least during the merge
window they just mean that I can't even see if somebody is introducing
any *real* problems when I pull.

So warnings disabled for now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[sw0312.kim: backport from mainline to fix gcc-7 build warnings]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ic7c286d72d03dbed393efa48142a571d82045d87

6 years agogpu: drm: exynos: Add extcon notification for hdmi connection 60/156260/5 accepted/tizen/4.0/unified/20171018.231844 accepted/tizen/unified/20171018.165341 submit/tizen/20171018.070350 submit/tizen_4.0/20171018.070324 tizen_4.0.m2_release
Dongwoo Lee [Tue, 17 Oct 2017 23:21:05 +0000 (08:21 +0900)]
gpu: drm: exynos: Add extcon notification for hdmi connection

Currently, hdmi connection generates only uevent by drm core. In
addition, it has no information about connection state. But, Tizen
starts TV-out behavior along with extcon uevent. To this end, this
patch will add extcon notification for hdmi connection.

Change-Id: I831d53ed345631273fc797c3625c67a70443ae25
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agoARM: tizen_{odroid,tm2}_defconfig: enable CONNECTOR/PROC_EVENTS options 25/155925/1 accepted/tizen/4.0/unified/20171017.212502 accepted/tizen/unified/20171017.071147 submit/tizen/20171017.031118 submit/tizen_4.0/20171017.030930
Seung-Woo Kim [Mon, 16 Oct 2017 11:38:45 +0000 (20:38 +0900)]
ARM: tizen_{odroid,tm2}_defconfig: enable CONNECTOR/PROC_EVENTS options

CONFIG_CONNECTOR and CONFIG_PROC_EVENTS options enable Netlink
Connector feature of kernel to monitor process lifecycle like Fork
and Exit status of all processes asynchronously.

In Tzen, they will be used by stc-manager (smart traffic control) to
monitor process lifecycle.

Change-Id: I7dc90c6ef9d7d3d5f337dd7cb81745756495e778
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agoarm64: cpuinfo: Missing NULL terminator in compat_hwcap_str 11/155911/1
Julien Grall [Tue, 10 May 2016 14:40:31 +0000 (15:40 +0100)]
arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str

The loop that browses the array compat_hwcap_str will stop when a NULL
is encountered, however NULL is missing at the end of array. This will
lead to overrun until a NULL is found somewhere in the following memory.
In reality, this works out because the compat_hwcap2_str array tends to
follow immediately in memory, and that *is* terminated correctly.
Furthermore, the unsigned int compat_elf_hwcap is checked before
printing each capability, so we end up doing the right thing because
the size of the two arrays is less than 32. Still, this is an obvious
mistake and should be fixed.

Note for backporting: commit 12d11817eaafa414 ("arm64: Move
/proc/cpuinfo handling code") moved this code in v4.4. Prior to that
commit, the same change should be made in arch/arm64/kernel/setup.c.

Fixes: 44b82b7700d0 "arm64: Fix up /proc/cpuinfo"
Cc: <stable@vger.kernel.org> # v3.19+ (but see note above prior to v4.4)
Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[sw0312.kim: backport from mainline to fix KASAN warning.
 - change file name to arch/arm64/kernel/setup.c]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ib0bb9b18f803c50aaad59ae5c356a5fb6a685168

6 years agoARM: dts: exynos: Add support for Hardkernel's Odroid HC1 board 72/153772/3
Marek Szyprowski [Fri, 29 Sep 2017 11:53:58 +0000 (13:53 +0200)]
ARM: dts: exynos: Add support for Hardkernel's Odroid HC1 board

Odroid HC1 board is based on Odroid XU4 board, but it has no HDMI,
no eMMC, no build-in USB3.0 hub, no extension port pins, and no GPIO
button. USB3.0 ports are used for build-in JMicron USB to SATA bridge
and Gigabit R8152 ethernet chips. HC1 uses only passive cooling.

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

6 years agoextcon: max88743: add support for SmartDock accessory 06/153306/6 accepted/tizen/4.0/unified/20171011.071839 accepted/tizen/unified/20171011.070207 submit/tizen/20171011.043021 submit/tizen_4.0/20171011.042941 tizen_4.0.IoT.p1_release
Marek Szyprowski [Fri, 29 Sep 2017 07:38:19 +0000 (09:38 +0200)]
extcon: max88743: add support for SmartDock accessory

SmartDock uses ADC_RESERVED_ACC_3 (0x10) ADC ID type and provides following
features:
1. USB host with embedded USB hub (2-4 ports) for mice, keyboard, etc,
2. MHL for video output,
3. charging.

Tested with Unitek Y-2165 MHL+OTG Hub Smart Phone Dock.

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

6 years agopower: max77843: move OTG power control to the MUIC driver 05/153305/3
Marek Szyprowski [Thu, 28 Sep 2017 08:06:44 +0000 (10:06 +0200)]
power: max77843: move OTG power control to the MUIC driver

Enabling power on VBUS micro-usb pin is required only when passive OTG
cable is connected. However such information is not really available
from the extcon notification, thus move VBUS power control directly to
MUIC driver, which has a bit more information on the attached accessory.
For example SmartDock is externally powered and use VBUS pin for charging
battery, so VBUS charging pump should be disabled in such case.

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

6 years agoextcon: max88743: replace MHL-TA with standard TA cable notification 92/153692/2
Marek Szyprowski [Fri, 29 Sep 2017 07:37:40 +0000 (09:37 +0200)]
extcon: max88743: replace MHL-TA with standard TA cable notification

There is no need for separate "MHL-TA" notification. Replace it with
standard "TA" notification, so charger will work properly also when MHL
accessory is connected.

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

6 years agoLOCAL / Revert "Revert "Revert "usb: core: lpm: set lpm_capable for root hub device""" 59/151759/1 accepted/tizen/4.0/unified/20170927.181909 accepted/tizen/unified/20170927.181400 submit/tizen/20170927.053729 submit/tizen_4.0/20170927.053657
Dongwoo Lee [Thu, 21 Sep 2017 00:57:18 +0000 (09:57 +0900)]
LOCAL / Revert "Revert "Revert "usb: core: lpm: set lpm_capable for root hub device"""

After enabling SuperSpeed mode on Exynos54xx by resolving CRPORT reset
issue, lpm_capable for root hub device is also set again. However,
some devices still failed to enumerate due to LPM issues. Thus, this
patch re-reverts commit 7b799aa2bf57 ("Revert "Revert "usb: core: lpm:
set lpm_capable for root hub device""").

<This is workaround, lpm_capable will be restored after resolving issue>

Change-Id: Ia1013c2e6233ee3994941555fd21b418983d1430
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agogpu: arm: midgard: fix build warning in r5p0_06rel0 with arm64 63/150263/2 accepted/tizen/4.0/unified/20170920.081531 accepted/tizen/unified/20170920.081129 submit/tizen/20170920.004419 submit/tizen_4.0/20170920.004041
Seung-Woo Kim [Fri, 15 Sep 2017 02:38:02 +0000 (11:38 +0900)]
gpu: arm: midgard: fix build warning in r5p0_06rel0 with arm64

The debugfs usage in midgard r5p0_06rel0 has build warning in arm64
because of printing pointer with unsigned int. Fix the build warning
as fixed in r12p0.

It converts pointer type to 32bit unsigned int type for printing
format.

Change-Id: I10a12df503e7c2605b816ce2e1cc7fde061f4e7e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agogpu: arm: midgard: fix build error in r5p0_06rel0 with CONFIG_SYNC 62/150262/2
Seung-Woo Kim [Fri, 15 Sep 2017 02:34:26 +0000 (11:34 +0900)]
gpu: arm: midgard: fix build error in r5p0_06rel0 with CONFIG_SYNC

The fence code in midgard r5p0_06rel0 has build error with
CONFIG_SYNC because it uses old sync framework. Fix the build error
with CONFIG_SYNC as fixed in r12p0.

Change-Id: I9233a9d64a802e92b5c973c172eda01c083c2fa7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 years agoarm64: dts: exynos: Add support of bus frequency using VDD_MIF/INT on Exynos5433... 98/150298/1
Chanwoo Choi [Fri, 15 Sep 2017 03:05:28 +0000 (12:05 +0900)]
arm64: dts: exynos: Add support of bus frequency using VDD_MIF/INT on Exynos5433 TM2E

This patch adds the bus Device-tree nodes for both INT (Internal) and
MIF (Memory Interface) block in order to enable the bus frequency scaling.

Change-Id: If0b606b649fc9b83895f0b2c22bc8c9ff09042f4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoarm64: dts: exynos: Add support of bus frequency using VDD_MIF on Exynos5433 TM2 03/150003/3
Chanwoo Choi [Wed, 9 Aug 2017 08:28:11 +0000 (17:28 +0900)]
arm64: dts: exynos: Add support of bus frequency using VDD_MIF on Exynos5433 TM2

This patch adds the bus Device-tree nodes for MIF (Memory Interface) block
in order to enable the bus frequency scaling.

Change-Id: Id205723fcd0b678623d63bf77643ff0f41f45527
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoarm64: dts: exynos5433: Add bus dt node using VDD_MIF for Exynos5433 02/150002/2
Chanwoo Choi [Wed, 9 Aug 2017 08:27:34 +0000 (17:27 +0900)]
arm64: dts: exynos5433: Add bus dt node using VDD_MIF for Exynos5433

This patch adds the bus nodes using VDD_MIF for Exynos5433 SoC.
Exynos5433 has the following AXI buses to translate data
between DRAM and CCI, NOC and LLI.
- CCI (Cache Coherent Interconnect)
- LLI (Low Latency Interface)
- NoC (Network on Chip)

Change-Id: I33279dac16214416afc6eed2fa3e344b3dce1d4c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoBluetooth: Properly check L2CAP config option output buffer 36/150036/2
Ben Seri [Sat, 9 Sep 2017 21:15:59 +0000 (23:15 +0200)]
Bluetooth: Properly check L2CAP config option output buffer

commit e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 upstream.

Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.

Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[dh79.pyun: Cherry-pick from mainline to fix CVE-2017-1000251]
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Change-Id: Ia665b17aa7bfaa6ee13d652cce494da10b19b56d

6 years agogpu: arm: midgard: r12p0_04rel0: Fix build error for power model callbacks
Chanwoo Choi [Wed, 9 Aug 2017 06:21:48 +0000 (15:21 +0900)]
gpu: arm: midgard: r12p0_04rel0: Fix build error for power model callbacks

The commit 489b687c3e1f ("devfreq_cooling: pass a pointer to devfreq
in the power model callbacks") changes the parameters for power model
callbacks. This patch fixes the build error.

Change-Id: I3cb2c9f3ecb97b0c4662009c1a7dfcff6dfc423e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agothermal: devfreq: Check OPP for errors
Viresh Kumar [Tue, 7 Feb 2017 04:10:03 +0000 (09:40 +0530)]
thermal: devfreq: Check OPP for errors

It is possible for dev_pm_opp_find_freq_exact() to return errors. It was
all fine earlier as dev_pm_opp_get_voltage() had a check within it to
check for invalid OPPs, but dev_pm_opp_put() doesn't have any similar
checks and the callers need to make sure OPP is valid before calling
them.

Also update the later dev_warn_ratelimited() to not print the error
message as the OPP is guaranteed to be valid now.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
6 years agothermal: devfreq_cooling: Replace dev_warn with dev_err
Viresh Kumar [Tue, 7 Feb 2017 04:10:02 +0000 (09:40 +0530)]
thermal: devfreq_cooling: Replace dev_warn with dev_err

There isn't much the user can do on seeing this warning, as the hardware
is actually okay. dev_err suits much better here.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
6 years agothermal: devfreq: Simplify expression
Viresh Kumar [Tue, 7 Feb 2017 04:10:01 +0000 (09:40 +0530)]
thermal: devfreq: Simplify expression

There is no need to check for IS_ERR() as we are looking for a very
particular error value here. Drop the first check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
6 years agothermal: convert devfreq_cooling to use an IDA
Matthew Wilcox [Wed, 21 Dec 2016 17:47:06 +0000 (09:47 -0800)]
thermal: convert devfreq_cooling to use an IDA

thermal devfreq cooling does not use the ability to look up pointers by
ID, so convert it from using an IDR to the more space-efficient IDA.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
6 years agodevfreq_cooling: pass a pointer to devfreq in the power model callbacks
Javi Merino [Thu, 15 Sep 2016 14:44:23 +0000 (15:44 +0100)]
devfreq_cooling: pass a pointer to devfreq in the power model callbacks

When the devfreq cooling device was designed, it was an oversight not to
pass a pointer to the struct devfreq as the first parameters of the
callbacks.  The design patterns of the kernel suggest it for a good
reason.

By passing a pointer to struct devfreq, the driver can register one
function that works with multiple devices.  With the current
implementation, a driver that can work with multiple devices has to
create multiple copies of the same function with different parameters so
that each devfreq_cooling_device can use the appropriate one.  By
passing a pointer to struct devfreq, the driver can identify which
device it's referring to.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Ørjan Eide <orjan.eide@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
6 years agodevfreq_cooling: no need to check state with negative number
Shawn Lin [Mon, 22 Aug 2016 08:08:06 +0000 (16:08 +0800)]
devfreq_cooling: no need to check state with negative number

We could see that state is defined as unsigned type, so it
should never be less than zero. Let' remove this check.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
6 years agoPM / devfreq: Fix memory leak when fail to register device
Chanwoo Choi [Tue, 22 Aug 2017 07:16:44 +0000 (16:16 +0900)]
PM / devfreq: Fix memory leak when fail to register device

When the devfreq_add_device fails to register deivce, the memory
leak of devfreq instance happen. So, this patch fix the memory
leak issue. Before freeing the devfreq instance checks whether
devfreq instance is NULL or not because the device_unregister()
frees the devfreq instance when jumping to the 'err_init'.
It is to prevent the duplicate the kfee(devfreq).

Change-Id: Ic594e6729984fd7227a7efda50db600a6bf1be79
Cc: stable@vger.kernel.org
Fixes: ac4b281176a5 ("PM / devfreq: fix duplicated kfree on devfreq pointer")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Add dependency on PM_OPP
Chanwoo Choi [Mon, 21 Aug 2017 05:34:28 +0000 (14:34 +0900)]
PM / devfreq: Add dependency on PM_OPP

The devfreq ues the OPP library to handle the voltage and frequency
for the device basically. This patch adds the dependency on CONFIG_PM_OPP
in order to prevent either the build break or the unknow behavior.

Change-Id: I1a2b56c1653b9c1f42454b46ab45d6e1af2b069f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Move private devfreq_update_stats() into devfreq
Chanwoo Choi [Tue, 18 Jul 2017 14:37:04 +0000 (23:37 +0900)]
PM / devfreq: Move private devfreq_update_stats() into devfreq

THe devfreq_update_stats() updates the 'struct devfreq_dev_status'
in order to get current status of devfreq device. It is only used
for the governors.

This patch moves the devfreq_update_stats() into devfreq directory.

Change-Id: I4acc7347d4950258b1ebea4eb2371b77d8fcddb7
Signed-off-by: Chanwoo Choi <cwchoi00@gmail.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
6 years agoarm64: dts: exynos: Add support of bus frequency using VDD_INT on Exynos5433 TM2
Chanwoo Choi [Tue, 8 Aug 2017 11:03:09 +0000 (20:03 +0900)]
arm64: dts: exynos: Add support of bus frequency using VDD_INT on Exynos5433 TM2

This patch adds the bus Device-tree nodes for INT (Internal) block
and enables the bus frequency scaling.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
6 years agoarm64: dts: exynos: Add bus nodes using VDD_INT for Exynos5433
Chanwoo Choi [Tue, 8 Aug 2017 10:56:34 +0000 (19:56 +0900)]
arm64: dts: exynos: Add bus nodes using VDD_INT for Exynos5433

This patch adds the AMBA AXI bus nodes using VDD_INT for Exynos5433 SoC.

Following list specify the detailed correlation between sub-block and clock:
- CLK_ACLK_G2D_{400|266}  : Bus clock for G2D (2D graphic engine)
- CLK_ACLK_MSCL_400       : Bus clock for MSCL (Memory to memory Scaler)
- CLK_ACLK_GSCL_333       : Bus clock for GSCL (General Scaler)
- CLK_SCLK_JPEG_MSCL      : Bus clock for JPEG
- CLK_ACLK_MFC_400        : Bus clock for MFC (Multi Format Codec)
- CLK_ACLK_HEVC_400       : Bus clock for HEVC (High Efficient Video Codec)
- CLK_ACLK_BUS0_400       : NoC's (Network On Chip) bus clock for PERIC/PERIS/FSYS/MSCL
- CLK_ACLK_BUS1_400       : NoC's bus clock for MFC/HEVC/G3D
- CLK_ACLK_BUS2_400       : NoC's bus clock for GSCL/DISP/G2D/CAM0/CAM1/ISP

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
6 years agoarm64: dts: exynos5433: Remove legacy memory-bus frequency
Chanwoo Choi [Tue, 8 Aug 2017 10:53:10 +0000 (19:53 +0900)]
arm64: dts: exynos5433: Remove legacy memory-bus frequency

This patch removes the legacy memory-bus frequency
in order to apply the generic bus frequency driver
for Exynos SoC.

Change-Id: I861f312529f042b4b93359fa04a405ec78377708
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoPM / devfreq: exynos-bus: Add the detailed correlation for Exynos5433
Chanwoo Choi [Fri, 2 Dec 2016 06:29:02 +0000 (15:29 +0900)]
PM / devfreq: exynos-bus: Add the detailed correlation for Exynos5433

This patch adds the detailed corrleation between sub-blocks and VDD_INT power
line for Exynos5433. VDD_INT provided the power source to INT (Internal) block.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoARM: dts: exynos: Add support of Bus frequency using VDD_INT for exynos5422-odroidxu3
Chanwoo Choi [Wed, 9 Aug 2017 06:53:39 +0000 (15:53 +0900)]
ARM: dts: exynos: Add support of Bus frequency using VDD_INT for exynos5422-odroidxu3

This patch adds the bus device tree nodes for INT (Internal) block
to enable the AMBA bus frequency scaling and add the NoC (Network on Chip)
Probe Device Tree node to measure the bandwidth for AMBA AXI bus.

The WCORE bus bus is parent device in INT block using VDD_INT.

Change-Id: Iddfe7f4970beca1abea9fd6d01b951021b45ba0c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add bus nodes using VDD_INT for Exynos542x SoC
Chanwoo Choi [Wed, 9 Aug 2017 06:51:07 +0000 (15:51 +0900)]
ARM: dts: exynos: Add bus nodes using VDD_INT for Exynos542x SoC

This patch adds the AMBA bus nodes using VDD_INT for Exynos542x SoC.
Exynos542x has the following AMBA buses to translate data between
DRAM and sub-blocks.

Following list specifies the detailed correlation between sub-block and clock:
- CLK_DOUT_ACLK400_WCORE clock for WCORE's AXI
- CLK_DOUT_ACLK100_NOC for NoC (Network on Chip)'s AXI
- CLK_DOUT_PCLK200_FSYS for FSYS's APB
- CLK_DOUT_ACLK200_FSYS for FSYS's AXI
- CLK_DOUT_ACLK200_FSYS2 for FSYS2's AXI
- CLK_DOUT_ACLK333 for MFC's AXI
- CLK_DOUT_ACLK266 for GEN's AXI
- CLK_DOUT_ACLK66 for PERIC/PERIR's AXI
- CLK_DOUT_ACLK333_G2D for G2D's AXI
- CLK_DOUT_ACLK266_G2D for ACP's AXI
- CLK_DOUT_ACLK300_JPEG for JPEG's AXI
- CLK_DOUT_ACLK166 for JPEG's APB
- CLK_DOUT_ACLK300_DISP1 for FIMD's AXI
- CLK_DOUT_ACLK400_DISP1 for DISP1's AXI
- CLK_DOUT_ACLK300_GSCL for GSCL Scaler's AXI
- CLK_DOUT_ACLK400_MSCL for MSCL's AXI

Change-Id: I48f00b91bdd1b5f973704e67ec5e26a25850c2b8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add NoC Probe dt node for Exynos542x SoC
Chanwoo Choi [Fri, 15 Apr 2016 06:32:51 +0000 (15:32 +0900)]
ARM: dts: exynos: Add NoC Probe dt node for Exynos542x SoC

This patch adds the NoCP (Network on Chip Probe) Device Tree node
to measure the bandwidth of memory and g3d in Exynos542x SoC.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add support of bus frequency for exynos4412-trats/odroidu3
Chanwoo Choi [Wed, 9 Aug 2017 06:44:39 +0000 (15:44 +0900)]
ARM: dts: exynos: Add support of bus frequency for exynos4412-trats/odroidu3

This patch adds the bus device tree nodes for both MIF (Memory) and INT
(Internal) block to enable the bus frequency.

The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS
bus is parent device in INT block using VDD_INT.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Change-Id: I29a555f3b58e557db90397063c39193174ad9f9b

6 years agoARM: dts: exynos: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
Chanwoo Choi [Wed, 9 Aug 2017 06:41:40 +0000 (15:41 +0900)]
ARM: dts: exynos: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3

This patch expands the voltage range of buck1/3 regulator due to as following:
- MIF (Memory Interface) bus frequency needs the range of '900 - 1100 mV'.
- INT (Internal) bus frequency needs the range of '900 - 1050 mV'.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Change-Id: I62fff9334fd684b07e9f2a6fec04c8eb2ca005ae

6 years agoARM: dts: exynos: Add support of bus frequency using VDD_INT for exynos3250-rinato
Chanwoo Choi [Wed, 9 Aug 2017 07:03:28 +0000 (16:03 +0900)]
ARM: dts: exynos: Add support of bus frequency using VDD_INT for exynos3250-rinato

This patch adds the bus device-tree nodes of INT (internal) block
to enable the bus frequency scaling. The following sub-blocks share
the VDD_INT power source:
- LEFTBUS (parent device)
- RIGHTBUS
- PERIL
- LCD0
- FSYS
- MCUISP / ISP
- MFC

The LEFTBUS is parent device with devfreq ondemand governor
and the rest of devices depend on the LEFTBUS device.

Change-Id: Ia6d3aaeacbb4200ddb1eb103466e9ee880ec5537
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
Chanwoo Choi [Wed, 9 Aug 2017 02:39:07 +0000 (11:39 +0900)]
ARM: dts: exynos: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes

This patch adds the exynos4412-ppmu-common.dtsi to remove duplicate PPMU nodes
because exynos3250-rinato/monk, exynos4412-trats2/odroidu3 has the same
PPMU device tree node.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[cw00.choi: Fix merge issue and apply mainline patch]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Change-Id: Ic2609b3fbc6736bd74e68d709e74a19e6c77d0e6

6 years agoARM: dts: exynos: Add bus nodes using VDD_MIF for Exynos4210
Chanwoo Choi [Mon, 11 Apr 2016 03:57:54 +0000 (12:57 +0900)]
ARM: dts: exynos: Add bus nodes using VDD_MIF for Exynos4210

This patch adds the bus nodes for Exynos4210 SoC. Exynos4210 SoC has
one power line for all buses to translate data between DRAM and sub-blocks.

Following list specifies the detailed relation between DRAM and sub-blocks:
- DMC/ACP clock for DMC (Dynamic Memory Controller)
- ACLK200 clock for LCD0
- ACLK100 clock for PERIL/PERIR/MFC(PCLK)
- ACLK160 clock for CAM/TV/LCD0/LCD1
- ACLK133 clock for FSYS/GPS
- GDL/GDR clock for LEFTBUS/RIGHTBUS
- SCLK_MFC clock for MFC

Change-Id: I20beb1ff8315f497f75467dd9ebb967a6b1f79ce
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add bus nodes using VDD_INT for Exynos4x12
Chanwoo Choi [Mon, 11 Apr 2016 03:57:53 +0000 (12:57 +0900)]
ARM: dts: exynos: Add bus nodes using VDD_INT for Exynos4x12

This patch adds the bus nodes using VDD_INT for Exynos4x12 SoC.
Exynos4x12 has the following AXI buses to translate data between
DRAM and sub-blocks.

Following list specifies the detailed relation between DRAM and sub-blocks:
- ACLK100 clock for PERIL/PERIR/MFC(PCLK)
- ACLK160 clock for CAM/TV/LCD
: The minimum clock of ACLK160 should be over 160MHz.
  When drop the clock under 160MHz, show the broken image.
- ACLK133 clock for FSYS
- GDL clock for LEFTBUS
- GDR clock for RIGHTBUS
- SCLK_MFC clock for MFC

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Change-Id: I1fec9bafbc955cc07c82807c658e6ef34512d872

6 years agoARM: dts: exynos: Add bus nodes using VDD_MIF for Exynos4x12
Chanwoo Choi [Mon, 11 Apr 2016 03:57:52 +0000 (12:57 +0900)]
ARM: dts: exynos: Add bus nodes using VDD_MIF for Exynos4x12

This patch adds the bus nodes using VDD_MIF for Exynos4x12 SoC.
Exynos4x12 has the following AXI buses to translate data
between DRAM and DMC/ACP/C2C.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Change-Id: I54e41571a08aaaf62f48ae9258cdeac8613efc44

6 years agoARM: dts: exynos: Add bus nodes using VDD_INT for Exynos3250
Chanwoo Choi [Mon, 11 Apr 2016 03:57:51 +0000 (12:57 +0900)]
ARM: dts: exynos: Add bus nodes using VDD_INT for Exynos3250

This patch adds the bus nodes using VDD_INT for Exynos3250 SoC.
Exynos3250 has following AXI buses to translate data between
DRAM and sub-blocks.

Following list specifies the detailed relation between DRAM and sub-blocks:
- ACLK400 clock for MCUISP
- ACLK266 clock for ISP
- ACLK200 clock for FSYS
- ACLK160 clock for LCD0
- ACLK100 clock for PERIL
- GDL clock for LEFTBUS
- GDR clock for RIGHTBUS
- SCLK_MFC clock for MFC

Change-Id: I9c725e40aa03943e895d9388cd1950439dbc623f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add DMC bus frequency for exynos3250-rinato/monk
Chanwoo Choi [Wed, 9 Aug 2017 06:56:24 +0000 (15:56 +0900)]
ARM: dts: exynos: Add DMC bus frequency for exynos3250-rinato/monk

This patch adds the DMC (Dynamic Memory Controller) bus frequency node
which includes the devfreq-events and regulator properties. The bus
frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature
with ondemand governor.

The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus
on runtime and the buck1_reg (VDD_MIF power line) supplies the power to
the DMC block.

Change-Id: If3df539c570bdf26407bd58a2ea4426d5dcd5c9d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos: Add DMC bus node for Exynos3250
Chanwoo Choi [Mon, 11 Apr 2016 03:57:49 +0000 (12:57 +0900)]
ARM: dts: exynos: Add DMC bus node for Exynos3250

This patch adds the DMC (Dynamic Memory Controller) bus node for Exynos3250 SoC.
The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard
SDRAM devices. The bus includes the OPP tables and the source clock for DMC
block.

Following list specifies the detailed relation between the clock and DMC block:
- The source clock of DMC block : div_dmc

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoARM: dts: exynos; Remove legacy memory-bus frequency
Chanwoo Choi [Wed, 9 Aug 2017 02:23:24 +0000 (11:23 +0900)]
ARM: dts: exynos; Remove legacy memory-bus frequency

This patch removes the legacy memory-bus frequency
in order to apply the generic bus frequency driver
for Exynos SoC.

Change-Id: I30ef6102e185d9ff912680f0f912d1daa8eeb0dc
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoclk: samsung: exynos5420: Add clocks for CMU_CDREX domain
Chanwoo Choi [Wed, 13 Sep 2017 10:21:22 +0000 (19:21 +0900)]
clk: samsung: exynos5420: Add clocks for CMU_CDREX domain

This patch adds the mux/divider clocks for CMU_CDREX (DRAM Express
Controller) which generates the clocks for DRAM and NoC (Network on Chip)
bus.  There is differnet source of MUX_MX_MSPLL_CCORE between exynos5420
and exynos5422, so each MUX_MX_MSPLL_CCORE uses the different parent source
group.

Change-Id: I898ff4d5e2ef3ba4ce5b6b3ced686316a0b93f60
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: Add clock IDs for the CMU_CDREX (DRAM Express Controller)
Chanwoo Choi [Wed, 13 Sep 2017 10:19:38 +0000 (19:19 +0900)]
clk: samsung: Add clock IDs for the CMU_CDREX (DRAM Express Controller)

This patch adds missing clock IDs for CMU_CDREX (DRAM Express Controller)
which generates clocks for DRAM and NoC (Network on Chip) busses.

Change-Id: I69f84fe4288fb5edcce7952b829a60042c7b29a8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: exynos542x: Add the clock id for ACLK
Chanwoo Choi [Wed, 13 Sep 2017 10:04:24 +0000 (19:04 +0900)]
clk: samsung: exynos542x: Add the clock id for ACLK

This patch adds the clock id for ACLK clock which is source clock
of AMBA AXI bus. This clock should be handled in the bus frequency
scaling driver.

Change-Id: I58739711470e9bc3c7d182e5f2ac6d78fab78854
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agodt-bindings: clock: Add the clock id for ACLK clock of Exynos542x SoC
Chanwoo Choi [Fri, 15 Apr 2016 06:32:52 +0000 (15:32 +0900)]
dt-bindings: clock: Add the clock id for ACLK clock of Exynos542x SoC

This patch adds the clock id for ACLK clock of Exynos542x SoC.
ACLK clock means the source clock of AMBA AXI bus. This clock
id should be used for Bus frequency scaling.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoPM / OPP: reuse of_parse_phandle()
Viresh Kumar [Fri, 4 Sep 2015 08:17:22 +0000 (13:47 +0530)]
PM / OPP: reuse of_parse_phandle()

We already have a better API to get the opp descriptor block's node from
cpu-node. Lets reuse that instead of creating our own routines for the
same stuff. That cleans the code a lot.

This also kills a check we had earlier (as we are using the generic API
now). Earlier we used to check if the operating-points-v2 property
contained multiple phandles instead of a single phandle.

Killing this check isn't an issue because, we only parse the first entry
with of_parse_phandle(). So, if a user passes multiple phandles, its
really his problem :)

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Return suspend_opp only if it is enabled
Viresh Kumar [Wed, 9 Sep 2015 11:28:22 +0000 (16:58 +0530)]
PM / OPP: Return suspend_opp only if it is enabled

There is no point returning suspend_opp, if it is disabled by the core.
As we can't use it at all. Fix it.

Fixes: 4eafbd15b6c8 ("PM / OPP: add dev_pm_opp_get_suspend_opp() helper")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: add dev_pm_opp_get_suspend_opp() helper
Bartlomiej Zolnierkiewicz [Tue, 8 Sep 2015 16:41:01 +0000 (18:41 +0200)]
PM / OPP: add dev_pm_opp_get_suspend_opp() helper

Add dev_pm_opp_get_suspend_opp() helper to obtain suspend opp.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Drop unlikely before IS_ERR(_OR_NULL)
Viresh Kumar [Wed, 12 Aug 2015 10:29:39 +0000 (15:59 +0530)]
PM / OPP: Drop unlikely before IS_ERR(_OR_NULL)

IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Fix static checker warning (broken 64bit big endian systems)
Viresh Kumar [Mon, 17 Aug 2015 13:50:20 +0000 (19:20 +0530)]
PM / OPP: Fix static checker warning (broken 64bit big endian systems)

Dan Carpenter reported (generated with static checker):

drivers/base/power/opp.c:949 _opp_add_static_v2()
warn: passing casted pointer '&new_opp->clock_latency_ns' to
'of_property_read_u32()' 64 vs 32.

This code will break on 64 bit, big endian machines.

Fix this by reading the value in a u32 type variable first and then
assigning it to the unsigned long variable.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Free resources and properly return error on failure
Viresh Kumar [Wed, 12 Aug 2015 11:00:18 +0000 (16:30 +0530)]
PM / OPP: Free resources and properly return error on failure

_of_init_opp_table_v2() isn't freeing up resources on some errors and
the error values returned are also not correct always.

This fixes following problems:
- Return -ENOENT, if no entries are found in the table.
- Use IS_ERR() to properly check return value of _find_device_opp().
- Return error value with PTR_ERR() in above case.
- Free table if _find_device_opp() fails.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: add dev_pm_opp_is_turbo() helper
Bartlomiej Zolnierkiewicz [Thu, 9 Jul 2015 15:43:35 +0000 (17:43 +0200)]
PM / OPP: add dev_pm_opp_is_turbo() helper

Add dev_pm_opp_is_turbo() helper to verify if an opp is to be used only
for turbo mode or not.

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Add helpers for initializing CPU OPPs
Viresh Kumar [Fri, 12 Jun 2015 11:40:38 +0000 (17:10 +0530)]
PM / OPP: Add helpers for initializing CPU OPPs

With "operating-points-v2" its possible to tell which devices share
OPPs. We already have infrastructure to decode that information.

This patch adds following APIs:
 - of_get_cpus_sharing_opps: Returns cpumask of CPUs sharing OPPs (only
   valid with v2 bindings).
 - of_cpumask_init_opp_table: Initializes OPPs for all CPUs present in
   cpumask.
 - of_cpumask_free_opp_table: Frees OPPs for all CPUs present in cpumask.

 - set_cpus_sharing_opps: Sets which CPUs share OPPs (only valid with old
   OPP bindings, as this information isn't present in DT).

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / OPP: Add support for opp-suspend
Viresh Kumar [Sat, 13 Jun 2015 09:40:21 +0000 (15:10 +0530)]
PM / OPP: Add support for opp-suspend

With "operating-points-v2" bindings, it's possible to specify the OPP to
which the device must be switched, before suspending.

This patch adds support for getting that information.

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>