summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2018-05-03 00:08:10 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 07:42:02 -0400
commitc92afad630f0539dfd2d28369d493715648b4ace (patch)
treecbcd80480693f6a7a9c7cc71366fa2bda74ed08b
parent6e739d924fe9b778fa82396e0e941143f498acb8 (diff)
gpu: nvgpu: use nvgpu logging in clk arbiter
Clk arbiter uses the legacy gk20a_dbg_fn logging APIs. Use nvgpu logging instead, while also defining a new log mask for clk arbiter. Jira VQRM-3741 Change-Id: I86feb4fa434b404705cc3fba1e854180d4df508d Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1707394 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/clk_arb.c10
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c20
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/log.h1
3 files changed, 17 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk_arb.c b/drivers/gpu/nvgpu/common/linux/clk_arb.c
index 7cb3752a..85d9d11c 100644
--- a/drivers/gpu/nvgpu/common/linux/clk_arb.c
+++ b/drivers/gpu/nvgpu/common/linux/clk_arb.c
@@ -766,7 +766,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct work_struct *work)
766 766
767#endif 767#endif
768 768
769 gk20a_dbg_fn(""); 769 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
770 770
771 /* bail out if gpu is down */ 771 /* bail out if gpu is down */
772 if (nvgpu_atomic64_read(&arb->alarm_mask) & EVENT(ALARM_GPU_LOST)) 772 if (nvgpu_atomic64_read(&arb->alarm_mask) & EVENT(ALARM_GPU_LOST))
@@ -1045,7 +1045,7 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
1045 int index; 1045 int index;
1046 struct nvgpu_clk_vf_table *table; 1046 struct nvgpu_clk_vf_table *table;
1047 1047
1048 gk20a_dbg_fn(""); 1048 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
1049 1049
1050 if (!g->ops.clk_arb.get_arbiter_clk_domains) 1050 if (!g->ops.clk_arb.get_arbiter_clk_domains)
1051 return 0; 1051 return 0;
@@ -1230,7 +1230,7 @@ int nvgpu_clk_arb_init_session(struct gk20a *g,
1230 struct nvgpu_clk_arb *arb = g->clk_arb; 1230 struct nvgpu_clk_arb *arb = g->clk_arb;
1231 struct nvgpu_clk_session *session = *(_session); 1231 struct nvgpu_clk_session *session = *(_session);
1232 1232
1233 gk20a_dbg_fn(""); 1233 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
1234 1234
1235 if (!g->ops.clk_arb.get_arbiter_clk_domains) 1235 if (!g->ops.clk_arb.get_arbiter_clk_domains)
1236 return 0; 1236 return 0;
@@ -1279,7 +1279,7 @@ void nvgpu_clk_arb_free_session(struct nvgpu_ref *refcount)
1279 struct nvgpu_clk_dev *dev, *tmp; 1279 struct nvgpu_clk_dev *dev, *tmp;
1280 struct llist_node *head; 1280 struct llist_node *head;
1281 1281
1282 gk20a_dbg_fn(""); 1282 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
1283 1283
1284 if (arb) { 1284 if (arb) {
1285 nvgpu_spinlock_acquire(&arb->sessions_lock); 1285 nvgpu_spinlock_acquire(&arb->sessions_lock);
@@ -1300,7 +1300,7 @@ void nvgpu_clk_arb_release_session(struct gk20a *g,
1300{ 1300{
1301 struct nvgpu_clk_arb *arb = g->clk_arb; 1301 struct nvgpu_clk_arb *arb = g->clk_arb;
1302 1302
1303 gk20a_dbg_fn(""); 1303 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
1304 1304
1305 session->zombie = true; 1305 session->zombie = true;
1306 nvgpu_ref_put(&session->refcount, nvgpu_clk_arb_free_session); 1306 nvgpu_ref_put(&session->refcount, nvgpu_clk_arb_free_session);
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c b/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
index 27afe777..62b6ae17 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
@@ -55,7 +55,7 @@ static int nvgpu_clk_arb_release_completion_dev(struct inode *inode,
55 struct nvgpu_clk_session *session = dev->session; 55 struct nvgpu_clk_session *session = dev->session;
56 56
57 57
58 gk20a_dbg_fn(""); 58 nvgpu_log(session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
59 59
60 nvgpu_ref_put(&session->refcount, nvgpu_clk_arb_free_session); 60 nvgpu_ref_put(&session->refcount, nvgpu_clk_arb_free_session);
61 nvgpu_ref_put(&dev->refcount, nvgpu_clk_arb_free_fd); 61 nvgpu_ref_put(&dev->refcount, nvgpu_clk_arb_free_fd);
@@ -66,7 +66,7 @@ static unsigned int nvgpu_clk_arb_poll_dev(struct file *filp, poll_table *wait)
66{ 66{
67 struct nvgpu_clk_dev *dev = filp->private_data; 67 struct nvgpu_clk_dev *dev = filp->private_data;
68 68
69 gk20a_dbg_fn(""); 69 nvgpu_log(dev->session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
70 70
71 poll_wait(filp, &dev->readout_wq.wq, wait); 71 poll_wait(filp, &dev->readout_wq.wq, wait);
72 return nvgpu_atomic_xchg(&dev->poll_mask, 0); 72 return nvgpu_atomic_xchg(&dev->poll_mask, 0);
@@ -81,7 +81,7 @@ static int nvgpu_clk_arb_release_event_dev(struct inode *inode,
81 81
82 arb = session->g->clk_arb; 82 arb = session->g->clk_arb;
83 83
84 gk20a_dbg_fn(""); 84 nvgpu_log(session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
85 85
86 if (arb) { 86 if (arb) {
87 nvgpu_spinlock_acquire(&arb->users_lock); 87 nvgpu_spinlock_acquire(&arb->users_lock);
@@ -128,7 +128,8 @@ static ssize_t nvgpu_clk_arb_read_event_dev(struct file *filp, char __user *buf,
128 struct nvgpu_gpu_event_info info; 128 struct nvgpu_gpu_event_info info;
129 ssize_t err; 129 ssize_t err;
130 130
131 gk20a_dbg_fn("filp=%p, buf=%p, size=%zu", filp, buf, size); 131 nvgpu_log(dev->session->g, gpu_dbg_fn | gpu_dbg_clk_arb,
132 "filp=%p, buf=%p, size=%zu", filp, buf, size);
132 133
133 if ((size - *off) < sizeof(info)) 134 if ((size - *off) < sizeof(info))
134 return 0; 135 return 0;
@@ -242,7 +243,7 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g,
242 char name[64]; 243 char name[64];
243 struct nvgpu_clk_dev *dev; 244 struct nvgpu_clk_dev *dev;
244 245
245 gk20a_dbg_fn(""); 246 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
246 247
247 dev = nvgpu_kzalloc(g, sizeof(*dev)); 248 dev = nvgpu_kzalloc(g, sizeof(*dev));
248 if (!dev) 249 if (!dev)
@@ -298,7 +299,7 @@ int nvgpu_clk_arb_install_event_fd(struct gk20a *g,
298 struct nvgpu_clk_dev *dev; 299 struct nvgpu_clk_dev *dev;
299 int fd; 300 int fd;
300 301
301 gk20a_dbg_fn(""); 302 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
302 303
303 fd = nvgpu_clk_arb_install_fd(g, session, &event_dev_ops, &dev); 304 fd = nvgpu_clk_arb_install_fd(g, session, &event_dev_ops, &dev);
304 if (fd < 0) 305 if (fd < 0)
@@ -330,7 +331,7 @@ int nvgpu_clk_arb_install_request_fd(struct gk20a *g,
330 struct nvgpu_clk_dev *dev; 331 struct nvgpu_clk_dev *dev;
331 int fd; 332 int fd;
332 333
333 gk20a_dbg_fn(""); 334 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
334 335
335 fd = nvgpu_clk_arb_install_fd(g, session, &completion_dev_ops, &dev); 336 fd = nvgpu_clk_arb_install_fd(g, session, &completion_dev_ops, &dev);
336 if (fd < 0) 337 if (fd < 0)
@@ -349,7 +350,7 @@ int nvgpu_clk_arb_commit_request_fd(struct gk20a *g,
349 struct fd fd; 350 struct fd fd;
350 int err = 0; 351 int err = 0;
351 352
352 gk20a_dbg_fn(""); 353 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
353 354
354 fd = fdget(request_fd); 355 fd = fdget(request_fd);
355 if (!fd.file) 356 if (!fd.file)
@@ -383,7 +384,8 @@ int nvgpu_clk_arb_set_session_target_mhz(struct nvgpu_clk_session *session,
383 struct fd fd; 384 struct fd fd;
384 int err = 0; 385 int err = 0;
385 386
386 gk20a_dbg_fn("domain=0x%08x target_mhz=%u", api_domain, target_mhz); 387 nvgpu_log(session->g, gpu_dbg_fn | gpu_dbg_clk_arb,
388 "domain=0x%08x target_mhz=%u", api_domain, target_mhz);
387 389
388 fd = fdget(request_fd); 390 fd = fdget(request_fd);
389 if (!fd.file) 391 if (!fd.file)
diff --git a/drivers/gpu/nvgpu/include/nvgpu/log.h b/drivers/gpu/nvgpu/include/nvgpu/log.h
index 87ab17ee..e64c72f3 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/log.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/log.h
@@ -79,6 +79,7 @@ void __nvgpu_log_dbg(struct gk20a *g, u64 log_mask,
79#define gpu_dbg_sgl BIT(23) /* SGL related traces. */ 79#define gpu_dbg_sgl BIT(23) /* SGL related traces. */
80#define gpu_dbg_vidmem BIT(24) /* VIDMEM tracing. */ 80#define gpu_dbg_vidmem BIT(24) /* VIDMEM tracing. */
81#define gpu_dbg_nvlink BIT(25) /* nvlink Operation tracing. */ 81#define gpu_dbg_nvlink BIT(25) /* nvlink Operation tracing. */
82#define gpu_dbg_clk_arb BIT(26) /* Clk arbiter debugging. */
82#define gpu_dbg_mem BIT(31) /* memory accesses; very verbose. */ 83#define gpu_dbg_mem BIT(31) /* memory accesses; very verbose. */
83 84
84/** 85/**