mmc: omap_hsmmc: save clock rate to use in interrupt context
clk_get_rate throws DEBUG_LOCKS_WARN_ON(in_interrupt()) warning if called from interrupt context. use cached clock rate in set_data_timeout, so that set_data_timeout can be called from interrupt context. Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <chris@printf.net>
This commit is contained in:
parent
4ea42235b5
commit
6e3076c27d
|
@ -192,6 +192,7 @@ struct omap_hsmmc_host {
|
||||||
int reqs_blocked;
|
int reqs_blocked;
|
||||||
int use_reg;
|
int use_reg;
|
||||||
int req_in_progress;
|
int req_in_progress;
|
||||||
|
unsigned long clk_rate;
|
||||||
struct omap_hsmmc_next next_data;
|
struct omap_hsmmc_next next_data;
|
||||||
struct omap_mmc_platform_data *pdata;
|
struct omap_mmc_platform_data *pdata;
|
||||||
};
|
};
|
||||||
|
@ -1360,7 +1361,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
|
||||||
if (clkd == 0)
|
if (clkd == 0)
|
||||||
clkd = 1;
|
clkd = 1;
|
||||||
|
|
||||||
cycle_ns = 1000000000 / (clk_get_rate(host->fclk) / clkd);
|
cycle_ns = 1000000000 / (host->clk_rate / clkd);
|
||||||
timeout = timeout_ns / cycle_ns;
|
timeout = timeout_ns / cycle_ns;
|
||||||
timeout += timeout_clks;
|
timeout += timeout_clks;
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
|
@ -1484,6 +1485,7 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
|
||||||
host->reqs_blocked = 0;
|
host->reqs_blocked = 0;
|
||||||
WARN_ON(host->mrq != NULL);
|
WARN_ON(host->mrq != NULL);
|
||||||
host->mrq = req;
|
host->mrq = req;
|
||||||
|
host->clk_rate = clk_get_rate(host->fclk);
|
||||||
err = omap_hsmmc_prepare_data(host, req);
|
err = omap_hsmmc_prepare_data(host, req);
|
||||||
if (err) {
|
if (err) {
|
||||||
req->cmd->error = err;
|
req->cmd->error = err;
|
||||||
|
|
Loading…
Reference in New Issue