drm/nouveau/clk: allow non-blocking for nouveau_clock_astate()
authorVince Hsu <vinceh@nvidia.com>
Mon, 22 Dec 2014 09:11:37 +0000 (17:11 +0800)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Jan 2015 02:15:02 +0000 (12:15 +1000)
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>
drivers/gpu/drm/nouveau/core/include/subdev/clock.h
drivers/gpu/drm/nouveau/core/subdev/clock/base.c

index 0fd5e4a3a7a276a08fc318e0aa4e25e02492ae48..39ad2d2cee2a2ac0ca6e097b23c6d2d708e81aa2 100644 (file)
@@ -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);
 
index e51b72d471293e304053c46eb4890c892f6a94a0..b1bbe764fa35ca7d05693cdcf6eeebf3a7c4358c 100644 (file)
@@ -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
This page took 0.027032 seconds and 5 git commands to generate.