platform/kernel/linux-exynos.git
6 years agoPM / devfreq: exynos-nocp: Remove incorrect IS_ERR() check
Dan Carpenter [Thu, 26 May 2016 06:45:42 +0000 (09:45 +0300)]
PM / devfreq: exynos-nocp: Remove incorrect IS_ERR() check

Smatch complains because platform_get_resource() returns NULL on error
and not an error pointer so the check is wrong.  Julia Lawall pointed
out that normally we don't check these, because devm_ioremap_resource()
has a check for NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: remove double put_device
MyungJoo Ham [Mon, 16 May 2016 02:41:57 +0000 (11:41 +0900)]
PM / devfreq: remove double put_device

When device_register() returns with error, it has already
done put_device() on the input device pointer.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: fix double call put_device
Cai Zhiyong [Sat, 14 May 2016 06:13:30 +0000 (14:13 +0800)]
PM / devfreq: fix double call put_device

1295  */
1296 void device_unregister(struct device *dev)
1297 {
1298         pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
1299         device_del(dev);
1300         put_device(dev);
1301 }
1302 EXPORT_SYMBOL_GPL(device_unregister);
1303

device_unregister is called put_device, there is no need to call
put_device(&devfreq->dev) again.

Signed-off-by: Cai Zhiyong <caizhiyong@huawei.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: fix duplicated kfree on devfreq pointer
MyungJoo Ham [Fri, 2 Oct 2015 03:48:54 +0000 (12:48 +0900)]
PM / devfreq: fix duplicated kfree on devfreq pointer

device_unregister() calls kfree already.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: devm_kzalloc to have dev pointer more precisely
MyungJoo Ham [Fri, 2 Oct 2015 03:39:23 +0000 (12:39 +0900)]
PM / devfreq: devm_kzalloc to have dev pointer more precisely

devm_kzalloc of devfreq's statistics data structure has been
using its parent device as the dev allocated for.
If a device's devfreq is disabled in run-time,
such allocated memory won't be freed.

Desginating more precisely with the devfreq device
pointer fixes the issue.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: style/typo fixes
MyungJoo Ham [Fri, 29 Apr 2016 07:13:03 +0000 (16:13 +0900)]
PM / devfreq: style/typo fixes

- Typo in comments fixed
- Unnecessary return statement removed

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus
Chanwoo Choi [Fri, 27 Nov 2015 04:03:59 +0000 (13:03 +0900)]
PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus

This patch adds the detailed corrleation between sub-blocks and power line
for Exynos5422.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: event: Find the instance of devfreq-event device by using phandle
Chanwoo Choi [Thu, 14 Apr 2016 05:37:12 +0000 (14:37 +0900)]
PM / devfreq: event: Find the instance of devfreq-event device by using phandle

This patch use the phandle to find the instance of devfreq-event device in
Device Tree when calling the devfreq_event_get_edev_by_phandle() because there
is two type devfreq-event devices as following:

First case, exynos-ppmu.c driver provides the maximum four event of each PPMU.
So, when getting the instance of devfreq-event device, using the unique name of
struct devfreq_event_desc.

Second case, exynos-nocp.c driver provide the only one event of each NoC Probe
device. So, when getting the instance of devfreq-event device, using the
phandle of each NoC probe device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: event: Add new Exynos NoC probe driver
Chanwoo Choi [Thu, 7 Apr 2016 02:29:11 +0000 (11:29 +0900)]
PM / devfreq: event: Add new Exynos NoC probe driver

This patch adds NoC (Network on Chip) Probe driver which provides
the primitive values to get the performance data. The packets that the Network
on Chip (NoC) probes detects are transported over the network infrastructure.
Exynos542x bus has multiple NoC probes to provide bandwidth information about
behavior of the SoC that you can use while analyzing system performance.

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>
6 years agoPM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
Chanwoo Choi [Mon, 23 Nov 2015 14:58:17 +0000 (23:58 +0900)]
PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver

This patch removes the unused exynos4/5 busfreq driver. Instead,
generic exynos-bus frequency driver support the all Exynos SoCs.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
Chanwoo Choi [Fri, 27 Nov 2015 03:55:23 +0000 (12:55 +0900)]
PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line

This patch adds the detailed correlation between sub-blocks and power line
for Exynos3250, Exynos4210 and Exynos4x12.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: exynos: Update documentation for bus devices using passive governor
Chanwoo Choi [Mon, 23 Nov 2015 14:18:52 +0000 (23:18 +0900)]
PM / devfreq: exynos: Update documentation for bus devices using passive governor

This patch updates the documentation for passive bus devices and adds the
detailed example of Exynos3250.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor
Chanwoo Choi [Thu, 5 Nov 2015 09:29:27 +0000 (18:29 +0900)]
PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor

This patch adds the support of bus frequency feature for sub-blocks which share
the one power line. If each bus depends on the power line, each bus is not able
to change the voltage by oneself. To optimize the power-consumption on runtime,
some buses using the same power line should change the source clock and
regulator at the same time. So, this patch uses the passive governor to support
the bus frequency for all buses which sharing the one power line.

For example,

Exynos3250 include the two power line for AXI buses as following:
: VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller)
  with the power (regulator).
: VDD_INT : INT (Internal) provide the various sub-blocks with the power
  (regulator).

Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus
use the power line. So, there is no any depencency between buese. But, in the
case of VDD_INT, various buses share the one power line of VDD_INT. We need to
make the depenency between buses. When using passive governor, there is no
problem to support the bus frequency as DVFS for all buses. One bus should be
operated as the parent bus device which gathering the current load of INT block
and then decides the new frequency with some governors except of passive
governor. After deciding the new frequency by the parent bus device, the rest
bus devices will change the each source clock according to new frequency of the
parent bus device.

- MIF (Memory Interface) block
: VDD_MIF |--- DMC

- INT (Internal) block
: VDD_INT |--- LEFTBUS (parent)
          |--- PERIL
          |--- MFC
          |--- G3D
          |--- RIGHTBUS
          |--- FSYS
          |--- LCD0
          |--- PERIR
          |--- ISP
          |--- CAM

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[tjakobi: Reported debugfs error during booting and cw00.choi fix it.]
Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: Add new passive governor
Chanwoo Choi [Tue, 22 Mar 2016 04:44:03 +0000 (13:44 +0900)]
PM / devfreq: Add new passive governor

This patch adds the new passive governor for DEVFREQ framework. The following
governors are already present and used for DVFS (Dynamic Voltage and Frequency
Scaling) drivers. The following governors are independently used for one device
driver which don't give the influence to other device drviers and also don't
receive the effect from other device drivers.
- ondemand / performance / powersave / userspace

The passive governor depends on operation of parent driver with specific
governos extremely and is not able to decide the new frequency by oneself.
According to the decided new frequency of parent driver with governor,
the passive governor uses it to decide the appropriate frequency for own
device driver. The passive governor must need the following information
from device tree:
- the source clock and OPP tables
- the instance of parent device

For exameple,
there are one more devfreq device drivers which need to change their source
clock according to their utilization on runtime. But, they share the same
power line (e.g., regulator). So, specific device driver is operated as parent
with ondemand governor and then the rest device driver with passive governor
is influenced by parent device.

Suggested-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[tjakobi: Reported RCU locking issue and cw00.choi fix it]
Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
[linux.amoon: Reported possible recursive locking and cw00.choi fix it]
Reported-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier
Chanwoo Choi [Tue, 26 Jan 2016 04:21:26 +0000 (13:21 +0900)]
PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier

This patch adds the new DEVFREQ_TRANSITION_NOTIFIER notifier to send
the notification when the frequency of device is changed.
This notifier has two state as following:
- DEVFREQ_PRECHANGE  : Notify it before chaning the frequency of device
- DEVFREQ_POSTCHANGE : Notify it after changed the frequency of device

And this patch adds the resourced-managed function to release the resource
automatically when error happen.

Signed-off-by: Chanwoo Choi <cw00.choi@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: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: Add devfreq_get_devfreq_by_phandle()
Chanwoo Choi [Tue, 10 Nov 2015 11:31:07 +0000 (20:31 +0900)]
PM / devfreq: Add devfreq_get_devfreq_by_phandle()

This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function
which can find the instance of devfreq device by using phandle ("devfreq").

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@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>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
Chanwoo Choi [Wed, 4 Nov 2015 01:52:45 +0000 (10:52 +0900)]
PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver

This patch adds the documentation for generic exynos bus frequency
driver.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: exynos: Add generic exynos bus frequency driver
Chanwoo Choi [Tue, 3 Nov 2015 10:04:16 +0000 (19:04 +0900)]
PM / devfreq: exynos: Add generic exynos bus frequency driver

This patch adds the generic exynos bus frequency driver for AMBA AXI bus
of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC
have the common architecture for bus between DRAM and sub-blocks in SoC.
This driver can support the generic bus frequency driver for Exynos SoCs.

In devicetree, Each bus block has a bus clock, regulator, operation-point
and devfreq-event devices which measure the utilization of each bus block.

Signed-off-by: Chanwoo Choi <cw00.choi@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: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
6 years agoPM / devfreq: Spelling s/frequnecy/frequency/
Geert Uytterhoeven [Mon, 14 Mar 2016 15:29:02 +0000 (16:29 +0100)]
PM / devfreq: Spelling s/frequnecy/frequency/

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 years agoPM / devfreq: Do not show statistics if it's not ready.
MyungJoo Ham [Mon, 23 Nov 2015 06:45:36 +0000 (15:45 +0900)]
PM / devfreq: Do not show statistics if it's not ready.

Before this patch for a device without statistics support,

$ cat trans_stat
    From  :   To
          :   time(ms)
Total transitions : 0
$

After this patch applied for such a device,

$ cat trans_stat
Not Supported.
$

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Modify the indentation of trans_stat sysfs for readability
Chanwoo Choi [Thu, 19 Nov 2015 07:28:46 +0000 (16:28 +0900)]
PM / devfreq: Modify the indentation of trans_stat sysfs for readability

This patch modifies the indentation of 'trans_stat' sysfs to improve readability.
The 1GHz is 1000,000,000. So it needs the least 10 position to show the GHz unit.

- Before apply this patch,
-sh-3.2# cat trans_stat
   From  :   To
         :50000000100000000133000000200000000400000000   time(ms)
*50000000:       0       0       0       0       7   1817635
 100000000:       4       0       0       0       4      1590
 133000000:       1       4       0       0       7       975
 200000000:       2       2       7       0       1      2655
 400000000:       0       2       5      12       0      1860
Total transition : 58

- After apply this patch,
-sh-3.2# cat trans_stat
     From  :   To
           :  50000000 100000000 133000000 200000000 400000000   time(ms)
*  50000000:         0         0         0         0         7     14405
  100000000:         4         0         0         0         3      2015
  133000000:         2         3         0         0         7      1020
  200000000:         1         2         7         0         0      2970
  400000000:         0         2         5        10         0      1575
Total transition : 53

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Set the freq_table of devfreq device
Chanwoo Choi [Wed, 18 Nov 2015 05:49:02 +0000 (14:49 +0900)]
PM / devfreq: Set the freq_table of devfreq device

This patch initialize the freq_table array of each devfreq device by using
the devfreq_set_freq_table(). If freq_table is NULL, the devfreq framework
is not able to support the frequency transtion information through sysfs.

The OPP core uses the integer type for the number of opps in the opp list
and uses the 'unsigned long' type for each frequency. So, this patch
modifies the type of some variable as following:
- the type of freq_table : unsigned int -> unsigned long
- the type of max_state  : unsigned int -> int

- Corrected types, format strings, mutex usages by MyungJoo

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Add show_one macro to delete the duplicate code
Chanwoo Choi [Fri, 13 Nov 2015 10:25:28 +0000 (19:25 +0900)]
PM / devfreq: Add show_one macro to delete the duplicate code

This patch adds the 'show_one' macro to simplify the duplicate code
of both max_freq_show() and min_freq_show().

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: event: Fix the error and warning from script/checkpatch.pl
Chanwoo Choi [Thu, 19 Nov 2015 08:03:44 +0000 (17:03 +0900)]
PM / devfreq: event: Fix the error and warning from script/checkpatch.pl

This patch just fixes following error and warning by using
scripts/checkpatch.pl.

- Follwoing issue from checkpatch.pl:
ERROR: space prohibited before that close parenthesis ')'
+ if (count < 0 ) {

WARNING: line over 80 characters
+ ptr = devres_alloc(devm_devfreq_event_release, sizeof(*ptr), GFP_KERNEL);

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: event: Remove the error log of devfreq_event_get_edev_by_phandle()
Chanwoo Choi [Tue, 17 Nov 2015 05:25:06 +0000 (14:25 +0900)]
PM / devfreq: event: Remove the error log of devfreq_event_get_edev_by_phandle()

This patch just removes the error log when
devfreq_event_get_edev_by_phandle() fail to get the instance of
devfreq-event device. It is related to sequence of the probe() of each
driver. So, this error log might show the always during kernel booting.
Each driver using this function can show the appropriate error log.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: fix double kfree
Geliang Tang [Thu, 1 Oct 2015 14:18:19 +0000 (22:18 +0800)]
PM / devfreq: fix double kfree

When device_register() fails, kfree(devfreq) is called already in
devfreq_dev_release(), hence there is no need to call kfree(devfreq)
in err_dev again.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Fix governor_store()
Tobias Jakobi [Mon, 21 Sep 2015 18:23:52 +0000 (20:23 +0200)]
PM / devfreq: Fix governor_store()

Writing the currently set governor into sysfs currently
seems to fail.
Fix this by setting the return code to zero before
leaving governor_store().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Fix incorrect type issue.
Xiaolong Ye [Fri, 11 Sep 2015 03:05:23 +0000 (11:05 +0800)]
PM / devfreq: Fix incorrect type issue.

time_in_state in struct devfreq is defined as unsigned long, so
devm_kzalloc should use sizeof(unsigned long) as argument instead
of sizeof(unsigned int), otherwise it will cause unexpected result
in 64bit system.

Signed-off-by: Xiaolong Ye <yexl@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: comments for get_dev_status usage updated
MyungJoo Ham [Tue, 18 Aug 2015 04:45:49 +0000 (13:45 +0900)]
PM / devfreq: comments for get_dev_status usage updated

With the introduction of devfreq_update_stats(), governors
are not recommended to use get_dev_status() directly.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
[jy0922.shim: apply mainline patch]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
6 years agoPM / devfreq: drop comment about thermal setting max_freq
Javi Merino [Fri, 14 Aug 2015 17:57:00 +0000 (18:57 +0100)]
PM / devfreq: drop comment about thermal setting max_freq

The thermal infrastructure should use the devfreq cooling device, which
uses the OPP library to disable OPPs as necessary.

Fix a couple of typos in the same comment while we are at it.

Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: cache the last call to get_dev_status()
Javi Merino [Fri, 14 Aug 2015 17:56:56 +0000 (18:56 +0100)]
PM / devfreq: cache the last call to get_dev_status()

The return value of get_dev_status() can be reused.  Cache it so that
other parts of the kernel can reuse it instead of having to call the
same function again.

Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoPM / devfreq: Drop unlikely before IS_ERR(_OR_NULL)
Viresh Kumar [Mon, 10 Aug 2015 06:12:25 +0000 (11:42 +0530)]
PM / devfreq: 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.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
6 years agoRevert "PM / devfreq: exynos: Add documentation for generic exynos memory bus frequen...
Chanwoo Choi [Wed, 9 Aug 2017 02:48:33 +0000 (11:48 +0900)]
Revert "PM / devfreq: exynos: Add documentation for generic exynos memory bus frequency driver"

This reverts commit 2dea71417b1b164cd8f4a4e8b8cbcfd1e2d50b3d.

6 years agoRevert "PM / devfreq: exynos: Add generic exynos memory bus frequency driver"
Chanwoo Choi [Tue, 8 Aug 2017 08:17:04 +0000 (17:17 +0900)]
Revert "PM / devfreq: exynos: Add generic exynos memory bus frequency driver"

This reverts commit 81e71993f7d397915a664706f9e84e61b4c43c76.

6 years agoRevert "PM / devfreq: exynos: Remove unused exynos4 memory busfreq driver"
Chanwoo Choi [Tue, 8 Aug 2017 08:16:55 +0000 (17:16 +0900)]
Revert "PM / devfreq: exynos: Remove unused exynos4 memory busfreq driver"

This reverts commit c77ebcc61f5b84ddba67898bf7c1c491fcce9221.

6 years agoRevert "PM / devfreq: cache the last call to get_dev_status()"
Chanwoo Choi [Tue, 8 Aug 2017 07:54:15 +0000 (16:54 +0900)]
Revert "PM / devfreq: cache the last call to get_dev_status()"

This reverts commit f97b42f9e6fd63101ded5bb5c4d37cce59920ff5.

6 years agoRevert "PM / devfreq: comments for get_dev_status usage updated"
Chanwoo Choi [Tue, 8 Aug 2017 07:54:05 +0000 (16:54 +0900)]
Revert "PM / devfreq: comments for get_dev_status usage updated"

This reverts commit 9b75a7414e3cf606b15b1c67c5ad486af73bcf30.

6 years agopackaging: Disable UBSan build 71/146271/3 accepted/tizen/unified/20170828.164523 submit/tizen/20170828.023313
Denis Khalikov [Fri, 25 Aug 2017 13:11:14 +0000 (16:11 +0300)]
packaging: Disable UBSan build

UBSan build on kernel will cause build error because kernel has its own
sanitizer build options. So, dislable UBSan build from packaging spec.

Change-Id: Ie06197677c9949eb8ed9537af6fc366d20d3a000
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
6 years agofimc-is: Remove BUG() from fimc_is_itf_s_param() 07/145207/1 accepted/tizen/4.0/unified/20170829.020507 accepted/tizen/unified/20170822.023852 submit/tizen/20170822.003618 submit/tizen_4.0/20170828.100004
Sylwester Nawrocki [Mon, 21 Aug 2017 16:19:50 +0000 (18:19 +0200)]
fimc-is: Remove BUG() from fimc_is_itf_s_param()

The condition being tested for that BUG() invocation is often
recoverable, so replace BUG() with a WARN_ON() and return EINVAL.
This prevents specific user space call sequences crashing the kernel,
which should never happen.
The callers of fimc_is_itf_s_param() function will be updated in
subsequent patches if necessary, to prevent any further possible
crashes.

Change-Id: I90a08278baa0cee85a4a69fa1b278e28e5c6764a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agofimc-is: Remove F/W log dump at ISP video node close 46/145146/2
Sylwester Nawrocki [Mon, 21 Aug 2017 11:29:21 +0000 (13:29 +0200)]
fimc-is: Remove F/W log dump at ISP video node close

The fimc_is_hw_logdump() call was added for debug purpose,
it slows down the camera close sequence by few seconds
so remove that function call.

Change-Id: If0ce3ab16550130be9233c8a5aae4e5874065247
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agodrm/exynos/gsc: Fix check pos size and allocated memory size 22/145122/2
Hoegeun Kwon [Mon, 21 Aug 2017 01:08:53 +0000 (10:08 +0900)]
drm/exynos/gsc: Fix check pos size and allocated memory size

It will not allow to use various resolutions if we allow to use only
resolution with multiple of 16.
Therefore the pos size changed by a multiple of 16 is compared with
the allocated memory without error handling for multiples of resolution.

Change-Id: I6ce5f059baa23dd06b56ecf780261fad349e2314
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
6 years agodrm/exynos/gsc: Fix the multiple of resolution to 16 21/145121/1
Hoegeun Kwon [Mon, 21 Aug 2017 01:06:34 +0000 (10:06 +0900)]
drm/exynos/gsc: Fix the multiple of resolution to 16

There is a problem that multiples of 4, 8 are considered only for
certain format. Change to a multiple of 16 to accommodate all formats.

Change-Id: I56a664ea85bc136ad424dfb40e29d20e4225c481
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
6 years agodrm/exynos/gsc: Fix check multiples of source resolution 97/144997/1
Hoegeun Kwon [Fri, 18 Aug 2017 04:28:52 +0000 (13:28 +0900)]
drm/exynos/gsc: Fix check multiples of source resolution

The destination resolution is not related to multiples of 4, 8.
Therefore check only the source resolution.

Change-Id: I1fca3718ccd176522e6016f0efe08a00a55975aa
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
6 years agopackaging: Add kernel devel package to odroid spec 30/142330/4 accepted/tizen/unified/20170811.071716 submit/tizen/20170811.021835
Alexander Aksenov [Thu, 27 Jul 2017 12:51:55 +0000 (15:51 +0300)]
packaging: Add kernel devel package to odroid spec

Add kernel devel package to odroid spec to build out-of-tree kernel
modules.

Change-Id: I2e28ee5b6bec342b0d1d5c3e3409ff1f4aac8c7a
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
6 years agopackaging: Remove symbolic link in a devel package 05/143505/5
Jaechul Lee [Thu, 10 Aug 2017 02:03:58 +0000 (11:03 +0900)]
packaging: Remove symbolic link in a devel package

The symbolic link to kernel-devel-tizen-dev doesn't need anymore because
those who want to build SWAP-DA will use the absolute package name for
building respectively on the several kernels.

The out-of-tree kernel module build uses absolute devel package name to
bulid SWAP-DA. It should be left out to prevent a conflict between
each kernel devel packages.

Change-Id: I5eb1182500c1f9201420b958b1ad0617ec167f04
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
6 years agosensors: brcm: Remove wake_lock to fix the suspend issue 77/143477/1
Chanwoo Choi [Thu, 10 Aug 2017 05:33:47 +0000 (14:33 +0900)]
sensors: brcm: Remove wake_lock to fix the suspend issue

Even if TM2 doesn't use the wake_lock feature, the brcm sensor
drivers used the wake_lock and the the count of GPS interrupt
of brcm sensor is too much. The too much interrupt causes the
pending of reading the 'sys/power/wakeup_count' and then failed
to enter the suspend state by user-process.

This patch removes the wake_lock code to fix the suspend issue.

Change-Id: Ibd161a7a53adc4398f145e482a90efa35febbdb6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agodrm/exynos/gsc: Add resolution check and error handling 27/140227/10
Hoegeun Kwon [Thu, 20 Jul 2017 04:25:49 +0000 (13:25 +0900)]
drm/exynos/gsc: Add resolution check and error handling

If the gscaler device tries to rotate the screen with a resolution
other than a multiple of 4 and 8, a kernel panic [1] occurs because of
referring unallocated memory areas. The cause of this problem is that
multiples of the resolution must be a multiple of 4, 8 each
horizontally and vertically. It is related to the hardware limit of
gscaler.

Add error handling to check that each horizontal and vertical
resolution is not a multiple of 4 and 8.

[1]
   BUG: failure at drivers/iommu/exynos-iommu.c:425/exynos_sysmmu_irq()!
   Kernel panic - not syncing: BUG!
   CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.36-00004-gfbfeb5b-dirty #215
   Hardware name: Samsung TM2 board (DT)
   Call trace:
   [<ffffffc00008a008>] dump_backtrace+0x0/0x12c
   [<ffffffc00008a148>] show_stack+0x14/0x1c
   [<ffffffc000a5c818>] dump_stack+0x84/0xa8
   [<ffffffc000a589d4>] panic+0xf0/0x234
   [<ffffffc00045c4c0>] exynos_sysmmu_irq+0x68/0x78
   [<ffffffc0000e8ab4>] handle_irq_event_percpu+0x78/0x290
   [<ffffffc0000e8d18>] handle_irq_event+0x4c/0x78
   [<ffffffc0000eb9c0>] handle_fasteoi_irq+0xe4/0x198
   [<ffffffc0000e8050>] generic_handle_irq+0x34/0x4c
   [<ffffffc0000e83a4>] __handle_domain_irq+0x88/0xf0
   [<ffffffc000082418>] gic_handle_irq+0x34/0x84
   Exception stack(0xffffffc001097da0 to 0xffffffc001097ed0)
   7da0: 010a1000 ffffffc0 00000000 00000080 01097ef0 ffffffc0 00086974 ffffffc0
   7dc0: 00000000 00000000 01097f00 ffffffc0 00000001 00000000 00000000 00000000
   7de0: 00000000 00000000 98e93c98 ffffffc0 6abd3580 00000018 99087c98 ffffffc0
   7e00: 010af230 ffffffc0 01097e40 ffffffc0 ffffb3a1 00000000 00a72988 ffffffc0
   7e20: f1efd6f4 00000000 f1efd708 00000000 f1efe290 00000000 00000000 00000000
   7e40: 0010cfa0 ffffffc0 00000000 00000000 00000000 00000000 010a1000 ffffffc0
   7e60: 0122a000 ffffffc0 00a71000 ffffffc0 00000000 00000000 00000000 00000000
   7e80: 010891b0 ffffffc0 0108a740 ffffffc0 01083be0 ffffffc0 00f54000 ffffffc0
   7ea0: 00000000 00000000 01097ef0 ffffffc0 00086970 ffffffc0 01097ef0 ffffffc0
   7ec0: 00086974 ffffffc0 60000145 00000000
   [<ffffffc000085700>] el1_irq+0x80/0xf8
   [<ffffffc0000d9d50>] cpu_startup_entry+0x290/0x458
   [<ffffffc000a5702c>] rest_init+0x84/0x8c
   [<ffffffc000fe9984>] start_kernel+0x398/0x3ac

Change-Id: I5e81a5217a0eaa12e8645cbe4fe118661decc037
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
6 years agoclk: samsung: exynos5433: Correct typos in SoC name 71/143171/2
Marek Szyprowski [Wed, 9 Aug 2017 00:38:47 +0000 (09:38 +0900)]
clk: samsung: exynos5433: Correct typos in SoC name

This patch fixes simple typos in Exynos5433 clocks driver. The SoC name
was referred a few times as '5443' instead of '5433'.

Change-Id: Ie0507e195a323b134af0cb0c775637755b128df7
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 years agoclk: samsung: exynos5433: Add data for 250MHz and 278MHz PLL rates 70/143170/2
Marek Szyprowski [Thu, 26 Jan 2017 12:37:53 +0000 (13:37 +0100)]
clk: samsung: exynos5433: Add data for 250MHz and 278MHz PLL rates

Default clock configuration applied by the bootloader for TM2 and TM2e
boards includes 250MHz and 278MHz rate for DISP PLL clock. To ensure
such configuration for those boards with 'assigned-clock-*' properties,
parameters for those two additional rates are needed.

Change-Id: I637f105f7141bb5854f1f78cacc215eb7c447621
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoclk: samsung: exynos5433: Add IDs for PHYCLK_MIPIDPHY0_* clocks 69/143169/2
Marek Szyprowski [Wed, 9 Aug 2017 00:36:41 +0000 (09:36 +0900)]
clk: samsung: exynos5433: Add IDs for PHYCLK_MIPIDPHY0_* clocks

Add missing identifiers for phyclk_mipidphy0_bitclkdiv8_phy and
phyclk_mipidphy0_rxclkesc0_phy clocks. Access to those clocks is needed
to setup initial clock configuration for display subsystem in device tree
in order to avoid dependency on the configuration left by the bootloader.

Change-Id: I808ec0e89d38e55e6ca5839bf365dce7b694af27
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoclk: samsung: exynos5433: Set NoC (Network On Chip) clocks as critical 68/143168/1
Chanwoo Choi [Thu, 8 Dec 2016 04:58:07 +0000 (13:58 +0900)]
clk: samsung: exynos5433: Set NoC (Network On Chip) clocks as critical

The ACLK_BUS0/1/2 are used for NoC (Network on Chip). If NoC's clocks are
disabled, the system halt happens. Following clocks must be always enabled:
 - CLK_ACLK_BUS0_400 : NoC's 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.

This patch also adds the CLK_SET_RATE_PARENT flag to the CLK_SCLK_JPEG_MSCL
because this clock should be used for bus frequency scaling. This clock need
to be changed on the fly with CLK_SET_RATE_PARENT flag.

Change-Id: I37661bb8c4d8c36d96464df6eeb2927be1065a2a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoclk: exynos5433: Mark some clocks as critical 67/143167/1
Marek Szyprowski [Fri, 18 Nov 2016 10:04:18 +0000 (11:04 +0100)]
clk: exynos5433: Mark some clocks as critical

Some parent clocks of the Exynos5433 CMUs must be always enabled to access
any register in the given CMU or devices connected to it. For the time
being, until a proper solution based on runtime PM is applied, mark those
clocks as critical (instead of ignore unused) to prevent disabling them.

Change-Id: Icf0955a6a357acd90865512d326da04974ba9ed9
Reported-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 years agoclk: exynos5433: Fix parent clocks for FSYS block 66/143166/1
Marek Szyprowski [Thu, 17 Nov 2016 11:42:52 +0000 (12:42 +0100)]
clk: exynos5433: Fix parent clocks for FSYS block

The proper parent clock for FSYS block is "aclk_fsys_200"
according to the Exynos5433 reference manual.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[cw00.choi: Apply mainline patch as backporting]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Change-Id: I02f8fad8004de987d0f85fae6269af0a7b71225a

6 years agoclk: WARN_ON about to disable a critical clock 65/143165/1
Lee Jones [Wed, 9 Aug 2017 00:50:03 +0000 (09:50 +0900)]
clk: WARN_ON about to disable a critical clock

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1455225554-13267-3-git-send-email-mturquette@baylibre.com
[cw00.choi: Fix the merge conflict and apply mainline patch]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Change-Id: Ibf56e2d41935224629097b50c7856e19349c82ad

6 years agoclk: Allow clocks to be marked as CRITICAL 64/143164/1
Lee Jones [Wed, 9 Aug 2017 00:47:55 +0000 (09:47 +0900)]
clk: Allow clocks to be marked as CRITICAL

Critical clocks are those which must not be gated, else undefined
or catastrophic failure would occur.  Here we have chosen to
ensure the prepare/enable counts are correctly incremented, so as
not to confuse users with enabled clocks with no visible users.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1455225554-13267-2-git-send-email-mturquette@baylibre.com
[cw00.choi: Fix the merge conflict and apply the mainline patch]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Change-Id: Ic4ec2959426dc4a424bf71bdc6b725dd9022616c

6 years agoRevert "Revert "usb: core: lpm: set lpm_capable for root hub device"" 15/125315/11 accepted/tizen/unified/20170807.152205 submit/tizen/20170807.013143
Dongwoo Lee [Fri, 14 Apr 2017 03:36:30 +0000 (12:36 +0900)]
Revert "Revert "usb: core: lpm: set lpm_capable for root hub device""

This reverts commit 'dc463ecea9d0 ("Revert "usb: core: lpm: set lpm_capable
for root hub device"")'

The original commit was reverted because it makes the USB port is not
working on Odroid-XU4. But now PHY tuning resolves this problem, so it
will be restored.

Change-Id: I59cdd3a6bf2f0fce06dce88a4f7844a82ed1eab5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agousb: host: xhci-plat: Tune PHY after xhci reset 14/125314/10
Dongwoo Lee [Tue, 11 Apr 2017 05:32:44 +0000 (14:32 +0900)]
usb: host: xhci-plat: Tune PHY after xhci reset

It tunes PHY to enable USB 3.0 super-speed mode.

Since xhci reset clears PHY CR port settings, PHY should be re-tuned
after xhci reset completes.

Change-Id: I1ab574c592d1a64b2735773b387687997647d89a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agophy: exynos5-usbdrd: Add USB 3.0 super-speed mode tune 13/125313/9
Dongwoo Lee [Wed, 22 Mar 2017 04:54:50 +0000 (13:54 +0900)]
phy: exynos5-usbdrd: Add USB 3.0 super-speed mode tune

It implements PHY tune operation to activate USB 3.0 super-speed mode.

Change-Id: I56971effacc2d3383b1fc55c2e73f76f54d603a0
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
6 years agophy: core: Add PHY tune operation 12/125312/6
Dongwoo Lee [Fri, 7 Apr 2017 06:22:18 +0000 (15:22 +0900)]
phy: core: Add PHY tune operation

PHY framework currently provides phy_init to set initial state of
registers, powers and clocks but it is always called before xhci is
probed. However, some PHYs might need to adjust their configuration
during its operation because of h/w characteristics (or problem).
To resolve this problem, it provides tune operation to generic PHY
framework.

Change-Id: I74b0104d6ecada8c4274036c69497b9368e7f38a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agoarm64: dts: exynos5433: Enable exynos-avs on the tm2 and tm2e boards 75/136275/3
Wook Song [Wed, 28 Jun 2017 08:57:08 +0000 (17:57 +0900)]
arm64: dts: exynos5433: Enable exynos-avs on the tm2 and tm2e boards

This patch adds the exynos-avs device nodes to the exynos5433-tm2 and
exynos5433-tm2e board dts files. The vdd-supply property required by
each exynos-avs device is also added to the corresponding device node.

Change-Id: Ia4ae2bd0624bb97d98157820fdae93bf4dace6a0
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoarm64: dts: exynos5433: Add exynos-avs device node 74/136274/3
Wook Song [Wed, 28 Jun 2017 06:18:06 +0000 (15:18 +0900)]
arm64: dts: exynos5433: Add exynos-avs device node

This patch adds exynos AVS device tree node for Exynos5433. Since the
AVS device driver for Exynos5433 requries the phandle of the syscon node
for chipid register set, this patch also adds the "syscon" compatible
property to the exynos-chipid binding node.

Change-Id: Icef5aba65fac3864553ebdac233181015bb2f393
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoPM / AVS: exynos-avs: Add Adaptive Voltage Scaling (AVS) device driver 50/111950/11
Wook Song [Tue, 24 Jan 2017 08:10:54 +0000 (17:10 +0900)]
PM / AVS: exynos-avs: Add Adaptive Voltage Scaling (AVS) device driver

In Exynos SoC, Adaptive Supply Voltage (ASV) is a technique, which
provides sets of voltage values optimized to the SoC revision variations
for given operating frequencies of devices such as CPU, GPU, and BUS.
For each given operating frequency of the device, there is an ASV group
number, which indicates the SoC revision variaion. By using the ASV
group number, it is possible to identify which one is the most suitable
set of voltages. In general, the ASV group numbers are decided at the
manufactoring time and we can get these numbers by reading specific
memory addresses mapped to a special read-only region.

This patch adds a dt-based common device driver for ASV support in
Exynos SoC. Since the ASV technique can be also viewed as a Adaptive
Voltage Scaling (AVS) feature, we let this device driver be included in
drivers/power/avs directory. This common device driver supports basic
operations to read the ASV group number and replace the OPP table of the
device with the optimized one by using the ASV group number.

In the current version of the AVS common device driver, instead of
supporting all the resource types, CPU-related resource types are
supported. It will be extended to support other types of resources such
as GPU and BUS.

For the specific SoC support by using this common device driver, this
patch also adds a device driver for Exynos5433 SoC. In the case of
Exynos5433 SoC, there are four vesions of the OPP tables for each
resource. Since each OPP table contains 16 sets of voltages for 16 ASV
groups, 64 sets of operating points are required to only support the
Little cluster. Therefore, in the current implementation, this
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 is
the latest version). It will be also extended to supprot all of the 16
ASV groups in the OPP table version 2 soon.

Change-Id: Ie4d7e810a42c1cbcad7c6af9a77cce0964e104bb
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agoPM / AVS: exynos-avs: Add binding document for exynos-avs 49/111949/7
Wook Song [Tue, 24 Jan 2017 07:47:16 +0000 (16:47 +0900)]
PM / AVS: exynos-avs: Add binding document for exynos-avs

This patch adds a device tree binding document describing the exynos AVS
device driver.

Change-Id: I6f40e5ee9d9c796f3318dbfd71448c63f9467f8e
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 years agolocal/net: bcm4358: fix misleading-indentation build warning 47/137947/1 accepted/tizen/4.0/unified/20170816.012918 accepted/tizen/unified/20170711.180931 submit/tizen/20170711.010212 submit/tizen_4.0/20170811.094300
Seung-Woo Kim [Mon, 10 Jul 2017 10:33:46 +0000 (19:33 +0900)]
local/net: bcm4358: fix misleading-indentation build warning

This patch fixes following build warning caused by wrong indent:

   drivers/net/wireless/bcmdhd4358/wl_cfg80211.c: In function 'wl_cfg80211_mgmt_tx':
   drivers/net/wireless/bcmdhd4358/wl_cfg80211.c:6345:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       if ((dev == bcmcfg_to_prmry_ndev(cfg)) && cfg->p2p)
       ^~
   drivers/net/wireless/bcmdhd4358/wl_cfg80211.c:6347:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
        wl_cfgp2p_set_management_ie(cfg, dev, bssidx,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I6ab0087a11b9a1a2be05211ba0ef751ff8f564b7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agosched: hmp: fix misleading-indentation build warning 46/137946/1
Seung-Woo Kim [Mon, 10 Jul 2017 10:26:32 +0000 (19:26 +0900)]
sched: hmp: fix misleading-indentation build warning

This patch fixes following build warning caused by wrong indent:

   kernel/sched/fair.c: In function 'move_specific_task':
   kernel/sched/fair.c:9074:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (throttled_lb_pair(task_group(p), env->src_rq->cpu,
     ^~
   kernel/sched/fair.c:9078:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      if (!hmp_can_migrate_task(p, env))
      ^~

Change-Id: Ibaad680588b9b6b7f1ba6fec3ec1422963268d7a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agodrm/exynos/gsc: Add rotation hardware limits of gscaler 37/123837/15 submit/tizen/20170710.070742
Hoegeun Kwon [Fri, 7 Apr 2017 06:11:14 +0000 (15:11 +0900)]
drm/exynos/gsc: Add rotation hardware limits of gscaler

The gscaler has hardware rotation limits that need to be imported from
dts. Parse them and add them to the property list.

The rotation hardware limits are related to the cropped source size.
When swap occurs, use rot_max size instead of crop_max size.

Also the scaling limits are related to post size, use pos size to
check the limits.

Change-Id: I081568c20ac5b30e5decd76498b39bacf29829b6
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agoarm64: dts: exynos: Add the hardware rotation limits for gsc 38/123838/14
Hoegeun Kwon [Fri, 7 Apr 2017 06:27:56 +0000 (15:27 +0900)]
arm64: dts: exynos: Add the hardware rotation limits for gsc

The gscaler has maximum size of input or output rotation. Add the
hardware limits property for the gscaler rotation in the exynos5433
dts.

Change-Id: Ifb1109d635e5a6993f29803ac04636e84120e0b7
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agoARM: dts: exynos: Add the hardware rotation limits for gsc 39/123839/13
Hoegeun Kwon [Fri, 7 Apr 2017 06:28:18 +0000 (15:28 +0900)]
ARM: dts: exynos: Add the hardware rotation limits for gsc

The gscaler has maximum size of input or output rotation. Add the
hardware limits property for the gscaler rotation in the exynos5250
and exynos5420 dts.

Change-Id: Ia37f7c7334bad31ca8f96d0c57cab54dd2e1cbfd
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agopackaging: fix baselibs not to include aarch64 header package 47/136947/2 accepted/tizen/unified/20170705.162341 submit/tizen/20170705.015412
Seung-Woo Kim [Tue, 4 Jul 2017 01:11:09 +0000 (10:11 +0900)]
packaging: fix baselibs not to include aarch64 header package

The armv7l repo already has kernel-headers for tm2 board, so
repackaging with baselibs is not required for the package, and
this patch fixes baselibs not to include aarch64 header package
for armv7l.

Change-Id: I43fbd1fd0e4f984b35b51aacfcf614d959b0c163
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agodrm/panel: s6e3ha2: Remove unnecessary error handling and func 82/136982/3
Hoegeun Kwon [Fri, 30 Jun 2017 06:00:36 +0000 (15:00 +0900)]
drm/panel: s6e3ha2: Remove unnecessary error handling and func

Remove the callback function(s6e3ha2_get_brightness) because it
supports get brightness in the backlight framework.
And also backlight framework of mainline already checks
whether the brightness value is valid or not so it removes
the relevant code from panel driver.

Change-Id: Ia27c10e317289440ef1818ad8b48d1413f32ff36
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agoASoC: samsung: i2s: Supported high resolution rates 42/136342/7
Jaechul Lee [Thu, 22 Jun 2017 02:03:27 +0000 (11:03 +0900)]
ASoC: samsung: i2s: Supported high resolution rates

This driver can support more frequencies over 96KHz. There are no reasons to
limit the frequency range below 96KHz. If codecs/amps or something else can't
support high resolution rate, the constraints would be set rates properly
because each drivers has its own limits.

This patch was tested with 192KHz audio stream on exynos5433

Change-Id: I35233199f1b1ee10239793780e9bb14fdc590aca
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
7 years agoARM: tizen_{odroid,tm2}_defconfig: fix maximum ram block device size 15/135615/2 accepted/tizen/unified/20170703.154931 submit/tizen/20170703.020614
Seung-Woo Kim [Fri, 23 Jun 2017 09:45:42 +0000 (18:45 +0900)]
ARM: tizen_{odroid,tm2}_defconfig: fix maximum ram block device size

Tizen platform needs to support 12MiB ram bloack device, so this
patch fixes maximum ram block device size as 12MiB.

Change-Id: Iaedb2d4f949166cfb43b71bc7d2202c3b6b40cb6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoBluetooth: Fix enhance audio streaming chopping issue 02/136502/3
Seungyoun Ju [Fri, 30 Jun 2017 02:46:53 +0000 (11:46 +0900)]
Bluetooth: Fix enhance audio streaming chopping issue

If BT controller's buffer is occupied by another profile such as
OPP or SPP, and it is blocked due to RF condition, A2DP packets
couldn't be sent properly. It causes the A2DP chopping issue.
It is because HCI buffer is limited but another tx requests
occupy it and audio sreaming packet delay is occurred. So this
patch reserves some HCI buffer for A2DP to guarantee A2DP QoS
better.

Change-Id: I7f423f885ef6b7b0a56880d259fd7cd47ce60213
Signed-off-by: Seungyoun Ju <sy39.ju@samsung.com>
7 years agousb: gadget: slp: fix to use arm system_serial if no dmi serial 02/125502/7
Seung-Woo Kim [Tue, 18 Apr 2017 01:15:12 +0000 (10:15 +0900)]
usb: gadget: slp: fix to use arm system_serial if no dmi serial

From ARM system, system_serial is identical serial number. So, this
patch fixes to use arm system_serial as serial of lagacy slp usb
gadget instead of fixed serial if there is no dmi serial value.

Change-Id: Ie28c6c3d2afc54fc1ea54d3eb67100d3ed27165d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agousb: gadget: slp: fix to use serial number of dmi 22/126022/4
Seung-Woo Kim [Wed, 19 Apr 2017 01:00:36 +0000 (10:00 +0900)]
usb: gadget: slp: fix to use serial number of dmi

For identical serial string of slp gadget, this patch fixes to use
product serial of dmi if the dmi value is set.

Change-Id: Ic75f6c7730cba5860afdf3bd60babc754b3ecd67
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoLOCAL / ARM: SAMSUNG: set chip product id as system_serial 01/125501/6
Seung-Woo Kim [Tue, 18 Apr 2017 01:11:01 +0000 (10:11 +0900)]
LOCAL / ARM: SAMSUNG: set chip product id as system_serial

The Exynos SoC has 64bit chip product id and it is identical for
each chip. So it can be used as system_serial.

Change-Id: Id739b865a1e355a0209841ff2ca1802b5daeabb2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agofimc-is: change metadata header as uapi header 55/135455/1 accepted/tizen/unified/20170629.085911 submit/tizen/20170623.052107
Seung-Woo Kim [Thu, 22 Jun 2017 09:41:20 +0000 (18:41 +0900)]
fimc-is: change metadata header as uapi header

The header fimc-is-metadata.h is required from user, so it should
be a uapi header. So this patch moves the header to uapi header.

Change-Id: I5618889c806d4463da0bf0ea947bf5d1b667d5e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agouapi: add missing exynos camera interface header 54/135454/1
Seung-Woo Kim [Thu, 22 Jun 2017 09:16:42 +0000 (18:16 +0900)]
uapi: add missing exynos camera interface header

The header videodev2_exynos_camera.h is required as uapi header,
but it is missed from install script. So this patch adds the
missing header.

Change-Id: I71b40de01c23ec210d1a9c8cea633116a41da8be
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agopackaging: tm2: add kernel headers for arm 32 bit 53/135453/1
Seung-Woo Kim [Thu, 22 Jun 2017 07:45:48 +0000 (16:45 +0900)]
packaging: tm2: add kernel headers for arm 32 bit

To support 32 bit compat, kernel headers should be required for arm
32 bit, so this adds kernel headers for 32 bit.

Change-Id: I973b7413a4cb61b5159cc045c870663092aa5240
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agodrm/exynos/ipp: Add check the property even if ipp id exists 19/126319/4
Hoegeun Kwon [Fri, 21 Apr 2017 01:59:21 +0000 (10:59 +0900)]
drm/exynos/ipp: Add check the property even if ipp id exists

If user calls exynos_drm_ipp_set_property() with ioctl, check_property
is not executed if ipp id(prop_id) is present.

This means that you can not dynamically check the rotation limits, So
check the property even if ipp id exists.

Change-Id: Ibc99dda25ea41ded3db7f3307ca3a4b0ba5de9bb
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agopackaging: Turn off building with ASan 14/130914/2 accepted/tizen/unified/20170609.054034 submit/tizen/20170607.041440
Gonzha Dmitriy Evgenevich [Wed, 24 May 2017 10:56:15 +0000 (13:56 +0300)]
packaging: Turn off building with ASan

Turn off ASan for ASan sanitized firmware build

Change-Id: I4df18ac8d98cf99c08a2302640e18bea82672240
Signed-off-by: Gonzha Dmitriy Evgenevich <d.gonzha@samsung.com>
7 years agoARM: defconfig: odroid: Disable CONFIG_OABI_COMPAT 19/127219/2
Paweł Szewczyk [Wed, 17 May 2017 11:27:16 +0000 (13:27 +0200)]
ARM: defconfig: odroid: Disable CONFIG_OABI_COMPAT

This change allows enabling syscall auditing (CONFIG_AUDITSYSCALL).

Change-Id: I145f9f74dfacae050346ed0feee4bc27dd155234
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoextcon: max77843: control the JIG pin by Auto detection 98/126198/3 accepted/tizen/unified/20170421.042254 submit/tizen/20170421.012531 tizen_4.0.m1_release
Jaehoon Chung [Thu, 20 Apr 2017 10:53:25 +0000 (19:53 +0900)]
extcon: max77843: control the JIG pin by Auto detection

Control the JIG pin by Auto dection.

Coontrol3 register has JIGset[1:0].
00: JIG pin controlled by Auto detection
01: JIG pin Output Low
10 to 11 : JIG pin Hi-Impedance

This patch is for fixing 'poweroff" issue.
- Download the some image
- After downloading the image, rebooting target.
- Press the poweroff, it runs 'reboot' instead of 'poweroff'

Change-Id: Ie17a46f79f2b4da6bbffc7d57feaddc7524b3524
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoudp: properly support MSG_PEEK with truncated buffers 89/125789/1
Eric Dumazet [Tue, 30 Aug 2016 04:34:58 +0000 (00:34 -0400)]
udp: properly support MSG_PEEK with truncated buffers

[ Upstream commit 197c949e7798fbf28cfadc69d9ca0c2abbf93191 ]

Backport of this upstream commit into stable kernels :
89c22d8c3b27 ("net: Fix skb csum races when peeking")
exposed a bug in udp stack vs MSG_PEEK support, when user provides
a buffer smaller than skb payload.

In this case,
skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr),
                                 msg->msg_iov);
returns -EFAULT.

This bug does not happen in upstream kernels since Al Viro did a great
job to replace this into :
skb_copy_and_csum_datagram_msg(skb, sizeof(struct udphdr), msg);
This variant is safe vs short buffers.

For the time being, instead reverting Herbert Xu patch and add back
skb->ip_summed invalid changes, simply store the result of
udp_lib_checksum_complete() so that we avoid computing the checksum a
second time, and avoid the problematic
skb_copy_and_csum_datagram_iovec() call.

This patch can be applied on recent kernels as it avoids a double
checksumming, then backported to stable kernels as a bug fix.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[Applied missed stable commit from linux-4.4.y tree to resolve CVE-2016-10229]
Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I736f7d244cade936e8991e2419466e803fead571

7 years agodrm/exynos/hdmi: dis-join pipeline on power-off 15/124515/3
Andrzej Hajda [Tue, 11 Apr 2017 11:31:37 +0000 (13:31 +0200)]
drm/exynos/hdmi: dis-join pipeline on power-off

Tizen's way of interaction with old/non-atomic DRM unveils apparent bug
in DRM core - pipeline is not destroyed on connector's removal. As a
result after re-connect full modeset code is not executed and can cause
incorrect behavior of the driver. The patch forcibly dis-joins the
pipeline on hdmi power-off to fix it.

Change-Id: If0798684ba90ddede5ccb6b59ca1ae672f35d3c0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/decon5433: replace old method of enabling PHY with pipe clk 14/124514/4
Andrzej Hajda [Tue, 11 Apr 2017 11:20:24 +0000 (13:20 +0200)]
drm/exynos/decon5433: replace old method of enabling PHY with pipe clk

DECON requires clock provided by HDMI-PHY prior to its configuration,
and the clock should be off after DECON disable.
Since introduction of pipe_clk DECON can fully control PHY clock.
It obsoletes exynos_hdmiphy_enable workaround.
The patch adds also missing code to disable HDMI-PHY on DECON disable.

Change-Id: I61b42bec9883d4f43a0ed5bcf1ed9f1b1f81781d
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos/hdmi: expose HDMI-PHY clock as pipeline clock 13/124513/2
Andrzej Hajda [Tue, 11 Apr 2017 11:17:37 +0000 (13:17 +0200)]
drm/exynos/hdmi: expose HDMI-PHY clock as pipeline clock

HDMI-PHY clock should be accessible from other components in the pipeline.

Change-Id: I17fa9cc3260ad33358dcf355e804de3ef4b4b19f
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
7 years agodrm/exynos: add support for pipeline clock to the framework 12/124512/2
Andrzej Hajda [Tue, 11 Apr 2017 11:14:11 +0000 (13:14 +0200)]
drm/exynos: add support for pipeline clock to the framework

Components belonging to the same pipeline often requires
synchronized clocks. Such clocks are sometimes provided
by external clock controller, but they can be also provided by
pipeline components. In latter case there should be a way
to access them from another component belonging to the same pipeline.
This is the case of:
- DECON,FIMD -> HDMI and HDMI-PHY clock,
- FIMD -> DP and DP clock in FIMD.
The latter case has been solved by clock_enable callback
in exynos_drm_crtc_ops. This solutin will not work with
HDMI path as in this case clock is provided by encoder.

This patch provides more generic solution allowing to register
pipeline clock during initialization in exynos_drm_crtc structure.
This way the clock will be easily accessible from both components.

Change-Id: I1fa6f541aaea154b0c3c1b52b94ab5ad31fbbe01
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoextcon: max77843: define USB device ADC state 29/121829/3
Andi Shyti [Fri, 17 Feb 2017 08:25:51 +0000 (17:25 +0900)]
extcon: max77843: define USB device ADC state

The ADC state defines the resistance that a USB device has in
order to distinguish between devices.

Use the 10001 (0x11) value as reserved for device slot number 4
and set the device as usb host.

Change-Id: Ice0e39a2a74568ccb21d28e40d487e4b67eb2668
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agopower: charger-manager: Add sysfs node for disabling charger 16/117616/12 accepted/tizen/unified/20170407.190140 submit/tizen/20170407.011250
Dongwoo Lee [Mon, 6 Mar 2017 06:32:46 +0000 (15:32 +0900)]
power: charger-manager: Add sysfs node for disabling charger

The new attribute 'disable_charge' will be added to
"/sys/devices/virtual/power_supply/battery/" If this attribute is
set to 1, battery charging will completely stop within 'discharging'
state, and it cannot be resumed until the node is set to 0 or the
target is rebooted.

Change-Id: Ie2d855a25d0b1660598a7b2821871334aa8c75a2
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agopower: charger-manager: Make sysfs node group 15/117615/11
Dongwoo Lee [Fri, 31 Mar 2017 06:39:03 +0000 (15:39 +0900)]
power: charger-manager: Make sysfs node group

Currently charger-manager uses only a single sysfs node for global
charger-manager, and register it as a separate file. However, if we
want to extend the node, we should register each sysfs node as an
additional file. To avoid this unextensible and uncomfortable tasks,
sysfs node group will be used.

Change-Id: Ie86c571b24668020e823deb9a72b5789f946ea3e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agopower: charger-manager: Fix error handling of sysfs node creation 30/122330/3
Dongwoo Lee [Thu, 30 Mar 2017 10:40:01 +0000 (19:40 +0900)]
power: charger-manager: Fix error handling of sysfs node creation

This fixes to remove the remaining sysfs node if probe fails, and
eliminates the redundant error log.

Change-Id: I22ba67c509d9560416b5a37b545f03b72d00be32
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
7 years agoRevert "Revert "Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection... 21/119821/2
Hyotaek Shim [Mon, 20 Mar 2017 07:58:48 +0000 (00:58 -0700)]
Revert "Revert "Revert "kdbus: add CMD_UPDATE_METADATA ioctl (reinitialize connection metadata)"""

This reverts commit 3cd1cf51706d2df8256cf8014d01b3d23d553f44.

Change-Id: Iea89918ca8ff2992fe967ce47887ad15d881053c

7 years agoARM: tizen_{odroid,tm2}_defconfig: disable DMA BUF FENCE support 04/116404/7
Hoegeun Kwon [Tue, 21 Feb 2017 04:15:08 +0000 (13:15 +0900)]
ARM: tizen_{odroid,tm2}_defconfig: disable DMA BUF FENCE support

The workaround is to disable the dma fence due to a problem that makes
the fence deadlocked after calling eglFrontBufferSetSEC() in the VR
application. Until the fence deadlock issue is resolved.

Revert commit
f09d2a5 (ARM: tizen_{odroid,tm2}_defconfig: enable DMA BUF FENCE support)

Change-Id: I3f37daa48675fd8e201ac46321d855e0f5da6363
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agogpu: arm: midgard: Fix the removal method of the fence 78/118678/5
Hoegeun Kwon [Mon, 13 Mar 2017 11:46:54 +0000 (20:46 +0900)]
gpu: arm: midgard: Fix the removal method of the fence

Fix the fence removal method because of the fence list is removed
twice. This change is also updated from mali midgard r15p0 by ARM.

The GL application calls the flip ioctl and then calls the
eglFrontBufferSetSEC function to use the user space front
buffer. At this time, if the user space application is terminated,
in Kernel, the link is removed from the kbase_dma_fence_cancel_all_atoms() function, a following error occurs referring to the wrong link.

   Unable to handle kernel paging request at virtual address dead000000000108
   pgd = ffffffc09e385000
   [dead000000000108] *pgd=0000000000000000, *pud=0000000000000000
   Internal error: Oops: 96000044 [#1] PREEMPT SMP
   ...
   task: ffffffc09952ad00 ti: ffffffc086c70000 task.ti: ffffffc086c70000
   PC is at kbase_dma_fence_cancel_all_atoms+0x64/0xf8
   LR is at kbase_dma_fence_cancel_all_atoms+0xac/0xf8
   ...
   Call trace:
   [<ffffffc0004c9df8>] kbase_dma_fence_cancel_all_atoms+0x64/0xf8
   [<ffffffc0004b170c>] kbase_jd_zap_context+0x74/0xa0
   [<ffffffc0004b6078>] kbase_destroy_context+0x40/0x1e0
   [<ffffffc0004c0468>] kbase_release+0xe4/0x168
   ...

Change-Id: Ief351783808e63e01797fdfa2d7460dec013bff4
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agolocal/net: bcm4358: fix panic when unregistering p2p interface 38/118838/2 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170316.161713 accepted/tizen/ivi/20170316.101834 accepted/tizen/mobile/20170316.101734 accepted/tizen/tv/20170316.101804 accepted/tizen/unified/20170316.101853 accepted/tizen/wearable/20170316.101819 submit/tizen/20170316.045621
Seung-Woo Kim [Tue, 14 Mar 2017 07:48:23 +0000 (16:48 +0900)]
local/net: bcm4358: fix panic when unregistering p2p interface

When unregistering p2p interface, following kernel panic occurs:

   BUG: failure at mm/slub.c:3413/kfree()!
   Kernel panic - not syncing: BUG!
   CPU: 1 PID: 2698 Comm: wpa_supplicant Not tainted 4.1.36-arm64-tm2 #1
   ...
   [<ffffffc000a6bc78>] panic+0xf0/0x234
   [<ffffffc00019cc1c>] show_slab_objects+0x0/0x264
   [<ffffffc0009e2204>] nl80211_set_wowlan+0x748/0x81c
   ...

It is because kfree(wdev->wiphy->wowlan_config) is called from
cfg80211_rdev_free_wowlan(), but it is assigned with const struct
pointer from the commit c1cdee9f047f ("LOCAL / net: bcm4358: set
wowlan_config for broadcom driver"). So this patch fixes to assign
it with kmemdup.

Change-Id: Ia924d27d7f262dfd0b49d61ee0214f2ae24fb5c7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoarm64: disable kasan when accessing frame->fp in unwind_frame 92/118792/1
Yang Shi [Mon, 8 Feb 2016 17:13:09 +0000 (09:13 -0800)]
arm64: disable kasan when accessing frame->fp in unwind_frame

When boot arm64 kernel with KASAN enabled, the below error is reported by
kasan:

BUG: KASAN: out-of-bounds in unwind_frame+0xec/0x260 at addr ffffffc064d57ba0
Read of size 8 by task pidof/499
page:ffffffbdc39355c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0x0()
page dumped because: kasan: bad access detected
CPU: 2 PID: 499 Comm: pidof Not tainted 4.5.0-rc1 #119
Hardware name: Freescale Layerscape 2085a RDB Board (DT)
Call trace:
[<ffffffc00008d078>] dump_backtrace+0x0/0x290
[<ffffffc00008d32c>] show_stack+0x24/0x30
[<ffffffc0006a981c>] dump_stack+0x8c/0xd8
[<ffffffc0002e4400>] kasan_report_error+0x558/0x588
[<ffffffc0002e4958>] kasan_report+0x60/0x70
[<ffffffc0002e3188>] __asan_load8+0x60/0x78
[<ffffffc00008c92c>] unwind_frame+0xec/0x260
[<ffffffc000087e60>] get_wchan+0x110/0x160
[<ffffffc0003b647c>] do_task_stat+0xb44/0xb68
[<ffffffc0003b7730>] proc_tgid_stat+0x40/0x50
[<ffffffc0003ac840>] proc_single_show+0x88/0xd8
[<ffffffc000345be8>] seq_read+0x370/0x770
[<ffffffc00030aba0>] __vfs_read+0xc8/0x1d8
[<ffffffc00030c0ec>] vfs_read+0x94/0x168
[<ffffffc00030d458>] SyS_read+0xb8/0x128
[<ffffffc000086530>] el0_svc_naked+0x24/0x28
Memory state around the buggy address:
 ffffffc064d57a80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f4 f4
 ffffffc064d57b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc064d57b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                  ^
 ffffffc064d57c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffffc064d57c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Since the shadow byte pointed by the report is 0, so it may mean it is just hit
oob in non-current task. So, disable the instrumentation to silence these
warnings.

Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Yang Shi <yang.shi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[Backport from mainline to remove KASAN warning.]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I2bf853904b6cc3517cbefb38a92a232f77f55d9c

7 years agocompiler, atomics, kasan: Provide READ_ONCE_NOCHECK() 91/118791/1
Andrey Ryabinin [Mon, 19 Oct 2015 08:37:17 +0000 (11:37 +0300)]
compiler, atomics, kasan: Provide READ_ONCE_NOCHECK()

Some code may perform racy by design memory reads. This could be
harmless, yet such code may produce KASAN warnings.

To hide such accesses from KASAN this patch introduces
READ_ONCE_NOCHECK() macro. KASAN will not check the memory
accessed by READ_ONCE_NOCHECK(). The KernelThreadSanitizer
(KTSAN) is going to ignore it as well.

This patch creates __read_once_size_nocheck() a clone of
__read_once_size(). The only difference between them is
'no_sanitized_address' attribute appended to '*_nocheck'
function. This attribute tells the compiler that instrumentation
of memory accesses should not be applied to that function. We
declare it as static '__maybe_unsed' because GCC is not capable
to inline such function:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368

With KASAN=n READ_ONCE_NOCHECK() is just a clone of READ_ONCE().

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
Cc: kasan-dev <kasan-dev@googlegroups.com>
Link: http://lkml.kernel.org/r/1445243838-17763-2-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[Backport from mainline to remove meaningless KASAN warning.]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I1282df522e5271497a92fcd9e4be37ed4f6b2c63

7 years agomedia: mfc: Fix race between interrupt routine and device functions 63/116263/2
Marek Szyprowski [Thu, 23 Feb 2017 11:15:48 +0000 (12:15 +0100)]
media: mfc: Fix race between interrupt routine and device functions

Interrupt routine must wake process waiting for given interrupt AFTER
updating driver's internal structures and contexts. Doing it in-between
is a serious bug. This patch moves all calls to the wake() function to
the end of the interrupt processing block to avoid potential and real
races, especially on multi-core platforms. This also fixes following issue
reported from clock core (clocks were disabled in interrupt after being
unprepared from the other place in the driver, the stack trace however
points to the different place than s5p_mfc driver because of the race):

WARNING: CPU: 1 PID: 18 at drivers/clk/clk.c:544 clk_core_unprepare+0xc8/0x108
Modules linked in:
CPU: 1 PID: 18 Comm: kworker/1:0 Not tainted 4.10.0-next-20170223-00070-g04e18bc99ab9-dirty #2154
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
Workqueue: pm pm_runtime_work
[<c010d8b0>] (unwind_backtrace) from [<c010a534>] (show_stack+0x10/0x14)
[<c010a534>] (show_stack) from [<c033292c>] (dump_stack+0x74/0x94)
[<c033292c>] (dump_stack) from [<c011cef4>] (__warn+0xd4/0x100)
[<c011cef4>] (__warn) from [<c011cf40>] (warn_slowpath_null+0x20/0x28)
[<c011cf40>] (warn_slowpath_null) from [<c0387a84>] (clk_core_unprepare+0xc8/0x108)
[<c0387a84>] (clk_core_unprepare) from [<c0389d84>] (clk_unprepare+0x24/0x2c)
[<c0389d84>] (clk_unprepare) from [<c03d4660>] (exynos_sysmmu_suspend+0x48/0x60)
[<c03d4660>] (exynos_sysmmu_suspend) from [<c042b9b0>] (pm_generic_runtime_suspend+0x2c/0x38)
[<c042b9b0>] (pm_generic_runtime_suspend) from [<c0437580>] (genpd_runtime_suspend+0x94/0x220)
[<c0437580>] (genpd_runtime_suspend) from [<c042e240>] (__rpm_callback+0x134/0x208)
[<c042e240>] (__rpm_callback) from [<c042e334>] (rpm_callback+0x20/0x80)
[<c042e334>] (rpm_callback) from [<c042d3b8>] (rpm_suspend+0xdc/0x458)
[<c042d3b8>] (rpm_suspend) from [<c042ea24>] (pm_runtime_work+0x80/0x90)
[<c042ea24>] (pm_runtime_work) from [<c01322c4>] (process_one_work+0x120/0x318)
[<c01322c4>] (process_one_work) from [<c0132520>] (worker_thread+0x2c/0x4ac)
[<c0132520>] (worker_thread) from [<c0137ab0>] (kthread+0xfc/0x134)
[<c0137ab0>] (kthread) from [<c0107978>] (ret_from_fork+0x14/0x3c)
---[ end trace 1ead49a7bb83f0d8 ]---

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: af93574678108 ("[media] MFC: Add MFC 5.1 V4L2 driver")
CC: stable@vger.kernel.org # v4.5+
Change-Id: I5eead70012591cdb5878f698fcf0ae7304ffb223

7 years agopci: exynos5433: use the bit name intead of magic number 91/105191/3
Jaehoon Chung [Fri, 16 Dec 2016 01:34:06 +0000 (10:34 +0900)]
pci: exynos5433: use the bit name intead of magic number

It can be checked wether link is up or not with XMLH_LINKUP(bit[4]).
According to Designware PCI Expreess Reference Manual(v3.22a),
XMLH_LINK_UP bit is used "LTSSM reports PHY link up".

Change-Id: I85dc5258471b5976ecd429e273d1edb1be08e13a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>