All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/4] clk: allow non-blocking for nouveau_clock_astate()
@ 2014-12-22  9:11 Vince Hsu
       [not found] ` <1419239500-19703-1-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Vince Hsu @ 2014-12-22  9:11 UTC (permalink / raw)
  To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA, martin.peres-GANU6spQydw,
	seven-FA6nBp6kBxZzu6KWmfFNGwC/G2K4zDHf,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w,
	samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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>
---

v2: none. (v1 is the RFC actually)

 nvkm/include/subdev/clock.h | 2 +-
 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 36ed035d4d42..6c36f0e4385b 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 e51b72d47129..b1bbe764fa35 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
-- 
1.9.1

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-08  1:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22  9:11 [PATCH V2 1/4] clk: allow non-blocking for nouveau_clock_astate() Vince Hsu
     [not found] ` <1419239500-19703-1-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-12-22  9:11   ` [PATCH V2 2/4] pwr: make nouveau_pwr_pgob() non-static Vince Hsu
     [not found]     ` <1419239500-19703-2-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-12-23  1:37       ` Vince Hsu
     [not found]         ` <5498C743.9060402-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-01-04 22:29           ` Ben Skeggs
     [not found]             ` <CACAvsv771pkd+p6eEQPCyYBXzL+YmCOg9CeMQ8Gghe_2=d2r9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-05  1:30               ` Vince Hsu
2014-12-22  9:11   ` [PATCH V2 3/4] pwr: add support for GK20A Vince Hsu
2014-12-22  9:11   ` [PATCH V2 4/4] clk: allow users to enable auto mode when loading driver Vince Hsu
2015-01-07  5:10   ` [PATCH V2 1/4] clk: allow non-blocking for nouveau_clock_astate() Vince Hsu
     [not found]     ` <54ACBFDC.4000603-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-01-07 11:22       ` Ben Skeggs
     [not found]         ` <CACAvsv7ej-nd-x8stSvH8uHVu0W1p1A+O4mQJDV1yc76cUgcKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-07 14:14           ` Vince Hsu
2015-01-07 15:34       ` Martin Peres
     [not found]         ` <54AD51F6.8090001-GANU6spQydw@public.gmane.org>
2015-01-08  1:55           ` Vince Hsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.