mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] mci: sdhci: atmel: fix truncation when reading out caps
@ 2024-02-12 15:45 Ahmad Fatoum
  2024-02-13  9:19 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-02-12 15:45 UTC (permalink / raw)
  To: barebox; +Cc: Joacim Zetterling, Ahmad Fatoum

The capability read out was changed a few years ago to use 32-bit
accessors, but the variable that it was stored in remained at 16-bit
leading to truncation of the upper bits and breaking detection of the
SD-Card on my SAMA5D27-SOM1-EK:

  ERROR: barebox-environment chosen:environment-sd.of: probe failed: No such file or directory

Fix this by using the appropriate type. The commit introducing the
regression touched multiple drivers, but the Atmel SDHCI one is the only
one which still used a 16-bit type.

Fixes: 1570f8d8d87e ("mci: sdhci: straighten capabilities register")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/atmel-sdhci-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/atmel-sdhci-common.c b/drivers/mci/atmel-sdhci-common.c
index 171737ab01d4..a69d6b67b551 100644
--- a/drivers/mci/atmel-sdhci-common.c
+++ b/drivers/mci/atmel-sdhci-common.c
@@ -39,7 +39,7 @@ static inline struct at91_sdhci *to_priv(struct sdhci *sdhci)
 void at91_sdhci_host_capability(struct at91_sdhci *host,
 				unsigned *voltages)
 {
-	u16 caps;
+	u32 caps;
 
 	caps = sdhci_read32(&host->sdhci, SDHCI_CAPABILITIES);
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] mci: sdhci: atmel: fix truncation when reading out caps
  2024-02-12 15:45 [PATCH master] mci: sdhci: atmel: fix truncation when reading out caps Ahmad Fatoum
@ 2024-02-13  9:19 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-02-13  9:19 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Joacim Zetterling


On Mon, 12 Feb 2024 16:45:51 +0100, Ahmad Fatoum wrote:
> The capability read out was changed a few years ago to use 32-bit
> accessors, but the variable that it was stored in remained at 16-bit
> leading to truncation of the upper bits and breaking detection of the
> SD-Card on my SAMA5D27-SOM1-EK:
> 
>   ERROR: barebox-environment chosen:environment-sd.of: probe failed: No such file or directory
> 
> [...]

Applied, thanks!

[1/1] mci: sdhci: atmel: fix truncation when reading out caps
      https://git.pengutronix.de/cgit/barebox/commit/?id=1db4fae6e97c (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-13  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 15:45 [PATCH master] mci: sdhci: atmel: fix truncation when reading out caps Ahmad Fatoum
2024-02-13  9:19 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox