All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Alexandre Bailon <abailon@baylibre.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/4] DRM: Add support of AI Processor Unit (APU)
Date: Sun, 19 Sep 2021 11:19:24 +0800	[thread overview]
Message-ID: <20210919031924.4426-1-hdanton@sina.com> (raw)
In-Reply-To: <20210917125945.620097-3-abailon@baylibre.com>

On Fri, 17 Sep 2021 14:59:43 +0200 Alexandre Bailon wrote:
> +static DEFINE_IDA(req_ida);
> +static LIST_HEAD(complete_node);

I see accesses to complete_node in apu_drm_callback(), apu_job_timedout()
and ioctl_gem_dequeue() without working out the serialization to avoid
list corruption. Can you add a comment to specify it?

> +
> +int apu_drm_callback(struct apu_core *apu_core, void *data, int len)
> +{
> +	struct apu_request *apu_req, *tmp;
> +	struct apu_dev_request *hdr = data;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&apu_core->ctx_lock, flags);
> +	list_for_each_entry_safe(apu_req, tmp, &apu_core->requests, node) {
> +		struct apu_job *job = apu_req->job;
> +
> +		if (job && hdr->id == job->id) {
> +			kref_get(&job->refcount);
> +			job->result = hdr->result;
> +			if (job->size_out)
> +				memcpy(job->data_out, hdr->data + job->size_in,
> +				       min(job->size_out, hdr->size_out));
> +			job->size_out = hdr->size_out;
> +			list_add(&job->node, &complete_node);
> +			list_del(&apu_req->node);
> +			ida_simple_remove(&req_ida, hdr->id);
> +			kfree(apu_req);
> +			drm_send_event(job->apu_drm->drm,
> +				       &job->event->pending_event);
> +			dma_fence_signal_locked(job->done_fence);
> +		}
> +	}
> +	spin_unlock_irqrestore(&apu_core->ctx_lock, flags);
> +
> +	return 0;
> +}

  reply	other threads:[~2021-09-19  3:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 12:59 [RFC PATCH 0/4] Add a DRM driver to support AI Processing Unit (APU) Alexandre Bailon
2021-09-17 12:59 ` Alexandre Bailon
2021-09-17 12:59 ` Alexandre Bailon
2021-09-17 12:59 ` Alexandre Bailon
2021-09-17 12:59 ` [RFC PATCH 1/4] dt-bindings: Add bidings for mtk,apu-drm Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-17 19:48   ` Rob Herring
2021-09-17 19:48     ` Rob Herring
2021-09-17 19:48     ` Rob Herring
2021-09-20 20:55   ` Rob Herring
2021-09-20 20:55     ` Rob Herring
2021-09-20 20:55     ` Rob Herring
2021-09-17 12:59 ` [RFC PATCH 2/4] DRM: Add support of AI Processor Unit (APU) Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-19  3:19   ` Hillf Danton [this message]
2021-09-23  0:58   ` Dave Airlie
2021-09-23  0:58     ` Dave Airlie
2021-09-23  0:58     ` Dave Airlie
2021-09-23  0:58     ` Dave Airlie
2021-09-23  6:17     ` Christian König
2021-09-23  6:17       ` Christian König
2021-09-23  6:17       ` Christian König
2021-09-23  6:17       ` Christian König
2021-09-17 12:59 ` [RFC PATCH 3/4] rpmsg: " Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-23  3:31   ` Bjorn Andersson
2021-09-23  3:31     ` Bjorn Andersson
2021-09-23  3:31     ` Bjorn Andersson
2021-09-17 12:59 ` [RFC PATCH 4/4] ARM64: mt8183-pumpkin: Add the APU DRM device Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon
2021-09-17 12:59   ` Alexandre Bailon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210919031924.4426-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=abailon@baylibre.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.