All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Erhard Furtner <erhard_f@mailbox.org>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>,
	Linux DRI Development <dri-devel@lists.freedesktop.org>,
	Huang Rui <ray.huang@amd.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Karolina Stolarek <karolina.stolarek@intel.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Zi Yan <ziy@nvidia.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: Running ttm_device_test leads to list_add corruption. prev->next should be next (ffffffffc05cd428), but was 6b6b6b6b6b6b6b6b. (prev=ffffa0b1a5c034f0) (kernel 6.7.5)
Date: Wed, 21 Feb 2024 15:07:20 +0100	[thread overview]
Message-ID: <3c5b80a7-5bf9-4752-a596-438924fdec9c@amd.com> (raw)
In-Reply-To: <20240220184323.2c8b4f0a@yea>

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

Am 20.02.24 um 18:43 schrieb Erhard Furtner:
> On Tue, 20 Feb 2024 14:50:04 +0100
> Christian König <christian.koenig@amd.com> wrote:
>
>> Yeah and that's probably the problem. The test is not supposed to be
>> compiled and executed on bare metal, but rather just as unit test
>> through user mode Linux.
>>
>> We probably don't check that correctly in the kconfig for some reason.
>> Can you provide your .config file?
>>
> Here's my v6.8-rc5 .config attached.

Thanks for that.

As long as nobody comes up with an approach how to run the test even 
when other drivers want to interact with TTM the attached patch is my 
best idea.

It basically disabled compiling the TTM tests as long as neither 
compiling for UML or COMPILE_TEST are set.

Opinions?

Thanks,
Christian.

>
> Regards,
> Erhard

[-- Attachment #2: 0001-drm-ttm-tests-depend-on-UML-COMPILE_TEST.patch --]
[-- Type: text/x-patch, Size: 1604 bytes --]

From a1dcd1ce632bf6c38765e3cc006b6d92c4e70b38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Wed, 21 Feb 2024 08:18:59 +0100
Subject: [PATCH] drm/ttm/tests: depend on UML || COMPILE_TEST
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

At least the device test requires that no other driver using TTM is
loaded. So make those unit tests depend on UML || COMPILE_TEST to
prevent people from trying them on bare metal.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 2520db0b776e..c7edba18a6f0 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -199,7 +199,7 @@ config DRM_TTM
 config DRM_TTM_KUNIT_TEST
         tristate "KUnit tests for TTM" if !KUNIT_ALL_TESTS
         default n
-        depends on DRM && KUNIT && MMU
+        depends on DRM && KUNIT && MMU && (UML || COMPILE_TEST)
         select DRM_TTM
         select DRM_EXPORT_FOR_TESTS if m
         select DRM_KUNIT_TEST_HELPERS
@@ -207,7 +207,8 @@ config DRM_TTM_KUNIT_TEST
         help
           Enables unit tests for TTM, a GPU memory manager subsystem used
           to manage memory buffers. This option is mostly useful for kernel
-          developers.
+          developers. It depends on (UML || COMPILE_TEST) since no other driver
+          which uses TTM can be loaded while running the tests.
 
           If in doubt, say "N".
 
-- 
2.34.1


  reply	other threads:[~2024-02-21 14:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 22:01 Running ttm_device_test leads to list_add corruption. prev->next should be next (ffffffffc05cd428), but was 6b6b6b6b6b6b6b6b. (prev=ffffa0b1a5c034f0) (kernel 6.7.5) Erhard Furtner
2024-02-20  9:12 ` Bagas Sanjaya
2024-02-20 12:45   ` Erhard Furtner
2024-02-20 13:50     ` Christian König
2024-02-20 17:43       ` Erhard Furtner
2024-02-21 14:07         ` Christian König [this message]
2024-02-21 15:09           ` Alex Deucher
2024-02-20 13:28   ` Christian König
2024-02-20 14:56     ` Maxime Ripard
2024-02-20 15:03       ` Christian König
2024-02-21 14:41         ` Maxime Ripard
2024-02-21 14:54           ` Christian König

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=3c5b80a7-5bf9-4752-a596-438924fdec9c@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bagasdotme@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=erhard_f@mailbox.org \
    --cc=karolina.stolarek@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=tzimmermann@suse.de \
    --cc=ziy@nvidia.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.