All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Rob Herring <robh+dt@kernel.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Robin Murphy <robin.murphy@arm.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues
Date: Fri, 2 Jul 2021 11:08:58 +0100	[thread overview]
Message-ID: <700919f1-a0d0-d8fb-e871-915b56260f83@arm.com> (raw)
In-Reply-To: <20210701091224.3209803-5-boris.brezillon@collabora.com>

On 01/07/2021 10:12, Boris Brezillon wrote:
> Needed to keep VkQueues isolated from each other.

One more comment I noticed when I tried this out:

[...]
> +struct panfrost_submitqueue *
> +panfrost_submitqueue_create(struct panfrost_file_priv *ctx,
> +			    enum panfrost_submitqueue_priority priority,
> +			    u32 flags)
> +{
> +	struct panfrost_submitqueue *queue;
> +	enum drm_sched_priority sched_prio;
> +	int ret, i;
> +
> +	if (flags || priority >= PANFROST_SUBMITQUEUE_PRIORITY_COUNT)
> +		return ERR_PTR(-EINVAL);
> +
> +	queue = kzalloc(sizeof(*queue), GFP_KERNEL);
> +	if (!queue)
> +		return ERR_PTR(-ENOMEM);
> +
> +	queue->pfdev = ctx->pfdev;
> +	sched_prio = to_sched_prio(priority);
> +	for (i = 0; i < NUM_JOB_SLOTS; i++) {
> +		struct drm_gpu_scheduler *sched;
> +
> +		sched = panfrost_job_get_sched(ctx->pfdev, i);
> +		ret = drm_sched_entity_init(&queue->sched_entity[i],
> +					    sched_prio, &sched, 1, NULL);
> +		if (ret)
> +			break;
> +	}
> +
> +	if (ret) {
> +		for (i--; i >= 0; i--)
> +			drm_sched_entity_destroy(&queue->sched_entity[i]);
> +
> +		return ERR_PTR(ret);
> +	}
> +
> +	kref_init(&queue->refcount);
> +	idr_lock(&ctx->queues);
> +	ret = idr_alloc(&ctx->queues, queue, 0, INT_MAX, GFP_KERNEL);

This makes lockdep complain. idr_lock() is a spinlock and GFP_KERNEL can
sleep. So either we need to bring our own mutex here or not use GFP_KERNEL.

Steve

  parent reply	other threads:[~2021-07-02 10:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  9:12 [PATCH v2 0/7] drm/panfrost: drm/panfrost: Add a new submit ioctl Boris Brezillon
2021-07-01  9:12 ` [PATCH v2 1/7] drm/panfrost: Pass a job to panfrost_{acquire, attach_object_fences}() Boris Brezillon
2021-07-02  9:42   ` [PATCH v2 1/7] drm/panfrost: Pass a job to panfrost_{acquire,attach_object_fences}() Steven Price
2021-07-01  9:12 ` [PATCH v2 2/7] drm/panfrost: Move the mappings collection out of panfrost_lookup_bos() Boris Brezillon
2021-07-02  9:43   ` Steven Price
2021-07-01  9:12 ` [PATCH v2 3/7] drm/panfrost: Add BO access flags to relax dependencies between jobs Boris Brezillon
2021-07-02  9:45   ` Steven Price
2021-07-01  9:12 ` [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues Boris Brezillon
2021-07-02  9:56   ` Steven Price
2021-07-02 10:43     ` Boris Brezillon
2021-07-02 10:55       ` Steven Price
2021-07-02 11:02         ` Daniel Stone
2021-07-02 13:58       ` Alyssa Rosenzweig
2021-07-02 14:09         ` Boris Brezillon
2021-07-02 10:08   ` Steven Price [this message]
2021-07-02 10:52     ` Boris Brezillon
2021-07-02 10:58       ` Steven Price
2021-07-02 11:01         ` Boris Brezillon
2021-07-01  9:12 ` [PATCH v2 5/7] drm/panfrost: Add a new ioctl to submit batches Boris Brezillon
2021-07-02 10:08   ` Steven Price
2021-07-01  9:12 ` [PATCH v2 6/7] drm/panfrost: Advertise the SYNCOBJ_TIMELINE feature Boris Brezillon
2021-07-02 10:08   ` Steven Price
2021-07-01  9:12 ` [PATCH v2 7/7] drm/panfrost: Bump minor version to reflect the feature additions Boris Brezillon
2021-07-02 10:08   ` Steven Price

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=700919f1-a0d0-d8fb-e871-915b56260f83@arm.com \
    --to=steven.price@arm.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tomeu.vizoso@collabora.com \
    /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.