devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Andrej Picej <andrej.picej@norik.com>,
	Marco Felsch <m.felsch@pengutronix.de>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, festevam@gmail.com,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de,
	shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org,
	upstream@phytec.de
Subject: Re: [PATCH 2/2] ARM: dts: imx6: pfla02: Fix SD card reboot problem
Date: Wed, 5 Jul 2023 14:06:59 +0200	[thread overview]
Message-ID: <e9a08364-c277-bfec-cb31-b01b39e17bed@pengutronix.de> (raw)
In-Reply-To: <6a2e5b14-c5d3-b384-2539-033381768dca@norik.com>

On 05.07.23 12:39, Andrej Picej wrote:> On 5. 07. 23 10:40, Andrej Picej wrote:
>> On 5. 07. 23 10:30, Ahmad Fatoum wrote:
>>> On 05.07.23 10:28, Andrej Picej wrote:
>>>> I think the main reason for a failed boot is that the PMIC doesn't get reset and that the bootloader doesn't specifically enable the SD card regulator.
>>>>
>>>> Could this patch still be applied or should we put the fix in reset routine/bootloader?
>>>
>>> Is SD-Card not main boot medium? From your description, I thought BootROM
>>> will fail to boot before bootloader has a chance to do anything about it.
>>>
>>
>> Yes sorry, you are absolutly right, the BootROM fails. It confused me because I could see the booloader booting, but it was from one of the fallback mediums. So I guess fixing the bootloader is not really an option.
>> Sorry for the confusion.
>>
> 
> Ok, the main problem is well known, that's why PHYTEC disables the imx watchdog and uses a PMIC one for the reboot handler. This one resets the board completely. The SD card regulator problem is really just the manifestation of that bug. Unfortunately I didn't noticed that. :(
> 
> I will create a v2 with a proper fix, where imx watchdog gets disabled.

I'd be wary about solving it this way at the DTSI level, because it can
break existing users:

  - Boot flow depends on reading boot reason, but with PMIC reset, everything
    is power-on reset

  - Bootloader starts i.MX watchdog, but new kernel will service only
    PMIC watchdog leading to system reset

  - Even if updating bootloader and kernel together, fallback of kernel
    may end up that bootloader uses PMIC watchdog, but kernel uses i.MX
    watchdog

  - There can be valid reasons to use both watchdogs and disabling
    one at the SoM level breaks that

I had a similar issue once (Board controller reset to be used instead of SoC
reset) and settled on using the barebox watchdog-priority/restart-priority[1]
binding to select the "better" watchdog and then fixed up this choice into
the kernel command line (barebox CONFIG_SYSTEMD_OF_WATCHDOG).

If you decide to fix it for the evaluation kits, please add some text
into the commit message that this fix should not be backported to older kernels.
While it's ultimately the correct thing to do, changing this is IMO not stable
backport material.

[1]: FWIW, there was past discussion about adding restart priorities to Linux, e.g.
https://lore.kernel.org/all/20201006102949.dbw6b2mrgt2ltgpw@pengutronix.de/

Cheers,
Ahmad

> 
> Thanks for your help,
> Andrej
> 
> 
>>
>>>>
>>>> Best regards,
>>>> Andrej
>>>>
>>>>>
>>>>> Regards,
>>>>>     Marco
>>>>>
>>>>>>                };
>>>>>>                  vdd_sd1_reg: ldo10 {
>>>>>> -- 
>>>>>> 2.25.1
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


  reply	other threads:[~2023-07-05 12:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04  8:03 [PATCH 0/2] PHYTEC i.MX6 device-tree fixes Andrej Picej
2023-07-04  8:03 ` [PATCH 1/2] ARM: dts: imx6: phytec: fix RTC interrupt level Andrej Picej
2023-07-04  8:03 ` [PATCH 2/2] ARM: dts: imx6: pfla02: Fix SD card reboot problem Andrej Picej
2023-07-04  8:15   ` Ahmad Fatoum
     [not found]     ` <02d491bb-2a40-4909-ebc3-be2e183cfcbb@norik.com>
2023-07-05  8:26       ` Ahmad Fatoum
2023-07-04  8:17   ` Marco Felsch
2023-07-05  8:28     ` Andrej Picej
2023-07-05  8:30       ` Ahmad Fatoum
2023-07-05  8:40         ` Andrej Picej
2023-07-05 10:39           ` Andrej Picej
2023-07-05 12:06             ` Ahmad Fatoum [this message]
2023-07-07  9:28               ` Andrej Picej
2023-07-12  8:54                 ` Ahmad Fatoum

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=e9a08364-c277-bfec-cb31-b01b39e17bed@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=andrej.picej@norik.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=upstream@phytec.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).