Re: [PATCH] drm/exynos: remove ifdeferry from initialization code

2014-10-01 Thread Ajay kumar
On Wed, Oct 1, 2014 at 11:18 AM, Inki Dae inki@samsung.com wrote:
 On 2014년 09월 30일 20:29, Andrzej Hajda wrote:
 Hi Inki,

 Gently ping.

 Hi Andrzej,

 I merged it to local repository to test. But now exynos drm doesn't work
 correctly since pulling drm-next of Dave regardless of your patch.

 Problems are,
 1. error occurs when we try to test modetest with -v option from second
 times.
I face a similar issue. For me, modetest -v doesn't work for the first try also.
I tried to test on snow and peach_pit.
modetest returns with following error from drm_crtc.c:
if (crtc-primary-fb-pixel_format != fb-pixel_format) {
DRM_DEBUG_KMS(Page flip is not allowed to change
frame buffer format.\n);
ret = -EINVAL;
goto out;
}
This has started coming since 3.15 I think.

Ajay

 2. error occurs when we try to test unbind.

 Now we are checking these problems. Can you try to also check it?

 Thanks,
 Inki Dae


 Andrzej

 On 09/10/2014 01:53 PM, Andrzej Hajda wrote:
 The patch replaces separate calls to driver (de)registration by
 loops over the array of drivers. As a result it significantly
 decreases number of ifdefs. Additionally it moves device registration
 related ifdefs to header file.

 Signed-off-by: Andrzej Hajda a.ha...@samsung.com
 ---
 Hi Inki,

 During testing your component match support patch [1] I have prepared patch
 removing most ifdefs from exynos_drm_drv.c. It is based on your patch, but
 I can rebase it if necessary.

 [1]: http://permalink.gmane.org/gmane.linux.kernel.samsung-soc/37031

 Regards
 Andrzej
 ---
  drivers/gpu/drm/exynos/exynos_drm_drv.c | 170 
 +++-
  drivers/gpu/drm/exynos/exynos_drm_drv.h |  25 +++--
  2 files changed, 48 insertions(+), 147 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
 b/drivers/gpu/drm/exynos/exynos_drm_drv.c
 index b2c710a..a660e46 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
 @@ -553,74 +553,54 @@ static const struct component_master_ops 
 exynos_drm_ops = {
  .unbind = exynos_drm_unbind,
  };

 -static int exynos_drm_platform_probe(struct platform_device *pdev)
 -{
 -struct component_match *match;
 -int ret;
 -
 -pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
 -exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
 -
 +static struct platform_driver * const exynos_drm_drivers[] = {
  #ifdef CONFIG_DRM_EXYNOS_FIMD
 -ret = platform_driver_register(fimd_driver);
 -if (ret  0)
 -return ret;
 +fimd_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_DP
 -ret = platform_driver_register(dp_driver);
 -if (ret  0)
 -goto err_unregister_fimd_drv;
 +dp_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_DSI
 -ret = platform_driver_register(dsi_driver);
 -if (ret  0)
 -goto err_unregister_dp_drv;
 +dsi_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_HDMI
 -ret = platform_driver_register(mixer_driver);
 -if (ret  0)
 -goto err_unregister_dsi_drv;
 -ret = platform_driver_register(hdmi_driver);
 -if (ret  0)
 -goto err_unregister_mixer_drv;
 +mixer_driver,
 +hdmi_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_G2D
 -ret = platform_driver_register(g2d_driver);
 -if (ret  0)
 -goto err_unregister_hdmi_drv;
 +g2d_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_FIMC
 -ret = platform_driver_register(fimc_driver);
 -if (ret  0)
 -goto err_unregister_g2d_drv;
 +fimc_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_ROTATOR
 -ret = platform_driver_register(rotator_driver);
 -if (ret  0)
 -goto err_unregister_fimc_drv;
 +rotator_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_GSC
 -ret = platform_driver_register(gsc_driver);
 -if (ret  0)
 -goto err_unregister_rotator_drv;
 +gsc_driver,
  #endif
 -
  #ifdef CONFIG_DRM_EXYNOS_IPP
 -ret = platform_driver_register(ipp_driver);
 -if (ret  0)
 -goto err_unregister_gsc_drv;
 +ipp_driver,
 +#endif
 +};
 +
 +static int exynos_drm_platform_probe(struct platform_device *pdev)
 +{
 +struct component_match *match;
 +int ret, i;
 +
 +pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
 +exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
 +
 +for (i = 0; i  ARRAY_SIZE(exynos_drm_drivers); ++i) {
 +ret = platform_driver_register(exynos_drm_drivers[i]);
 +if (ret  0)
 +goto err_unregister_drivers;
 +}

  ret = exynos_platform_device_ipp_register();
  if (ret  0)
 -goto err_unregister_ipp_drv;
 -#endif
 +goto err_unregister_drivers;

  match = exynos_drm_match_add(pdev-dev);
  if (IS_ERR(match)) {
 @@ -632,96 +612,24 @@ static int exynos_drm_platform_probe(struct 
 platform_device *pdev)
 

Re: 3.17-rc6 on ODROID: ERROR: Bad of_node_put() on /ehci@12580000/port@1

2014-10-01 Thread Vivek Gautam
Hi Daniel,


On Sat, Sep 27, 2014 at 5:54 AM, Daniel Drake dr...@endlessm.com wrote:
 Hi,

it's always good to keep the relevant mailing list also in CC (linux-usb).
Also added Alan here.


 Booting 3.17-rc6 on ODROID-U2, I see this message:

 ERROR: Bad of_node_put() on /ehci@1258/port@1
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc6-00376-g85cd8fd #1031
 [c0016418] (unwind_backtrace) from [c0011f00] (show_stack+0x10/0x14)
 [c0011f00] (show_stack) from [c08213fc] (dump_stack+0x84/0xc4)
 [c08213fc] (dump_stack) from [c02dacc0] (kobject_cleanup+0x58/0x6c)
 [c02dacc0] (kobject_cleanup) from [c0608718]
 (of_get_next_available_child+0x78/0x98)
 [c0608718] (of_get_next_available_child) from [c05673c8]
 (exynos_ehci_probe+0x254/0x424)
 [c05673c8] (exynos_ehci_probe) from [c03ce700]
 (platform_drv_probe+0x2c/0x5c)
 [c03ce700] (platform_drv_probe) from [c03ccd00]
 (driver_probe_device+0xe8/0x234)
 [c03ccd00] (driver_probe_device) from [c03ccef8] 
 (__driver_attach+0x68/0x8c)

 This repeats for all of the ehci and ohci ports.

 Haven't had time to dig deeper. Is this a known issue?

I don't think it's a known issue, atleast i don't see it on exynos5250-smdk5250.

One reason i doubt why it could be coming is because we are
specifically putting the
child after doing everything with it.

When we are getting the child node using for_each_available_child_of_node(),
which calls for of_get_next_available_child(). So of_get_next_available_child()
does a of_node_put() on the prev node, in case we have siblings to the child.

Can you see if the below change helps ?


diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 7189f2e..1b726bf 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -74,7 +74,6 @@ static int exynos_ehci_get_phy(struct device *dev,

phy = devm_of_phy_get(dev, child, NULL);
exynos_ehci-phy[phy_number] = phy;
-   of_node_put(child);
if (IS_ERR(phy)) {
ret = PTR_ERR(phy);
if (ret == -EPROBE_DEFER) {



This is on top of usb-next.
If you are testing on rc6 only, then probably you will have to cherrypick two
patches each for ehci-exynos and ohci-exynos:
usb: host: ehci-exynos: Remove unnecessary usb-phy support
usb: host: ohci-exynos: Remove unnecessary usb-phy support



-- 
Best Regards
Vivek Gautam
Samsung RD Institute, Bangalore
India
--
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] clk: samsung: exynos5440: move restart code into clock driver

2014-10-01 Thread Tomasz Figa
Hi Pankaj,

Please see my comments inline.

On 01.10.2014 07:48, Pankaj Dubey wrote:
 Let's register reboot_notifier for Exynos5440 from it's clock driver
 for reboot functionality. So that we can cleanup restart hooks from
 machine specific file.
 
 CC: Sylwester Nawrocki s.nawro...@samsung.com
 CC: Mike Turquette mturque...@linaro.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
  arch/arm/mach-exynos/exynos.c|   13 
  drivers/clk/samsung/clk-exynos5440.c |   37 
 ++
  2 files changed, 37 insertions(+), 13 deletions(-)
 
 diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
 index 2f2f7b2..d56134a 100644
 --- a/arch/arm/mach-exynos/exynos.c
 +++ b/arch/arm/mach-exynos/exynos.c
 @@ -143,19 +143,6 @@ static void exynos_restart(enum reboot_mode mode, const 
 char *cmd)
   u32 val = 0x1;
   void __iomem *addr = pmu_base_addr + EXYNOS_SWRESET;

You can remove the variables above as well...

  
 - if (of_machine_is_compatible(samsung,exynos5440)) {
 - u32 status;
 - np = of_find_compatible_node(NULL, NULL, 
 samsung,exynos5440-clock);
 -
 - addr = of_iomap(np, 0) + 0xbc;
 - status = __raw_readl(addr);
 -
 - addr = of_iomap(np, 0) + 0xcc;
 - val = __raw_readl(addr);
 -
 - val = (val  0x) | (status  0x);
 - }
 -
   __raw_writel(val, addr);

and make this use the constants instead.

  }
  
 diff --git a/drivers/clk/samsung/clk-exynos5440.c 
 b/drivers/clk/samsung/clk-exynos5440.c
 index 00d1d00..171d3af 100644
 --- a/drivers/clk/samsung/clk-exynos5440.c
 +++ b/drivers/clk/samsung/clk-exynos5440.c
 @@ -15,6 +15,8 @@
  #include linux/clk-provider.h
  #include linux/of.h
  #include linux/of_address.h
 +#include linux/notifier.h
 +#include linux/reboot.h
  
  #include clk.h
  #include clk-pll.h
 @@ -89,6 +91,38 @@ static const struct of_device_id ext_clk_match[] 
 __initconst = {
   {},
  };
  
 +static int exynos5440_clk_reboot_notify_handler(struct notifier_block *this,
 + unsigned long code, void *unused)
 +{
 + if (code == SYS_RESTART) {
 + struct device_node *np;
 + void __iomem *addr;
 + u32 val, status;
 +
 + np = of_find_compatible_node(NULL, NULL,
 + samsung,exynos5440-clock);
 +
 + addr = of_iomap(np, 0) + 0xbc;

You can just save the address in exynos5440_clk_init() and use it here
without the whole dance with DT and ioremap.

Best regards,
Tomasz
--
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 2/2] ARM: EXYNOS: PMU: move restart code into pmu driver

2014-10-01 Thread Tomasz Figa
Hi Pankaj,

Please see my comments inline.

On 01.10.2014 07:49, Pankaj Dubey wrote:
 Let's register reboot_notifier from PMU driver for reboot
 functionality. So that we can remove restart hooks from
 machine specific file, and thus moving ahead when PMU moved
 to driver folder, this functionality can be reused for ARM64
 based Exynos SoC's.

[snip]

 +static int pmu_reboot_notify_handler(struct notifier_block *this,
 + unsigned long code, void *unused)
 +{
 + if (code == SYS_RESTART) {
 + u32 val = 0x1;
 +
 + pmu_raw_writel(val, EXYNOS_SWRESET);

As already mentioned for patch 1, no need for the variable, because this
is just a constant 1.

Best regards,
Tomasz
--
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 2/4] ARM: exynos: Ensure PM domains are powered at initialization

2014-10-01 Thread Tomasz Figa
On 30.09.2014 20:33, Kevin Hilman wrote:
 Ulf Hansson ulf.hans...@linaro.org writes:
 
 At -probe() it's common practice for drivers/subsystems to bring their
 devices to full power and without depending on CONFIG_PM_RUNTIME.

 We could also expect that drivers/subsystems requires their device's
 corresponding PM domains to be powered, to successfully complete a
 -probe() sequence.

 Align to the behavior above, by ensuring all PM domains are powered
 prior initialization of a generic PM domain.

 Do note, since the generic PM domain will try to power off unused PM
 domains at late_init, there are no increased power consumption over
 time.
 
 IMO no increased power consumption is a bit misleading because
 boot-time power consumption may have a major increase when all power
 domains are powered on.  Sure, they will eventually (hopefully) be
 turned off in after late_initcall, but there will still be an impact.
 
 I guess the Samsung folks should comment here on whether that is
 significant.

Unfortunately this series has not been posted to linux-samsung-soc
mailing list and I'm a formerly-Samsung folk now, so it hasn't really
reached there.

Best regards,
Tomasz
--
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 v2 0/2] Handle reboot for Exynos SoC via reboot_notifier

2014-10-01 Thread Pankaj Dubey
This patch removes restart hook from machine_desc of Exynos, and moves
respective code into reboot_notifiers.
Exynos5440 handles reboot via clock register so let's register a
reboot_notifier in Exynos5440 clock driver.
For reset Exynos SoC, reboot is handled via PMU SWRESET register so
let's register a reboot_notifier in PMU driver for handling this.

This patch is inspired and dependent on following patch series[1] from
Geunter Roeck.

Also this patch is dependent on PMU platform driver patch [2] by me, and
has been prepared on top of it.

[1]: kernel: Add support for kernel restart handler call chain
https://lkml.org/lkml/2014/8/19/652

[2]: ARM: Exynos: Convert PMU implementation into a platform driver
https://lkml.org/lkml/2014/9/30/219

I have tested reboot functionality on Exynos3250 based board, on
kgene/for-next as well as linux-next's next-20140925 tag.

Patch v1 and related discussion can be found here
http://www.spinics.net/lists/linux-samsung-soc/msg37445.html

Changes since v1:
  - Addressed review comments from Tomasz Figa. Removed usage of 
local variables where ever unnecessary.
  - Make reg_base as global in clk-exynos5440.c file, to avoid 
iomapping it again in reboot_notifier handler.

Pankaj Dubey (2):
  clk: samsung: exynos5440: move restart code into clock driver
  ARM: EXYNOS: PMU: move restart code into pmu driver

 arch/arm/mach-exynos/common.h|1 -
 arch/arm/mach-exynos/exynos.c|   23 ---
 arch/arm/mach-exynos/pmu.c   |   25 +
 drivers/clk/samsung/clk-exynos5440.c |   30 +-
 4 files changed, 54 insertions(+), 25 deletions(-)

-- 
1.7.9.5

--
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 v2 1/2] clk: samsung: exynos5440: move restart code into clock driver

2014-10-01 Thread Pankaj Dubey
Let's register reboot_notifier for Exynos5440 from it's clock driver
for reboot functionality. So that we can cleanup restart hooks from
machine specific file.

Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
 arch/arm/mach-exynos/exynos.c|   19 +--
 drivers/clk/samsung/clk-exynos5440.c |   30 +-
 2 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 2f2f7b2..aa394cb 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -139,24 +139,7 @@ static struct map_desc exynos5_iodesc[] __initdata = {
 
 static void exynos_restart(enum reboot_mode mode, const char *cmd)
 {
-   struct device_node *np;
-   u32 val = 0x1;
-   void __iomem *addr = pmu_base_addr + EXYNOS_SWRESET;
-
-   if (of_machine_is_compatible(samsung,exynos5440)) {
-   u32 status;
-   np = of_find_compatible_node(NULL, NULL, 
samsung,exynos5440-clock);
-
-   addr = of_iomap(np, 0) + 0xbc;
-   status = __raw_readl(addr);
-
-   addr = of_iomap(np, 0) + 0xcc;
-   val = __raw_readl(addr);
-
-   val = (val  0x) | (status  0x);
-   }
-
-   __raw_writel(val, addr);
+   __raw_writel(0x1, pmu_base_addr + EXYNOS_SWRESET);
 }
 
 static struct platform_device exynos_cpuidle = {
diff --git a/drivers/clk/samsung/clk-exynos5440.c 
b/drivers/clk/samsung/clk-exynos5440.c
index 00d1d00..994595b 100644
--- a/drivers/clk/samsung/clk-exynos5440.c
+++ b/drivers/clk/samsung/clk-exynos5440.c
@@ -15,6 +15,8 @@
 #include linux/clk-provider.h
 #include linux/of.h
 #include linux/of_address.h
+#include linux/notifier.h
+#include linux/reboot.h
 
 #include clk.h
 #include clk-pll.h
@@ -23,6 +25,8 @@
 #define CPU_CLK_STATUS 0xfc
 #define MISC_DOUT1 0x558
 
+static void __iomem *reg_base;
+
 /* parent clock name list */
 PNAME(mout_armclk_p)   = { cplla, cpllb };
 PNAME(mout_spi_p)  = { div125, div200 };
@@ -89,10 +93,31 @@ static const struct of_device_id ext_clk_match[] 
__initconst = {
{},
 };
 
+static int exynos5440_clk_reboot_notify_handler(struct notifier_block *this,
+   unsigned long code, void *unused)
+{
+   if (code == SYS_RESTART) {
+   u32 val, status;
+
+   status = readl_relaxed(reg_base + 0xbc);
+   val = readl_relaxed(reg_base + 0xcc);
+   val = (val  0x) | (status  0x);
+   writel_relaxed(val, reg_base + 0xcc);
+   }
+   return NOTIFY_DONE;
+}
+
+/*
+ * Exynos5440 Clock reboot notifier, handles reboot functionality
+ */
+static struct notifier_block exynos5440_clk_reboot_notifier = {
+   .notifier_call = exynos5440_clk_reboot_notify_handler,
+   .priority = 128,
+};
+
 /* register exynos5440 clocks */
 static void __init exynos5440_clk_init(struct device_node *np)
 {
-   void __iomem *reg_base;
struct samsung_clk_provider *ctx;
 
reg_base = of_iomap(np, 0);
@@ -125,6 +150,9 @@ static void __init exynos5440_clk_init(struct device_node 
*np)
 
samsung_clk_of_add_provider(np, ctx);
 
+   if (register_reboot_notifier(exynos5440_clk_reboot_notifier))
+   pr_err(exynos5440 clock can't register reboot notifier\n);
+
pr_info(Exynos5440: arm_clk = %ldHz\n, _get_rate(arm_clk));
pr_info(exynos5440 clock initialization complete\n);
 }
-- 
1.7.9.5

--
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 v2 2/2] ARM: EXYNOS: PMU: move restart code into pmu driver

2014-10-01 Thread Pankaj Dubey
Let's register reboot_notifier from PMU driver for reboot
functionality. So that we can remove restart hooks from
machine specific file, and thus moving ahead when PMU moved
to driver folder, this functionality can be reused for ARM64
based Exynos SoC's.

Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
 arch/arm/mach-exynos/common.h |1 -
 arch/arm/mach-exynos/exynos.c |6 --
 arch/arm/mach-exynos/pmu.c|   25 +
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 431be1b..865f878 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -12,7 +12,6 @@
 #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
 #define __ARCH_ARM_MACH_EXYNOS_COMMON_H
 
-#include linux/reboot.h
 #include linux/of.h
 
 #define EXYNOS3250_SOC_ID  0xE3472000
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index aa394cb..3aa75b8e 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -137,11 +137,6 @@ static struct map_desc exynos5_iodesc[] __initdata = {
},
 };
 
-static void exynos_restart(enum reboot_mode mode, const char *cmd)
-{
-   __raw_writel(0x1, pmu_base_addr + EXYNOS_SWRESET);
-}
-
 static struct platform_device exynos_cpuidle = {
.name  = exynos_cpuidle,
 #ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -365,7 +360,6 @@ DT_MACHINE_START(EXYNOS_DT, SAMSUNG EXYNOS (Flattened 
Device Tree))
.init_machine   = exynos_dt_machine_init,
.init_late  = exynos_init_late,
.dt_compat  = exynos_dt_compat,
-   .restart= exynos_restart,
.reserve= exynos_reserve,
.dt_fixup   = exynos_dt_fixup,
 MACHINE_END
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 1993e08..c0855a5 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -11,7 +11,10 @@
 
 #include linux/io.h
 #include linux/of.h
+#include linux/of_address.h
 #include linux/platform_device.h
+#include linux/notifier.h
+#include linux/reboot.h
 
 #include exynos-pmu.h
 #include regs-pmu.h
@@ -439,6 +442,15 @@ static void exynos5250_pmu_init(void)
pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
 }
 
+static int pmu_reboot_notify_handler(struct notifier_block *this,
+   unsigned long code, void *unused)
+{
+   if (code == SYS_RESTART)
+   pmu_raw_writel(0x1, EXYNOS_SWRESET);
+
+   return NOTIFY_DONE;
+}
+
 static const struct exynos_pmu_data exynos4210_pmu_data = {
.pmu_config = exynos4210_pmu_config,
 };
@@ -478,11 +490,20 @@ static const struct of_device_id 
exynos_pmu_of_device_ids[] = {
{ /*sentinel*/ },
 };
 
+/*
+ * Exynos PMU reboot notifier, handles reboot functionality
+ */
+static struct notifier_block pmu_reboot_notifier = {
+   .notifier_call = pmu_reboot_notify_handler,
+   .priority = 128,
+};
+
 static int exynos_pmu_probe(struct platform_device *pdev)
 {
const struct of_device_id *match;
struct device *dev = pdev-dev;
struct resource *res;
+   int ret;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pmu_base_addr = devm_ioremap_resource(dev, res);
@@ -507,6 +528,10 @@ static int exynos_pmu_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, pmu_context);
 
+   ret = register_reboot_notifier(pmu_reboot_notifier);
+   if (ret)
+   dev_err(dev, can't register reboot notifier err=%d\n, ret);
+
dev_dbg(dev, Exynos PMU Driver probe done\n);
return 0;
 }
-- 
1.7.9.5

--
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 2/2] ARM: EXYNOS: PMU: move restart code into pmu driver

2014-10-01 Thread Pankaj Dubey
Hi Tomasz,

On Wednesday, October 01, 2014 4:07 PM, Tomasz Figa wrote,
 To: Pankaj Dubey; linux-arm-ker...@lists.infradead.org; linux-samsung-
 s...@vger.kernel.org
 Cc: kgene@samsung.com; li...@arm.linux.org.uk; thomas...@samsung.com;
 vikas.saj...@samsung.com; li...@roeck-us.net; naus...@samsung.com
 Subject: Re: [PATCH 2/2] ARM: EXYNOS: PMU: move restart code into pmu
 driver
 
 Hi Pankaj,
 
 Please see my comments inline.
 
 On 01.10.2014 07:49, Pankaj Dubey wrote:
  Let's register reboot_notifier from PMU driver for reboot
  functionality. So that we can remove restart hooks from machine
  specific file, and thus moving ahead when PMU moved to driver folder,
  this functionality can be reused for ARM64 based Exynos SoC's.
 
 [snip]
 
  +static int pmu_reboot_notify_handler(struct notifier_block *this,
  +   unsigned long code, void *unused)
  +{
  +   if (code == SYS_RESTART) {
  +   u32 val = 0x1;
  +
  +   pmu_raw_writel(val, EXYNOS_SWRESET);
 
 As already mentioned for patch 1, no need for the variable, because this
is just a
 constant 1.
 

Thanks for review.
Addressed all your review comments for this patch series in v2.

Thanks,
Pankaj Dubey

 Best regards,
 Tomasz

--
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 2/4] ARM: exynos: Ensure PM domains are powered at initialization

2014-10-01 Thread Ulf Hansson
On 1 October 2014 13:23, Tomasz Figa tomasz.f...@gmail.com wrote:
 On 30.09.2014 20:33, Kevin Hilman wrote:
 Ulf Hansson ulf.hans...@linaro.org writes:

 At -probe() it's common practice for drivers/subsystems to bring their
 devices to full power and without depending on CONFIG_PM_RUNTIME.

 We could also expect that drivers/subsystems requires their device's
 corresponding PM domains to be powered, to successfully complete a
 -probe() sequence.

 Align to the behavior above, by ensuring all PM domains are powered
 prior initialization of a generic PM domain.

 Do note, since the generic PM domain will try to power off unused PM
 domains at late_init, there are no increased power consumption over
 time.

 IMO no increased power consumption is a bit misleading because
 boot-time power consumption may have a major increase when all power
 domains are powered on.  Sure, they will eventually (hopefully) be
 turned off in after late_initcall, but there will still be an impact.

 I guess the Samsung folks should comment here on whether that is
 significant.

 Unfortunately this series has not been posted to linux-samsung-soc
 mailing list and I'm a formerly-Samsung folk now, so it hasn't really
 reached there.


Ohh, thanks for pointing this out. I will resend it.

Kind regards
Uffe
--
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 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Bartlomiej Zolnierkiewicz

Hi,

On Tuesday, September 30, 2014 10:22:34 AM Doug Anderson wrote:
 Bartlomiej
 
 On Mon, Sep 29, 2014 at 5:31 AM, Bartlomiej Zolnierkiewicz
 b.zolnier...@samsung.com wrote:
 
  Hi,
 
  On Friday, August 29, 2014 01:34:44 PM Ulf Hansson wrote:
  On 22 August 2014 15:47, Yuvaraj Kumar C D yuvaraj...@gmail.com wrote:
   This patch makes use of mmc_regulator_get_supply() to handle
   the vmmc and vqmmc regulators.Also it moves the code handling
   the these regulators to dw_mci_set_ios().It turned on the vmmc
   and vqmmc during MMC_POWER_UP and MMC_POWER_ON,and turned off
   during MMC_POWER_OFF.
  
   Signed-off-by: Yuvaraj Kumar C D yuvaraj...@samsung.com
 
  Thanks! Applied for next.
 
  Unfortunately this patch breaks mmc1 card (Kingston 32GB micro SDHC)
  detection on Exynos5420 Arndale Octa for me:
 
  [   10.797979] dwmmc_exynos 1222.mmc: no support for card's volts
  [   10.797998] mmc1: error -22 whilst initialising SD card
 
  Without the patch:
 
  [   10.866926] mmc_host mmc1: Bus speed (slot 0) = 5000Hz (slot req 
  5000Hz, actual 5000HZ div = 0)
  [   10.866977] mmc1: new high speed SDHC card at address 1234
  [   10.868730] mmcblk1: mmc1:1234 SA32G 29.3 GiB
  [   10.915054]  mmcblk1: p1 p2 p3
 
  The config is attached (exynos_defconfig doesn't work correctly for
  this board yet).
 
 Yup, this is an expected behavior, unfortunately.  This was talked
 about extensively during the review of this patch series.

Do you mean that a patch with a known regression has been merged
into next branch of mmc tree?  It would be quite sad if it would be
true.

 I believe that patch #3 in Yuvaraj's series would fix your problem.
 Specifically https://patchwork.kernel.org/patch/4763891/.

Unfortunately this patch doesn't fix the problem (there is no longer
a lockup on regulators initialization but -22 error is still present).

 The current summary of this issue is (Ulf, please correct me if I got
 anything wrong):
 
 1. If nothing else, Yuvaraj's patch should probably be split in two.
 One half should be the MMC core half that I originally sent Yuvaraj.
 I just rebased and re-uploaed it at
 https://chromium-review.googlesource.com/220560 in case you're
 curious.  The second half should be the dw_mmc piece that Yuvaraj
 wrote.
 
 2. Ulf has indicated that he thinks that the MMC core change (and thus
 Yuvaraj's patch) is ugly and not necessary.  He advocates instead
 using the MMC_CAP_NEEDS_POLL on all affected platforms.  That means
 we'll turn on the power every second, check for the card, then turn
 off power.
 
 3. I'm still of the opinion that the MMC core change isn't _that_
 ugly.  Given that there are a large number of systems affected (across

It also doesn't look that bad for me and well, when the hardware is
quirky then the resulting code can't be esthetically perfect..

 at least two SoC vendors) and that it would be nice if those systems
 didn't have to poll, I'd still be happy if the MMC core change could
 go in.  ...but I'm a pragmatist and know that the polling isn't
 _terrible_, so if that's the way we need to go then so be it.
 
 --
 
 My understanding was that Yuvaraj was going to spin his patch to use a
 similar type of scheme to autodetect affected SoCs (looking for SoCs
 known to have this problem where the platform data shows them using
 the built-in card detect) and then enable MMC_CAP_NEEDS_POLL.  I
 haven't seen a patch from him, so maybe you could post this up?

I worry that I have too little time and MMC code expertise to do this.

 Note: the reason why exynos5250-snow and some other boards aren't
 affected yet is that the regulator is simply not specified in the
 device tree (it's just left always on).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

--
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 2/2] drm/exynos: use drm generic mmap interface

2014-10-01 Thread Tomasz Figa
Hi Inki,

On 17.09.2014 15:48, Inki Dae wrote:
 This patch removes DRM_EXYNOS_GEM_MMAP ictrl feature specific
 to Exynos drm and instead uses drm generic mmap.

It looks like libdrm_exynos is still using DRM_EXYNOS_GEM_MMAP, but this
patch just removes it. This basically means that any application using
it is now broken. Do you have any plans to fix this?

Best regards,
Tomasz
--
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 v7 00/11] kernel: Add support for restart handler call chain

2014-10-01 Thread Heiko Stübner
Am Dienstag, 30. September 2014, 15:30:00 schrieb Guenter Roeck:
 On Tue, Sep 30, 2014 at 02:20:02PM -0700, Andrew Morton wrote:
  On Tue, 19 Aug 2014 17:45:27 -0700 Guenter Roeck li...@roeck-us.net 
wrote:
   Introduce a system restart handler call chain to solve the described
   problems. 
  So someone has merged eight of these patches into linux-next but these
  three:
  
  watchdog-s3c2410-add-restart-handler.patch
  clk-samsung-register-restart-handlers-for-s3c2412-and-s3c2443.patch
  clk-rockchip-add-restart-handler.patch
  
  were omitted.  What's up?
 
 Most likely PBKC on my side; Looks like I forgot to add those when I created
 the immutable branch for others to merge. Sorry for that :-(.
 
 Having said that, I somehow thought that the clock patches would go in
 through the clock tree. Heiko, did I get that wrong ? Separately, I sent a
 pull request that includes the watchdog patch to Wim.

I didn't realise that the patches would get dropped from -mm until I the 
removal notices this morning. So meanwhile I've send a pull to Mike for the 
Rockchip and S3C2412/2416/2443 restart handling.

So, as your pull includes the samsung watchdog restart, we should be hopefully 
all set again :-) .


Heiko
--
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 v8 0/2] Adds PMU and S2R support for exynos5420

2014-10-01 Thread Javier Martinez Canillas
Hello Vikas,

On Wed, Oct 1, 2014 at 12:23 PM, Vikas Sajjan vikas.saj...@samsung.com wrote:

 My git log looks like below on top of Kukjin's for-next branch,

 d861ddd clk: exynos: Add CLK_IGNORE_UNUSED to aclk200_disp1 and aclk300_disp1
 adc14dc POSTED: ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420
 d61fc43 ARM: exynos5: Add Suspend-to-RAM support for 5420
 3d1d7bd ARM: exynos5: Add PMU support for 5420
 a8887b3 mfd: syscon: Decouple syscon interface from platform devices
 072e2bc ARM: EXYNOS: Move PMU specific definitions from common.h
 ec2f950 ARM: EXYNOS: Add platform driver support for Exynos PMU


I tested Kukjin's for-next branch (HEAD in commit a84aaa7) + the
patches you mentioned and the system enters in suspend mode but the
RTC alarm IRQ does not make it resume. Is the branch you are using to
test public so I can give it a try?

 recently I noticed that, without the CLK_IGNORE_UNUSED flag for
 aclk200_disp1 and aclk300_disp1 CLK,  the system is NOT suspending,
 which was NOT the case when i had posted my previous revisions.


I tried both with and without your patch that adds the
CLK_IGNORE_UNUSED to aclk200_disp1 and aclk300_disp1 and in both cases
it behaves the same, the system seems to go into suspend mode but
never resumes:

# echo +20  /sys/class/rtc/rtc0/wakealarm  echo mem  /sys/power/state
[  105.376596] PM: Syncing filesystems ... done.
[  105.383207] Freezing user space processes ... (elapsed 0.001 seconds) done.
[  105.388681] Freezing remaining freezable tasks ... (elapsed 0.001
seconds) done.
[  105.488589] wake enabled for irq 281
[  105.491609] wake enabled for irq 280
[  105.498102] wake enabled for irq 284
[  105.554736] PM: suspend of devices complete after 155.406 msecs
[  105.562572] PM: late suspend of devices complete after 3.361 msecs
[  105.570389] PM: noirq suspend of devices complete after 3.102 msecs
[  105.575185] Disabling non-boot CPUs ...
[  105.579706] IRQ153 no longer affine to CPU1
[  105.580008] CPU1: shutdown
[  105.587230] IRQ154 no longer affine to CPU2
[  105.587472] CPU2: shutdown
[  105.594953] IRQ155 no longer affine to CPU3
[  105.595190] CPU3: shutdown
[  105.602464] IRQ160 no longer affine to CPU4
[  105.602979] CPU4: shutdown
[  105.609996] IRQ161 no longer affine to CPU5
[  105.610424] CPU5: shutdown
[  105.617116] IRQ162 no longer affine to CPU6
[  105.617557] CPU6: shutdown
[  105.625163] IRQ163 no longer affine to CPU7
[  105.625596] CPU7: shutdown

I'm testing on a Exynos5420 Peach Pit using exynos_defconfig and
disabling CONFIG_BL_SWITCHER as you suggested. My bootargs is:

console=ttySAC3,115200 debug earlyprintk root=/dev/mmcblk1p2 rootwait
rw no_console_suspend

And I'm booting using a chained nv-uboot with built version:

U-Boot 2013.04-gb98ed09 (Mar 07 2014 - 12:25:37) for Peach

I checked that the s3c2410-rtc alarm IRQ is fired correctly by looking
at /sys/class/rtc/rtc0/wakealarm and also /proc/interrupts.

Any ideas before I dig into this?

Thanks a lot and 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 v2 2/2] ARM: EXYNOS: PMU: move restart code into pmu driver

2014-10-01 Thread Guenter Roeck

On 10/01/2014 04:36 AM, Pankaj Dubey wrote:

Let's register reboot_notifier from PMU driver for reboot
functionality. So that we can remove restart hooks from
machine specific file, and thus moving ahead when PMU moved
to driver folder, this functionality can be reused for ARM64
based Exynos SoC's.

Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
  arch/arm/mach-exynos/common.h |1 -
  arch/arm/mach-exynos/exynos.c |6 --
  arch/arm/mach-exynos/pmu.c|   25 +
  3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 431be1b..865f878 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -12,7 +12,6 @@
  #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
  #define __ARCH_ARM_MACH_EXYNOS_COMMON_H

-#include linux/reboot.h
  #include linux/of.h

  #define EXYNOS3250_SOC_ID 0xE3472000
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index aa394cb..3aa75b8e 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -137,11 +137,6 @@ static struct map_desc exynos5_iodesc[] __initdata = {
},
  };

-static void exynos_restart(enum reboot_mode mode, const char *cmd)
-{
-   __raw_writel(0x1, pmu_base_addr + EXYNOS_SWRESET);
-}
-
  static struct platform_device exynos_cpuidle = {
.name  = exynos_cpuidle,
  #ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -365,7 +360,6 @@ DT_MACHINE_START(EXYNOS_DT, SAMSUNG EXYNOS (Flattened Device 
Tree))
.init_machine   = exynos_dt_machine_init,
.init_late  = exynos_init_late,
.dt_compat  = exynos_dt_compat,
-   .restart= exynos_restart,
.reserve= exynos_reserve,
.dt_fixup   = exynos_dt_fixup,
  MACHINE_END
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 1993e08..c0855a5 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -11,7 +11,10 @@

  #include linux/io.h
  #include linux/of.h
+#include linux/of_address.h
  #include linux/platform_device.h
+#include linux/notifier.h
+#include linux/reboot.h

  #include exynos-pmu.h
  #include regs-pmu.h
@@ -439,6 +442,15 @@ static void exynos5250_pmu_init(void)
pmu_raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST);
  }

+static int pmu_reboot_notify_handler(struct notifier_block *this,
+   unsigned long code, void *unused)
+{
+   if (code == SYS_RESTART)
+   pmu_raw_writel(0x1, EXYNOS_SWRESET);
+
+   return NOTIFY_DONE;
+}
+
  static const struct exynos_pmu_data exynos4210_pmu_data = {
.pmu_config = exynos4210_pmu_config,
  };
@@ -478,11 +490,20 @@ static const struct of_device_id 
exynos_pmu_of_device_ids[] = {
{ /*sentinel*/ },
  };

+/*
+ * Exynos PMU reboot notifier, handles reboot functionality
+ */
+static struct notifier_block pmu_reboot_notifier = {
+   .notifier_call = pmu_reboot_notify_handler,
+   .priority = 128,
+};
+
  static int exynos_pmu_probe(struct platform_device *pdev)
  {
const struct of_device_id *match;
struct device *dev = pdev-dev;
struct resource *res;
+   int ret;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pmu_base_addr = devm_ioremap_resource(dev, res);
@@ -507,6 +528,10 @@ static int exynos_pmu_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pmu_context);

+   ret = register_reboot_notifier(pmu_reboot_notifier);
+   if (ret)
+   dev_err(dev, can't register reboot notifier err=%d\n, ret);
+
dev_dbg(dev, Exynos PMU Driver probe done\n);
return 0;
  }



Something went wrong here.

You don't want to register with reboot_notifier, but with restart_notifier.
The code is not SYS_RESTART, but the value of reboot_mode.

The same applies to the other patch as well.

Guenter

--
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 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Bartlomiej Zolnierkiewicz

Hi,

On Tuesday, September 30, 2014 02:23:44 PM Jaehoon Chung wrote:
 Hi
 
 On 09/29/2014 09:31 PM, Bartlomiej Zolnierkiewicz wrote:
  
  Hi,
  
  On Friday, August 29, 2014 01:34:44 PM Ulf Hansson wrote:
  On 22 August 2014 15:47, Yuvaraj Kumar C D yuvaraj...@gmail.com wrote:
  This patch makes use of mmc_regulator_get_supply() to handle
  the vmmc and vqmmc regulators.Also it moves the code handling
  the these regulators to dw_mci_set_ios().It turned on the vmmc
  and vqmmc during MMC_POWER_UP and MMC_POWER_ON,and turned off
  during MMC_POWER_OFF.
 
  Signed-off-by: Yuvaraj Kumar C D yuvaraj...@samsung.com
 
  Thanks! Applied for next.
  
  Unfortunately this patch breaks mmc1 card (Kingston 32GB micro SDHC)
  detection on Exynos5420 Arndale Octa for me:
  
  [   10.797979] dwmmc_exynos 1222.mmc: no support for card's volts
  [   10.797998] mmc1: error -22 whilst initialising SD card
 
 OCR value is not matched. Which values are supported about the mmc_host's 
 value and card's value?
 Could you share the value?

Sure.  I've added dev_info()s at the beginning of mmc_select_voltage():

+   dev_warn(mmc_dev(host), card's volts: 0x%0x\n, ocr);
+   dev_warn(mmc_dev(host), host's volts: 0x%0x\n, host-ocr_avail);

and got following results:

[   10.851678] dwmmc_exynos 1222.mmc: card's volts: 0xff8000
[   10.851691] dwmmc_exynos 1222.mmc: host's volts: 0x80

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

 Best Regards,
 Jaehoon Chung
 
  
  Without the patch:
  
  [   10.866926] mmc_host mmc1: Bus speed (slot 0) = 5000Hz (slot req 
  5000Hz, actual 5000HZ div = 0)
  [   10.866977] mmc1: new high speed SDHC card at address 1234
  [   10.868730] mmcblk1: mmc1:1234 SA32G 29.3 GiB 
  [   10.915054]  mmcblk1: p1 p2 p3
  
  The config is attached (exynos_defconfig doesn't work correctly for
  this board yet).
  
  Best regards,
  --
  Bartlomiej Zolnierkiewicz
  Samsung RD Institute Poland
  Samsung Electronics
  
  Kind regards
  Uffe
 
  ---
  changes from v1:
  1.Used mmc_regulator_set_ocr() instead of regulator_enable() for 
  vmmc.
  2.Turned on vmmc and vqmmc during MMC_POWER_UP.
  3. Removed the flags DW_MMC_CARD_POWERED and DW_MMC_IO_POWERED 
  which
 added during the initial version of this patch.
  4. Added error message, if it failed to turn on regulator's.
 
   drivers/mmc/host/dw_mmc.c  |   72 
  +---
   include/linux/mmc/dw_mmc.h |2 +-
   2 files changed, 36 insertions(+), 38 deletions(-)
 
  diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
  index 7f227e9..aadb0d6 100644
  --- a/drivers/mmc/host/dw_mmc.c
  +++ b/drivers/mmc/host/dw_mmc.c
  @@ -936,6 +936,7 @@ static void dw_mci_set_ios(struct mmc_host *mmc, 
  struct mmc_ios *ios)
  struct dw_mci_slot *slot = mmc_priv(mmc);
  const struct dw_mci_drv_data *drv_data = slot-host-drv_data;
  u32 regs;
  +   int ret;
 
  switch (ios-bus_width) {
  case MMC_BUS_WIDTH_4:
  @@ -974,12 +975,38 @@ static void dw_mci_set_ios(struct mmc_host *mmc, 
  struct mmc_ios *ios)
 
  switch (ios-power_mode) {
  case MMC_POWER_UP:
  +   if (!IS_ERR(mmc-supply.vmmc)) {
  +   ret = mmc_regulator_set_ocr(mmc, mmc-supply.vmmc,
  +   ios-vdd);
  +   if (ret) {
  +   dev_err(slot-host-dev,
  +   failed to enable vmmc 
  regulator\n);
  +   /*return, if failed turn on vmmc*/
  +   return;
  +   }
  +   }
  +   if (!IS_ERR(mmc-supply.vqmmc)  
  !slot-host-vqmmc_enabled) {
  +   ret = regulator_enable(mmc-supply.vqmmc);
  +   if (ret  0)
  +   dev_err(slot-host-dev,
  +   failed to enable vqmmc 
  regulator\n);
  +   else
  +   slot-host-vqmmc_enabled = true;
  +   }
  set_bit(DW_MMC_CARD_NEED_INIT, slot-flags);
  regs = mci_readl(slot-host, PWREN);
  regs |= (1  slot-id);
  mci_writel(slot-host, PWREN, regs);
  break;
  case MMC_POWER_OFF:
  +   if (!IS_ERR(mmc-supply.vmmc))
  +   mmc_regulator_set_ocr(mmc, mmc-supply.vmmc, 0);
  +
  +   if (!IS_ERR(mmc-supply.vqmmc)  
  slot-host-vqmmc_enabled) {
  +   regulator_disable(mmc-supply.vqmmc);
  +   slot-host-vqmmc_enabled = false;
  +   }
  +
  regs = mci_readl(slot-host, PWREN);
  regs = ~(1  slot-id);
  mci_writel(slot-host, PWREN, regs);
  @@ -2110,7 

Re: [PATCH V2 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Bartlomiej Zolnierkiewicz

Hi,

On Wednesday, October 01, 2014 12:47:52 AM YUVARAJ CD wrote:

 Since I am out of station, i dont have an access to my work set up.
 Can you send me the dts entries of sd crad and their corresponding regulator 
 entries?

From arch/arm/boot/dts/exynos5420-arndale-octa.dts:

...
mmc@1220 {
status = okay;
broken-cd;
supports-highspeed;
card-detect-delay = 200;
samsung,dw-mshc-ciu-div = 3;
samsung,dw-mshc-sdr-timing = 0 4;
samsung,dw-mshc-ddr-timing = 0 2;
pinctrl-names = default;
pinctrl-0 = sd0_clk sd0_cmd sd0_bus4 sd0_bus8;
vmmc-supply = ldo10_reg;

slot@0 {
reg = 0;
bus-width = 8;
};
};

mmc@1222 {
status = okay;
supports-highspeed;
card-detect-delay = 200;
samsung,dw-mshc-ciu-div = 3;
samsung,dw-mshc-sdr-timing = 2 3;
samsung,dw-mshc-ddr-timing = 1 2;
pinctrl-names = default;
pinctrl-0 = sd2_clk sd2_cmd sd2_cd sd2_bus4;
vmmc-supply = ldo10_reg;

slot@0 {
reg = 0;
bus-width = 4;
};
};
...
ldo10_reg: LDO10 {
regulator-name = PVDD_PRE_1V8;
regulator-min-microvolt = 180;
regulator-max-microvolt = 180;
regulator-always-on;
};
...

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

--
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 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Bartlomiej Zolnierkiewicz
On Wednesday, October 01, 2014 03:57:54 PM Bartlomiej Zolnierkiewicz wrote:
 
 Hi,
 
 On Tuesday, September 30, 2014 02:23:44 PM Jaehoon Chung wrote:
  Hi
  
  On 09/29/2014 09:31 PM, Bartlomiej Zolnierkiewicz wrote:
   
   Hi,
   
   On Friday, August 29, 2014 01:34:44 PM Ulf Hansson wrote:
   On 22 August 2014 15:47, Yuvaraj Kumar C D yuvaraj...@gmail.com wrote:
   This patch makes use of mmc_regulator_get_supply() to handle
   the vmmc and vqmmc regulators.Also it moves the code handling
   the these regulators to dw_mci_set_ios().It turned on the vmmc
   and vqmmc during MMC_POWER_UP and MMC_POWER_ON,and turned off
   during MMC_POWER_OFF.
  
   Signed-off-by: Yuvaraj Kumar C D yuvaraj...@samsung.com
  
   Thanks! Applied for next.
   
   Unfortunately this patch breaks mmc1 card (Kingston 32GB micro SDHC)
   detection on Exynos5420 Arndale Octa for me:
   
   [   10.797979] dwmmc_exynos 1222.mmc: no support for card's volts
   [   10.797998] mmc1: error -22 whilst initialising SD card
  
  OCR value is not matched. Which values are supported about the mmc_host's 
  value and card's value?
  Could you share the value?
 
 Sure.  I've added dev_info()s at the beginning of mmc_select_voltage():
 
 + dev_warn(mmc_dev(host), card's volts: 0x%0x\n, ocr);
 + dev_warn(mmc_dev(host), host's volts: 0x%0x\n, host-ocr_avail);
 
 and got following results:
 
 [   10.851678] dwmmc_exynos 1222.mmc: card's volts: 0xff8000
 [   10.851691] dwmmc_exynos 1222.mmc: host's volts: 0x80

Data for the working kernel:

[   10.856214] dwmmc_exynos 1222.mmc: card's volts: 0xff8000
[   10.856227] dwmmc_exynos 1222.mmc: host's volts: 0x30

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

 Best regards,
 --
 Bartlomiej Zolnierkiewicz
 Samsung RD Institute Poland
 Samsung Electronics
 
  Best Regards,
  Jaehoon Chung
  
   
   Without the patch:
   
   [   10.866926] mmc_host mmc1: Bus speed (slot 0) = 5000Hz (slot req 
   5000Hz, actual 5000HZ div = 0)
   [   10.866977] mmc1: new high speed SDHC card at address 1234
   [   10.868730] mmcblk1: mmc1:1234 SA32G 29.3 GiB 
   [   10.915054]  mmcblk1: p1 p2 p3
   
   The config is attached (exynos_defconfig doesn't work correctly for
   this board yet).
   
   Best regards,
   --
   Bartlomiej Zolnierkiewicz
   Samsung RD Institute Poland
   Samsung Electronics
   
   Kind regards
   Uffe
  
   ---
   changes from v1:
   1.Used mmc_regulator_set_ocr() instead of regulator_enable() 
   for vmmc.
   2.Turned on vmmc and vqmmc during MMC_POWER_UP.
   3. Removed the flags DW_MMC_CARD_POWERED and DW_MMC_IO_POWERED 
   which
  added during the initial version of this patch.
   4. Added error message, if it failed to turn on regulator's.
  
drivers/mmc/host/dw_mmc.c  |   72 
   +---
include/linux/mmc/dw_mmc.h |2 +-
2 files changed, 36 insertions(+), 38 deletions(-)
  
   diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
   index 7f227e9..aadb0d6 100644
   --- a/drivers/mmc/host/dw_mmc.c
   +++ b/drivers/mmc/host/dw_mmc.c
   @@ -936,6 +936,7 @@ static void dw_mci_set_ios(struct mmc_host *mmc, 
   struct mmc_ios *ios)
   struct dw_mci_slot *slot = mmc_priv(mmc);
   const struct dw_mci_drv_data *drv_data = slot-host-drv_data;
   u32 regs;
   +   int ret;
  
   switch (ios-bus_width) {
   case MMC_BUS_WIDTH_4:
   @@ -974,12 +975,38 @@ static void dw_mci_set_ios(struct mmc_host *mmc, 
   struct mmc_ios *ios)
  
   switch (ios-power_mode) {
   case MMC_POWER_UP:
   +   if (!IS_ERR(mmc-supply.vmmc)) {
   +   ret = mmc_regulator_set_ocr(mmc, 
   mmc-supply.vmmc,
   +   ios-vdd);
   +   if (ret) {
   +   dev_err(slot-host-dev,
   +   failed to enable vmmc 
   regulator\n);
   +   /*return, if failed turn on vmmc*/
   +   return;
   +   }
   +   }
   +   if (!IS_ERR(mmc-supply.vqmmc)  
   !slot-host-vqmmc_enabled) {
   +   ret = regulator_enable(mmc-supply.vqmmc);
   +   if (ret  0)
   +   dev_err(slot-host-dev,
   +   failed to enable vqmmc 
   regulator\n);
   +   else
   +   slot-host-vqmmc_enabled = true;
   +   }
   set_bit(DW_MMC_CARD_NEED_INIT, slot-flags);
   regs = mci_readl(slot-host, PWREN);
   regs |= (1  slot-id);
   mci_writel(slot-host, PWREN, regs);
   break;
   case MMC_POWER_OFF:
   +   if (!IS_ERR(mmc-supply.vmmc))
   +  

[PATCH v2 3/4] PM / Domains: Expect PM domains being powered at initialization

2014-10-01 Thread Ulf Hansson
At -probe() it's common practice for drivers/subsystems to bring their
devices to full power and without depending on CONFIG_PM_RUNTIME.

We could also expect that drivers/subsystems requires their device's
corresponding PM domains to be powered, to successfully complete a
-probe() sequence.

Align the generic PM domain to the behavior above, by enforcing a PM
domain to be powered at initialization.

Previous patch changed the only call of pm_genpd_init() with true for
the is_off parameter into false. Thus all calls of pm_genpd_init()
now uses false as the value for is_off.

To make it clear that genpd currently only supports powered PM domains
at init, let's also remove the is_off parameter from the API.

Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
Acked-by: Geert Uytterhoeven geert+rene...@glider.be
---
 arch/arm/mach-exynos/pm_domains.c   | 2 +-
 arch/arm/mach-s3c64xx/pm.c  | 4 ++--
 arch/arm/mach-shmobile/pm-r8a7779.c | 2 +-
 arch/arm/mach-shmobile/pm-rmobile.c | 2 +-
 drivers/base/power/domain.c | 5 ++---
 include/linux/pm_domain.h   | 4 ++--
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 58e18e9..f2e5096 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -158,7 +158,7 @@ no_clk:
if (!(__raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN))
exynos_pd_power_on(pd-pd);
 
-   pm_genpd_init(pd-pd, NULL, false);
+   pm_genpd_init(pd-pd, NULL);
of_genpd_add_provider_simple(np, pd-pd);
}
 
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index aaf7bea..42dead0 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -315,10 +315,10 @@ int __init s3c64xx_pm_init(void)
 
for (i = 0; i  ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
pm_genpd_init(s3c64xx_always_on_pm_domains[i]-pd,
- pm_domain_always_on_gov, false);
+ pm_domain_always_on_gov);
 
for (i = 0; i  ARRAY_SIZE(s3c64xx_pm_domains); i++)
-   pm_genpd_init(s3c64xx_pm_domains[i]-pd, NULL, false);
+   pm_genpd_init(s3c64xx_pm_domains[i]-pd, NULL);
 
 #ifdef CONFIG_S3C_DEV_FB
if (dev_get_platdata(s3c_device_fb.dev))
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c 
b/arch/arm/mach-shmobile/pm-r8a7779.c
index 82fe3d7..c20ef44 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -83,7 +83,7 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain 
*r8a7779_pd)
 {
struct generic_pm_domain *genpd = r8a7779_pd-genpd;
 
-   pm_genpd_init(genpd, NULL, false);
+   pm_genpd_init(genpd, NULL);
genpd-dev_ops.stop = pm_clk_suspend;
genpd-dev_ops.start = pm_clk_resume;
genpd-dev_ops.active_wakeup = pd_active_wakeup;
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c 
b/arch/arm/mach-shmobile/pm-rmobile.c
index 818de2f..e6a0490 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -107,7 +107,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain 
*rmobile_pd)
struct generic_pm_domain *genpd = rmobile_pd-genpd;
struct dev_power_governor *gov = rmobile_pd-gov;
 
-   pm_genpd_init(genpd, gov ? : simple_qos_governor, false);
+   pm_genpd_init(genpd, gov ? : simple_qos_governor);
genpd-dev_ops.stop = pm_clk_suspend;
genpd-dev_ops.start= pm_clk_resume;
genpd-dev_ops.active_wakeup= rmobile_pd_active_wakeup;
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 36871b3..cfb76e8 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1836,10 +1836,9 @@ static int pm_genpd_default_restore_state(struct device 
*dev)
  * pm_genpd_init - Initialize a generic I/O PM domain object.
  * @genpd: PM domain object to initialize.
  * @gov: PM domain governor to associate with the domain (may be NULL).
- * @is_off: Initial value of the domain's power_is_off field.
  */
 void pm_genpd_init(struct generic_pm_domain *genpd,
-  struct dev_power_governor *gov, bool is_off)
+  struct dev_power_governor *gov)
 {
if (IS_ERR_OR_NULL(genpd))
return;
@@ -1852,7 +1851,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
INIT_WORK(genpd-power_off_work, genpd_power_off_work_fn);
genpd-in_progress = 0;
atomic_set(genpd-sd_count, 0);
-   genpd-status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE;
+   genpd-status = GPD_STATE_ACTIVE;
init_waitqueue_head(genpd-status_wait_queue);
genpd-poweroff_task = NULL;
genpd-resume_count = 0;
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index a21dfa9..ad4aa87 100644
--- 

[PATCH v2 1/4] PM / Domains: Remove pm_genpd_dev_need_restore() API

2014-10-01 Thread Ulf Hansson
There are currently no users of this API, let's remove it.

Additionally, if such feature would be needed future wise, a better
option is likely use pm_runtime_set_active|suspended() in some form.

Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
Acked-by: Geert Uytterhoeven geert+rene...@glider.be
Acked-by: Kevin Hilman khil...@linaro.org
---
 drivers/base/power/domain.c | 20 
 include/linux/pm_domain.h   |  2 --
 2 files changed, 22 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 18cc68d..36871b3 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1533,26 +1533,6 @@ int pm_genpd_remove_device(struct generic_pm_domain 
*genpd,
 }
 
 /**
- * pm_genpd_dev_need_restore - Set/unset the device's need restore flag.
- * @dev: Device to set/unset the flag for.
- * @val: The new value of the device's need restore flag.
- */
-void pm_genpd_dev_need_restore(struct device *dev, bool val)
-{
-   struct pm_subsys_data *psd;
-   unsigned long flags;
-
-   spin_lock_irqsave(dev-power.lock, flags);
-
-   psd = dev_to_psd(dev);
-   if (psd  psd-domain_data)
-   to_gpd_data(psd-domain_data)-need_restore = val;
-
-   spin_unlock_irqrestore(dev-power.lock, flags);
-}
-EXPORT_SYMBOL_GPL(pm_genpd_dev_need_restore);
-
-/**
  * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
  * @genpd: Master PM domain to add the subdomain to.
  * @subdomain: Subdomain to be added.
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 9004743..a21dfa9 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -129,7 +129,6 @@ extern int __pm_genpd_name_add_device(const char 
*domain_name,
 
 extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
  struct device *dev);
-extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
 extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
  struct generic_pm_domain *new_subdomain);
 extern int pm_genpd_add_subdomain_names(const char *master_name,
@@ -175,7 +174,6 @@ static inline int pm_genpd_remove_device(struct 
generic_pm_domain *genpd,
 {
return -ENOSYS;
 }
-static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
 static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
 struct generic_pm_domain *new_sd)
 {
-- 
1.9.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 v2 2/4] ARM: exynos: Ensure PM domains are powered at initialization

2014-10-01 Thread Ulf Hansson
At -probe() it's common practice for drivers/subsystems to bring their
devices to full power and without depending on CONFIG_PM_RUNTIME.

We could also expect that drivers/subsystems requires their device's
corresponding PM domains to be powered, to successfully complete a
-probe() sequence.

Align to the behavior above, by ensuring all PM domains are powered
prior initialization of a generic PM domain.

Do note, since the generic PM domain will try to power off unused PM
domains at late_init, there should be no increased power consumption
over time, but potentially during boot.

Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
---
 arch/arm/mach-exynos/pm_domains.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 20f2671..58e18e9 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -112,7 +112,7 @@ static __init int exynos4_pm_init_power_domain(void)
 
for_each_compatible_node(np, NULL, samsung,exynos4210-pd) {
struct exynos_pm_domain *pd;
-   int on, i;
+   int i;
struct device *dev;
 
pdev = of_find_device_by_node(np);
@@ -155,9 +155,10 @@ static __init int exynos4_pm_init_power_domain(void)
clk_put(pd-oscclk);
 
 no_clk:
-   on = __raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN;
+   if (!(__raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN))
+   exynos_pd_power_on(pd-pd);
 
-   pm_genpd_init(pd-pd, NULL, !on);
+   pm_genpd_init(pd-pd, NULL, false);
of_genpd_add_provider_simple(np, pd-pd);
}
 
-- 
1.9.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 v2 4/4] PM / Domains: Enforce PM domains to stay powered during boot

2014-10-01 Thread Ulf Hansson
When there are more than one device in a PM domain these will obviously
be probed at different times. Depending on timing and the implemented
support for runtime PM in a driver/subsystem, genpd may be advised to
power off a PM domain after a successful probe sequence.

Ideally we should have relied on the driver/subsystem, through runtime
PM, to bring their device's PM domain into powered state prior doing
probing if such requirement exist.

Since this is not a common practice by drivers/subsystems, enforcing
such a change doesn't seem viable.

Instead, let's improve the situation, by preventing genpd from powering
off any of the PM domains until late_init. At that point genpd already
tries to power off unused PM domains, so it seems like a decent match.

Cases which can't be covered within the window of until late_init needs
to be adressed separately and likely through a more common long term
solution.

Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
---
 drivers/base/power/domain.c | 17 -
 include/linux/pm_domain.h   |  1 +
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index cfb76e8..3dbadfd 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -451,10 +451,12 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
*genpd)
 * (2) The domain is waiting for its master to power up.
 * (3) One of the domain's devices is being resumed right now.
 * (4) System suspend is in progress.
+* (5) late_init hasn't completed to allow it.
 */
if (genpd-status == GPD_STATE_POWER_OFF
|| genpd-status == GPD_STATE_WAIT_MASTER
-   || genpd-resume_count  0 || genpd-prepared_count  0)
+   || genpd-resume_count  0 || genpd-prepared_count  0
+   || genpd-keep_power)
return 0;
 
if (atomic_read(genpd-sd_count)  0)
@@ -724,6 +726,18 @@ void pm_genpd_poweroff_unused(void)
 
 static int __init genpd_poweroff_unused(void)
 {
+   struct generic_pm_domain *genpd;
+
+   mutex_lock(gpd_list_lock);
+
+   list_for_each_entry(genpd, gpd_list, gpd_list_node) {
+   genpd_acquire_lock(genpd);
+   genpd-keep_power = false;
+   genpd_release_lock(genpd);
+   }
+
+   mutex_unlock(gpd_list_lock);
+
pm_genpd_poweroff_unused();
return 0;
 }
@@ -1854,6 +1868,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
genpd-status = GPD_STATE_ACTIVE;
init_waitqueue_head(genpd-status_wait_queue);
genpd-poweroff_task = NULL;
+   genpd-keep_power = true;
genpd-resume_count = 0;
genpd-device_count = 0;
genpd-max_off_time_ns = -1;
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index ad4aa87..d87ef6a 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -58,6 +58,7 @@ struct generic_pm_domain {
enum gpd_status status; /* Current state of the domain */
wait_queue_head_t status_wait_queue;
struct task_struct *poweroff_task;  /* Powering off task */
+   bool keep_power;/* Flag to keep power until late_init */
unsigned int resume_count;  /* Number of devices being resumed */
unsigned int device_count;  /* Number of devices */
unsigned int suspended_count;   /* System suspend device counter */
-- 
1.9.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 v2 0/4] PM / Domains: Fix race conditions during boot

2014-10-01 Thread Ulf Hansson
Changes in v2:
-Added some acks.
-Updated commit messages.
-Included a wider audience of the patchset. V1 was lacking SoC
 maintainers.

Here are link to the first patchset, were some discussion started.
http://marc.info/?l=linux-pmm=141208104729597w=2


When there are more than one device in a PM domain these will obviously
be probed at different times. Depending on timing and the implemented
support for runtime PM in a driver/subsystem, genpd may be advised to
power off a PM domain after a successful probe sequence.

Ideally we should have relied on the driver/subsystem, through runtime
PM, to bring their device's PM domain into powered state prior doing
probing if such requirement exist.

Since this is not a common practice by drivers/subsystems, enforcing
such a change doesn't seem viable.

Instead, let's improve the situation, by preventing genpd from powering
off any of the PM domains until late_init. At that point genpd already
tries to power off unused PM domains, so it seems like a decent match.

Cases which can't be covered within the window of until late_init needs
to be adressed separately and likely through a more common long term
solution.


Ulf Hansson (4):
  PM / Domains: Remove pm_genpd_dev_need_restore() API
  ARM: exynos: Ensure PM domains are powered at initialization
  PM / Domains: Expect PM domains being powered at initialization
  PM / Domains: Enforce PM domains to stay powered during boot

 arch/arm/mach-exynos/pm_domains.c   |  7 ---
 arch/arm/mach-s3c64xx/pm.c  |  4 ++--
 arch/arm/mach-shmobile/pm-r8a7779.c |  2 +-
 arch/arm/mach-shmobile/pm-rmobile.c |  2 +-
 drivers/base/power/domain.c | 42 -
 include/linux/pm_domain.h   |  7 +++
 6 files changed, 29 insertions(+), 35 deletions(-)

-- 
1.9.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: 3.17-rc6 on ODROID: ERROR: Bad of_node_put() on /ehci@12580000/port@1

2014-10-01 Thread Daniel Drake
On Wed, Oct 1, 2014 at 12:36 AM, Vivek Gautam gautam.vi...@samsung.com wrote:
 One reason i doubt why it could be coming is because we are
 specifically putting the
 child after doing everything with it.

 When we are getting the child node using for_each_available_child_of_node(),
 which calls for of_get_next_available_child(). So 
 of_get_next_available_child()
 does a of_node_put() on the prev node, in case we have siblings to the 
 child.

 Can you see if the below change helps ?

 
 diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
 index 7189f2e..1b726bf 100644
 --- a/drivers/usb/host/ehci-exynos.c
 +++ b/drivers/usb/host/ehci-exynos.c
 @@ -74,7 +74,6 @@ static int exynos_ehci_get_phy(struct device *dev,

 phy = devm_of_phy_get(dev, child, NULL);
 exynos_ehci-phy[phy_number] = phy;
 -   of_node_put(child);
 if (IS_ERR(phy)) {
 ret = PTR_ERR(phy);
 if (ret == -EPROBE_DEFER) {
 


 This is on top of usb-next.
 If you are testing on rc6 only, then probably you will have to cherrypick two
 patches each for ehci-exynos and ohci-exynos:
 usb: host: ehci-exynos: Remove unnecessary usb-phy support
 usb: host: ohci-exynos: Remove unnecessary usb-phy support

I made the equivalent change to 3.17-rc7 (right now 3.17 is my main
interest), i.e. removed all of_node_put calls from
exynos_ehci_get_phy(). Same change is needed in exynos_ohci_get_phy().
Now the warnings are gone.
BTW, I think the warning only appeared when CONFIG_OF_SELFTEST=y

I didn't check the implementation details like you did, but I looked
at a few other users of for_each_available_child_of_node and it looks
like indeed you do not need to call of_node_put() on the children in
the normal case, or at least, nobody else does.

Thanks,
Daniel
--
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] drm/exynos: remove DRM_EXYNOS_GEM_MAP_OFFSET ioctl

2014-10-01 Thread Tomasz Figa
Hi Inki,

On 17.09.2014 15:48, Inki Dae wrote:
 This interface and relevant codes aren't used anymore.
 

Hmm, I might be missing something, but after removing this IOCTL, how do
we obtain an offset to pass to mmap()?

Best regards,
Tomasz
--
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 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Doug Anderson
Hi,

On Wed, Oct 1, 2014 at 6:06 AM, Bartlomiej Zolnierkiewicz
b.zolnier...@samsung.com wrote:

 Hi,

 On Tuesday, September 30, 2014 10:22:34 AM Doug Anderson wrote:
 Bartlomiej

 On Mon, Sep 29, 2014 at 5:31 AM, Bartlomiej Zolnierkiewicz
 b.zolnier...@samsung.com wrote:
 
  Hi,
 
  On Friday, August 29, 2014 01:34:44 PM Ulf Hansson wrote:
  On 22 August 2014 15:47, Yuvaraj Kumar C D yuvaraj...@gmail.com wrote:
   This patch makes use of mmc_regulator_get_supply() to handle
   the vmmc and vqmmc regulators.Also it moves the code handling
   the these regulators to dw_mci_set_ios().It turned on the vmmc
   and vqmmc during MMC_POWER_UP and MMC_POWER_ON,and turned off
   during MMC_POWER_OFF.
  
   Signed-off-by: Yuvaraj Kumar C D yuvaraj...@samsung.com
 
  Thanks! Applied for next.
 
  Unfortunately this patch breaks mmc1 card (Kingston 32GB micro SDHC)
  detection on Exynos5420 Arndale Octa for me:
 
  [   10.797979] dwmmc_exynos 1222.mmc: no support for card's volts
  [   10.797998] mmc1: error -22 whilst initialising SD card
 
  Without the patch:
 
  [   10.866926] mmc_host mmc1: Bus speed (slot 0) = 5000Hz (slot req 
  5000Hz, actual 5000HZ div = 0)
  [   10.866977] mmc1: new high speed SDHC card at address 1234
  [   10.868730] mmcblk1: mmc1:1234 SA32G 29.3 GiB
  [   10.915054]  mmcblk1: p1 p2 p3
 
  The config is attached (exynos_defconfig doesn't work correctly for
  this board yet).

 Yup, this is an expected behavior, unfortunately.  This was talked
 about extensively during the review of this patch series.

 Do you mean that a patch with a known regression has been merged
 into next branch of mmc tree?  It would be quite sad if it would be
 true.

...so looking at your dts file, it looks like this _isn't_ your
problem.  Your vmmc regulator is listed as always on, so I believe
that you're OK.  Your regulator probably _shouldn't_ be always on
(it prevents power cycling the SD card) but right now it's good that
it is...

If any board has a vmmc that is not listed as always on then it
would regress with the first two patches applied (and without the
3rd), but there are none that I personally know of that do.
--
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: 3.17-rc6 on ODROID: ERROR: Bad of_node_put() on /ehci@12580000/port@1

2014-10-01 Thread Grant Likely
On Wed, Oct 1, 2014 at 4:12 PM, Daniel Drake dr...@endlessm.com wrote:
 On Wed, Oct 1, 2014 at 12:36 AM, Vivek Gautam gautam.vi...@samsung.com 
 wrote:
 One reason i doubt why it could be coming is because we are
 specifically putting the
 child after doing everything with it.

 When we are getting the child node using for_each_available_child_of_node(),
 which calls for of_get_next_available_child(). So 
 of_get_next_available_child()
 does a of_node_put() on the prev node, in case we have siblings to the 
 child.

 Can you see if the below change helps ?

 
 diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
 index 7189f2e..1b726bf 100644
 --- a/drivers/usb/host/ehci-exynos.c
 +++ b/drivers/usb/host/ehci-exynos.c
 @@ -74,7 +74,6 @@ static int exynos_ehci_get_phy(struct device *dev,

 phy = devm_of_phy_get(dev, child, NULL);
 exynos_ehci-phy[phy_number] = phy;
 -   of_node_put(child);
 if (IS_ERR(phy)) {
 ret = PTR_ERR(phy);
 if (ret == -EPROBE_DEFER) {
 


 This is on top of usb-next.
 If you are testing on rc6 only, then probably you will have to cherrypick two
 patches each for ehci-exynos and ohci-exynos:
 usb: host: ehci-exynos: Remove unnecessary usb-phy support
 usb: host: ohci-exynos: Remove unnecessary usb-phy support

 I made the equivalent change to 3.17-rc7 (right now 3.17 is my main
 interest), i.e. removed all of_node_put calls from
 exynos_ehci_get_phy(). Same change is needed in exynos_ohci_get_phy().
 Now the warnings are gone.
 BTW, I think the warning only appeared when CONFIG_OF_SELFTEST=y

 I didn't check the implementation details like you did, but I looked
 at a few other users of for_each_available_child_of_node and it looks
 like indeed you do not need to call of_node_put() on the children in
 the normal case, or at least, nobody else does.

CONFIG_OF_SELFTEST enables CONFIG_OF_DYNAMIC, and reference counting
is only implemented when OF_DYNAMIC is enabled. That's probably why
selftest exposes the problem.

g.
--
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: [GIT PULL 1/2] Second Samsung DT updates for v3.18

2014-10-01 Thread Arnd Bergmann
On Wednesday 24 September 2014, Kukjin Kim wrote:
 Hi Arnd, Olof and Kevin
 
 Here is second bunch of Samsung DT updates for v3.18.
 
 This is based on previous pull-request for tags/samsung-dt but not yet 
 pulled into arm-soc.
 
 Please pull and if any problems, kindly let me know.
 

Pulled into next/late for now, I didn't pull it last week as the merge
window seemed imminent, but it may still have a chance now.

Arnd
--
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: [GIT PULL 2/2] Exynos PM updates for v3.18

2014-10-01 Thread Arnd Bergmann
On Wednesday 24 September 2014, Kukjin Kim wrote:
 The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:
 
Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)
 
 are available in the git repository at:
 
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
 tags/exynos-pm
 
 for you to fetch changes up to c3294253713cbc96df59a7cc6a9a3fc0c4ae5ba7:
 
ARM: EXYNOS: Refactor the pm code to use DT based lookup (2014-09-24 
 16:45:14 +0900)
 
 
 PM related updates for exynos v3.18
 
 - Refactor the pm code to use DT based lookup instead of
using soc_is_exynos
 - While at it, move exynos5250 specific disabling of JPEG
USE_RETENTION to pmu.c

Pulled into next/late, thanks,

Arnd
--
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: [GIT PULL 1/3] 3rd Round for Samsung-cleanup-2 for v3.18

2014-10-01 Thread Arnd Bergmann
On Thursday 25 September 2014, Kukjin Kim wrote:
 The following changes since commit f6361c6b3880063c2248d4e453331e3dc1efbf83:
 
ARM: S3C24XX: remove separate restart code (2014-09-14 02:43:09 +0900)
 
 are available in the git repository at:
 
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git 
 tags/samsung-cleanup-2
 
 for you to fetch changes up to 5a1f0c6d3161a37da3a651f80b18febc2e5d7b75:
 
ARM: EXYNOS: Fix CPU idle clock down after CPU off (2014-09-14 
 02:49:32 +0900)
 
 
 Samsung 2nd cleanup for v3.18
 
 - Cleanup SMP/hotplug codes from hotplug.c to platsmp.c
 
 - Remove unneeded __ref annotation for exynos_cpu_die()
 
 - Fix the way to power down CPU on exynos4 and CPUidle
clock down after power down some CPU

Pulled into next/late with a fixup, see below. Your original changen broke
allmodconfig.

Arnd

From 9bbebfb41db4109b23d330f14ce41e4ebc825716 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann a...@arndb.de
Date: Fri, 26 Sep 2014 23:09:38 +0200
Subject: [PATCH] ARM: EXYNOS: fix build error in platsmp.c

/tmp/ccYeWL3V.s: Assembler messages:
/tmp/ccYeWL3V.s:659: Error: selected processor does not support ARM mode `isb '
/tmp/ccYeWL3V.s:664: Error: selected processor does not support ARM mode `isb '
/tmp/ccYeWL3V.s:665: Error: selected processor does not support ARM mode `dsb '
make[3]: *** [arch/arm/mach-exynos/platsmp.o] Error 1

Signed-off-by: Arnd Bergmann a...@arndb.de
Fixes: 17342534e1d932 (ARM: EXYNOS: Move code from hotplug.c to platsmp.c)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 0095de99d703..5d336b43cb10 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_PM_SLEEP)+= pm.o sleep.o
 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
+CFLAGS_platsmp.o   := -march=armv7-a
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o:=-Wa,-march=armv7-a$(plus_sec)
--
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: [GIT PULL 2/3] 3rd Round of Samsung-DT-3 updates for v3.18

2014-10-01 Thread Arnd Bergmann
On Thursday 25 September 2014, Kukjin Kim wrote:
 Samsung 3rd DT updates for v3.18
 
 - Fix rebase conflcits in previous tags/samsung-dt-2
: Fix chip select GPIO for exynos5250-smdk5250
: Remove display timings node for exynos5250-snow
 
 - Fix Exynos USB on kernels with USB Gadget support
: Explicitly set dr_mode for the dwc3 controller
for exynos5420-arndale-octa, exynos5420-peach-pit
and exynos5800-peach-pi boards
 
 - add CPU nodes for exynos4210, exynos4212, exynos4412
 

Pulled into next/late, thanks

Arnd
--
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: [GIT PULL 3/3] 3rd Round of Exynos-PM-2 Updates for v3.18

2014-10-01 Thread Arnd Bergmann
On Thursday 25 September 2014, Kukjin Kim wrote:
 Exynos 2nd PM related updates for v3.18
 
 - Firmware supporting suspend and resume to excute of low
level operations to enter and leave power mode for exynos
: introduce suspend() and resume() firmware operations
 
 - Fix AFTR mode on boards with secure firmware enabled and
allows exynos cpuidle driver usage on exynos4x12 SoCs
 
 - Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=y
 
 - SWRESET is needed to boot secondary CPU on exynos3250
 

I needed another fixup to make this build, but I'm not sure about
whether this is the right solution.

I decided not to pull this one, please test again with and without
my patch for the case that ARM_CPU_SUSPEND is disabled.

Arnd

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 64324bf5edb4..aaab67d84bf6 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -14,9 +14,9 @@ obj-  :=
 
 # Core
 
-obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o 
sleep.o
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o
 
-obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o
+obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
 
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index 2c5bc6bfcbdf..b7ff8f25bf4a 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -129,11 +129,11 @@ static int exynos_resume(void)
 }
 
 static const struct firmware_ops exynos_firmware_ops = {
-   .do_idle= exynos_do_idle,
+   .do_idle= IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? 
exynos_do_idle : NULL,
.set_cpu_boot_addr  = exynos_set_cpu_boot_addr,
.cpu_boot   = exynos_cpu_boot,
-   .suspend= exynos_suspend,
-   .resume = exynos_resume,
+   .suspend= IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_suspend 
: NULL,
+   .resume = IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_resume : 
NULL,
 };
 
 void __init exynos_firmware_init(void)
--
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 1/3] mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators

2014-10-01 Thread Doug Anderson
Hi,

On Wed, Oct 1, 2014 at 7:00 AM, Bartlomiej Zolnierkiewicz
b.zolnier...@samsung.com wrote:

 Hi,

 On Wednesday, October 01, 2014 12:47:52 AM YUVARAJ CD wrote:

 Since I am out of station, i dont have an access to my work set up.
 Can you send me the dts entries of sd crad and their corresponding regulator 
 entries?

 From arch/arm/boot/dts/exynos5420-arndale-octa.dts:

 ...
 mmc@1220 {
 status = okay;
 broken-cd;
 supports-highspeed;
 card-detect-delay = 200;
 samsung,dw-mshc-ciu-div = 3;
 samsung,dw-mshc-sdr-timing = 0 4;
 samsung,dw-mshc-ddr-timing = 0 2;
 pinctrl-names = default;
 pinctrl-0 = sd0_clk sd0_cmd sd0_bus4 sd0_bus8;
 vmmc-supply = ldo10_reg;

 slot@0 {
 reg = 0;
 bus-width = 8;
 };
 };

 mmc@1222 {
 status = okay;
 supports-highspeed;
 card-detect-delay = 200;
 samsung,dw-mshc-ciu-div = 3;
 samsung,dw-mshc-sdr-timing = 2 3;
 samsung,dw-mshc-ddr-timing = 1 2;
 pinctrl-names = default;
 pinctrl-0 = sd2_clk sd2_cmd sd2_cd sd2_bus4;
 vmmc-supply = ldo10_reg;

 slot@0 {
 reg = 0;
 bus-width = 4;
 };
 };
 ...
 ldo10_reg: LDO10 {
 regulator-name = PVDD_PRE_1V8;
 regulator-min-microvolt = 180;
 regulator-max-microvolt = 180;
 regulator-always-on;
 };

I don't have schematics for Arndale Octa, but the above is really
fishy.  vmmc shouldn't be 1.8V.  That's the general power signal to
MMC and should be 2.7V - 3.6V.  vqmmc could be 1.8V in certain
situations, but my understanding is that for maximum compatibility it
should at least start out identical to vmmc (and later go down to
1.7V - 1.95V).

My first thought would be to just remove the vmmc-supply from your
DTS.  I think we could land that and pick it back easily.  That will
get you something working and won't introduce any regressions because:
1. MMC core will give you a dummy regulator
2. The code will default to assuming that vmmc is 3.3V, which is what
it used to do anyway.
3. The only referenced regulator is always on anyway.

Separately you could specify a proper vmmc and maybe even a vqmmc.

On SMDK5420 I see this for the SD card (mmc2):
* vmmc should be VDD_SD_2V8.  From LDO19.
* vqmmc should be VDDQ_MMC2_AP.  From LDO13.

OK, I dug up the Arndale schematics.  For mmc2:
* vmmc should be PVDD_TFLASH_2V8.  That's LDO19.
* vqmmc (hooked up to VDDQ_MMC2): PVDD_APIO_MMCOFF_2V8.  LDO13 just like SMDK.

...sadly it looks like Anrdale has a schematics problem that prevents
you from doing UHS.  I see that the data lines are pulled up to
PVDD_TFLASH_2V8 (vmmc), not pulled up to PVDD_APIO_MMCOFF_2V8 (vqmmc).
I think that means that if you ever lower vqmmc to 1.8V (as needed for
UHS) then you'll still be pulling up to 2.8V.  That's not good.  You
should probably make sure that both LDO13 and LDO19 are listed as
being exactly 2.8V.


Anyway, the above has (obviously) not been tested and is just based on
a casual browsing of schematics.  Please let me know how it goes.



-Doug
--
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 2/4] ARM: exynos: Ensure PM domains are powered at initialization

2014-10-01 Thread Sylwester Nawrocki
On 01/10/14 16:41, Ulf Hansson wrote:
 At -probe() it's common practice for drivers/subsystems to bring their
 devices to full power and without depending on CONFIG_PM_RUNTIME.
 
 We could also expect that drivers/subsystems requires their device's
 corresponding PM domains to be powered, to successfully complete a
 -probe() sequence.
 
 Align to the behavior above, by ensuring all PM domains are powered
 prior initialization of a generic PM domain.
 
 Do note, since the generic PM domain will try to power off unused PM
 domains at late_init, there should be no increased power consumption
 over time, but potentially during boot.

Wouldn't it be a better idea to power on the power domains which are
turned off only when CONFIG_PM_RUNTIME is not enabled ? I had a plan
to submit a patch doing that but unfortunately this has fallen through
the cracks. At the moment mach-exynos/pm_domains.c is not even built in
when CONFIG_PM_RUNTIME is disabled.

I don't like the behaviour introduced in this patch to be the default,
i.e. turning all possible power domains during boot sequence, even if
some are not used and not needed. While we're trying to decrease the
power consumption in any possible way this doesn't help at all.

 Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
 ---
  arch/arm/mach-exynos/pm_domains.c | 7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/arch/arm/mach-exynos/pm_domains.c 
 b/arch/arm/mach-exynos/pm_domains.c
 index 20f2671..58e18e9 100644
 --- a/arch/arm/mach-exynos/pm_domains.c
 +++ b/arch/arm/mach-exynos/pm_domains.c
 @@ -112,7 +112,7 @@ static __init int exynos4_pm_init_power_domain(void)
  
   for_each_compatible_node(np, NULL, samsung,exynos4210-pd) {
   struct exynos_pm_domain *pd;
 - int on, i;
 + int i;
   struct device *dev;
  
   pdev = of_find_device_by_node(np);
 @@ -155,9 +155,10 @@ static __init int exynos4_pm_init_power_domain(void)
   clk_put(pd-oscclk);
  
  no_clk:
 - on = __raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN;
 + if (!(__raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN))
 + exynos_pd_power_on(pd-pd);
  
 - pm_genpd_init(pd-pd, NULL, !on);
 + pm_genpd_init(pd-pd, NULL, false);
   of_genpd_add_provider_simple(np, pd-pd);
   }

--
Thanks,
Sylwester
--
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 1/4] PM / Domains: Remove pm_genpd_dev_need_restore() API

2014-10-01 Thread Sylwester Nawrocki
On 01/10/14 16:41, Ulf Hansson wrote:
 There are currently no users of this API, let's remove it.

The sad fact is that removal of pm_genpd_dev_need_restore() calls
from arch/arm/mach-exynos/pm_domains.c introduces regressions in
multiple exynos drivers (I'm sure it breaks media drivers).
I think before doing such changes all relevant drivers should be
updated first. I need to take a closer look again, but it seems
after dropping the pm_genpd_dev_need_restore() calls, client
driver's runtime_resume() callback is not being called in response
to first pm_runtime_get(_sync) call, even if a device is runtime
pm active.

More details can be found in commit ebc35c726298ba3fdebba316a
'ARM: EXYNOS: register devices in 'need_restore' state for pm_domains'.

The above only happens when devices are added to an inactive power
domain, then I guess patch 2/4 is also an attempt to address this
issue ?

--
Thanks,
Sylwester






--
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 v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol

2014-10-01 Thread Abhilash Kesavan
Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
specific code.

Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
Reviewed-by: Tomasz Figa tomasz.f...@gmail.com
---
Changes in v2:
- Re-ordered the patches
- Added a define for number of uart ports in 
arch/arm/plat-samsung/init.c
- Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c

Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
and arm64's defconfig with and without the serial driver enabled. Boot tested
on Exynos5420 and Exynos7.

 arch/arm/mach-s3c64xx/irq-pm.c |6 +++---
 arch/arm/plat-samsung/init.c   |7 ++-
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index ae4ea76..b20024e 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -55,10 +55,10 @@ static struct irq_grp_save {
u32 mask;
 } eint_grp_save[5];
 
-#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
-#define SERIAL_SAMSUNG_UARTS 0
+#ifndef CONFIG_SERIAL_SAMSUNG
+#define SERIAL_SAMSUNG_UARTS   0
 #else
-#defineSERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
+#define SERIAL_SAMSUNG_UARTS   4
 #endif
 
 static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 11fbbc2..6114942 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
 /* uart management */
 #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
 static int nr_uarts __initdata = 0;
+#define MAX_UART_PORTS 4
 
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
-static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
-#endif
+static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
 
 /* s3c24xx_init_uartdevs
  *
@@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
  struct s3c24xx_uart_resources *res,
  struct s3c2410_uartcfg *cfg, int no)
 {
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
struct platform_device *platdev;
struct s3c2410_uartcfg *cfgptr = uart_cfgs;
struct s3c24xx_uart_resources *resp;
@@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
}
 
nr_uarts = no;
-#endif
 }
 
 void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
-- 
1.7.9.5

--
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 v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs

2014-10-01 Thread Abhilash Kesavan
Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
select the number of UART ports available on the SoC. Replace the usage
of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
UART ports possible. Removal of these symbols also helps in Exynos7
serial enablement.

Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com
Reviewed-by: Tomasz Figa tomasz.f...@gmail.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
---
 drivers/tty/serial/Kconfig   |   16 
 drivers/tty/serial/samsung.c |   11 +++
 drivers/tty/serial/samsung.h |5 -
 3 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 81f6ee7..9fc9092 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
  provide all of these ports, depending on how the serial port
  pins are configured.
 
-config SERIAL_SAMSUNG_UARTS_4
-   bool
-   depends on PLAT_SAMSUNG
-   default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
-   help
- Internal node for the common case of 4 Samsung compatible UARTs
-
-config SERIAL_SAMSUNG_UARTS
-   int
-   depends on PLAT_SAMSUNG
-   default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
-   default 3
-   help
- Select the number of available UART ports for the Samsung S3C
- serial driver
-   
 config SERIAL_SAMSUNG_DEBUG
bool Samsung SoC serial debug
depends on SERIAL_SAMSUNG  DEBUG_LL
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a..ba04c6d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
 static struct uart_driver s3c24xx_uart_drv = {
.owner  = THIS_MODULE,
.driver_name= s3c2410_serial,
-   .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
+   .nr = MAX_SAMSUNG_UARTS,
.cons   = S3C24XX_SERIAL_CONSOLE,
.dev_name   = S3C24XX_SERIAL_NAME,
.major  = S3C24XX_SERIAL_MAJOR,
.minor  = S3C24XX_SERIAL_MINOR,
 };
 
-static struct s3c24xx_uart_port 
s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
+static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
[0] = {
.port = {
.lock   = 
__SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
@@ -992,8 +992,6 @@ static struct s3c24xx_uart_port 
s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line   = 1,
}
},
-#if CONFIG_SERIAL_SAMSUNG_UARTS  2
-
[2] = {
.port = {
.lock   = 
__SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
@@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port 
s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line   = 2,
}
},
-#endif
-#if CONFIG_SERIAL_SAMSUNG_UARTS  3
[3] = {
.port = {
.lock   = 
__SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
@@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port 
s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line   = 3,
}
}
-#endif
 };
 
 /* s3c24xx_serial_resetport
@@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char 
*options)
 
/* is this a valid port */
 
-   if (co-index == -1 || co-index = CONFIG_SERIAL_SAMSUNG_UARTS)
+   if (co-index == -1 || co-index = MAX_SAMSUNG_UARTS)
co-index = 0;
 
port = s3c24xx_serial_ports[co-index].port;
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index eb071dd..484b49e 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -1,6 +1,9 @@
 #ifndef __SAMSUNG_H
 #define __SAMSUNG_H
 
+/* Maximum UART ports available */
+#define MAX_SAMSUNG_UARTS   4
+
 /*
  * Driver for Samsung SoC onboard UARTs.
  *
@@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
 struct s3c24xx_serial_drv_data {
struct s3c24xx_uart_info*info;
struct s3c2410_uartcfg  *def_cfg;
-   unsigned intfifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
+   unsigned intfifosize[MAX_SAMSUNG_UARTS];
 };
 
 struct s3c24xx_uart_port {
-- 
1.7.9.5

--
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: [GIT PULL 3/3] 3rd Round of Exynos-PM-2 Updates for v3.18

2014-10-01 Thread Bartlomiej Zolnierkiewicz

Hi,

On Wednesday, October 01, 2014 06:01:29 PM Arnd Bergmann wrote:
 On Thursday 25 September 2014, Kukjin Kim wrote:
  Exynos 2nd PM related updates for v3.18
  
  - Firmware supporting suspend and resume to excute of low
 level operations to enter and leave power mode for exynos
 : introduce suspend() and resume() firmware operations
  
  - Fix AFTR mode on boards with secure firmware enabled and
 allows exynos cpuidle driver usage on exynos4x12 SoCs
  
  - Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=y
  
  - SWRESET is needed to boot secondary CPU on exynos3250
  
 
 I needed another fixup to make this build, but I'm not sure about
 whether this is the right solution.

Could you please share the build errors and the used config?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

 I decided not to pull this one, please test again with and without
 my patch for the case that ARM_CPU_SUSPEND is disabled.
 
   Arnd
 
 diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
 index 64324bf5edb4..aaab67d84bf6 100644
 --- a/arch/arm/mach-exynos/Makefile
 +++ b/arch/arm/mach-exynos/Makefile
 @@ -14,9 +14,9 @@ obj-:=
  
  # Core
  
 -obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o 
 sleep.o
 +obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o
  
 -obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o
 +obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
  obj-$(CONFIG_PM_SLEEP)   += suspend.o
  obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
  
 diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
 index 2c5bc6bfcbdf..b7ff8f25bf4a 100644
 --- a/arch/arm/mach-exynos/firmware.c
 +++ b/arch/arm/mach-exynos/firmware.c
 @@ -129,11 +129,11 @@ static int exynos_resume(void)
  }
  
  static const struct firmware_ops exynos_firmware_ops = {
 - .do_idle= exynos_do_idle,
 + .do_idle= IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? 
 exynos_do_idle : NULL,
   .set_cpu_boot_addr  = exynos_set_cpu_boot_addr,
   .cpu_boot   = exynos_cpu_boot,
 - .suspend= exynos_suspend,
 - .resume = exynos_resume,
 + .suspend= IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_suspend 
 : NULL,
 + .resume = IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_resume : 
 NULL,
  };
  
  void __init exynos_firmware_init(void)

--
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: [GIT PULL 3/3] 3rd Round of Exynos-PM-2 Updates for v3.18

2014-10-01 Thread Arnd Bergmann
On Wednesday 01 October 2014 18:49:20 Bartlomiej Zolnierkiewicz wrote:
 On Wednesday, October 01, 2014 06:01:29 PM Arnd Bergmann wrote:
  On Thursday 25 September 2014, Kukjin Kim wrote:
   Exynos 2nd PM related updates for v3.18
   
   - Firmware supporting suspend and resume to excute of low
  level operations to enter and leave power mode for exynos
  : introduce suspend() and resume() firmware operations
   
   - Fix AFTR mode on boards with secure firmware enabled and
  allows exynos cpuidle driver usage on exynos4x12 SoCs
   
   - Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=y
   
   - SWRESET is needed to boot secondary CPU on exynos3250
   
  
  I needed another fixup to make this build, but I'm not sure about
  whether this is the right solution.
 
 Could you please share the build errors and the used config?

I'm building with an additional series that works around all known
build failures in randconfig, so it's possible that the configuration
causes other problems in your tree, or that one of my own patches
introduces the problem and the exynos tree by itself is fine.

This is the build error I get:

arch/arm/mach-exynos/built-in.o: In function `exynos_suspend':
:(.text+0x294): undefined reference to `cpu_suspend'
:(.text+0x29c): undefined reference to `cpu_suspend'
arch/arm/mach-exynos/built-in.o: In function `skip_cp15':
:(.data+0x58): undefined reference to `cpu_resume'
arch/arm/mach-exynos/built-in.o: In function `cp15_save_power':
:(.data+0x70): undefined reference to `cpu_resume'

The defconfig file is attached, the details don't matter to
other readers, except that it has CONFIG_ARM_CPU_SUSPEND
disabled, which means that sleep.S can't be linked properly.

Arnd#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.17.0-rc6 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_NO_IOPORT_MAP=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_BANDGAP=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_VECTORS_BASE=0x
CONFIG_PHYS_OFFSET=0x0080
CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_LZMA=y
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME=(none)
# CONFIG_SYSVIPC is not set
CONFIG_FHANDLE=y
# CONFIG_USELIB is not set

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y

#
# Timers subsystem
#
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ_FULL is not set
CONFIG_NO_HZ=y
# CONFIG_HIGH_RES_TIMERS is not set

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_TASKS_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_RCU_USER_QS=y
# CONFIG_CONTEXT_TRACKING_FORCE is not set
CONFIG_RCU_FANOUT=32
CONFIG_RCU_FANOUT_LEAF=16
CONFIG_RCU_FANOUT_EXACT=y
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_NOCB_CPU is not set
# CONFIG_BUILD_BIN2C is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
CONFIG_GENERIC_SCHED_CLOCK=y
# CONFIG_CGROUPS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
# CONFIG_NAMESPACES is not set
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
# CONFIG_RD_LZO is not set
CONFIG_RD_LZ4=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_PRINTK is not set
# CONFIG_BUG is not set
CONFIG_ELF_CORE=y
# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# CONFIG_SIGNALFD is not set
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
# CONFIG_AIO is not set
# CONFIG_ADVISE_SYSCALLS is not set
# CONFIG_EMBEDDED 

Re: [PATCH v2 2/4] ARM: exynos: Ensure PM domains are powered at initialization

2014-10-01 Thread Rafael J. Wysocki
On Wednesday, October 01, 2014 06:18:58 PM Sylwester Nawrocki wrote:
 On 01/10/14 16:41, Ulf Hansson wrote:
  At -probe() it's common practice for drivers/subsystems to bring their
  devices to full power and without depending on CONFIG_PM_RUNTIME.
  
  We could also expect that drivers/subsystems requires their device's
  corresponding PM domains to be powered, to successfully complete a
  -probe() sequence.
  
  Align to the behavior above, by ensuring all PM domains are powered
  prior initialization of a generic PM domain.
  
  Do note, since the generic PM domain will try to power off unused PM
  domains at late_init, there should be no increased power consumption
  over time, but potentially during boot.
 
 Wouldn't it be a better idea to power on the power domains which are
 turned off only when CONFIG_PM_RUNTIME is not enabled ? I had a plan
 to submit a patch doing that but unfortunately this has fallen through
 the cracks. At the moment mach-exynos/pm_domains.c is not even built in
 when CONFIG_PM_RUNTIME is disabled.
 
 I don't like the behaviour introduced in this patch to be the default,
 i.e. turning all possible power domains during boot sequence, even if
 some are not used and not needed. While we're trying to decrease the
 power consumption in any possible way this doesn't help at all.

Agreed (as stated before).

And I'm wondering why that comment of mine was ignored?

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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] drm/exynos: remove DRM_EXYNOS_GEM_MAP_OFFSET ioctl

2014-10-01 Thread Joonyoung Shim
Hi Tomasz,

On 10/02/2014 12:13 AM, Tomasz Figa wrote:
 Hi Inki,
 
 On 17.09.2014 15:48, Inki Dae wrote:
 This interface and relevant codes aren't used anymore.

 
 Hmm, I might be missing something, but after removing this IOCTL, how do
 we obtain an offset to pass to mmap()?

There is DRM_IOCTL_MODE_MAP_DUMB, it can get mmap offset before mmap and
the offset is passed via mmap.

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 v2 3/4] PM / Domains: Expect PM domains being powered at initialization

2014-10-01 Thread Simon Horman
On Wed, Oct 01, 2014 at 04:41:33PM +0200, Ulf Hansson wrote:
 At -probe() it's common practice for drivers/subsystems to bring their
 devices to full power and without depending on CONFIG_PM_RUNTIME.
 
 We could also expect that drivers/subsystems requires their device's
 corresponding PM domains to be powered, to successfully complete a
 -probe() sequence.
 
 Align the generic PM domain to the behavior above, by enforcing a PM
 domain to be powered at initialization.
 
 Previous patch changed the only call of pm_genpd_init() with true for
 the is_off parameter into false. Thus all calls of pm_genpd_init()
 now uses false as the value for is_off.
 
 To make it clear that genpd currently only supports powered PM domains
 at init, let's also remove the is_off parameter from the API.
 
 Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
 Acked-by: Geert Uytterhoeven geert+rene...@glider.be
 ---
  arch/arm/mach-exynos/pm_domains.c   | 2 +-
  arch/arm/mach-s3c64xx/pm.c  | 4 ++--
  arch/arm/mach-shmobile/pm-r8a7779.c | 2 +-
  arch/arm/mach-shmobile/pm-rmobile.c | 2 +-
  drivers/base/power/domain.c | 5 ++---
  include/linux/pm_domain.h   | 4 ++--
  6 files changed, 9 insertions(+), 10 deletions(-)

I am mildly concerned about the potential for conflicts in
arch/arm/mach-shmobile/. But I think that taking this through Rafael's tree
is consistent with how we have handled things before.

So, providing it can appear in v3.18-rc1, in which case I can
rebase anything in my tree to avoid conflicts bubling up:

Acked-by: Simon Horman horms+rene...@verge.net.au

 diff --git a/arch/arm/mach-exynos/pm_domains.c 
 b/arch/arm/mach-exynos/pm_domains.c
 index 58e18e9..f2e5096 100644
 --- a/arch/arm/mach-exynos/pm_domains.c
 +++ b/arch/arm/mach-exynos/pm_domains.c
 @@ -158,7 +158,7 @@ no_clk:
   if (!(__raw_readl(pd-base + 0x4)  INT_LOCAL_PWR_EN))
   exynos_pd_power_on(pd-pd);
  
 - pm_genpd_init(pd-pd, NULL, false);
 + pm_genpd_init(pd-pd, NULL);
   of_genpd_add_provider_simple(np, pd-pd);
   }
  
 diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
 index aaf7bea..42dead0 100644
 --- a/arch/arm/mach-s3c64xx/pm.c
 +++ b/arch/arm/mach-s3c64xx/pm.c
 @@ -315,10 +315,10 @@ int __init s3c64xx_pm_init(void)
  
   for (i = 0; i  ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++)
   pm_genpd_init(s3c64xx_always_on_pm_domains[i]-pd,
 -   pm_domain_always_on_gov, false);
 +   pm_domain_always_on_gov);
  
   for (i = 0; i  ARRAY_SIZE(s3c64xx_pm_domains); i++)
 - pm_genpd_init(s3c64xx_pm_domains[i]-pd, NULL, false);
 + pm_genpd_init(s3c64xx_pm_domains[i]-pd, NULL);
  
  #ifdef CONFIG_S3C_DEV_FB
   if (dev_get_platdata(s3c_device_fb.dev))
 diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c 
 b/arch/arm/mach-shmobile/pm-r8a7779.c
 index 82fe3d7..c20ef44 100644
 --- a/arch/arm/mach-shmobile/pm-r8a7779.c
 +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
 @@ -83,7 +83,7 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain 
 *r8a7779_pd)
  {
   struct generic_pm_domain *genpd = r8a7779_pd-genpd;
  
 - pm_genpd_init(genpd, NULL, false);
 + pm_genpd_init(genpd, NULL);
   genpd-dev_ops.stop = pm_clk_suspend;
   genpd-dev_ops.start = pm_clk_resume;
   genpd-dev_ops.active_wakeup = pd_active_wakeup;
 diff --git a/arch/arm/mach-shmobile/pm-rmobile.c 
 b/arch/arm/mach-shmobile/pm-rmobile.c
 index 818de2f..e6a0490 100644
 --- a/arch/arm/mach-shmobile/pm-rmobile.c
 +++ b/arch/arm/mach-shmobile/pm-rmobile.c
 @@ -107,7 +107,7 @@ static void rmobile_init_pm_domain(struct 
 rmobile_pm_domain *rmobile_pd)
   struct generic_pm_domain *genpd = rmobile_pd-genpd;
   struct dev_power_governor *gov = rmobile_pd-gov;
  
 - pm_genpd_init(genpd, gov ? : simple_qos_governor, false);
 + pm_genpd_init(genpd, gov ? : simple_qos_governor);
   genpd-dev_ops.stop = pm_clk_suspend;
   genpd-dev_ops.start= pm_clk_resume;
   genpd-dev_ops.active_wakeup= rmobile_pd_active_wakeup;
 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
 index 36871b3..cfb76e8 100644
 --- a/drivers/base/power/domain.c
 +++ b/drivers/base/power/domain.c
 @@ -1836,10 +1836,9 @@ static int pm_genpd_default_restore_state(struct 
 device *dev)
   * pm_genpd_init - Initialize a generic I/O PM domain object.
   * @genpd: PM domain object to initialize.
   * @gov: PM domain governor to associate with the domain (may be NULL).
 - * @is_off: Initial value of the domain's power_is_off field.
   */
  void pm_genpd_init(struct generic_pm_domain *genpd,
 -struct dev_power_governor *gov, bool is_off)
 +struct dev_power_governor *gov)
  {
   if (IS_ERR_OR_NULL(genpd))
   return;
 @@ -1852,7 +1851,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
   

[PATCH] ARM: dts: add board dts file for Exynos3250-based Monk board

2014-10-01 Thread YoungJun Cho
From: Youngjun Cho yj44@samsung.com

This patch adds new board dts file to support Samsung Monk board which is
based on Exynos3250 SoC and has different H/W configuration from Rinato.

This patch is based on linux-samsung.git for-next branch and depends on
[PATCH 0/2] ARM: dts: Add new board dts file for Exynos3250-based Rinato 
board[1]

This dts file support following features:
- eMMC
- Main PMIC (Samsung S2MPS14)
- Interface PMIC (Maxim MAX77836, MUIC, fuel-gauge, charger)
- RTC of Exynos3250
- ADC of Exynos3250 with NTC thermistor
- I2S of Exynos3250
- TMU of Exynos3250
- Secure firmware for Exynos3250 secondary cpu boot
- Serial ports of Exynos3250
- gpio-key for power key

[1] http://www.spinics.net/lists/arm-kernel/msg366849.html

Signed-off-by: Youngjun Cho yj44@samsung.com
Signed-off-by: Chanwoo Choi cw00.c...@samsung.com
Signed-off-by: Inki Dae inki@samsung.com
Signed-off-by: Seung-Woo Kim sw0312@samsung.com
Signed-off-by: Jaehoon Chung jh80.ch...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/boot/dts/Makefile|   3 +-
 arch/arm/boot/dts/exynos3250-monk.dts | 592 ++
 2 files changed, 594 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/exynos3250-monk.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5728918..0c8ae64 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -64,7 +64,8 @@ dtb-$(CONFIG_ARCH_BRCMSTB) += \
 dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
da850-evm.dtb
 dtb-$(CONFIG_ARCH_EFM32) += efm32gg-dk3750.dtb
-dtb-$(CONFIG_ARCH_EXYNOS) += exynos3250-rinato.dtb \
+dtb-$(CONFIG_ARCH_EXYNOS) += exynos3250-monk.dtb \
+   exynos3250-rinato.dtb \
exynos4210-origen.dtb \
exynos4210-smdkv310.dtb \
exynos4210-trats.dtb \
diff --git a/arch/arm/boot/dts/exynos3250-monk.dts 
b/arch/arm/boot/dts/exynos3250-monk.dts
new file mode 100644
index 000..9e94294
--- /dev/null
+++ b/arch/arm/boot/dts/exynos3250-monk.dts
@@ -0,0 +1,592 @@
+/*
+ * Samsung's Exynos3250 based Monk board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Device tree source file for Samsung's Monk board which is based on
+ * Samsung Exynos3250 SoC.
+ *
+ * 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.
+ */
+
+/dts-v1/;
+#include exynos3250.dtsi
+#include dt-bindings/input/input.h
+
+/ {
+   model = Samsung Monk board;
+   compatible = samsung,monk, samsung,exynos3250, samsung,exynos3;
+
+   aliases {
+   i2c7 = i2c_max77836;
+   };
+
+   memory {
+   reg =  0x4000 0x0800
+   0x4800 0x0800
+   0x5000 0x0800
+   0x5800 0x07F0;
+   };
+
+   chosen {
+   bootargs = console=ttySAC1,115200N8 root=/dev/mmcblk0p15 
rootwait earlyprintk panic=5;
+   };
+
+   firmware@0205F000 {
+   compatible = samsung,secure-firmware;
+   reg = 0x0205F000 0x1000;
+   } ;
+
+   gpio_keys {
+   compatible = gpio-keys;
+
+   power_key {
+   interrupt-parent = gpx2;
+   interrupts = 7 0;
+   gpios = gpx2 7 1;
+   linux,code = KEY_POWER;
+   label = power key;
+   debounce-interval = 10;
+   gpio-key,wakeup;
+   };
+   };
+
+   regulators {
+   compatible = simple-bus;
+   #address-cells = 1;
+   #size-cells = 0;
+
+   vemmc_reg: voltage-regulator-0 {
+   compatible = regulator-fixed;
+   regulator-name = V_EMMC_2.8V-fixed;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   gpio = gpk0 2 0;
+   enable-active-high;
+   };
+   };
+
+   i2c_max77836: i2c-gpio-0 {
+   compatible = i2c-gpio;
+   gpios = gpd0 2 0, gpd0 3 0;
+   #address-cells = 1;
+   #size-cells = 0;
+
+   max77836: subpmic@25 {
+   compatible = maxim,max77836;
+   interrupt-parent = gpx1;
+   interrupts = 5 0;
+   reg = 0x25;
+   wakeup;
+
+   muic: max77836-muic {
+   compatible = maxim,max77836-muic;
+   };
+
+   regulators {
+   compatible = maxim,max77836-regulator;
+   safeout_reg: SAFEOUT