All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
To: Alim Akhtar <alim.akhtar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org,
	Alim Akhtar <alim.akhtar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	kgene <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Krzysztof Kozłowski"
	<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"Tobias Jakobi"
	<tjakobi-o02PS0xoJP9W0yFyLvAVXMxlOr/tl8fh@public.gmane.org>
Subject: Re: [PATCH v2 0/6] Switch to generic syscon regmap based drivers
Date: Wed, 21 Oct 2015 12:16:19 +0200	[thread overview]
Message-ID: <562765F3.9010306@osg.samsung.com> (raw)
In-Reply-To: <56272C1C.8040007-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hello Alim,

On 10/21/2015 08:09 AM, Alim Akhtar wrote:

[snip]

>>>>>
>>>>> Hi Alim,
>>>>>
>>>>> I have installed your patch set above with git am on top of
>>>>> 4.3.0-rc6-00108-gce1fad2 torvalds/linux of today
>>>>> with make exynos_defconfig on Odroid U3.
>>>>>
>>>> which exynos soc Odroid U3 uses?
>>>>
>>> OK, I can see its uses exynos4412 and exynos4412-odroidu3.dts does
>>> include exynos4.dtsi,
>>> so these should have worked.
>>>
>>>>> "halt -p" worked (power 0.0W).
>>>>> "reboot" got stuck at 0.5W.
>>>>>
>>>> reboot stuck mean system does not reboot any more?
>>
>> It freezes when going for reboot.
>> Have to power off/on to boot again.
>>
>> Btw I use an mmc, not an sd-card.
>> No other HW connected, just LAN-cable.
>> Bootloader is u-boot v2015.10.
>> o
> Have checked on 4.3.0-rc6-00006-gd03c139e7e77, still works on peach boards.
> Sorry I don't have Odroid U3 with me, may be Javier or Krzysztof might help here to check whats wrong. To me its looks more of a board specific issue for now.
> 

Krzysztof has an Odroid XU3 lite and I have an Odroid XU4, both uses an
Exynos5422 so we can't check what's wrong with Odroid U3 (Exynos4412).

Having said that I think I know what is the issue here. Markus said that
he is using an eMMC instead of an uSD (which is what I used and my guess
is that Krzysztof did too).

Now, there is a subtle difference between the old PMU restart handler
and the syscon-reboot one, and that is the restart handler priorities:

notifier                    priority
------------------------------------
pmu_restart_notify          128
mmc_pwrseq_emmc_reset_nb    129
syscon_restart_handle       192

So, without Alim's patches, first the eMMC reset handler will be called
and then the PMU restart handler but after his series, the syscon reset
handler has a higher priority so the eMMC reset will never be called.

But the problem is that the eMMC card has to be properly reset on system
restart to allow the SoC iROM to be able to read the bootloader from the
eMMC since the iROM doesn't have restart logic and the card shouldn't be
left in an unknown state.

So the problem here is not that the system is not being reset (that I
think that works) but that on reboot, the system is not able to boot
again since the ROM is not able to read the second stage bootloader.

Markus, 

Can you please test following patch [0] on top of Alim's series? If that
works then it should either be part of Alim's series or the patches will
have to wait until that patch lands into mainline. I don't have an eMMC
to test it in XU4 but I'm pretty confident that it will solve the issue.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

[0]:
>From c9b250ee03bae338339b70693e906145c719f783 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Date: Wed, 21 Oct 2015 11:59:44 +0200
Subject: [RFT PATCH] mmc: pwrseq: Use highest priority for eMMC restart
 handler

The pwrseq_emmc driver does a eMMC card reset before a system reboot to
allow broken or limited ROM boot-loaders, that don't have an eMMC reset
logic, to be able to read the second stage from the eMMC.

But this has to be called before a system reboot handler and while most
of them use the priority 128, there are other restart handlers (such as
the syscon-reboot one) that use a higher priority. So, use the highest
priority to make sure that the eMMC hw is reset before a system reboot.

Signed-off-by: Javier Martinez Canillas <javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
---
 drivers/mmc/core/pwrseq_emmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c
index 137c97fb7aa8..ad4f94ec7e8d 100644
--- a/drivers/mmc/core/pwrseq_emmc.c
+++ b/drivers/mmc/core/pwrseq_emmc.c
@@ -84,11 +84,11 @@ struct mmc_pwrseq *mmc_pwrseq_emmc_alloc(struct mmc_host *host,
 
 	/*
 	 * register reset handler to ensure emmc reset also from
-	 * emergency_reboot(), priority 129 schedules it just before
-	 * system reboot
+	 * emergency_reboot(), priority 255 is the highest priority
+	 * so it will be executed before any system reboot handler.
 	 */
 	pwrseq->reset_nb.notifier_call = mmc_pwrseq_emmc_reset_nb;
-	pwrseq->reset_nb.priority = 129;
+	pwrseq->reset_nb.priority = 255;
 	register_restart_handler(&pwrseq->reset_nb);
 
 	pwrseq->pwrseq.ops = &mmc_pwrseq_emmc_ops;
-- 
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: javier@osg.samsung.com (Javier Martinez Canillas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/6] Switch to generic syscon regmap based drivers
Date: Wed, 21 Oct 2015 12:16:19 +0200	[thread overview]
Message-ID: <562765F3.9010306@osg.samsung.com> (raw)
In-Reply-To: <56272C1C.8040007@samsung.com>

Hello Alim,

On 10/21/2015 08:09 AM, Alim Akhtar wrote:

[snip]

>>>>>
>>>>> Hi Alim,
>>>>>
>>>>> I have installed your patch set above with git am on top of
>>>>> 4.3.0-rc6-00108-gce1fad2 torvalds/linux of today
>>>>> with make exynos_defconfig on Odroid U3.
>>>>>
>>>> which exynos soc Odroid U3 uses?
>>>>
>>> OK, I can see its uses exynos4412 and exynos4412-odroidu3.dts does
>>> include exynos4.dtsi,
>>> so these should have worked.
>>>
>>>>> "halt -p" worked (power 0.0W).
>>>>> "reboot" got stuck at 0.5W.
>>>>>
>>>> reboot stuck mean system does not reboot any more?
>>
>> It freezes when going for reboot.
>> Have to power off/on to boot again.
>>
>> Btw I use an mmc, not an sd-card.
>> No other HW connected, just LAN-cable.
>> Bootloader is u-boot v2015.10.
>> o
> Have checked on 4.3.0-rc6-00006-gd03c139e7e77, still works on peach boards.
> Sorry I don't have Odroid U3 with me, may be Javier or Krzysztof might help here to check whats wrong. To me its looks more of a board specific issue for now.
> 

Krzysztof has an Odroid XU3 lite and I have an Odroid XU4, both uses an
Exynos5422 so we can't check what's wrong with Odroid U3 (Exynos4412).

Having said that I think I know what is the issue here. Markus said that
he is using an eMMC instead of an uSD (which is what I used and my guess
is that Krzysztof did too).

Now, there is a subtle difference between the old PMU restart handler
and the syscon-reboot one, and that is the restart handler priorities:

notifier                    priority
------------------------------------
pmu_restart_notify          128
mmc_pwrseq_emmc_reset_nb    129
syscon_restart_handle       192

So, without Alim's patches, first the eMMC reset handler will be called
and then the PMU restart handler but after his series, the syscon reset
handler has a higher priority so the eMMC reset will never be called.

But the problem is that the eMMC card has to be properly reset on system
restart to allow the SoC iROM to be able to read the bootloader from the
eMMC since the iROM doesn't have restart logic and the card shouldn't be
left in an unknown state.

So the problem here is not that the system is not being reset (that I
think that works) but that on reboot, the system is not able to boot
again since the ROM is not able to read the second stage bootloader.

Markus, 

Can you please test following patch [0] on top of Alim's series? If that
works then it should either be part of Alim's series or the patches will
have to wait until that patch lands into mainline. I don't have an eMMC
to test it in XU4 but I'm pretty confident that it will solve the issue.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

[0]:
>From c9b250ee03bae338339b70693e906145c719f783 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Wed, 21 Oct 2015 11:59:44 +0200
Subject: [RFT PATCH] mmc: pwrseq: Use highest priority for eMMC restart
 handler

The pwrseq_emmc driver does a eMMC card reset before a system reboot to
allow broken or limited ROM boot-loaders, that don't have an eMMC reset
logic, to be able to read the second stage from the eMMC.

But this has to be called before a system reboot handler and while most
of them use the priority 128, there are other restart handlers (such as
the syscon-reboot one) that use a higher priority. So, use the highest
priority to make sure that the eMMC hw is reset before a system reboot.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
 drivers/mmc/core/pwrseq_emmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c
index 137c97fb7aa8..ad4f94ec7e8d 100644
--- a/drivers/mmc/core/pwrseq_emmc.c
+++ b/drivers/mmc/core/pwrseq_emmc.c
@@ -84,11 +84,11 @@ struct mmc_pwrseq *mmc_pwrseq_emmc_alloc(struct mmc_host *host,
 
 	/*
 	 * register reset handler to ensure emmc reset also from
-	 * emergency_reboot(), priority 129 schedules it just before
-	 * system reboot
+	 * emergency_reboot(), priority 255 is the highest priority
+	 * so it will be executed before any system reboot handler.
 	 */
 	pwrseq->reset_nb.notifier_call = mmc_pwrseq_emmc_reset_nb;
-	pwrseq->reset_nb.priority = 129;
+	pwrseq->reset_nb.priority = 255;
 	register_restart_handler(&pwrseq->reset_nb);
 
 	pwrseq->pwrseq.ops = &mmc_pwrseq_emmc_ops;
-- 
2.4.3

  parent reply	other threads:[~2015-10-21 10:16 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20  9:24 [PATCH v2 0/6] Switch to generic syscon regmap based drivers Alim Akhtar
2015-10-20  9:24 ` Alim Akhtar
2015-10-20  9:24 ` [PATCH v2 1/6] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs Alim Akhtar
2015-10-20  9:24   ` Alim Akhtar
     [not found]   ` <1445333085-22837-2-git-send-email-alim.akhtar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-11-20  0:20     ` Krzysztof Kozlowski
2015-11-20  0:20       ` Krzysztof Kozlowski
2015-10-20  9:24 ` [PATCH v2 2/6] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4 Alim Akhtar
2015-10-20  9:24   ` Alim Akhtar
2015-11-20  0:20   ` Krzysztof Kozlowski
2015-11-20  0:20     ` Krzysztof Kozlowski
2015-10-20  9:24 ` [PATCH v2 3/6] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5 Alim Akhtar
2015-10-20  9:24   ` Alim Akhtar
2015-10-20 10:30   ` Javier Martinez Canillas
2015-10-20 10:30     ` Javier Martinez Canillas
2015-10-21 11:55     ` Anand Moon
2015-10-21 11:55       ` Anand Moon
2015-11-20  0:22   ` Krzysztof Kozlowski
2015-11-20  0:22     ` Krzysztof Kozlowski
2015-10-20  9:24 ` [PATCH v2 4/6] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC Alim Akhtar
2015-10-20  9:24   ` Alim Akhtar
2015-11-20  0:21   ` Krzysztof Kozlowski
2015-11-20  0:21     ` Krzysztof Kozlowski
     [not found] ` <1445333085-22837-1-git-send-email-alim.akhtar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-10-20  9:24   ` [PATCH v2 5/6] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Alim Akhtar
2015-10-20  9:24     ` Alim Akhtar
2015-10-20 10:30     ` Javier Martinez Canillas
2015-10-20 10:30       ` Javier Martinez Canillas
2015-10-21  0:14     ` Krzysztof Kozlowski
2015-10-21  0:14       ` Krzysztof Kozlowski
2015-10-20  9:24 ` [PATCH v2 6/6] ARM: EXYNOS: Remove code for restart and poweroff for exynos SoCs Alim Akhtar
2015-10-20  9:24   ` Alim Akhtar
2015-10-20 10:31   ` Javier Martinez Canillas
2015-10-20 10:31     ` Javier Martinez Canillas
2015-10-20 10:29 ` [PATCH v2 0/6] Switch to generic syscon regmap based drivers Javier Martinez Canillas
2015-10-20 10:29   ` Javier Martinez Canillas
2015-10-20 14:59 ` Markus Reichl
2015-10-20 14:59   ` Markus Reichl
     [not found]   ` <562656D4.1040403-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
2015-10-20 15:47     ` Alim Akhtar
2015-10-20 15:47       ` Alim Akhtar
     [not found]       ` <CAGOxZ50G-ttivhVjbozUisA0HXcFz7bvRUuPR67xR88TTCa_wQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-20 15:52         ` Alim Akhtar
2015-10-20 15:52           ` Alim Akhtar
2015-10-20 17:23           ` Markus Reichl
2015-10-20 17:23             ` Markus Reichl
2015-10-21  6:09             ` Alim Akhtar
2015-10-21  6:09               ` Alim Akhtar
     [not found]               ` <56272C1C.8040007-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-10-21 10:16                 ` Javier Martinez Canillas [this message]
2015-10-21 10:16                   ` Javier Martinez Canillas
2015-10-21 10:42                   ` Markus Reichl
2015-10-21 10:42                     ` Markus Reichl
2015-10-21 10:46                     ` Alim Akhtar
2015-10-21 10:46                       ` Alim Akhtar
2015-10-21 11:46                       ` Anand Moon
2015-10-21 11:46                         ` Anand Moon
2015-10-21 13:25                         ` Javier Martinez Canillas
2015-10-21 13:25                           ` Javier Martinez Canillas
2015-10-21 10:44                   ` Alim Akhtar
2015-10-21 10:44                     ` Alim Akhtar
2015-10-21 13:23                     ` Javier Martinez Canillas
2015-10-21 13:23                       ` Javier Martinez Canillas
     [not found]                       ` <562791D4.3050105-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-10-21 14:56                         ` Alim Akhtar
2015-10-21 14:56                           ` Alim Akhtar
2015-10-21 14:50                   ` Alim Akhtar
2015-10-21 14:50                     ` Alim Akhtar
2015-10-21 14:55                     ` Javier Martinez Canillas
2015-10-21 14:55                       ` Javier Martinez Canillas
2015-10-21 15:01                       ` Alim Akhtar
2015-10-21 15:01                         ` Alim Akhtar
2015-10-22  0:17                         ` Krzysztof Kozlowski
2015-10-22  0:17                           ` Krzysztof Kozlowski
2015-10-22  3:54                           ` Alim Akhtar
2015-10-22  3:54                             ` Alim Akhtar
2015-11-19 18:06                           ` Alim Akhtar
2015-11-19 18:06                             ` Alim Akhtar
2015-11-19 18:18                             ` Javier Martinez Canillas
2015-11-19 18:18                               ` Javier Martinez Canillas
2015-11-20  0:46                             ` Krzysztof Kozlowski
2015-11-20  0:46                               ` Krzysztof Kozlowski
2015-11-20  5:08                               ` Alim Akhtar
2015-11-20  5:08                                 ` Alim Akhtar
     [not found]                       ` <5627A75E.60509-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-10-23 18:52                         ` Kukjin Kim
2015-10-23 18:52                           ` Kukjin Kim
     [not found]                           ` <562A8209.7090305-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-10-23 18:59                             ` Kukjin Kim
2015-10-23 18:59                               ` Kukjin Kim
2015-10-21  0:08 ` Krzysztof Kozlowski
2015-10-21  0:08   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562765F3.9010306@osg.samsung.com \
    --to=javier-jph+aebz4p+uejcrhfaqsw@public.gmane.org \
    --cc=alim.akhtar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=alim.akhtar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org \
    --cc=tjakobi-o02PS0xoJP9W0yFyLvAVXMxlOr/tl8fh@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.