lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFqNWirdJMA_7kpWjUcNYh4q9RLOLW+eY1hPztw4roEsMw@mail.gmail.com>
Date: Mon, 28 Apr 2025 18:08:41 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Ricky Wu <ricky_wu@...ltek.com>
Cc: linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org, 
	viro@...iv.linux.org.uk
Subject: Re: [PATCH] mmc: rtsx: usb add 100ms delay before power on

On Mon, 21 Apr 2025 at 05:15, Ricky Wu <ricky_wu@...ltek.com> wrote:
>
> this delay make sure the last time power off did the discharge clean.
> During the card recognition process, card power will be toggled in 1ms,
> and 1ms is not enough to discharge cleanly
>
> Signed-off-by: Ricky Wu <ricky_wu@...ltek.com>
> ---
>  drivers/mmc/host/rtsx_usb_sdmmc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
> index 1edfe2acf809..e5820b2bb380 100644
> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
> @@ -952,6 +952,8 @@ static int sd_power_on(struct rtsx_usb_sdmmc *host)
>         struct rtsx_ucr *ucr = host->ucr;
>         int err;
>
> +       msleep(100);
> +

Wouldn't it be better to do this at power-off instead then? Otherwise
you may end up adding 100ms at card-initialization even if the card
has been off for a long time?

Or maybe this is because we are worried about bootloaders turning on
the card and leaving it in that state when the kernel boots?

>         dev_dbg(sdmmc_dev(host), "%s\n", __func__);
>         rtsx_usb_init_cmd(ucr);
>         rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
> --
> 2.25.1
>

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ