From: Mark Brown <broonie@kernel.org>
To: Dave Airlie <airlied@redhat.com>, DRI <dri-devel@lists.freedesktop.org>
Cc: Heiko Stuebner <heiko@sntech.de>,
Intel Graphics <intel-gfx@lists.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Simona Vetter <simona.vetter@ffwll.ch>,
Tomeu Vizoso <tomeu@tomeuvizoso.net>,
Triet Hoang <triet.hoang.dev@gmail.com>
Subject: linux-next: manual merge of the drm tree with the drm-misc-fixes tree
Date: Wed, 18 Nov 2026 14:53:32 +0000 [thread overview]
Message-ID: <av27642L7XkY-L2E@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 7666 bytes --]
Hi all,
Today's linux-next merge of the drm tree got a conflict in:
drivers/accel/rocket/rocket_job.c
between commits:
9bca2b5f1a4fa ("accel/rocket: Keep scheduler allocation in rocket_file_priv")
d341ef030f3ce ("accel/rocket: Check allocations before use")
from the drm-misc-fixes tree and commits:
be22e979c18f5 ("accel/rocket: Check allocations before use")
91c7da1f42cad ("drm/rocket: Keep scheduler allocation in rocket_file_priv")
from the drm tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined drivers/accel/rocket/rocket_job.c
index 7b798a90bc492,b2a00992c8894..0000000000000
--- a/drivers/accel/rocket/rocket_job.c
+++ b/drivers/accel/rocket/rocket_job.c
@@@ -201,13 -201,12 +201,13 @@@ static int rocket_acquire_object_fences
static void rocket_attach_object_fences(struct drm_gem_object **bos,
int bo_count,
- struct dma_fence *fence)
+ struct dma_fence *fence,
+ enum dma_resv_usage usage)
{
int i;
for (i = 0; i < bo_count; i++)
- dma_resv_add_fence(bos[i]->resv, fence, DMA_RESV_USAGE_WRITE);
+ dma_resv_add_fence(bos[i]->resv, fence, usage);
}
static int rocket_job_push(struct rocket_job *job)
@@@ -215,7 -214,7 +215,7 @@@
struct rocket_device *rdev = job->rdev;
struct drm_gem_object **bos;
struct ww_acquire_ctx acquire_ctx;
- u32 bo_count;
+ int bo_count;
int ret = 0;
if (check_add_overflow(job->in_bo_count, job->out_bo_count, &bo_count))
@@@ -231,28 -230,27 +231,30 @@@
if (ret)
goto err;
+ ret = rocket_acquire_object_fences(job->in_bos, job->in_bo_count,
+ &job->base, false);
+ if (ret)
+ goto err_unlock;
+
+ ret = rocket_acquire_object_fences(job->out_bos, job->out_bo_count,
+ &job->base, true);
+ if (ret)
+ goto err_unlock;
+
scoped_guard(mutex, &rdev->sched_lock) {
drm_sched_job_arm(&job->base);
job->inference_done_fence = dma_fence_get(&job->base.s_fence->finished);
- ret = rocket_acquire_object_fences(job->in_bos, job->in_bo_count, &job->base, false);
- if (ret)
- goto err_unlock;
-
- ret = rocket_acquire_object_fences(job->out_bos, job->out_bo_count, &job->base, true);
- if (ret)
- goto err_unlock;
-
kref_get(&job->refcount); /* put by scheduler job completion */
drm_sched_entity_push_job(&job->base);
}
- rocket_attach_object_fences(job->out_bos, job->out_bo_count, job->inference_done_fence);
+ rocket_attach_object_fences(job->in_bos, job->in_bo_count,
+ job->inference_done_fence, DMA_RESV_USAGE_READ);
+ rocket_attach_object_fences(job->out_bos, job->out_bo_count,
+ job->inference_done_fence, DMA_RESV_USAGE_WRITE);
err_unlock:
drm_gem_unlock_reservations(bos, bo_count, &acquire_ctx);
@@@ -268,7 -266,7 +270,7 @@@ static void rocket_job_cleanup(struct k
refcount);
unsigned int i;
- rocket_iommu_domain_put(job->domain);
+ rocket_vm_put(job->vm);
dma_fence_put(job->done_fence);
dma_fence_put(job->inference_done_fence);
@@@ -349,7 -347,7 +351,7 @@@ static struct dma_fence *rocket_job_run
if (ret < 0)
goto err_put_fences;
- ret = iommu_attach_group(job->domain->domain, core->iommu_group);
+ ret = iommu_attach_group(job->vm->domain, core->iommu_group);
if (ret < 0)
goto err_put_pm;
@@@ -373,56 -371,39 +375,56 @@@ static void rocket_job_handle_irq(struc
{
pm_runtime_mark_last_busy(core->dev);
- rocket_pc_writel(core, OPERATION_ENABLE, 0x0);
- rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff);
+ scoped_guard(mutex, &core->job_lock) {
+ /*
+ * Stopping the block belongs under the lock. hw_submit() writes
+ * OPERATION_ENABLE too, and outside the lock this zero can land
+ * after that one and stop a task that has only just started.
+ */
+ rocket_pc_writel(core, OPERATION_ENABLE, 0x0);
+ rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff);
- scoped_guard(mutex, &core->job_lock)
if (core->in_flight_job) {
if (core->in_flight_job->next_task_idx < core->in_flight_job->task_count) {
rocket_job_hw_submit(core, core->in_flight_job);
return;
}
- iommu_detach_group(NULL, iommu_group_get(core->dev));
+ iommu_detach_group(NULL, core->iommu_group);
dma_fence_signal(core->in_flight_job->done_fence);
pm_runtime_put_autosuspend(core->dev);
core->in_flight_job = NULL;
}
+ }
}
static void
rocket_reset(struct rocket_core *core, struct drm_sched_job *bad)
{
+ bool put_job_ref;
+
if (!atomic_read(&core->reset.pending))
return;
drm_sched_stop(&core->sched, bad);
+ scoped_guard(mutex, &core->job_lock) {
+ if (pm_runtime_get_if_active(core->dev) > 0) {
+ rocket_pc_writel(core, INTERRUPT_MASK, 0x0);
+ rocket_pc_writel(core, INTERRUPT_CLEAR, 0x1ffff);
+ pm_runtime_put_autosuspend(core->dev);
+ }
+ }
+
+ synchronize_irq(core->irq);
+
/*
* Remaining interrupts have been handled, but we might still have
* stuck jobs. Let's make sure the PM counters stay balanced by
- * manually calling pm_runtime_put_noidle().
+ * dropping the job's reference once the core has been reset.
*/
scoped_guard(mutex, &core->job_lock) {
- if (core->in_flight_job)
- pm_runtime_put_noidle(core->dev);
+ put_job_ref = core->in_flight_job;
iommu_detach_group(NULL, core->iommu_group);
@@@ -432,9 -413,6 +434,9 @@@
/* Proceed with reset now. */
rocket_core_reset(core);
+ if (put_job_ref)
+ pm_runtime_put_autosuspend(core->dev);
+
/* NPU has been reset, we can clear the reset pending bit. */
atomic_set(&core->reset.pending, 0);
@@@ -572,7 -550,7 +574,7 @@@ int rocket_job_open(struct rocket_file_
DRM_SCHED_PRIORITY_NORMAL,
scheds,
rdev->num_cores, NULL);
- if (WARN_ON(ret))
+ if (ret)
kfree(scheds);
else
rocket_priv->scheds = scheds;
@@@ -584,8 -562,8 +586,8 @@@ void rocket_job_close(struct rocket_fil
{
struct drm_sched_entity *entity = &rocket_priv->sched_entity;
- kfree(rocket_priv->scheds);
drm_sched_entity_destroy(entity);
+ kfree(rocket_priv->scheds);
}
int rocket_job_is_idle(struct rocket_core *core)
@@@ -608,6 -586,11 +610,11 @@@ static int rocket_ioctl_submit_job(stru
if (job->task_count == 0)
return -EINVAL;
+ /* GEM lookup takes a signed object count. */
+ if (job->in_bo_handle_count > INT_MAX ||
+ job->out_bo_handle_count > INT_MAX)
+ return -EINVAL;
+
rjob = kzalloc_obj(*rjob);
if (!rjob)
return -ENOMEM;
@@@ -615,7 -598,7 +622,7 @@@
kref_init(&rjob->refcount);
rjob->rdev = rdev;
- rjob->domain = rocket_iommu_domain_get(file_priv);
+ rjob->vm = rocket_vm_get(file_priv);
ret = drm_sched_job_init(&rjob->base,
&file_priv->sched_entity,
@@@ -691,8 -674,11 +698,11 @@@ int rocket_ioctl_submit(struct drm_devi
}
- for (i = 0; i < args->job_count; i++)
- rocket_ioctl_submit_job(dev, file, &jobs[i]);
+ for (i = 0; i < args->job_count; i++) {
+ ret = rocket_ioctl_submit_job(dev, file, &jobs[i]);
+ if (ret)
+ goto exit;
+ }
exit:
kvfree(jobs);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2026-11-18 14:53 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 14:53 Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-19 16:10 linux-next: manual merge of the drm tree with the drm-misc-fixes tree Mark Brown
2026-10-19 19:09 ` Devin Wittmayer
2026-10-20 9:52 ` Mark Brown
2026-10-20 7:30 ` Jocelyn Falempe
2026-09-28 14:15 Mark Brown
2026-09-18 11:14 Mark Brown
2026-09-18 11:14 Mark Brown
2026-08-12 15:45 Mark Brown
2026-08-12 12:20 Mark Brown
2026-06-11 13:54 Mark Brown
2026-06-16 9:16 ` Geert Uytterhoeven
2026-03-20 14:17 Mark Brown
2026-03-20 15:39 ` Boris Brezillon
2026-04-08 17:26 ` Mark Brown
2026-04-09 7:47 ` Boris Brezillon
2026-03-18 14:36 Mark Brown
2026-03-18 15:49 ` Luca Ceresoli
2026-03-18 18:20 ` Cristian Ciocaltea
2026-01-05 2:21 Stephen Rothwell
2025-08-20 1:21 Stephen Rothwell
2025-08-20 10:30 ` Danilo Krummrich
2025-08-20 21:29 ` Stephen Rothwell
2025-07-18 4:41 Stephen Rothwell
2025-07-18 6:27 ` Thomas Zimmermann
2025-01-14 1:30 Stephen Rothwell
2023-11-22 0:29 Stephen Rothwell
2023-11-28 10:04 ` Geert Uytterhoeven
2023-09-28 2:05 Stephen Rothwell
2023-06-27 1:54 Stephen Rothwell
2023-07-11 1:17 ` Stephen Rothwell
2022-11-21 2:06 Stephen Rothwell
2022-07-11 2:47 Stephen Rothwell
2022-07-11 8:05 ` Christian König
2022-07-17 23:44 ` Stephen Rothwell
2022-07-19 7:35 ` Geert Uytterhoeven
2022-07-27 2:55 ` Stephen Rothwell
2022-07-27 3:24 ` Dave Airlie
2022-07-27 5:37 ` Stephen Rothwell
2022-03-18 0:55 Stephen Rothwell
2022-03-18 1:06 ` Stephen Rothwell
2021-12-22 3:50 Stephen Rothwell
2021-12-22 7:31 ` Christian König
2021-11-29 23:33 Stephen Rothwell
2021-11-30 8:58 ` Maxime Ripard
2021-11-30 20:35 ` Stephen Rothwell
2021-10-22 0:53 Stephen Rothwell
2021-06-17 1:42 Stephen Rothwell
2021-04-09 3:12 Stephen Rothwell
2021-03-18 1:02 Stephen Rothwell
2021-03-18 6:51 ` Tomi Valkeinen
2020-07-28 3:41 Stephen Rothwell
2020-05-01 3:45 Stephen Rothwell
2020-03-01 23:43 Stephen Rothwell
2019-09-15 21:18 Mark Brown
2019-09-16 5:29 ` Vasily Khoruzhick
2019-09-17 2:43 ` Qiang Yu
2019-08-26 3:06 Stephen Rothwell
2019-08-29 10:11 ` james qian wang (Arm Technology China)
2018-11-26 2:37 Stephen Rothwell
2018-03-08 0:47 Stephen Rothwell
2017-12-13 23:59 Stephen Rothwell
2017-01-17 0:59 Stephen Rothwell
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=av27642L7XkY-L2E@sirena.org.uk \
--to=broonie@kernel.org \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=simona.vetter@ffwll.ch \
--cc=tomeu@tomeuvizoso.net \
--cc=triet.hoang.dev@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox