diff options
author | Vince Hsu <vinceh@nvidia.com> | 2014-12-22 17:11:37 +0800 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-10 23:57:07 +1000 |
commit | 870538ee246836647e3b0a09fc2175d41319ac52 (patch) | |
tree | e62562a7a9729daf0299c2ea5c97b2146fd7ddb6 /nvkm | |
parent | 4f43b86b4e5a393d154d358d423614acd7850770 (diff) | |
download | nouveau-870538ee246836647e3b0a09fc2175d41319ac52.tar.gz |
clk: allow non-blocking for nouveau_clock_astate()
There might be some callers of nouveau_clock_astate(), and they are from
inetrrupt context. So we must ensure that this function can be atomic in
that condition. This patch adds one parameter which is subsequently passed
to nouveau_pstate_calc(). Therefore we can choose whether we want to wait
for the pstate work's completion or not.
Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm')
-rw-r--r-- | nvkm/include/subdev/clock.h | 2 | ||||
-rw-r--r-- | nvkm/subdev/clock/base.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/nvkm/include/subdev/clock.h b/nvkm/include/subdev/clock.h index 0fd5e4a3a..39ad2d2ce 100644 --- a/nvkm/include/subdev/clock.h +++ b/nvkm/include/subdev/clock.h @@ -159,7 +159,7 @@ int nva3_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *, int clk, struct nouveau_pll_vals *); int nouveau_clock_ustate(struct nouveau_clock *, int req, int pwr); -int nouveau_clock_astate(struct nouveau_clock *, int req, int rel); +int nouveau_clock_astate(struct nouveau_clock *, int req, int rel, bool wait); int nouveau_clock_dstate(struct nouveau_clock *, int req, int rel); int nouveau_clock_tstate(struct nouveau_clock *, int req, int rel); diff --git a/nvkm/subdev/clock/base.c b/nvkm/subdev/clock/base.c index e51b72d47..b1bbe764f 100644 --- a/nvkm/subdev/clock/base.c +++ b/nvkm/subdev/clock/base.c @@ -430,13 +430,13 @@ nouveau_clock_ustate(struct nouveau_clock *clk, int req, int pwr) } int -nouveau_clock_astate(struct nouveau_clock *clk, int req, int rel) +nouveau_clock_astate(struct nouveau_clock *clk, int req, int rel, bool wait) { if (!rel) clk->astate = req; if ( rel) clk->astate += rel; clk->astate = min(clk->astate, clk->state_nr - 1); clk->astate = max(clk->astate, 0); - return nouveau_pstate_calc(clk, true); + return nouveau_pstate_calc(clk, wait); } int |