All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Philipp Stanner" <phasta@mailbox.org>
Cc: phasta@kernel.org, oushixiong1025@163.com,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Shixiong Ou" <oushixiong@kylinos.cn>
Subject: Re: [PATCH v2] drm/sched: Guard against NULL dev in drm_sched_job trace event
Date: Wed, 26 Aug 2026 00:54:29 +0200	[thread overview]
Message-ID: <DKYE7V3DTBCP.2LAE0HS5PTKS5@kernel.org> (raw)
In-Reply-To: <488156c4065f4da218ecce730266bd5cec3a9ea6.camel@mailbox.org>

On Tue Aug 25, 2026 at 2:11 PM CEST, Philipp Stanner wrote:
> On Tue, 2026-08-25 at 14:02 +0200, Danilo Krummrich wrote:
>> 
>
> […]
>
>> 
>> I don't think that we should make such changes for Kunit tests only; it implies
>> that a NULL dev now would be a valid value for the scheduler.
>
> Strictly speaking we don't allow for the device pointer to be NULL, so
> you might be right. However, it actually is only used for creating
> debug prints, so…
>
>
>> 
>> Why can't we have the Kunit test create a fake device for this? For instance,
>> this is where struct faux_device becomes useful.
>
> Wouldn't that be the same result as printing "NULL device"?
>
> Many DRM print helpers do the latter already. __drm_dev_vprintk() takes
> dev == NULL into account.
> So one might argue that making the print-functions all robust against
> NULL would be the more consistent thing.

The dev_printk() primitives already do this, but that's not the point. The point
is that a scheduler with a NULL device makes no sense in the first place, so we
shouldn't support it -- especially not when it is just for a Kunit test that can
easily satisfy the API by calling faux_device_create().

      reply	other threads:[~2026-08-25 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 10:36 [PATCH v2] drm/sched: Guard against NULL dev in drm_sched_job trace event oushixiong1025
2026-08-25 12:02 ` Danilo Krummrich
2026-08-25 12:11   ` Philipp Stanner
2026-08-25 22:54     ` Danilo Krummrich [this message]

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=DKYE7V3DTBCP.2LAE0HS5PTKS5@kernel.org \
    --to=dakr@kernel.org \
    --cc=airlied@gmail.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=oushixiong1025@163.com \
    --cc=oushixiong@kylinos.cn \
    --cc=phasta@kernel.org \
    --cc=phasta@mailbox.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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.