All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karolina Stolarek <karolina.stolarek@intel.com>
To: "Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>,
	Amaranath Somalapuram <asomalap@amd.com>
Subject: Re: [PATCH v11 01/10] drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk
Date: Thu, 18 Apr 2024 10:21:27 +0200	[thread overview]
Message-ID: <1d2d3dd6-e683-443c-ae6d-a0a864239ebb@intel.com> (raw)
In-Reply-To: <2cdbb374-c4e7-4b2f-8ede-459ecc0224b9@amd.com>

On 18.04.2024 10:15, Christian König wrote:
> Am 17.04.24 um 15:03 schrieb Karolina Stolarek:
>> BOs in a bulk move have to share the same reservation object. That is
>> not the case in the ttm_bo_unreserve_bulk subtest. Share bo2's resv
>> object with bo1 to fix the issue.
>>
>> Fixes: 995279d280d1 ("drm/ttm/tests: Add tests for ttm_bo functions")
>> Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com>
>> ---
>>   drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c 
>> b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
>> index 1f8a4f8adc92..632306adc4a1 100644
>> --- a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
>> +++ b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
>> @@ -339,6 +339,9 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)
>>       bo1 = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
>>       bo2 = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
>> +    /* Share the reservation object in the same bulk move */
>> +    bo1->base.resv = bo2->base.resv;
>> +
> 
> In a real world driver that would be illegal because it is racy for the 
> UAPI. It might work in the test case, but it could leak any fence 
> storage allocate for the bo1 reservation object.
> 
> We should probably avoid that and I would rather modify 
> ttm_bo_kunit_init() so that it gets the reservation object which should 
> be used for the newly created BO with the default behavior if the 
> parameter is NULL.

Thanks for providing the context, makes sense. I'll extend that helper.

All the best,
Karolina

  reply	other threads:[~2024-04-18  8:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 13:03 [PATCH v11 00/10] Improve test coverage of TTM Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 01/10] drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk Karolina Stolarek
2024-04-18  8:15   ` Christian König
2024-04-18  8:21     ` Karolina Stolarek [this message]
2024-04-17 13:03 ` [PATCH v11 02/10] drm/ttm/tests: Delete unnecessary config option Karolina Stolarek
2024-04-17 14:07   ` Nirmoy Das
2024-04-17 13:03 ` [PATCH v11 03/10] drm/ttm/tests: Set DMA mask in KUnit device Karolina Stolarek
2024-04-17 13:54   ` Nirmoy Das
2024-04-17 13:03 ` [PATCH v11 04/10] drm/ttm/tests: Use an init function from the helpers lib Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 05/10] drm/ttm/tests: Test simple BO creation and validation Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 06/10] drm/ttm/tests: Add tests with mock resource managers Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 07/10] drm/ttm/tests: Add test cases dependent on fence signaling Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 08/10] drm/ttm/tests: Add eviction testing Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 09/10] drm/ttm/tests: Add tests for ttm_tt_populate Karolina Stolarek
2024-04-17 13:03 ` [PATCH v11 10/10] drm/ttm/tests: Add TODO file Karolina Stolarek

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=1d2d3dd6-e683-443c-ae6d-a0a864239ebb@intel.com \
    --to=karolina.stolarek@intel.com \
    --cc=asomalap@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=matthew.auld@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 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.