From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Luca Coelho <luciano.coelho@intel.com>, intel-gfx@lists.freedesktop.org
Cc: rodrigo.vivi@intel.com
Subject: Re: [Intel-gfx] [PATCH v2 3/3] drm/i915/selftests: add local workqueue for SW fence selftest
Date: Wed, 24 May 2023 12:01:18 +0100 [thread overview]
Message-ID: <8881a6f8-246a-1f11-1070-c303a0a1b85a@linux.intel.com> (raw)
In-Reply-To: <20230524090521.596399-4-luciano.coelho@intel.com>
On 24/05/2023 10:05, Luca Coelho wrote:
> Instead of using a global workqueue for the SW fence selftest,
> allocate a separate one temporarily only while running the test.
>
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index daa985e5a19b..8f5ce71fa453 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> @@ -523,12 +523,19 @@ static void task_ipc(struct work_struct *work)
> static int test_ipc(void *arg)
> {
> struct task_ipc ipc;
> + struct workqueue_struct *wq;
> int ret = 0;
>
> + wq = alloc_workqueue("i1915-selftest", 0, 0);
> + if (wq == NULL)
> + return -ENOMEM;
> +
> /* Test use of i915_sw_fence as an interprocess signaling mechanism */
> ipc.in = alloc_fence();
> - if (!ipc.in)
> - return -ENOMEM;
> + if (!ipc.in) {
> + ret = -ENOMEM;
> + goto err_work;
> + }
> ipc.out = alloc_fence();
> if (!ipc.out) {
> ret = -ENOMEM;
> @@ -540,7 +547,7 @@ static int test_ipc(void *arg)
>
> ipc.value = 0;
> INIT_WORK_ONSTACK(&ipc.work, task_ipc);
> - schedule_work(&ipc.work);
> + queue_work(wq, &ipc.work);
>
> wait_for_completion(&ipc.started);
>
> @@ -563,6 +570,9 @@ static int test_ipc(void *arg)
> free_fence(ipc.out);
> err_in:
> free_fence(ipc.in);
> +err_work:
> + destroy_workqueue(wq);
> +
> return ret;
> }
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
next prev parent reply other threads:[~2023-05-24 11:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 9:05 [Intel-gfx] [PATCH v2 0/3] drm/i915: implement internal workqueues Luca Coelho
2023-05-24 9:05 ` [Intel-gfx] [PATCH v2 1/3] drm/i915: use pointer to i915 instead of rpm in wakeref Luca Coelho
2023-05-24 10:42 ` Tvrtko Ursulin
2023-05-26 10:43 ` Jani Nikula
2023-05-24 9:05 ` [Intel-gfx] [PATCH v2 2/3] drm/i915: add a dedicated workqueue inside drm_i915_private Luca Coelho
2023-05-24 11:00 ` Tvrtko Ursulin
2023-05-24 11:05 ` Tvrtko Ursulin
2023-05-24 12:25 ` Coelho, Luciano
2023-05-26 11:30 ` Jani Nikula
2023-05-28 14:58 ` Coelho, Luciano
2023-05-24 9:05 ` [Intel-gfx] [PATCH v2 3/3] drm/i915/selftests: add local workqueue for SW fence selftest Luca Coelho
2023-05-24 11:01 ` Tvrtko Ursulin [this message]
2023-05-24 11:03 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: implement internal workqueues (rev2) Patchwork
2023-05-24 11:03 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-24 11:18 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
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=8881a6f8-246a-1f11-1070-c303a0a1b85a@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luciano.coelho@intel.com \
--cc=rodrigo.vivi@intel.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