From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 574183382FC for ; Tue, 25 Aug 2026 22:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787698474; cv=none; b=AXpwUBsmorqOIB5G/dkS2WfFFwRTndNwKWFtXqZsIYEQ02YKjPtqkJLg5E3RPi/TLbBgagM5qV4CYWKin2be6B8cJZGai+fir5LQzwsB3crnFyML6xnz5oIfcHeRDYE1BFoxrlb0vDVLEBAgob6xZmE+VKcs+JWM3qAB4oAdQ9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787698474; c=relaxed/simple; bh=fc8MUwRmV639hHyKviaVoau8KS/kJPFnbX4ZjDJiiDw=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=sqn1Wn7r0GYRMTVTVXopnCU7/hqXo2a4x4Anv2Jwky8BFMADa9kBQhHFnPin+MATipE2MOfs+LOwjbU77df/SLNDlBJIEZ9b+Iaw5UzyjLSvgvmQSfmK9BB5GEyAA23Yoy3ILidDV+iPNykdpNyxoM1rUueM3gDsfmN6kn7BkQA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jIy1VaNb; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jIy1VaNb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DE871F000E9; Tue, 25 Aug 2026 22:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787698473; bh=fc8MUwRmV639hHyKviaVoau8KS/kJPFnbX4ZjDJiiDw=; h=Date:Subject:Cc:To:From:References:In-Reply-To; b=jIy1VaNbSzuwhghnaTla6ZVAwkdtm93Sa9NUCVCoyBaSVouSN4aPCE++dYt5pkjlN 4BFhxDegyEI98zZjOYe+NsSFbb1Nn8OQHn/WRHe3lvtkZrxh8foNGt2KulOMSkrSjc UwZ5mDxxTOK5DBQaB0uEmTDfQ7DKKQ3mIUdnIcB66wccnoO/2vmjlZfZ0Fet0FCKuO qYPludUli7d8bcNbyHzDYpKNxJRbZEFooEKFqKsFoNFQoYTT6JX6szBkkH0URIkCK9 Z+Q8JxdTRqzRPMwW1BW9j54PejgQREmybTesum1bZLFHjD1r8COuImSjrHtw5zGi+j IxzbOQ4SrbpdQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 26 Aug 2026 00:54:29 +0200 Message-Id: Subject: Re: [PATCH v2] drm/sched: Guard against NULL dev in drm_sched_job trace event Cc: , , "Matthew Brost" , =?utf-8?q?Christian_K=C3=B6nig?= , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , , , "Shixiong Ou" To: "Philipp Stanner" From: "Danilo Krummrich" References: <20260825103615.661200-1-oushixiong1025@163.com> <488156c4065f4da218ecce730266bd5cec3a9ea6.camel@mailbox.org> 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: >>=20 > > [=E2=80=A6] > >>=20 >> 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=E2=80=A6 > > >>=20 >> Why can't we have the Kunit test create a fake device for this? For inst= ance, >> 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 =3D=3D 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, s= o we shouldn't support it -- especially not when it is just for a Kunit test tha= t can easily satisfy the API by calling faux_device_create().