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

Commit 7ba53b8e authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Ram Prakash Gupta
Browse files

mmc: Porting minor fixes for mmc and sdcard



This is a squash of below minor fixes:
--------------------------------------
98ecf61 mmc: core: Make host->card as NULL when
		card is removed
a927374b	mmc: core: Remove unused variable cached_ext_csd
04ac7bd	mmc: core: Ignore CRC errors with CMD13 while
		executing tuning
772de4c	mmc: core: update host->card after getting RCA
		for SD card
35cf592	mmc: core: fix race between mmc_power_off and
		mmc_power_up
0b56648	mmc: host: add support to allow SANITIZE operation.

Change-Id: Ib238929eac1a1befc35adb301b1ca6648e00c4db
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 209affdc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -459,7 +459,8 @@ static int ioctl_do_sanitize(struct mmc_card *card)
{
	int err;

	if (!mmc_can_sanitize(card)) {
	if (!mmc_can_sanitize(card) &&
			(card->host->caps2 & MMC_CAP2_SANITIZE)) {
		pr_warn("%s: %s - SANITIZE is not supported\n",
			mmc_hostname(card->host), __func__);
		err = -EOPNOTSUPP;
+3 −0
Original line number Diff line number Diff line
@@ -260,12 +260,15 @@ EXPORT_SYMBOL(mmc_unregister_driver);
static void mmc_release_card(struct device *dev)
{
	struct mmc_card *card = mmc_dev_to_card(dev);
	struct mmc_host *host = card->host;

	sdio_free_common_cis(card);

	kfree(card->info);

	kfree(card);
	if (host)
		host->card = NULL;
}

/*
+3 −4
Original line number Diff line number Diff line
@@ -3579,17 +3579,16 @@ void mmc_rescan(struct work_struct *work)

void mmc_start_host(struct mmc_host *host)
{
	mmc_claim_host(host);
	host->f_init = max(freqs[0], host->f_min);
	host->rescan_disable = 0;
	host->ios.power_mode = MMC_POWER_UNDEFINED;

	if (!(host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)) {
		mmc_claim_host(host);
	if (!(host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP))
		mmc_power_up(host, host->ocr_avail);
		mmc_release_host(host);
	}

	mmc_gpiod_request_cd_irq(host);
	mmc_release_host(host);
	mmc_register_extcon(host);
	_mmc_detect_change(host, 0, false);
}
+4 −2
Original line number Diff line number Diff line
@@ -1066,6 +1066,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
		err = mmc_send_relative_addr(host, &card->rca);
		if (err)
			goto free_card;
		host->card = card;
	}

	if (!oldcard) {
@@ -1170,12 +1171,13 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
	card->clk_scaling_highest = mmc_sd_get_max_clock(card);
	card->clk_scaling_lowest = host->f_min;

	host->card = card;
	return 0;

free_card:
	if (!oldcard)
	if (!oldcard) {
		host->card = NULL;
		mmc_remove_card(card);
	}

	return err;
}
+8 −2
Original line number Diff line number Diff line
@@ -2789,7 +2789,13 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
	}

	if (host->ops->platform_execute_tuning) {
		/*
		 * Make sure re-tuning won't get triggered for the CRC errors
		 * occurred while executing tuning
		 */
		mmc_retune_disable(mmc);
		err = host->ops->platform_execute_tuning(host, opcode);
		mmc_retune_enable(mmc);
		goto out;
	}

Loading