aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2014-01-21 09:24:42 -0500
committerChris Ball <chris@printf.net>2014-03-04 11:45:07 -0500
commit6e3076c27da0ac653dda6503dadd2852c2d0eac1 (patch)
tree6071b6093d697ba7888edec1d2acfac923265a64 /drivers/mmc
parent4ea42235b5a999eff57f38696ae532a6b9377c55 (diff)
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index d9c84ea46b63..6cb4e19dcf07 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -192,6 +192,7 @@ struct omap_hsmmc_host {
192 int reqs_blocked; 192 int reqs_blocked;
193 int use_reg; 193 int use_reg;
194 int req_in_progress; 194 int req_in_progress;
195 unsigned long clk_rate;
195 struct omap_hsmmc_next next_data; 196 struct omap_hsmmc_next next_data;
196 struct omap_mmc_platform_data *pdata; 197 struct omap_mmc_platform_data *pdata;
197}; 198};
@@ -1360,7 +1361,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
1360 if (clkd == 0) 1361 if (clkd == 0)
1361 clkd = 1; 1362 clkd = 1;
1362 1363
1363 cycle_ns = 1000000000 / (clk_get_rate(host->fclk) / clkd); 1364 cycle_ns = 1000000000 / (host->clk_rate / clkd);
1364 timeout = timeout_ns / cycle_ns; 1365 timeout = timeout_ns / cycle_ns;
1365 timeout += timeout_clks; 1366 timeout += timeout_clks;
1366 if (timeout) { 1367 if (timeout) {
@@ -1484,6 +1485,7 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
1484 host->reqs_blocked = 0; 1485 host->reqs_blocked = 0;
1485 WARN_ON(host->mrq != NULL); 1486 WARN_ON(host->mrq != NULL);
1486 host->mrq = req; 1487 host->mrq = req;
1488 host->clk_rate = clk_get_rate(host->fclk);
1487 err = omap_hsmmc_prepare_data(host, req); 1489 err = omap_hsmmc_prepare_data(host, req);
1488 if (err) { 1490 if (err) {
1489 req->cmd->error = err; 1491 req->cmd->error = err;