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] [thread-next>] [day] [month] [year] [list]
Message-ID: <096e9122-23b8-5a36-7779-28994187c620@intel.com>
Date:   Mon, 4 Sep 2023 10:38:11 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     mathieu <mathieu.moneyron@...il.com>,
        ludovic.desroches@...rochip.com, ulf.hansson@...aro.org,
        nicolas.ferre@...rochip.com, alexandre.belloni@...tlin.com,
        Eugen Hristev <eugen.hristev@...rochip.com>
Cc:     linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: Fix force card detect in sdhci

+ Eugen Hristev

On 30/08/23 12:23, mathieu wrote:
> From: Mathieu Moneyron <mathieu.moneyron@...il.com>
> 
> On the ATMEL at91 when using the non-removable flag in device tree and not
> using the card-detect pin inside the device-tree pinctrl, the card detect
> pin is physically still used which can cause unknown behaviour when this
> pin is used for other purposes.
> 
> From my interpretation this seems to be caused by a hardware design flaw
> and the real hardware is not working as intended by the documentation.
> 
> Signed-off-by: Mathieu Moneyron <mathieu.moneyron@...il.com>
> ---
>  drivers/mmc/host/sdhci-of-at91.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
> index 69fef88e7..4fd6bfbf6 100644
> --- a/drivers/mmc/host/sdhci-of-at91.c
> +++ b/drivers/mmc/host/sdhci-of-at91.c
> @@ -51,10 +51,15 @@ struct sdhci_at91_priv {
>  static void sdhci_at91_set_force_card_detect(struct sdhci_host *host)
>  {
>  	u8 mc1r;
> +	u8 ctrl;
>  
>  	mc1r = readb(host->ioaddr + SDMMC_MC1R);
>  	mc1r |= SDMMC_MC1R_FCD;
>  	writeb(mc1r, host->ioaddr + SDMMC_MC1R);
> +
> +	ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL);
> +	ctrl |= SDHCI_CTRL_CDTEST_INS | SDHCI_CTRL_CDTEST_EN;
> +	writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
>  }
>  
>  static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ