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

Commit 02c8202f authored by Talel Shenhar's avatar Talel Shenhar Committed by Venkat Gopalakrishnan
Browse files

mmc: sdhci: cmdq: add notification for cmdq halt



During halted CMDQ mode, HW expects descriptors sizes
same as used in CMDQ mode.
Our SW uses the legacy path (SDHCI) in case CMDQ is halted,
thus, we need to update legacy path of the fact that we
are in Halted CMDQ state so it can adjust the descriptors
size accordingly.
This change adds a notification mechanism for that purpose.

Change-Id: Iabb473696fb11827dfcce9b137c26b2c5a5a879d
Signed-off-by: default avatarTalel Shenhar <tatias@codeaurora.org>
parent dcdc7a57
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1427,6 +1427,8 @@ int mmc_cmdq_halt(struct mmc_host *host, bool halt)
	mmc_host_clk_hold(host);
	if (host->cmdq_ops->halt) {
		err = host->cmdq_ops->halt(host, halt);
		if (!err && host->ops->notify_halt)
			host->ops->notify_halt(host, halt);
		if (!err && halt)
			mmc_host_set_halt(host);
		else if (!err && !halt)
+15 −0
Original line number Diff line number Diff line
@@ -1529,6 +1529,20 @@ static int sdhci_disable(struct mmc_host *mmc)
	return 0;
}

static void sdhci_notify_halt(struct mmc_host *mmc, bool halt)
{
	struct sdhci_host *host = mmc_priv(mmc);

	pr_debug("%s: halt notification was sent, halt=%d\n",
		mmc_hostname(mmc), halt);
	if (host->flags & SDHCI_USE_ADMA_64BIT) {
		if (halt)
			host->adma_desc_line_sz = 16;
		else
			host->adma_desc_line_sz = 12;
	}
}

static inline void sdhci_update_power_policy(struct sdhci_host *host,
		enum sdhci_power_policy policy)
{
@@ -2559,6 +2573,7 @@ static const struct mmc_host_ops sdhci_ops = {
	.enable		= sdhci_enable,
	.disable	= sdhci_disable,
	.notify_load	= sdhci_notify_load,
	.notify_halt	= sdhci_notify_halt,
};

/*****************************************************************************\
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ struct mmc_host_ops {
	unsigned long (*get_max_frequency)(struct mmc_host *host);
	unsigned long (*get_min_frequency)(struct mmc_host *host);
	int	(*notify_load)(struct mmc_host *, enum mmc_load);
	void	(*notify_halt)(struct mmc_host *mmc, bool halt);
};

struct mmc_card;