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
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
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
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>
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
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>
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
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>
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>
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>
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
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>
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
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>
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>
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
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
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
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
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
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Chanwoo Choi [Wed, 28 Dec 2016 11:52:35 +0000 (20:52 +0900)]
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
This patch fixes the bug of devfreq_add_device(). The devfreq device must
have the default governor. If find_devfreq_governor() returns error,
devfreq_add_device() fail to add the devfreq instance.
Fixes:
1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 1 Dec 2016 10:25:40 +0000 (15:55 +0530)]
devfreq: exynos: Don't use OPP structures outside of RCU locks
The OPP structures are abused to the best here, without understanding
how the OPP core and RCU locks work.
In short, the OPP pointer saved 'struct exynos_bus' can become invalid
under your nose, as the OPP core may free it.
Fix various abuses around OPP structures and calls.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
MyungJoo Ham [Wed, 9 Nov 2016 01:29:14 +0000 (10:29 +0900)]
PM / devfreq: correct comment typo.
The function name in the comment was incorrect.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Axel Lin [Fri, 21 Oct 2016 01:09:09 +0000 (09:09 +0800)]
PM / devfreq: exynos-ppmu: Remove unused mutex from struct exynos_ppmu
The mutex is not used at all, remove it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Axel Lin [Fri, 21 Oct 2016 01:09:08 +0000 (09:09 +0800)]
PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminated
The rest of the code uses ARRAY_SIZE to count the number of entries in
ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return
off-by-one value.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Javier Martinez Canillas [Wed, 19 Oct 2016 21:06:27 +0000 (18:06 -0300)]
PM / devfreq: exynos-ppmu: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias
$
After this patch:
$ modinfo drivers/devfreq/event/exynos-ppmu.ko | grep alias
alias: of:N*T*Csamsung,exynos-ppmu-v2C*
alias: of:N*T*Csamsung,exynos-ppmu-v2
alias: of:N*T*Csamsung,exynos-ppmuC*
alias: of:N*T*Csamsung,exynos-ppmu
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Javier Martinez Canillas [Wed, 19 Oct 2016 21:06:25 +0000 (18:06 -0300)]
PM / devfreq: exynos-nocp: Fix module autoload
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias
$
After this patch:
$ modinfo drivers/devfreq/event/exynos-nocp.ko | grep alias
alias: of:N*T*Csamsung,exynos5420-nocpC*
alias: of:N*T*Csamsung,exynos5420-nocp
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Tobias Jakobi [Thu, 29 Sep 2016 12:36:36 +0000 (14:36 +0200)]
PM / devfreq: Skip status update on uninitialized previous_freq
In case devfreq->previous_freq is still uninitialized in
devfreq_update_status(), i.e. it has value '0', the lookups in
that function fail, eventually leading to some error message:
[ 3.041292] devfreq bus_dmc: Couldn't update frequency transition information.
Just skip the statup update in this situation.
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Axel Lin [Thu, 29 Sep 2016 02:13:28 +0000 (10:13 +0800)]
PM / devfreq: Add proper locking around list_del()
Use devfreq_list_lock around list_del() to prevent list corruption.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>