Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 182931de authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: sd: fix the maximum au_size for SD3.0"

parents e47d6f4d 5641e819
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static int mmc_decode_scr(struct mmc_card *card)
static int mmc_read_ssr(struct mmc_card *card)
{
	unsigned int au, es, et, eo;
	int err, i;
	int err, i, max_au;
	u32 *ssr;

	if (!(card->csd.cmdclass & CCC_APP_SPEC)) {
@@ -246,12 +246,15 @@ static int mmc_read_ssr(struct mmc_card *card)
	for (i = 0; i < 16; i++)
		ssr[i] = be32_to_cpu(ssr[i]);

	/* SD3.0 increases max AU size to 64MB (0xF) from 4MB (0x9) */
	max_au = card->scr.sda_spec3 ? 0xF : 0x9;

	/*
	 * UNSTUFF_BITS only works with four u32s so we have to offset the
	 * bitfield positions accordingly.
	 */
	au = UNSTUFF_BITS(ssr, 428 - 384, 4);
	if (au > 0 && au <= 9) {
	if (au > 0 && au <= max_au) {
		card->ssr.au = 1 << (au + 4);
		es = UNSTUFF_BITS(ssr, 408 - 384, 16);
		et = UNSTUFF_BITS(ssr, 402 - 384, 6);