Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
mmc: sd: add fall-back extension register parsing attempt
Several types of cards have a common bug where the vendor did not
populate the General Information block, but extension registers are
present at assumed function offsets, and the features are correctly
implemented.

Probe the offsets to see if valid data is returned.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
  • Loading branch information
P33M committed Mar 5, 2026
commit ec1ef20dbf0684a8414bf54c1cdb419059f9473c
20 changes: 20 additions & 0 deletions drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,26 @@ static int mmc_sd_read_ext_regs(struct mmc_card *card)
goto out;
}

/* Some cards have zeroes in GEN_INFO but correctly implement EXT_PERF and EXT_PWR */
if (!memcmp(card->ext_reg_buf, gen_info_buf, 512)) {
pr_info("%s: using fall-back extension register parsing\n",
mmc_hostname(card->host));
/* PWR typically hard-coded at FNO=1 */
err = sd_parse_ext_reg_power(card, 1, 0, 0);
if (err) {
pr_err("%s: error %d parsing SD Power extension\n",
mmc_hostname(card->host), err);
goto out;
}
/* PERF typically hard-coded at FNO=2 */
err = sd_parse_ext_reg_perf(card, 2, 0, 0);
if (err) {
pr_err("%s: error %d parsing SD Performance extension\n",
mmc_hostname(card->host), err);
}
goto out;
}

/* General info structure revision. */
memcpy(&rev, &gen_info_buf[0], 2);

Expand Down