Skip to content

Commit

Permalink
drm/nouveau/flcn/cmdq: switch to falcon queue printk macros
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jan 15, 2020
1 parent c2c9b24 commit baafecb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ cmd_queue_open(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
u32 size)
{
struct nvkm_falcon *falcon = priv->falcon;
const struct nvkm_subdev *subdev = priv->falcon->owner;
bool rewind = false;

mutex_lock(&queue->mutex);

if (!cmd_queue_has_room(priv, queue, size, &rewind)) {
nvkm_error(subdev, "queue full\n");
FLCNQ_DBG(queue, "queue full");
mutex_unlock(&queue->mutex);
return -EAGAIN;
}
Expand All @@ -107,15 +106,14 @@ static int
cmd_write(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_hdr *cmd,
struct nvkm_msgqueue_queue *queue)
{
const struct nvkm_subdev *subdev = priv->falcon->owner;
static unsigned timeout = 2000;
unsigned long end_jiffies = jiffies + msecs_to_jiffies(timeout);
int ret = -EAGAIN;

while (ret == -EAGAIN && time_before(jiffies, end_jiffies))
ret = cmd_queue_open(priv, queue, cmd->size);
if (ret) {
nvkm_error(subdev, "pmu_queue_open_write failed\n");
FLCNQ_ERR(queue, "timeout waiting for queue space");
return ret;
}

Expand Down Expand Up @@ -169,8 +167,10 @@ nvkm_msgqueue_post(struct nvkm_msgqueue *priv, enum msgqueue_msg_priority prio,

if (!seq->async) {
if (!wait_for_completion_timeout(&seq->done,
msecs_to_jiffies(1000)))
msecs_to_jiffies(1000))) {
FLCNQ_ERR(queue, "timeout waiting for reply");
return -ETIMEDOUT;
}
ret = seq->result;
nvkm_falcon_qmgr_seq_release(queue->qmgr, seq);
}
Expand Down

0 comments on commit baafecb

Please sign in to comment.