3.17 fails to boot on Odroid U2 sometimes

2014-10-05 Thread Shixin Zeng
I've run into this problem a few times, but it doesn't happen every
time. When it happens, booting just hangs with the following messages:

[  240.302126] INFO: task swapper/0:1 blocked for more than 120 seconds.
[  240.302937]   Not tainted 3.17.0-rc7-00097-g7b6ea43 #42
[  240.308514] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[  240.316350] swapper/0   D c0703960 0 1  0 0x
[  240.322667] [c0703960] (__schedule) from [c070413c]
(schedule_preempt_disabled+0x14/0x20)
[  240.331159] [c070413c] (schedule_preempt_disabled) from
[c0706714] (__mutex_lock_slowpath+0x190/0x3d4)
[  240.340782] [c0706714] (__mutex_lock_slowpath) from [c0706964]
(mutex_lock+0xc/0x24)
[  240.348856] [c0706964] (mutex_lock) from [c046a6a4]
(regmap_read+0x30/0x60)
[  240.356135] [c046a6a4] (regmap_read) from [c0599e3c]
(max77686_clk_is_prepared+0x20/0x3c)
[  240.364639] [c0599e3c] (max77686_clk_is_prepared) from
[c059547c] (clk_unprepare_unused_subtree+0x68/0xa0)
[  240.374607] [c059547c] (clk_unprepare_unused_subtree) from
[c059692c] (clk_disable_unused+0xa8/0x138)
[  240.384146] [c059692c] (clk_disable_unused) from [c00088f0]
(do_one_initcall+0x8c/0x1c4)
[  240.392561] [c00088f0] (do_one_initcall) from [c099cd88]
(kernel_init_freeable+0x1a0/0x240)
[  240.401234] [c099cd88] (kernel_init_freeable) from [c06fec08]
(kernel_init+0x8/0xe8)
[  240.409301] [c06fec08] (kernel_init) from [c000e6b8]
(ret_from_fork+0x14/0x3c)
[  240.416830] INFO: task kworker/u8:0:6 blocked for more than 120 seconds.
[  240.423505]   Not tainted 3.17.0-rc7-00097-g7b6ea43 #42
[  240.429050] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[  240.436858] kworker/u8:0D c0703960 0 6  2 0x
[  240.443194] Workqueue: kmmcd mmc_rescan
[  240.447015] [c0703960] (__schedule) from [c070413c]
(schedule_preempt_disabled+0x14/0x20)
[  240.455520] [c070413c] (schedule_preempt_disabled) from
[c0706714] (__mutex_lock_slowpath+0x190/0x3d4)
[  240.465146] [c0706714] (__mutex_lock_slowpath) from [c0706964]
(mutex_lock+0xc/0x24)
[  240.473215] [c0706964] (mutex_lock) from [c0595880]
(clk_prepare_lock+0x88/0xfc)
[  240.480930] [c0595880] (clk_prepare_lock) from [c05971c8]
(clk_unprepare+0x1c/0x2c)
[  240.488916] [c05971c8] (clk_unprepare) from [c05288cc]
(s3c24xx_i2c_xfer+0x170/0x3d4)
[  240.497063] [c05288cc] (s3c24xx_i2c_xfer) from [c05233f8]
(__i2c_transfer+0x78/0x90)
[  240.505125] [c05233f8] (__i2c_transfer) from [c0523d90]
(i2c_transfer+0x94/0xc4)
[  240.512846] [c0523d90] (i2c_transfer) from [c046ecd4]
(regmap_i2c_read+0x48/0x64)
[  240.520654] [c046ecd4] (regmap_i2c_read) from [c046ab8c]
(_regmap_raw_read+0x98/0xf4)
[  240.528804] [c046ab8c] (_regmap_raw_read) from [c046ac0c]
(_regmap_bus_read+0x24/0x5c)
[  240.537040] [c046ac0c] (_regmap_bus_read) from [c046a5fc]
(_regmap_read+0x6c/0xe4)
[  240.544932] [c046a5fc] (_regmap_read) from [c046a6b4]
(regmap_read+0x40/0x60)
[  240.552391] [c046a6b4] (regmap_read) from [c03e9a04]
(regulator_get_voltage_sel_regmap+0x20/0x54)
[  240.561593] [c03e9a04] (regulator_get_voltage_sel_regmap) from
[c03e4ec4] (_regulator_get_voltage+0x20/0xb4)
[  240.571747] [c03e4ec4] (_regulator_get_voltage) from [c03e4e8c]
(regulator_get_voltage+0x1c/0x34)
[  240.580932] [c03e4e8c] (regulator_get_voltage) from [c0562960]
(mmc_regulator_set_ocr+0x44/0x128)
[  240.590129] [c0562960] (mmc_regulator_set_ocr) from [c057678c]
(sdhci_do_set_ios+0x130/0x5fc)
[  240.598968] [c057678c] (sdhci_do_set_ios) from [c0576c80]
(sdhci_set_ios+0x28/0x34)
[  240.606951] [c0576c80] (sdhci_set_ios) from [c0569f10]
(mmc_sd_init_card+0x454/0x664)
[  240.615097] [c0569f10] (mmc_sd_init_card) from [c056a320]
(mmc_attach_sd+0x84/0x150)
[  240.623161] [c056a320] (mmc_attach_sd) from [c0564a0c]
(mmc_rescan+0x2a0/0x308)
[  240.630796] [c0564a0c] (mmc_rescan) from [c003b1c4]
(process_one_work+0x128/0x318)
[  240.638688] [c003b1c4] (process_one_work) from [c003b998]
(worker_thread+0x44/0x4dc)
[  240.646757] [c003b998] (worker_thread) from [c003fa1c]
(kthread+0xd0/0xe8)
[  240.653958] [c003fa1c] (kthread) from [c000e6b8]
(ret_from_fork+0x14/0x3c)
[  360.657146] INFO: task swapper/0:1 blocked for more than 120 seconds.
[  360.657952]   Not tainted 3.17.0-rc7-00097-g7b6ea43 #42
[  360.663526] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[  360.671336] swapper/0   D c0703960 0 1  0 0x
[  360.677679] [c0703960] (__schedule) from [c070413c]
(schedule_preempt_disabled+0x14/0x20)
[  360.686175] [c070413c] (schedule_preempt_disabled) from
[c0706714] (__mutex_lock_slowpath+0x190/0x3d4)
[  360.695796] [c0706714] (__mutex_lock_slowpath) from [c0706964]
(mutex_lock+0xc/0x24)
[  360.703869] [c0706964] (mutex_lock) from [c046a6a4]
(regmap_read+0x30/0x60)
[  360.711149] [c046a6a4] (regmap_read) from [c0599e3c]
(max77686_clk_is_prepared+0x20/0x3c)
[  360.719653] [c0599e3c] (max77686_clk_is_prepared) from
[c059547c] 

Re: [PATCH v8 2/2] ARM: exynos5: Add Suspend-to-RAM support for 5420

2014-10-05 Thread Abhilash Kesavan
Hi Vikas,

[...]

 +static void exynos5420_pm_resume(void)
 +{
 +   unsigned long tmp;
 +
 +   /* Restore the CPU0 low power state register */
 +   tmp = pmu_raw_readl(EXYNOS5_ARM_CORE0_SYS_PWR_REG);
 +   pmu_raw_writel(tmp | S5P_CORE_LOCAL_PWR_EN,
 +   EXYNOS5_ARM_CORE0_SYS_PWR_REG);

I think these lines were accidentally added to this patch, please
remove them. I have a couple of changes to make in my s2r patch which
I will post once you send a new version.

Regards,
Abhilash
 +
 +   /* Restore the sysram cpu state register */
 +   __raw_writel(exynos5420_cpu_state,
 +   sysram_base_addr + EXYNOS5420_CPU_STATE);
 +
 +   pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL,
 +   S5P_CENTRAL_SEQ_OPTION);
 +
 +   if (exynos_pm_central_resume())
 +   goto early_wakeup;
 +
 +   /* For release retention */
 +   exynos_pm_release_retention();
 +
 +   pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3);
 +
 +   s3c_pm_do_restore_core(exynos_core_save, 
 ARRAY_SIZE(exynos_core_save));
 +
 +early_wakeup:
 +
 +   tmp = pmu_raw_readl(EXYNOS5420_SFR_AXI_CGDIS1);
 +   tmp = ~EXYNOS5420_UFS;
 +   pmu_raw_writel(tmp, EXYNOS5420_SFR_AXI_CGDIS1);
 +
 +   tmp = pmu_raw_readl(EXYNOS5420_FSYS2_OPTION);
 +   tmp = ~EXYNOS5420_EMULATION;
 +   pmu_raw_writel(tmp, EXYNOS5420_FSYS2_OPTION);
 +
 +   tmp = pmu_raw_readl(EXYNOS5420_PSGEN_OPTION);
 +   tmp = ~EXYNOS5420_EMULATION;
 +   pmu_raw_writel(tmp, EXYNOS5420_PSGEN_OPTION);
 +
 +   /* Clear SLEEP mode set in INFORM1 */
 +   pmu_raw_writel(0x0, S5P_INFORM1);
 +}
 +
  /*
   * Suspend Ops
   */
 @@ -310,6 +449,16 @@ static const struct exynos_pm_data exynos5250_pm_data = {
 .cpu_suspend= exynos_cpu_suspend,
  };

 +static struct exynos_pm_data exynos5420_pm_data = {
 +   .wkup_irq   = exynos5250_wkup_irq,
 +   .wake_disable_mask = (0x7F  7) | (0x1F  1),
 +   .release_ret_regs = exynos5420_release_ret_regs,
 +   .pm_resume  = exynos5420_pm_resume,
 +   .pm_suspend = exynos5420_pm_suspend,
 +   .pm_prepare = exynos5420_pm_prepare,
 +   .cpu_suspend= exynos5420_cpu_suspend,
 +};
 +
  static struct of_device_id exynos_pmu_of_device_ids[] = {
 {
 .compatible = samsung,exynos4210-pmu,
 @@ -323,6 +472,9 @@ static struct of_device_id exynos_pmu_of_device_ids[] = {
 }, {
 .compatible = samsung,exynos5250-pmu,
 .data = exynos5250_pm_data,
 +   }, {
 +   .compatible = samsung,exynos5420-pmu,
 +   .data = exynos5420_pm_data,
 },
 { /*sentinel*/ },
  };
 --
 1.7.9.5


 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
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] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420

2014-10-05 Thread Abhilash Kesavan
Hi Javier,

[...]

 diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
 index adb36a8..222aa3c 100644
 --- a/arch/arm/mach-exynos/platsmp.c
 +++ b/arch/arm/mach-exynos/platsmp.c
 @@ -137,6 +137,18 @@ void exynos_cpu_power_down(int cpu)
   */
  void exynos_cpu_power_up(int cpu)
  {
 +   if (cpu == 0  (of_machine_is_compatible(samsung,exynos5420) ||
 +   of_machine_is_compatible(samsung,exynos5800))) {
 +   /*
 +* Bypass power down for CPU0 during suspend. Check for
 +* the SYS_PWR_REG value to decide if we are suspending
 +* the system.
 +*/
 +   int val = __raw_readl(pmu_base_addr +
 +   EXYNOS5_ARM_CORE0_SYS_PWR_REG);
 +   if (!(val  S5P_CORE_LOCAL_PWR_EN))
 +   return;
 +   }
 pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN,
 EXYNOS_ARM_CORE_CONFIGURATION(cpu));
  }

The above block of code should be in exynos_cpu_power_down(). Can you
re-test s2r after modifying it ? I have to convert a __raw_readl to
pmu_raw_readl in this patch as well. Once Vikas re-works the base s2r
patch I will re-post a v9.

Regards,
Abhilash
--
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 v4 0/6] Add initial support for pinctrl on Exynos7

2014-10-05 Thread Abhilash Kesavan
Hi Linus,

On Tue, Sep 30, 2014 at 8:00 PM, Abhilash Kesavan a.kesa...@samsung.com wrote:
 Changes since v3:
 - Changed variable name from exynos_wkup_irq_chip to irq_chip
 - Added acked-by tag from Tomasz Figa

 Changes since v2:
 - Added a .irq_chip field to the samsung_pin_bank struct
 - Consolidated the wakeup and gpio irqd_ops

 Changes since v1:
 - Marked the newly created irq_chip instances as __initdata
 - Used kmemdup to keep a copy of the irq_chip
 - Change the pinctrl name from sd0_rdqs to sd0_ds as per UM
 - Moved the pinctrl enablement for exynos7 into a separate patch
 - Added tested-by and reviewed-by tags from Thomas Abraham

 Following patches have been tested on linux-next (20140926).
 https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/

 Following patches are required for this series:
 1) tty/serial: fix config dependencies for samsung serial

 https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg36208.html
 2) dts, kbuild: Implement support for dtb vendor subdirs patchset
http://comments.gmane.org/gmane.linux.kbuild.devel/12131
 3) arch: arm64: enable support for Samsung Exynos7 SoC patchset (v5)
http://www.spinics.net/lists/arm-kernel/msg364014.html

 Abhilash Kesavan (3):
   pinctrl: exynos: Generalize the eint16_31 demux code
   pinctrl: exynos: Consolidate irq domain callbacks
   pinctrl: exynos: Add irq_chip instance for Exynos7 wakeup interrupts

 Naveen Krishna Ch (3):
   pinctrl: exynos: Add initial driver data for Exynos7
   arm64: dts: Add initial pinctrl support to EXYNOS7
   arm64: exynos: Enable pinctrl support for Exynos7

  .../bindings/pinctrl/samsung-pinctrl.txt   |3 +
  arch/arm64/Kconfig |2 +
  arch/arm64/boot/dts/exynos/exynos7-pinctrl.dtsi|  560 
 
  arch/arm64/boot/dts/exynos/exynos7.dtsi|   66 +++
  drivers/pinctrl/samsung/pinctrl-exynos.c   |  196 +--
  drivers/pinctrl/samsung/pinctrl-exynos.h   |3 +
  drivers/pinctrl/samsung/pinctrl-samsung.c  |2 +
  drivers/pinctrl/samsung/pinctrl-samsung.h  |3 +
  8 files changed, 799 insertions(+), 36 deletions(-)
  create mode 100644 arch/arm64/boot/dts/exynos/exynos7-pinctrl.dtsi

Does this series look OK to you ?

Regards,
Abhilash

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

2014-10-05 Thread Vivek Gautam
On Wed, Oct 1, 2014 at 8:42 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.

Yes, i saw the same; and the reason i mentioned above looks like the
issue with us.
I will post necessary patches for removing this extra of_node_put()
from ehci/ohci-exynos



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