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

Commit c6303c5d authored by Baolin Wang's avatar Baolin Wang Committed by Ulf Hansson
Browse files

mmc: sdhci-sprd: Fix the incorrect soft reset operation when runtime resuming



The SD host controller specification defines 3 types software reset:
software reset for data line, software reset for command line and software
reset for all. Software reset for all means this reset affects the entire
Host controller except for the card detection circuit.

In sdhci_runtime_resume_host() we always do a software "reset for all",
which causes the Spreadtrum variant controller to work abnormally after
resuming. To fix the problem, let's do a software reset for the data and
the command part, rather than "for all".

However, as sdhci_runtime_resume() is a common sdhci function and we don't
want to change the behaviour for other variants, let's introduce a new
in-parameter for it. This enables the caller to decide if a "reset for all"
shall be done or not.

Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Fixes: fb8bd90f ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent e21a712a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -883,7 +883,7 @@ static int sdhci_acpi_runtime_resume(struct device *dev)


	sdhci_acpi_byt_setting(&c->pdev->dev);
	sdhci_acpi_byt_setting(&c->pdev->dev);


	return sdhci_runtime_resume_host(c->host);
	return sdhci_runtime_resume_host(c->host, 0);
}
}


#endif
#endif
+1 −1
Original line number Original line Diff line number Diff line
@@ -1705,7 +1705,7 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
		esdhc_pltfm_set_clock(host, imx_data->actual_clock);
		esdhc_pltfm_set_clock(host, imx_data->actual_clock);
	}
	}


	err = sdhci_runtime_resume_host(host);
	err = sdhci_runtime_resume_host(host, 0);
	if (err)
	if (err)
		goto disable_ipg_clk;
		goto disable_ipg_clk;


+1 −1
Original line number Original line Diff line number Diff line
@@ -289,7 +289,7 @@ static int sdhci_at91_runtime_resume(struct device *dev)
	}
	}


out:
out:
	return sdhci_runtime_resume_host(host);
	return sdhci_runtime_resume_host(host, 0);
}
}
#endif /* CONFIG_PM */
#endif /* CONFIG_PM */


+2 −2
Original line number Original line Diff line number Diff line
@@ -167,7 +167,7 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip)


err_pci_runtime_suspend:
err_pci_runtime_suspend:
	while (--i >= 0)
	while (--i >= 0)
		sdhci_runtime_resume_host(chip->slots[i]->host);
		sdhci_runtime_resume_host(chip->slots[i]->host, 0);
	return ret;
	return ret;
}
}


@@ -181,7 +181,7 @@ static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip)
		if (!slot)
		if (!slot)
			continue;
			continue;


		ret = sdhci_runtime_resume_host(slot->host);
		ret = sdhci_runtime_resume_host(slot->host, 0);
		if (ret)
		if (ret)
			return ret;
			return ret;
	}
	}
+1 −1
Original line number Original line Diff line number Diff line
@@ -554,7 +554,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
	if (!IS_ERR(pxa->clk_core))
	if (!IS_ERR(pxa->clk_core))
		clk_prepare_enable(pxa->clk_core);
		clk_prepare_enable(pxa->clk_core);


	return sdhci_runtime_resume_host(host);
	return sdhci_runtime_resume_host(host, 0);
}
}
#endif
#endif


Loading