diff --git a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c index 68c0853fd..7942f8047 100644 --- a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c +++ b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c @@ -274,7 +274,7 @@ u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev, head = (tail - head) < arb->notification_queue.size ? head : tail - arb->notification_queue.size; - for (index = head; _WRAPGTEQ(tail, index); index++) { + for (index = head; WRAPGTEQ(tail, index); index++) { u32 alarm_detected; l_notification = &arb->notification_queue. diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h index 0aa18c363..0938e51f0 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h +++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h @@ -49,7 +49,8 @@ struct nvgpu_clk_notification_queue; struct nvgpu_clk_session; #define VF_POINT_INVALID_PSTATE ~0U -#define VF_POINT_SET_PSTATE_SUPPORTED(a, b) ((a)->pstates |= (BIT16(b))) +#define VF_POINT_SET_PSTATE_SUPPORTED(a, b) \ + ((a)->clk_vf_point_pstates |= (BIT16(b))) #define VF_POINT_GET_PSTATE(a) (((a)->pstates) ?\ (nvgpu_fls((a)->pstates) - 1UL) :\ VF_POINT_INVALID_PSTATE) @@ -92,7 +93,7 @@ struct nvgpu_clk_session; #define LOCAL_ALARM_MASK (EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE) | \ EVENT(VF_UPDATE)) -#define _WRAPGTEQ(a, b) (((a)-(b)) > (typeof(a))0) +#define WRAPGTEQ(a, b) (((a)-(b)) > (typeof(a))0) /* * NVGPU_POLL* defines equivalent to the POLL* linux defines @@ -132,7 +133,7 @@ struct nvgpu_clk_notification_queue { }; struct nvgpu_clk_vf_point { - u16 pstates; + u16 clk_vf_point_pstates; union { struct { u16 gpc_mhz; diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c b/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c index 7083b9003..a7c5b7767 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c @@ -172,7 +172,7 @@ static inline u32 __pending_event(struct nvgpu_clk_dev *dev, head = (tail - head) < dev->queue.size ? head : tail - dev->queue.size; - if (_WRAPGTEQ(tail, head) && info) { + if (WRAPGTEQ(tail, head) && info) { head++; p_notif = &dev->queue.clk_q_notifications[ head % dev->queue.size];