* SDHCI AM654 driver delaying boot time
@ 2023-11-08 18:56 João Paulo Silva Gonçalves
2023-11-09 17:51 ` Nishanth Menon
0 siblings, 1 reply; 6+ messages in thread
From: João Paulo Silva Gonçalves @ 2023-11-08 18:56 UTC (permalink / raw)
To: nm@ti.com, faiz_abbas@ti.com, ulf.hansson@linaro.org,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: adrian.hunter@intel.com, Francesco Dolcini
Hello all,
We are trying to minimize boot time for our AM62 devices. Unfortunately, we have identified a delay of approximately 1.5 seconds caused by the
sdhci_am654 driver. This delay is a result of a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was introduced in commit 7ca0f16 ("mmc:
sdhci_am654: Add workaround for card detect debounce timer"). This issue arises only when there is no SD card present in the MMC slot. We tested the
driver with a lower timeout value and everything worked. However, as indicated in the commit message, this timeout may be related to the way the sdhci
controller hardware IP works. Currently, the driver employs a sort of a "busy loop" to wait for this timeout to pass delaying the boot. Why is
need to busy loop for this timeout? Is it possible to wait for it in the backgroud? Am I am missing something here?
Regards,
Joao Paulo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: SDHCI AM654 driver delaying boot time
2023-11-08 18:56 SDHCI AM654 driver delaying boot time João Paulo Silva Gonçalves
@ 2023-11-09 17:51 ` Nishanth Menon
2023-11-10 4:38 ` Vignesh Raghavendra
2023-11-10 14:19 ` Francesco Dolcini
0 siblings, 2 replies; 6+ messages in thread
From: Nishanth Menon @ 2023-11-09 17:51 UTC (permalink / raw)
To: João Paulo Silva Gonçalves
Cc: faiz_abbas@ti.com, ulf.hansson@linaro.org,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
adrian.hunter@intel.com, Francesco Dolcini
On 18:56-20231108, João Paulo Silva Gonçalves wrote:
> Hello all,
>
> We are trying to minimize boot time for our AM62 devices. Unfortunately, we have identified a delay of approximately 1.5 seconds caused by the
> sdhci_am654 driver. This delay is a result of a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was introduced in commit 7ca0f16 ("mmc:
> sdhci_am654: Add workaround for card detect debounce timer"). This issue arises only when there is no SD card present in the MMC slot. We tested the
> driver with a lower timeout value and everything worked. However, as indicated in the commit message, this timeout may be related to the way the sdhci
> controller hardware IP works. Currently, the driver employs a sort of a "busy loop" to wait for this timeout to pass delaying the boot. Why is
> need to busy loop for this timeout? Is it possible to wait for it in the backgroud? Am I am missing something here?
I am not an mmc expert, but, Isn't this sequence part of the programmer
manual in the TRM[1]? Either way, one additional issue I did end up with
when I was doing beagleplay[2] was when i booted off emmc and runtime PM
disabled SD/MMC interface, the MMC IP's CD mode would'nt work since the
IP isn't clocked. So I switched the mux mode to GPIO to use mmc CD
there. I haven't timed that approach where
SDHCI_AM654_QUIRK_FORCE_CDTEST would get set.
[1] https://www.ti.com/lit/pdf/spruiv7
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts#n835
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: SDHCI AM654 driver delaying boot time
2023-11-09 17:51 ` Nishanth Menon
@ 2023-11-10 4:38 ` Vignesh Raghavendra
2023-11-10 14:55 ` João Paulo Silva Gonçalves
2023-11-10 14:19 ` Francesco Dolcini
1 sibling, 1 reply; 6+ messages in thread
From: Vignesh Raghavendra @ 2023-11-10 4:38 UTC (permalink / raw)
To: Nishanth Menon, João Paulo Silva Gonçalves
Cc: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, adrian.hunter@intel.com,
Francesco Dolcini
Hi Joao
On 09/11/23 23:21, Nishanth Menon wrote:
> On 18:56-20231108, João Paulo Silva Gonçalves wrote:
>> Hello all,
>>
>> We are trying to minimize boot time for our AM62 devices. Unfortunately, we have identified a delay of approximately 1.5 seconds caused by the
>> sdhci_am654 driver. This delay is a result of a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was introduced in commit 7ca0f16 ("mmc:
>> sdhci_am654: Add workaround for card detect debounce timer"). This issue arises only when there is no SD card present in the MMC slot. We tested the
>> driver with a lower timeout value and everything worked. However, as indicated in the commit message, this timeout may be related to the way the sdhci
>> controller hardware IP works. Currently, the driver employs a sort of a "busy loop" to wait for this timeout to pass delaying the boot. Why is
>> need to busy loop for this timeout? Is it possible to wait for it in the backgroud? Am I am missing something here?
sdhci_am654_write_power_on() does have usleep_range() of 1 to 10ms. If
that isn't sufficient to preempt and allow other drivers to probe, then
probably worth setting sleep_us in read_poll_timeout() call.
>
> I am not an mmc expert, but, Isn't this sequence part of the programmer
> manual in the TRM[1]? Either way, one additional issue I did end up with
> when I was doing beagleplay[2] was when i booted off emmc and runtime PM
> disabled SD/MMC interface, the MMC IP's CD mode would'nt work since the
> IP isn't clocked. So I switched the mux mode to GPIO to use mmc CD
> there. I haven't timed that approach where
> SDHCI_AM654_QUIRK_FORCE_CDTEST would get set.
>
> [1] https://www.ti.com/lit/pdf/spruiv7
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts#n835
Above is a good experiment to see if it helps boot time. Can you set
SDCD line to GPIO and hook up using cd-gpios? You would also need to
set ti,fails-without-test-cd
--
Regards
Vignesh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: SDHCI AM654 driver delaying boot time
2023-11-09 17:51 ` Nishanth Menon
2023-11-10 4:38 ` Vignesh Raghavendra
@ 2023-11-10 14:19 ` Francesco Dolcini
2023-11-14 8:25 ` Adrian Hunter
1 sibling, 1 reply; 6+ messages in thread
From: Francesco Dolcini @ 2023-11-10 14:19 UTC (permalink / raw)
To: Nishanth Menon
Cc: João Paulo Silva Gonçalves, faiz_abbas@ti.com,
ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, adrian.hunter@intel.com,
Francesco Dolcini
Hello Nishant,
On Thu, Nov 09, 2023 at 11:51:59AM -0600, Nishanth Menon wrote:
> On 18:56-20231108, João Paulo Silva Gonçalves wrote:
> > Hello all,
> >
> > We are trying to minimize boot time for our AM62 devices.
> > Unfortunately, we have identified a delay of approximately 1.5
> > seconds caused by the sdhci_am654 driver. This delay is a result of
> > a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was
> > introduced in commit 7ca0f16 ("mmc: sdhci_am654: Add workaround for
> > card detect debounce timer"). This issue arises only when there is
> > no SD card present in the MMC slot. We tested the driver with a
> > lower timeout value and everything worked. However, as indicated in
> > the commit message, this timeout may be related to the way the sdhci
> > controller hardware IP works. Currently, the driver employs a sort
> > of a "busy loop" to wait for this timeout to pass delaying the boot.
> > Why is need to busy loop for this timeout? Is it possible to wait
> > for it in the backgroud? Am I am missing something here?
>
> I am not an mmc expert, but, Isn't this sequence part of the programmer
> manual in the TRM[1]?
Probably original question from Joao was not fully understood.
It is clear why the code is waiting for the CD, the issue we are
experiencing is that the whole boot is delayed by 1.5 seconds because of
that piece of code for no reason.
- SD card exists in the system, but it's not used and the card slot is empty
- We boot from eMMC (that has no CD pin)
- Boot is delayed by 1.5 second because of that piece of code
Francesco
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: SDHCI AM654 driver delaying boot time
2023-11-10 4:38 ` Vignesh Raghavendra
@ 2023-11-10 14:55 ` João Paulo Silva Gonçalves
0 siblings, 0 replies; 6+ messages in thread
From: João Paulo Silva Gonçalves @ 2023-11-10 14:55 UTC (permalink / raw)
To: nm@ti.com, vigneshr@ti.com
Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Francesco Dolcini
On Fri, 2023-11-10 at 10:08 +0530, Vignesh Raghavendra wrote:
> Hi Joao
>
> On 09/11/23 23:21, Nishanth Menon wrote:
> > On 18:56-20231108, João Paulo Silva Gonçalves wrote:
> > > Hello all,
> > >
> > > We are trying to minimize boot time for our AM62 devices. Unfortunately, we have identified a delay of approximately 1.5 seconds caused by the
> > > sdhci_am654 driver. This delay is a result of a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was introduced in commit 7ca0f16 ("mmc:
> > > sdhci_am654: Add workaround for card detect debounce timer"). This issue arises only when there is no SD card present in the MMC slot. We tested the
> > > driver with a lower timeout value and everything worked. However, as indicated in the commit message, this timeout may be related to the way the sdhci
> > > controller hardware IP works. Currently, the driver employs a sort of a "busy loop" to wait for this timeout to pass delaying the boot. Why is
> > > need to busy loop for this timeout? Is it possible to wait for it in the backgroud? Am I am missing something here?
>
> sdhci_am654_write_power_on() does have usleep_range() of 1 to 10ms. If
> that isn't sufficient to preempt and allow other drivers to probe, then
> probably worth setting sleep_us in read_poll_timeout() call.
>
>
> >
> > I am not an mmc expert, but, Isn't this sequence part of the programmer
> > manual in the TRM[1]? Either way, one additional issue I did end up with
> > when I was doing beagleplay[2] was when i booted off emmc and runtime PM
> > disabled SD/MMC interface, the MMC IP's CD mode would'nt work since the
> > IP isn't clocked. So I switched the mux mode to GPIO to use mmc CD
> > there. I haven't timed that approach where
> > SDHCI_AM654_QUIRK_FORCE_CDTEST would get set.
> >
> > [1] https://www.ti.com/lit/pdf/spruiv7
> > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts#n835
>
>
> Above is a good experiment to see if it helps boot time. Can you set
> SDCD line to GPIO and hook up using cd-gpios? You would also need to
> set ti,fails-without-test-cd
>
I will try what Nishanth said about the gpio and also increase sleep_us.
Thank for the insights!
Regards,
Joao Paulo Goncalves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: SDHCI AM654 driver delaying boot time
2023-11-10 14:19 ` Francesco Dolcini
@ 2023-11-14 8:25 ` Adrian Hunter
0 siblings, 0 replies; 6+ messages in thread
From: Adrian Hunter @ 2023-11-14 8:25 UTC (permalink / raw)
To: Francesco Dolcini, Nishanth Menon
Cc: João Paulo Silva Gonçalves, faiz_abbas@ti.com,
ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, Francesco Dolcini
On 10/11/23 16:19, Francesco Dolcini wrote:
> Hello Nishant,
>
> On Thu, Nov 09, 2023 at 11:51:59AM -0600, Nishanth Menon wrote:
>> On 18:56-20231108, João Paulo Silva Gonçalves wrote:
>>> Hello all,
>>>
>>> We are trying to minimize boot time for our AM62 devices.
>>> Unfortunately, we have identified a delay of approximately 1.5
>>> seconds caused by the sdhci_am654 driver. This delay is a result of
>>> a timeout within the driver (MAX_POWER_ON_TIMEOUT) and was
>>> introduced in commit 7ca0f16 ("mmc: sdhci_am654: Add workaround for
>>> card detect debounce timer"). This issue arises only when there is
>>> no SD card present in the MMC slot. We tested the driver with a
>>> lower timeout value and everything worked. However, as indicated in
>>> the commit message, this timeout may be related to the way the sdhci
>>> controller hardware IP works. Currently, the driver employs a sort
>>> of a "busy loop" to wait for this timeout to pass delaying the boot.
>>> Why is need to busy loop for this timeout? Is it possible to wait
>>> for it in the backgroud? Am I am missing something here?
>>
>> I am not an mmc expert, but, Isn't this sequence part of the programmer
>> manual in the TRM[1]?
>
> Probably original question from Joao was not fully understood.
>
> It is clear why the code is waiting for the CD, the issue we are
> experiencing is that the whole boot is delayed by 1.5 seconds because of
> that piece of code for no reason.
>
> - SD card exists in the system, but it's not used and the card slot is empty
> - We boot from eMMC (that has no CD pin)
> - Boot is delayed by 1.5 second because of that piece of code
So maybe don't use that code for eMMC?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-11-14 8:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 18:56 SDHCI AM654 driver delaying boot time João Paulo Silva Gonçalves
2023-11-09 17:51 ` Nishanth Menon
2023-11-10 4:38 ` Vignesh Raghavendra
2023-11-10 14:55 ` João Paulo Silva Gonçalves
2023-11-10 14:19 ` Francesco Dolcini
2023-11-14 8:25 ` Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox