platform/kernel/linux-exynos.git
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

7 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>
7 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

7 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>
7 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>
7 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

7 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

7 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

7 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

7 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

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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

7 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>
7 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

7 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>
7 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

7 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

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agoPM / OPP: Add OPP sharing information to OPP library
Viresh Kumar [Wed, 29 Jul 2015 10:53:04 +0000 (16:23 +0530)]
PM / OPP: Add OPP sharing information to OPP library

An opp can be shared by multiple devices, for example its very common
for CPUs to share the OPPs, i.e. when they share clock/voltage rails.

This patch adds support of shared OPPs to the OPP library.

Instead of a single device, dev_opp will now contain a list of devices
that use it. It also senses if the device (we are trying to initialize
OPPs for) shares OPPs with a device added earlier and in that case we
update the list of devices managed by OPPs instead of duplicating OPPs
again.

The same infrastructure will be used for the old OPP bindings, with
later patches.

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>
7 years agoPM / OPP: Add clock-latency-ns support
Viresh Kumar [Wed, 29 Jul 2015 10:53:03 +0000 (16:23 +0530)]
PM / OPP: Add clock-latency-ns support

With "operating-points-v2" bindings, clock-latency is defined per OPP.
Users of this value expect a single value which defines the latency to
switch to any clock rate. Find maximum clock-latency-ns from the OPP
table to service requests from such users.

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>
7 years agoPM / OPP: Add support to parse "operating-points-v2" bindings
Viresh Kumar [Wed, 29 Jul 2015 10:53:02 +0000 (16:23 +0530)]
PM / OPP: Add support to parse "operating-points-v2" bindings

This adds support in OPP library to parse and create list of OPPs from
operating-points-v2 bindings. It takes care of most of the properties of
new bindings (except shared-opp, which will be handled separately).

For backward compatibility, we keep supporting earlier bindings. We try
to search for the new bindings first, in case they aren't present we
look for the old deprecated ones.

There are few things marked as TODO:
- Support for multiple OPP tables
- Support for multiple regulators

They should be fixed separately.

Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agoPM / OPP: Break _opp_add_dynamic() into smaller functions
Viresh Kumar [Wed, 29 Jul 2015 10:53:01 +0000 (16:23 +0530)]
PM / OPP: Break _opp_add_dynamic() into smaller functions

Later commits would add support for new OPP bindings and this would be
required then. So, lets do it in a separate patch to make it easily
reviewable.

Another change worth noticing is INIT_LIST_HEAD(&opp->node). We weren't
doing it earlier as we never tried to delete a list node before it is
added to list. But this wouldn't be the case anymore. We might try to
delete a node (just to reuse the same code paths), without it being
getting added to the list.

Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agoPM / OPP: Allocate dev_opp from _add_device_opp()
Viresh Kumar [Wed, 29 Jul 2015 10:53:00 +0000 (16:23 +0530)]
PM / OPP: Allocate dev_opp from _add_device_opp()

There is no need to complicate _opp_add_dynamic() with allocation of
dev_opp as well. Allocate it from _add_device_opp() instead.

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>
7 years agoPM / OPP: Create _remove_device_opp() for freeing dev_opp
Viresh Kumar [Wed, 29 Jul 2015 10:52:59 +0000 (16:22 +0530)]
PM / OPP: Create _remove_device_opp() for freeing dev_opp

This will be used from multiple places later. Lets create a separate
routine for that.

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>
7 years agoPM / OPP: Relocate few routines
Viresh Kumar [Wed, 29 Jul 2015 10:52:58 +0000 (16:22 +0530)]
PM / OPP: Relocate few routines

In order to prepare for the later commits, this relocates few routines
towards the top as they will be used earlier in the code.

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>
7 years agoPM / devfreq: exynos-bus: Fix build error
Chanwoo Choi [Tue, 8 Aug 2017 11:10:41 +0000 (20:10 +0900)]
PM / devfreq: exynos-bus: Fix build error

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoPM / devfreq: constify attribute_group structures.
Arvind Yadav [Mon, 3 Jul 2017 10:10:04 +0000 (15:40 +0530)]
PM / devfreq: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with const
attribute_group. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
    621     176       0     797     31d drivers/devfreq/governor_userspace.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   670     144       0     814     32e drivers/devfreq/governor_userspace.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: exynos-ppmu: Staticize event list
Krzysztof Kozlowski [Wed, 7 Jun 2017 18:12:28 +0000 (20:12 +0200)]
PM / devfreq: exynos-ppmu: Staticize event list

The ppmu_events array is accessed only in this compilation unit so it
can be made static.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: exynos-nocp: Handle return value of clk_prepare_enable
Arvind Yadav [Fri, 19 May 2017 10:50:35 +0000 (16:20 +0530)]
PM / devfreq: exynos-nocp: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Move struct devfreq_governor to devfreq directory
Chanwoo Choi [Thu, 6 Apr 2017 04:19:35 +0000 (13:19 +0900)]
PM / devfreq: Move struct devfreq_governor to devfreq directory

This patch moves the struct devfreq_governor from header file
to the devfreq directory because this structure is private data
and it have to be only accessed by the devfreq core.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Modify the device name as devfreq(X) for sysfs
Chanwoo Choi [Tue, 31 Jan 2017 07:47:57 +0000 (16:47 +0900)]
PM / devfreq: Modify the device name as devfreq(X) for sysfs

This patch modifies the device name as devfreq(X) for sysfs by using the 'devfreq'
prefix word instead of separate device name. On user-space aspect, user would
find the some devfreq drvier with 'devfreq(X)' pattern. So, this patch modify the
device name as following:
- /sys/class/devfreq/[non-standard device name] -> /sys/class/devfreq/devfreq(X)

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Simplify the sysfs name of devfreq-event device
Chanwoo Choi [Tue, 31 Jan 2017 07:47:56 +0000 (16:47 +0900)]
PM / devfreq: Simplify the sysfs name of devfreq-event device

This patch just removes '.' character from the sysfs name of devfreq-event
device as following. Usually, the subsystem uses the similiar naming style
such as {framework name}{Number}.
- old : /sys/class/devfreq-event/event.(X)
- new : /sys/class/devfreq-event/event(X)

And this patch initializes the value of 'event_no' with -1
in order to remove the unneeded operation (-1) when calling
the atomic_inc_return(&event_no).

Lastly, this patch adds the ABI document for devfreq-event class.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Remove unnecessary separate _remove_devfreq()
Chanwoo Choi [Tue, 31 Jan 2017 06:38:18 +0000 (15:38 +0900)]
PM / devfreq: Remove unnecessary separate _remove_devfreq()

The _remove_devfreq() releases the all resources of the devfreq
device. This function is only called in the devfreq_dev_release().
For that reason, the devfreq core doesn't need to leave the
_remove_devfreq() separately. This patch releases the all
resources in the devfreq_dev_release() and then removes the
_remove_devfreq().

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Fix wrong trans_stat of passive devfreq device
Chanwoo Choi [Tue, 31 Jan 2017 06:38:17 +0000 (15:38 +0900)]
PM / devfreq: Fix wrong trans_stat of passive devfreq device

Until now, the trans_stat information of passive devfreq is not updated.
This patch updates the trans_stat information after setting the target
frequency of passive devfreq device.

Fixes: 996133119f57 ("PM / devfreq: Add new passive governor")
Cc: stable@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Fix available_governor sysfs
Chanwoo Choi [Tue, 31 Jan 2017 06:38:16 +0000 (15:38 +0900)]
PM / devfreq: Fix available_governor sysfs

The devfreq using passive governor is not able to change the governor.
So, the user can not change the governor through 'available_governor' sysfs
entry. Also, the devfreq which don't use the passive governor is not able to
change to 'passive' governor on the fly.

Fixes: 996133119f57 ("PM / devfreq: Add new passive governor")
Cc: stable@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: exynos-ppmu: Show the registred device for ppmu device
Chanwoo Choi [Mon, 16 Jan 2017 12:26:05 +0000 (21:26 +0900)]
PM / devfreq: exynos-ppmu: Show the registred device for ppmu device

This patch just adds the simple log to show the PPMU device's registration
during the kernel booting.

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Fix the wrong description for userspace governor
Chanwoo Choi [Mon, 16 Jan 2017 12:26:04 +0000 (21:26 +0900)]
PM / devfreq: Fix the wrong description for userspace governor

This patch fixes the wrong description of governor_userspace.c
and removes the unneeded blank line.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Fix the checkpatch warnings
Chanwoo Choi [Sat, 19 Nov 2016 13:47:36 +0000 (22:47 +0900)]
PM / devfreq: Fix the checkpatch warnings

This patch just fixes the checkpatch warnings.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: exynos-bus: Print the real clock rate of bus
Chanwoo Choi [Thu, 1 Dec 2016 10:42:17 +0000 (19:42 +0900)]
PM / devfreq: exynos-bus: Print the real clock rate of bus

This patch shows the real clock rate after calling clk_set_rate()
to debug it.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: Don't delete sysfs group twice
Chris Diamand [Thu, 12 Jan 2017 14:57:41 +0000 (14:57 +0000)]
PM / devfreq: Don't delete sysfs group twice

The 'userspace' governor adds a sysfs entry, which is removed when
the governor is changed, or the devfreq device is released. However,
when the latter occurs via device_unregister(), device_del() is
called first, which removes the sysfs entries recursively and deletes
the kobject.

This means we get an Oops when the governor calls
sysfs_remove_group() on the deleted kobject. Fix this by only doing
the call when kobj *hasn't* been kobject_del()'d.

Note that we can't just remove the call to sysfs_remove_group()
entirely - it's needed for when the governor is changed to one which
doesn't need a sysfs entry.

Signed-off-by: Chris Diamand <chris.diamand@arm.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoPM / devfreq: exynos-bus: Fix the wrong return value
Chanwoo Choi [Wed, 28 Dec 2016 11:52:36 +0000 (20:52 +0900)]
PM / devfreq: exynos-bus: Fix the wrong return value

This patch fixes the wrong return value. If devfreq driver requires the wrong
and non-available governor, it is fail. So, this patch returns the error
insead of -EPROBE_DEFER.

Fixes: 403e0689d2a9 (PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>