Re: [PATCH v7 03/25] iommu: Init iommu-groups support earlier, in core_initcall

2015-05-25 Thread Marek Szyprowski

Hello,

On 2015-05-23 18:23, Laurent Pinchart wrote:

Hi Marek,

Thank you for the patch.

On Tuesday 19 May 2015 15:20:23 Marek Szyprowski wrote:

iommu_group_alloc might be called very early in case of iommu controllers
activated from of_iommu, so ensure that this part of subsystem is ready
when devices are being populated from device-tree (core_initcall seems to
be okay for this case).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
---
  drivers/iommu/iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index d4f527e56679..37a6aa8f318b 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1207,7 +1207,7 @@ static int __init iommu_init(void)

return 0;
  }
-arch_initcall(iommu_init);
+core_initcall(iommu_init);

I'll let Joerg comment on this, but this initcall ordering dance always makes
me feel that something isn't quite right. Have you had a chance to look at the
patch series I posted about a week ago to implement IOMMU probe deferral
support ?


I will try to check your IOMMU probe deferal, but for the time being 
changing the
initcall priority was the simplest way to get everything working with 
iommu_groups

(what was a requirement from Joerg).

I also don't like the initcall ordering hacks, but this change seems to 
be the
right approach. Probe deferal is convenient for development purpose and 
all king of
hotpluggable solutions, but imho for typical cases system should be 
tuned to avoid

deferal to reduce overhead on boot.

If possible I would like to avoid having dependency on your 
deferal-probe patches

and get the basic Exynos IOMMU support finally merged. There are still other
enhancements to Exynos IOMMU driver that depend on it and need real 
discussion
(like real runtime pm and exposing particular iommu controllers via dma 
api).





  int iommu_domain_get_attr(struct iommu_domain *domain,
  enum iommu_attr attr, void *data)




Best regards
--
Marek Szyprowski, PhD
Samsung RD Institute Poland

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] cpufreq:exynos-cpufreq - Fix for memory leak in case SOC name does not match.

2015-05-25 Thread Viresh Kumar
On 25-05-15, 07:39, Shailendra Verma wrote:
 During probe free the memory allocated to exynos_info in case of
 unknown SOC type.
 
 Signed-off-by: Shailendra Verma shailendra.capric...@gmail.com
 ---
  drivers/cpufreq/exynos-cpufreq.c |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/cpufreq/exynos-cpufreq.c 
 b/drivers/cpufreq/exynos-cpufreq.c
 index 82d2fbb..8682378 100644
 --- a/drivers/cpufreq/exynos-cpufreq.c
 +++ b/drivers/cpufreq/exynos-cpufreq.c
 @@ -182,7 +182,7 @@ static int exynos_cpufreq_probe(struct platform_device 
 *pdev)
   ret = exynos5250_cpufreq_init(exynos_info);
   } else {
   pr_err(%s: Unknown SoC type\n, __func__);
 - return -ENODEV;
 + ret = -ENODEV;
   }
  
   if (ret)
 @@ -190,12 +190,14 @@ static int exynos_cpufreq_probe(struct platform_device 
 *pdev)
  
   if (exynos_info-set_freq == NULL) {
   dev_err(pdev-dev, No set_freq function (ERR)\n);
 + ret = -EINVAL;
   goto err_vdd_arm;
   }
  
   arm_regulator = regulator_get(NULL, vdd_arm);
   if (IS_ERR(arm_regulator)) {
   dev_err(pdev-dev, failed to get resource vdd_arm\n);
 + ret = -EINVAL;
   goto err_vdd_arm;
   }
  
 @@ -227,7 +229,7 @@ err_cpufreq_reg:
   regulator_put(arm_regulator);
  err_vdd_arm:
   kfree(exynos_info);
 - return -EINVAL;
 + return ret;
  }
  
  static struct platform_driver exynos_cpufreq_platdrv = {

Acked-by: Viresh Kumar viresh.ku...@linaro.org

-- 
viresh
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3 1/2] ARM: dts: exynos5420: add nodes for jpeg codec

2015-05-25 Thread Krzysztof Kozlowski
2015-03-09 21:32 GMT+09:00 Andrzej Pietrasiewicz andrze...@samsung.com:
 Add nodes for jpeg codec in Exynos5420 SoC.

 Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com
 ---
  arch/arm/boot/dts/exynos5420.dtsi | 16 
  1 file changed, 16 insertions(+)

Acked-by: Krzysztof Kozlowski k.kozlow...@samsung.com

The patch adding bindings documentation and changing s5p-jpeg driver
was merged (7c15fd4bf3d3 merged in 4.1-rc1 cycle) so this can be
safely picked up by Samsung tree. Kukjin, can you apply it?

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9 v5] Helper to abstract vma handling in media layer

2015-05-25 Thread Hans Verkuil
Hi Jan,

On 05/13/2015 03:08 PM, Jan Kara wrote:
   Hello,
 
 I'm sending the fifth version of my patch series to abstract vma handling
 from the various media drivers. The patches got some review from mm people and
 testing from device driver guys so unless someone objects, patches will be
 queued in media tree for the next merge window.

What is the current status? I saw one comment for patch 9, so I assume it is not
quite ready yet.

Let me know when you think it is time to merge.

Regards,

Hans

 
 After this patch set drivers have to know much less details about vmas, their
 types, and locking. Also quite some code is removed from them. As a bonus
 drivers get automatically VM_FAULT_RETRY handling. The primary motivation for
 this series is to remove knowledge about mmap_sem locking from as many places 
 a
 possible so that we can change it with reasonable effort.
 
 The core of the series is the new helper get_vaddr_frames() which is given a
 virtual address and it fills in PFNs / struct page pointers (depending on VMA
 type) into the provided array. If PFNs correspond to normal pages it also 
 grabs
 references to these pages. The difference from get_user_pages() is that this
 function can also deal with pfnmap, and io mappings which is what the media
 drivers need.
 
 I have tested the patches with vivid driver so at least vb2 code got some
 exposure. Conversion of other drivers was just compile-tested (for x86 so e.g.
 exynos driver which is only for Samsung platform is completely untested).
 
   Honza
 Changes since v4:
 * Minor cleanups and fixes pointed out by Mel and Vlasta
 * Added Acked-by tags
 
 Changes since v3:
 * Added include linux/vmalloc.h into mm/gup.c as it's needed for some archs
 * Fixed error path for exynos driver
 
 Changes since v2:
 * Renamed functions and structures as Mel suggested
 * Other minor changes suggested by Mel
 * Rebased on top of 4.1-rc2
 * Changed functions to get pointer to array of pages / pfns to perform
   conversion if necessary. This fixes possible issue in the omap I may have
   introduced in v2 and generally makes the API less errorprone.
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: dts: odroidxu3: Enable wake alarm of S2MPS11 RTC

2015-05-25 Thread Krzysztof Kozlowski
The IRQB of S2MPS11 PMIC is wired to XEINT4 (GPX0-4) through pull-up
resistor.

Add interrupt properties and pinctrl configuration to enable RTC wake
alarm of rtc-s5m driver. This also removes a warning:
sec_pmic 4-0066: No interrupt specified, no interrupts

Signed-off-by: Krzysztof Kozlowski k.kozlowsk...@gmail.com
---
 arch/arm/boot/dts/exynos5422-odroidxu3.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts 
b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
index c16987950aa1..27014bb0c586 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -12,6 +12,7 @@
 
 /dts-v1/;
 #include dt-bindings/clock/samsung,s2mps11.h
+#include dt-bindings/interrupt-controller/irq.h
 #include dt-bindings/gpio/gpio.h
 #include dt-bindings/sound/samsung-i2s.h
 #include exynos5800.dtsi
@@ -153,6 +154,11 @@
s2mps11,buck3-ramp-enable = 1;
s2mps11,buck4-ramp-enable = 1;
 
+   interrupt-parent = gpx0;
+   interrupts = 4 IRQ_TYPE_EDGE_FALLING;
+   pinctrl-names = default;
+   pinctrl-0 = s2mps11_irq;
+
s2mps11_osc: clocks {
#clock-cells = 1;
clock-output-names = s2mps11_ap,
@@ -473,6 +479,13 @@
samsung,pin-pud = 0;
samsung,pin-drv = 0;
};
+
+   s2mps11_irq: s2mps11-irq {
+   samsung,pins = gpx0-4;
+   samsung,pin-function = 0xf;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
 };
 
 pwm {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: dts: odroidxu3: Enable wake alarm of S2MPS11 RTC

2015-05-25 Thread Javier Martinez Canillas
Hello Krzysztof,

On 05/25/2015 01:44 PM, Krzysztof Kozlowski wrote:
 The IRQB of S2MPS11 PMIC is wired to XEINT4 (GPX0-4) through pull-up
 resistor.
 
 Add interrupt properties and pinctrl configuration to enable RTC wake
 alarm of rtc-s5m driver. This also removes a warning:
 sec_pmic 4-0066: No interrupt specified, no interrupts
 
 Signed-off-by: Krzysztof Kozlowski k.kozlowsk...@gmail.com
 ---

I haven't checked with the board schematics but the patch
looks good to me.

Reviewed-by: Javier Martinez Canillas javier.marti...@collabora.co.uk

Best regards,
Javier
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM: dts: Add Odroid XU3 Lite support

2015-05-25 Thread Krzysztof Kozlowski
The Odroid XU3 Lite is almost the same as XU3, except:
1. Lower CPU frequencies (1.8 GHz for A15 and 1.3 GHz for A7, instead of
   2.0 GHz and 1.4 GHz).
2. No DisplayPort.
3. No TI INA231 energy measurement sensors.

This patch moves common nodes (which is almost everything) to a common
DTSI file and adds a new XU3 Lite DTS.

Currently in comparison to XU3, only the INA231 sensors are disabled to
remove the warning:
ina2xx 0-0040: error configuring the device: -6

Signed-off-by: Krzysztof Kozlowski k.kozlowsk...@gmail.com

---

Patch rebased on my DTS label rework ARM: dts: exynos5: labels for
overriding nodes and ARM: dts: odroidxu3: Enable wake alarm of S2MPS11
RTC.
---
 arch/arm/boot/dts/Makefile |   1 +
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 479 +
 arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts|  20 +
 arch/arm/boot/dts/exynos5422-odroidxu3.dts | 466 +---
 4 files changed, 501 insertions(+), 465 deletions(-)
 create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
 create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 86217db2937a..1c719391ee30 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -113,6 +113,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
exynos5420-peach-pit.dtb \
exynos5420-smdk5420.dtb \
exynos5422-odroidxu3.dtb \
+   exynos5422-odroidxu3-lite.dtb \
exynos5440-sd5v1.dtb \
exynos5440-ssdk5440.dtb \
exynos5800-peach-pi.dtb
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi 
b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
new file mode 100644
index ..b71cb2959ec5
--- /dev/null
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
@@ -0,0 +1,479 @@
+/*
+ * Hardkernel Odroid XU3 board device tree source
+ *
+ * Copyright (c) 2014 Collabora Ltd.
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include dt-bindings/clock/samsung,s2mps11.h
+#include dt-bindings/interrupt-controller/irq.h
+#include dt-bindings/gpio/gpio.h
+#include dt-bindings/sound/samsung-i2s.h
+#include exynos5800.dtsi
+
+/ {
+   memory {
+   reg = 0x4000 0x7EA0;
+   };
+
+   chosen {
+   linux,stdout-path = serial_2;
+   };
+
+   firmware@02073000 {
+   compatible = samsung,secure-firmware;
+   reg = 0x02073000 0x1000;
+   };
+
+   fixed-rate-clocks {
+   oscclk {
+   compatible = samsung,exynos5420-oscclk;
+   clock-frequency = 2400;
+   };
+   };
+
+   emmc_pwrseq: pwrseq {
+   pinctrl-0 = emmc_nrst_pin;
+   pinctrl-names = default;
+   compatible = mmc-pwrseq-emmc;
+   reset-gpios = gpd1 0 1;
+   };
+
+   pwmleds {
+   compatible = pwm-leds;
+
+   greenled {
+   label = green:mmc0;
+   pwms = pwm 1 200 0;
+   pwm-names = pwm1;
+   /*
+* Green LED is much brighter than the others
+* so limit its max brightness
+*/
+   max_brightness = 127;
+   linux,default-trigger = mmc0;
+   };
+
+   blueled {
+   label = blue:heartbeat;
+   pwms = pwm 2 200 0;
+   pwm-names = pwm2;
+   max_brightness = 255;
+   linux,default-trigger = heartbeat;
+   };
+   };
+
+   gpioleds {
+   compatible = gpio-leds;
+   redled {
+   label = red:microSD;
+   gpios = gpx2 3 GPIO_ACTIVE_HIGH;
+   default-state = off;
+   linux,default-trigger = mmc1;
+   };
+   };
+
+   sound: sound {
+   compatible = simple-audio-card;
+
+   simple-audio-card,name = Odroid-XU3;
+   simple-audio-card,widgets =
+   Headphone, Headphone Jack,
+   Speakers, Speakers;
+   simple-audio-card,routing =
+   Headphone Jack, HPL,
+   Headphone Jack, HPR,
+   Headphone Jack, MICBIAS,
+   IN1, Headphone Jack,
+   Speakers, SPKL,
+   Speakers, SPKR;
+
+   simple-audio-card,format = i2s;
+   simple-audio-card,bitclock-master = 

[PATCH 1/2] of: Add vendor prefix for Hardkernel

2015-05-25 Thread Krzysztof Kozlowski
Add Hardkernel Co., Ltd. to the list of device tree vendor prefixes.

Signed-off-by: Krzysztof Kozlowski k.kozlowsk...@gmail.com
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 80339192c93e..e8a00b74d8fe 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -90,6 +90,7 @@ gumstix   Gumstix, Inc.
 gw Gateworks Corporation
 hannstar   HannStar Display Corporation
 haoyu  Haoyu Microelectronic Co. Ltd.
+hardkernel Hardkernel Co., Ltd
 himax  Himax Technologies, Inc.
 hisilicon  Hisilicon Limited.
 hitHitachi Ltd.
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] of: Add vendor prefix for Hardkernel

2015-05-25 Thread Javier Martinez Canillas
Hello Krzysztof,

On 05/25/2015 02:26 PM, Krzysztof Kozlowski wrote:
 Add Hardkernel Co., Ltd. to the list of device tree vendor prefixes.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlowsk...@gmail.com
 ---
  Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
 b/Documentation/devicetree/bindings/vendor-prefixes.txt
 index 80339192c93e..e8a00b74d8fe 100644
 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
 +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
 @@ -90,6 +90,7 @@ gumstix Gumstix, Inc.
  gw   Gateworks Corporation
  hannstar HannStar Display Corporation
  haoyuHaoyu Microelectronic Co. Ltd.
 +hardkernel   Hardkernel Co., Ltd
  himaxHimax Technologies, Inc.
  hisiliconHisilicon Limited.
  hit  Hitachi Ltd.
 

Reviewed-by: Javier Martinez Canillas javier.marti...@collabora.co.uk

Best regards,
Javier
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9 v5] Helper to abstract vma handling in media layer

2015-05-25 Thread Jan Kara
On Mon 25-05-15 13:37:56, Hans Verkuil wrote:
 Hi Jan,
 
 On 05/13/2015 03:08 PM, Jan Kara wrote:
Hello,
  
  I'm sending the fifth version of my patch series to abstract vma handling
  from the various media drivers. The patches got some review from mm people 
  and
  testing from device driver guys so unless someone objects, patches will be
  queued in media tree for the next merge window.
 
 What is the current status? I saw one comment for patch 9, so I assume it is 
 not
 quite ready yet.
 
 Let me know when you think it is time to merge.
  There was a minor comment to the exynos patch - I've sent updated version
of that patch as a reply to the comment. Do you want me to resend the whole
series? Otherwise I think you can just pick up the patches and merge them.
Thanks!

Honza

  After this patch set drivers have to know much less details about vmas, 
  their
  types, and locking. Also quite some code is removed from them. As a bonus
  drivers get automatically VM_FAULT_RETRY handling. The primary motivation 
  for
  this series is to remove knowledge about mmap_sem locking from as many 
  places a
  possible so that we can change it with reasonable effort.
  
  The core of the series is the new helper get_vaddr_frames() which is given a
  virtual address and it fills in PFNs / struct page pointers (depending on 
  VMA
  type) into the provided array. If PFNs correspond to normal pages it also 
  grabs
  references to these pages. The difference from get_user_pages() is that this
  function can also deal with pfnmap, and io mappings which is what the media
  drivers need.
  
  I have tested the patches with vivid driver so at least vb2 code got some
  exposure. Conversion of other drivers was just compile-tested (for x86 so 
  e.g.
  exynos driver which is only for Samsung platform is completely untested).
  
  Honza
  Changes since v4:
  * Minor cleanups and fixes pointed out by Mel and Vlasta
  * Added Acked-by tags
  
  Changes since v3:
  * Added include linux/vmalloc.h into mm/gup.c as it's needed for some 
  archs
  * Fixed error path for exynos driver
  
  Changes since v2:
  * Renamed functions and structures as Mel suggested
  * Other minor changes suggested by Mel
  * Rebased on top of 4.1-rc2
  * Changed functions to get pointer to array of pages / pfns to perform
conversion if necessary. This fixes possible issue in the omap I may have
introduced in v2 and generally makes the API less errorprone.
  --
  To unsubscribe from this list: send the line unsubscribe linux-media in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
 
-- 
Jan Kara j...@suse.cz
SUSE Labs, CR
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] clocksource: exynos_mct: fix for sleeping in atomic ctx handling cpu hotplug notif.

2015-05-25 Thread Damian Eppel
On Mon, 2015-05-11 at 13:18 +0200, Daniel Lezcano wrote:
 On 03/12/2015 10:11 AM, Damian Eppel wrote:
  This is to fix an issue of sleeping in atomic context when processing
  hotplug notifications in Exynos MCT(Multi-Core Timer).
  The issue was reproducible on Exynos 3250 (Rinato board) and Exynos 5420
  (Arndale Octa board).
 
  Whilst testing cpu hotplug events on kernel configured with DEBUG_PREEMPT
  and DEBUG_ATOMIC_SLEEP we get following BUG message, caused by calling
  request_irq() and free_irq() in the context of hotplug notification
  (which is in this case atomic context).
 
  root@target:~# echo 0  /sys/devices/system/cpu/cpu1/online
 
  [   25.157867] IRQ18 no longer affine to CPU1
  ...
  [   25.158445] CPU1: shutdown
 
  root@target:~# echo 1  /sys/devices/system/cpu/cpu1/online
 
  [   40.785859] CPU1: Software reset
  [   40.786660] BUG: sleeping function called from invalid context at 
  mm/slub.c:1241
  [   40.786668] in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/1
  [   40.786678] Preemption disabled at:[  (null)]   (null)
  [   40.786681]
  [   40.786692] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 
  3.19.0-rc4-00024-g7dca860 #36
  [   40.786698] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
  [   40.786728] [c0014a00] (unwind_backtrace) from [c0011980] 
  (show_stack+0x10/0x14)
  [   40.786747] [c0011980] (show_stack) from [c0449ba0] 
  (dump_stack+0x70/0xbc)
  [   40.786767] [c0449ba0] (dump_stack) from [c00c6124] 
  (kmem_cache_alloc+0xd8/0x170)
  [   40.786785] [c00c6124] (kmem_cache_alloc) from [c005d6f8] 
  (request_threaded_irq+0x64/0x128)
  [   40.786804] [c005d6f8] (request_threaded_irq) from [c0350b8c] 
  (exynos4_local_timer_setup+0xc0/0x13c)
  [   40.786820] [c0350b8c] (exynos4_local_timer_setup) from [c0350ca8] 
  (exynos4_mct_cpu_notify+0x30/0xa8)
  [   40.786838] [c0350ca8] (exynos4_mct_cpu_notify) from [c003b330] 
  (notifier_call_chain+0x44/0x84)
  [   40.786857] [c003b330] (notifier_call_chain) from [c0022fd4] 
  (__cpu_notify+0x28/0x44)
  [   40.786873] [c0022fd4] (__cpu_notify) from [c0013714] 
  (secondary_start_kernel+0xec/0x150)
  [   40.786886] [c0013714] (secondary_start_kernel) from [40008764] 
  (0x40008764)
 
  Solution:
  Clockevent irqs cannot be requested/freed every time cpu is
  hot-plugged/unplugged as CPU_STARTING/CPU_DYING notifications
  that signals hotplug or unplug events are sent with both preemption
  and local interrupts disabled. Since request_irq() may sleep it is
  moved to the initialization stage and performed for all possible
  cpus prior putting them online. Then, in the case of hotplug event
  the irq asociated with the given cpu will simply be enabled.
  Similarly on cpu unplug event the interrupt is not freed but just
  disabled.
 
  Note that after successful request_irq() call for a clockevent device
  associated to given cpu the requested irq is disabled (via disable_irq()).
  That is to make things symmetric as we expect hotplug event as a next
  thing (which will enable irq again). This should not pose any problems
  because at the time of requesting irq the clockevent device is not
  fully initialized yet, therefore should not produce interrupts at that 
  point.
 
  For disabling an irq at cpu unplug notification disable_irq_nosync() is
  chosen which is a non-blocking function. This again shouldn't be a problem 
  as
  prior sending CPU_DYING notification interrupts are migrated away
  from the cpu.
 
 The code sounds very complex for what it is supposed to do.
 
 Perhaps I am missing something but you have more or less the same 
 functionality than the smp_twd timers and these ones don't look so complex.
 
 Could you please look at the smp_twd.c implementation ?

Hi Daniel,

exynos_mct.c driver looks more complex as it supports two types of timer
interrupts - private and shared peripheral interrupts (for exynos4412
and exynos4210 accordingly). In smp_twd.c driver I can see only PPI type
of irqs supported. SPI and PPI irqs differs slightly in setup - thus two
different code paths appears in the driver in initialization and
handling of CPU notifications. The fix is addressing issue that appears
only for hardware using SPI irqs so it is hard to compare it to
smp_twd.c.
BTW, If we remove support for SPI irqs in exynos_mct.c it would look
almost the same as smp_twd.c. 

Best Regards,
Damian
 
 
  Fixes: 7114cd749a12 (clocksource: exynos_mct: use (request/free)_irq calls 
  for local timer registration)
  Signed-off-by: Damian Eppel d.ep...@samsung.com
  Cc: sta...@vger.kernel.org
  Reported-by: Krzysztof Kozlowski k.kozlow...@samsung.com
  Reviewed-by: Krzysztof Kozlowski k.kozlow...@samsung.com
  Tested-by: Krzysztof Kozlowski k.kozlow...@samsung.com
  (Tested on Arndale Octa Board)
  Tested-by: Marcin Jabrzyk m.jabr...@samsung.com
  (Tested on Rinato B2 (Exynos 3250) board)
  ---
 
  Notes:
   Changes since v1:
   o added Krzysztof's and Marcin's Reviewed-by / Tested-by
 

[PATCH 00/21] On-demand device registration

2015-05-25 Thread Tomeu Vizoso
Hello,

I have a problem with the panel on my Tegra Chromebook taking longer than
expected to be ready during boot (Stéphane Marchesin reported what is
basically the same issue in [0]), and have looked into ordered probing as a
better way of solving this than moving nodes around in the DT or playing with
initcall levels.

While reading the thread [1] that Alexander Holler started with his series to
make probing order deterministic, it occurred to me that it should be possible
to achieve the same by registering devices as they are referenced by other
devices.

This basically reuses the information that is already implicit in the probe()
implementations, saving us from refactoring existing drivers or adding
information to DTBs.

Something I'm not completely happy with is that I have had to move the call to
of_platform_populate after all platform drivers have been registered.
Otherwise I don't see how I could register drivers on demand as we don't have
yet each driver's compatible strings.

For machs that don't move of_platform_populate() to a later point, these
patches shouldn't cause any problems but it's not guaranteed that we'll avoid
all the deferred probes as some drivers may not be registered yet.

I have tested this on boards with Tegra, iMX.6 and Exynos SoCs, and these
patches were enough to eliminate all the deferred probes.

With this series I get the kernel to output to the panel in 0.5s, instead of 
2.8s.

Regards,

Tomeu

[0] http://lists.freedesktop.org/archives/dri-devel/2014-August/066527.html

[1] https://lkml.org/lkml/2014/5/12/452

Tomeu Vizoso (21):
  regulator: core: Reduce critical area in _regulator_get
  ARM: tegra: Add gpio-ranges property
  ARM: tegra: Register drivers before devices
  ARM: EXYNOS: Register drivers before devices
  ARM i.MX6q: Register drivers before devices
  of/platform: Add of_platform_device_ensure()
  of/platform: Ensure device registration on lookup
  gpio: Probe GPIO drivers on demand
  gpio: Probe pinctrl devices on demand
  regulator: core: Probe regulators on demand
  drm: Probe panels on demand
  drm/tegra: Probe dpaux devices on demand
  i2c: core: Probe i2c master devices on demand
  pwm: Probe PWM chip devices on demand
  backlight: Probe backlight devices on demand
  usb: phy: Probe phy devices on demand
  clk: Probe clk providers on demand
  pinctrl: Probe pinctrl devices on demand
  phy: core: Probe phy providers on demand
  dma: of: Probe DMA controllers on demand
  power-supply: Probe power supplies on demand

 arch/arm/boot/dts/tegra124.dtsi |  1 +
 arch/arm/mach-exynos/exynos.c   |  4 +--
 arch/arm/mach-imx/mach-imx6q.c  | 12 -
 arch/arm/mach-tegra/tegra.c | 21 ++-
 drivers/clk/clk.c   |  3 +++
 drivers/dma/of-dma.c|  3 +++
 drivers/gpio/gpiolib-of.c   |  5 
 drivers/gpu/drm/drm_panel.c |  3 +++
 drivers/gpu/drm/tegra/dpaux.c   |  3 +++
 drivers/i2c/i2c-core.c  |  3 +++
 drivers/of/platform.c   | 53 +
 drivers/phy/phy-core.c  |  3 +++
 drivers/pinctrl/devicetree.c|  2 ++
 drivers/power/power_supply_core.c   |  3 +++
 drivers/pwm/core.c  |  3 +++
 drivers/regulator/core.c| 45 +++
 drivers/usb/phy/phy.c   |  3 +++
 drivers/video/backlight/backlight.c |  3 +++
 include/linux/of_platform.h |  2 ++
 19 files changed, 130 insertions(+), 45 deletions(-)

-- 
2.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/21] ARM: EXYNOS: Register drivers before devices

2015-05-25 Thread Tomeu Vizoso
So devices can be probed on demand, we need to have the drivers already
registered as we don't have enough information to register a driver on
demand.

Signed-off-by: Tomeu Vizoso tomeu.viz...@collabora.com
---
 arch/arm/mach-exynos/exynos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 5917a30..3c98c92 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -110,6 +110,8 @@ void __init exynos_sysram_init(void)
 
 static void __init exynos_init_late(void)
 {
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
if (of_machine_is_compatible(samsung,exynos5440))
/* to be supported later */
return;
@@ -246,8 +248,6 @@ static void __init exynos_dt_machine_init(void)
platform_device_register(exynos_cpuidle);
 
platform_device_register_simple(exynos-cpufreq, -1, NULL, 0);
-
-   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static char const *const exynos_dt_compat[] __initconst = {
-- 
2.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3 1/4] phy: phy-core: Make GENERIC_PHY an invisible option

2015-05-25 Thread Arun Ramamurthy



On 15-05-14 05:52 PM, Felipe Balbi wrote:

Hi,

On Wed, Apr 22, 2015 at 04:04:10PM -0700, Arun Ramamurthy wrote:

Most of the phy providers use select to enable GENERIC_PHY. Since select
is only recommended when the config is not visible, GENERIC_PHY is changed
an invisible option. To maintain consistency, all phy providers are changed
to select GENERIC_PHY and all non-phy drivers use depends on when the
phy framework is explicity required. USB_MUSB_OMAP2PLUS has a cyclic
dependency, so it is left as select.

Signed-off-by: Arun Ramamurthy arun.ramamur...@broadcom.com
---
  drivers/ata/Kconfig   | 1 -
  drivers/media/platform/exynos4-is/Kconfig | 2 +-
  drivers/phy/Kconfig   | 4 ++--
  drivers/usb/host/Kconfig  | 4 ++--
  drivers/video/fbdev/exynos/Kconfig| 2 +-
  5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 5f60155..6d2e881 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -301,7 +301,6 @@ config SATA_MV
tristate Marvell SATA support
depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
   ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
-   select GENERIC_PHY
help
  This option enables support for the Marvell Serial ATA family.
  Currently supports 88SX[56]0[48][01] PCI(-X) chips,
diff --git a/drivers/media/platform/exynos4-is/Kconfig 
b/drivers/media/platform/exynos4-is/Kconfig
index b7b2e47..b6f3eaa 100644
--- a/drivers/media/platform/exynos4-is/Kconfig
+++ b/drivers/media/platform/exynos4-is/Kconfig
@@ -31,7 +31,7 @@ config VIDEO_S5P_FIMC
  config VIDEO_S5P_MIPI_CSIS
tristate S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver
depends on REGULATOR
-   select GENERIC_PHY
+   depends on GENERIC_PHY
help
  This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
  receiver (MIPI-CSIS) devices.
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 2962de2..edecdb1 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -5,7 +5,7 @@
  menu PHY Subsystem

  config GENERIC_PHY
-   bool PHY Core
+   bool
help
  Generic PHY support.

@@ -72,7 +72,7 @@ config PHY_MIPHY365X
  config PHY_RCAR_GEN2
tristate Renesas R-Car generation 2 USB PHY driver
depends on ARCH_SHMOBILE
-   depends on GENERIC_PHY
+   select GENERIC_PHY


so some you changed from depends to select...


help
  Support for USB PHY found on Renesas R-Car generation 2 SoCs.

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5ad60e4..e2197e2 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -182,7 +182,7 @@ config USB_EHCI_HCD_SPEAR
  config USB_EHCI_HCD_STI
tristate Support for ST STiHxxx on-chip EHCI USB controller
depends on ARCH_STI  OF
-   select GENERIC_PHY
+   depends on GENERIC_PHY


while others you changed from select to depends.

NAK.

Felipe, I dont understand your concern, could you please explain it more 
detail?  The logic behind the changes is that in cases where there was 
an explicit dependency, I changed it to depends on and in other cases 
I changed it to selects. Thanks

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/21] ARM: EXYNOS: Register drivers before devices

2015-05-25 Thread Krzysztof Kozlowski
2015-05-25 23:53 GMT+09:00 Tomeu Vizoso tomeu.viz...@collabora.com:
 So devices can be probed on demand, we need to have the drivers already
 registered as we don't have enough information to register a driver on
 demand.

 Signed-off-by: Tomeu Vizoso tomeu.viz...@collabora.com

This is 4/21 but I can't see other patches. I found the cover letter
on samsung-soc list but where is the rest of this?

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html