From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 903EF5026F for ; Tue, 23 Jan 2024 14:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020430; cv=none; b=gqZy6k0qg7mnXdOPzGEN+F+d792TSA2GX4llIUqsUugZUquZXweDC+XL/0GLET4aem/QKWDRkowUTV+5EKO0Rx61Zr6OquFzPUEIwOu3bqU64vX8Ppyx03fSYT0CQKb7YU0CvPq8FQMINO3t5nHrlNOctF1stxYEBACkIAi32xk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020430; c=relaxed/simple; bh=OrQaBm/3X4/JptmXUDv2nfceAYZz3BfKaK5EznOjCgE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dAmrn1NkVCOOIL7xMmB9qpFjaJz4JyHx6W6osytNhVj+Pcw7aIhbDVIOauH9ctbkNM5q7akasw57DoX98+qHGF0c2BlH4X73pCLI/8lLDlxbp50Eq7FTKbIzMe2vaZs4qp2b503ZBjz8y1QmORcPDrYsAk3s5dFwz/2n5+ZfSJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45568C433B1; Tue, 23 Jan 2024 14:33:49 +0000 (UTC) Date: Tue, 23 Jan 2024 09:35:19 -0500 From: Steven Rostedt To: Christian =?UTF-8?B?S8O2bmln?= Cc: Dave Airlie , "Bhardwaj, Rajneesh" , Linus Torvalds , LKML , Felix Kuehling , dri-devel@lists.freedesktop.org, Fedor Pchelkin Subject: Re: [BUG] BUG: kernel NULL pointer dereference at ttm_device_init+0xb4 Message-ID: <20240123093519.3ed37601@gandalf.local.home> In-Reply-To: References: <20240122180605.28daf23a@gandalf.local.home> <20240122181547.16b029d6@gandalf.local.home> <20240122181901.05a3b9ab@gandalf.local.home> <27c3d1e9-5933-47a9-9c33-ff8ec13f40d3@amd.com> <20240122203552.529eeb20@gandalf.local.home> <20240122215200.1ec02a4a@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 23 Jan 2024 10:43:04 +0100 Christian K=C3=B6nig wrote: > While applying the fix a week ago I was under the impression that QXL=20 > doesn't use a device structure because it doesn't have one and so can't=20 > give anything meaningful for this parameter. >=20 > If QXL does have a device structure and can provide it I would rather=20 > like to go down this route and make the device and with it the numa node= =20 > mandatory for drivers to specify. Then at a minimum my original fix should be applied. Perhaps with a warning too. That is, I added at the beginning of that function: if (!dev) return -EINVAL; Could have that be: if (WARN_ON_ONCE(!dev)) return -EINVAL; In any case, it should not cause the system to crash. -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46ABCC47DDB for ; Tue, 23 Jan 2024 14:34:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CC2110E7E8; Tue, 23 Jan 2024 14:34:25 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A9CD10F2B2 for ; Tue, 23 Jan 2024 14:34:24 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 79CE961E19; Tue, 23 Jan 2024 14:33:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45568C433B1; Tue, 23 Jan 2024 14:33:49 +0000 (UTC) Date: Tue, 23 Jan 2024 09:35:19 -0500 From: Steven Rostedt To: Christian =?UTF-8?B?S8O2bmln?= Subject: Re: [BUG] BUG: kernel NULL pointer dereference at ttm_device_init+0xb4 Message-ID: <20240123093519.3ed37601@gandalf.local.home> In-Reply-To: References: <20240122180605.28daf23a@gandalf.local.home> <20240122181547.16b029d6@gandalf.local.home> <20240122181901.05a3b9ab@gandalf.local.home> <27c3d1e9-5933-47a9-9c33-ff8ec13f40d3@amd.com> <20240122203552.529eeb20@gandalf.local.home> <20240122215200.1ec02a4a@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Airlie , Felix Kuehling , "Bhardwaj, Rajneesh" , dri-devel@lists.freedesktop.org, LKML , Fedor Pchelkin , Linus Torvalds Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 23 Jan 2024 10:43:04 +0100 Christian K=C3=B6nig wrote: > While applying the fix a week ago I was under the impression that QXL=20 > doesn't use a device structure because it doesn't have one and so can't=20 > give anything meaningful for this parameter. >=20 > If QXL does have a device structure and can provide it I would rather=20 > like to go down this route and make the device and with it the numa node= =20 > mandatory for drivers to specify. Then at a minimum my original fix should be applied. Perhaps with a warning too. That is, I added at the beginning of that function: if (!dev) return -EINVAL; Could have that be: if (WARN_ON_ONCE(!dev)) return -EINVAL; In any case, it should not cause the system to crash. -- Steve