From 85d7b3c5cc2e081c8bc81f43cef08738a254fc32 Mon Sep 17 00:00:00 2001 From: Sourab Gupta Date: Mon, 7 May 2018 09:27:30 +0530 Subject: gpu: nvgpu: handle clk arb event posting in OS specific code The mechanism of posting events to userspace is OS specific. In linux this works through poll fd, wherein we can make use of nvgpu_cond variables to poll and trigger the corresponding wait_queue. The post event functionality on QNX doesn't work on poll though. It uses iofunc_notify_trigger to post the events to the calling process. As such QNX can't work with nvgpu_cond's. To overcome this issue, it is proposed to create OS specific interface function for posting clk arb events. Linux can call nvgpu_cond based implementation, which makes sense since these are already initialized and poll'ed in Linux specific code only. QNX can implement this interface to call iofunc_notify_* functions, as per its need. Jira VQRM-3741 Change-Id: I7d9f71dae2ae7f6a09cd56662003fd1b7e50324c Signed-off-by: Sourab Gupta Reviewed-on: https://git-master.nvidia.com/r/1709656 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/clk/clk_arb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/clk/clk_arb.c') diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 368bacc2..67e452f0 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -697,7 +697,7 @@ static u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev, if (poll_mask) { nvgpu_atomic_set(&dev->poll_mask, poll_mask); - nvgpu_cond_broadcast_interruptible(&dev->readout_wq); + nvgpu_clk_arb_event_post_event(dev); } return new_alarms_reported; @@ -1004,7 +1004,7 @@ exit_arb: nvgpu_list_for_each_entry_safe(dev, tmp, &arb->requests, nvgpu_clk_dev, node) { nvgpu_atomic_set(&dev->poll_mask, NVGPU_POLLIN | NVGPU_POLLRDNORM); - nvgpu_cond_signal_interruptible(&dev->readout_wq); + nvgpu_clk_arb_event_post_event(dev); nvgpu_ref_put(&dev->refcount, nvgpu_clk_arb_free_fd); nvgpu_list_del(&dev->node); } -- cgit v1.2.2