summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/clk_arb.c
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2018-04-29 05:07:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 07:42:22 -0400
commit3dabdf3e6d703ffdb4549ab54cf5bca34460706b (patch)
treea2dc77308351e7e149ffa95a0e53f4fcc393ca4f /drivers/gpu/nvgpu/common/linux/clk_arb.c
parent0ad40e83dbcf0f3f6e936f573c8e7878803ab37f (diff)
gpu: nvgpu: add conversion function for poll masks
In order to enable the movement of clk arbitrator to common code, we need to remove the linux specific POLL* defines and instead use NVGPU defines. Add a conversion function for the same. Also remove debugfs include, while at it. Jira VQRM-3741 Change-Id: I3c367625f9fa5fb8480d01bdaf6233df8cc2c722 Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1704885 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/clk_arb.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/clk_arb.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk_arb.c b/drivers/gpu/nvgpu/common/linux/clk_arb.c
index 3ec7fd54..39763f14 100644
--- a/drivers/gpu/nvgpu/common/linux/clk_arb.c
+++ b/drivers/gpu/nvgpu/common/linux/clk_arb.c
@@ -20,10 +20,6 @@
20#include <linux/rculist.h> 20#include <linux/rculist.h>
21#include <linux/llist.h> 21#include <linux/llist.h>
22#include <linux/uaccess.h> 22#include <linux/uaccess.h>
23#include <linux/poll.h>
24#ifdef CONFIG_DEBUG_FS
25#include <linux/debugfs.h>
26#endif
27 23
28#include <nvgpu/bitops.h> 24#include <nvgpu/bitops.h>
29#include <nvgpu/lock.h> 25#include <nvgpu/lock.h>
@@ -678,7 +674,7 @@ static u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev,
678 if ((target->gpc2clk < session->target->gpc2clk) 674 if ((target->gpc2clk < session->target->gpc2clk)
679 || (target->mclk < session->target->mclk)) { 675 || (target->mclk < session->target->mclk)) {
680 676
681 poll_mask |= (POLLIN | POLLPRI); 677 poll_mask |= (NVGPU_POLLIN | NVGPU_POLLPRI);
682 nvgpu_clk_arb_queue_notification(arb->g, &dev->queue, 678 nvgpu_clk_arb_queue_notification(arb->g, &dev->queue,
683 EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE)); 679 EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE));
684 } 680 }
@@ -686,7 +682,7 @@ static u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev,
686 682
687 /* Check if there is a new VF update */ 683 /* Check if there is a new VF update */
688 if (queue_alarm_mask & EVENT(VF_UPDATE)) 684 if (queue_alarm_mask & EVENT(VF_UPDATE))
689 poll_mask |= (POLLIN | POLLRDNORM); 685 poll_mask |= (NVGPU_POLLIN | NVGPU_POLLRDNORM);
690 686
691 /* Notify sticky alarms that were not reported on previous run*/ 687 /* Notify sticky alarms that were not reported on previous run*/
692 new_alarms_reported = (queue_alarm_mask | 688 new_alarms_reported = (queue_alarm_mask |
@@ -695,9 +691,9 @@ static u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev,
695 if (new_alarms_reported & ~LOCAL_ALARM_MASK) { 691 if (new_alarms_reported & ~LOCAL_ALARM_MASK) {
696 /* check that we are not re-reporting */ 692 /* check that we are not re-reporting */
697 if (new_alarms_reported & EVENT(ALARM_GPU_LOST)) 693 if (new_alarms_reported & EVENT(ALARM_GPU_LOST))
698 poll_mask |= POLLHUP; 694 poll_mask |= NVGPU_POLLHUP;
699 695
700 poll_mask |= (POLLIN | POLLPRI); 696 poll_mask |= (NVGPU_POLLIN | NVGPU_POLLPRI);
701 /* On next run do not report global alarms that were already 697 /* On next run do not report global alarms that were already
702 * reported, but report SHUTDOWN always 698 * reported, but report SHUTDOWN always
703 */ 699 */
@@ -1016,7 +1012,7 @@ exit_arb:
1016 /* notify completion for all requests */ 1012 /* notify completion for all requests */
1017 head = llist_del_all(&arb->requests); 1013 head = llist_del_all(&arb->requests);
1018 llist_for_each_entry_safe(dev, tmp, head, node) { 1014 llist_for_each_entry_safe(dev, tmp, head, node) {
1019 nvgpu_atomic_set(&dev->poll_mask, POLLIN | POLLRDNORM); 1015 nvgpu_atomic_set(&dev->poll_mask, NVGPU_POLLIN | NVGPU_POLLRDNORM);
1020 nvgpu_cond_signal_interruptible(&dev->readout_wq); 1016 nvgpu_cond_signal_interruptible(&dev->readout_wq);
1021 nvgpu_ref_put(&dev->refcount, nvgpu_clk_arb_free_fd); 1017 nvgpu_ref_put(&dev->refcount, nvgpu_clk_arb_free_fd);
1022 } 1018 }