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

Commit ad82bfea authored by Ulf Hansson's avatar Ulf Hansson
Browse files

mmc: mmci: Move all CMD irq handling to mmci_cmd_irq()



This patch won't change the behavior of how mmci deals with CMD irqs.
By moving code from mmci_irq() to mmci_cmd_irq(), we getter a better
overview of what going on.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: default avatarKees Cook <keescook@chromium.org>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 1cb9da50
Loading
Loading
Loading
Loading
+12 −10
Original line number Original line Diff line number Diff line
@@ -960,9 +960,17 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
	     unsigned int status)
	     unsigned int status)
{
{
	void __iomem *base = host->base;
	void __iomem *base = host->base;
	bool sbc = (cmd == host->mrq->sbc);
	bool sbc, busy_resp;
	bool busy_resp = host->variant->busy_detect &&

			(cmd->flags & MMC_RSP_BUSY);
	if (!cmd)
		return;

	sbc = (cmd == host->mrq->sbc);
	busy_resp = host->variant->busy_detect && (cmd->flags & MMC_RSP_BUSY);

	if (!((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|
		MCI_CMDSENT|MCI_CMDRESPEND)))
		return;


	/* Check if we need to wait for busy completion. */
	/* Check if we need to wait for busy completion. */
	if (host->busy_status && (status & MCI_ST_CARDBUSY))
	if (host->busy_status && (status & MCI_ST_CARDBUSY))
@@ -1209,8 +1217,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
	spin_lock(&host->lock);
	spin_lock(&host->lock);


	do {
	do {
		struct mmc_command *cmd;

		status = readl(host->base + MMCISTATUS);
		status = readl(host->base + MMCISTATUS);


		if (host->singleirq) {
		if (host->singleirq) {
@@ -1230,11 +1236,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)


		dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status);
		dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status);


		cmd = host->cmd;
		mmci_cmd_irq(host, host->cmd, status);
		if ((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|
			MCI_CMDSENT|MCI_CMDRESPEND) && cmd)
			mmci_cmd_irq(host, cmd, status);

		mmci_data_irq(host, host->data, status);
		mmci_data_irq(host, host->data, status);


		/* Don't poll for busy completion in irq context. */
		/* Don't poll for busy completion in irq context. */