From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA3723B19B7 for ; Tue, 9 Jun 2026 16:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781022066; cv=none; b=LhonE/nNlNYH+OSiwfVxI1JQDpSquvmk9kE+KIROzARwMNz6Sd2MJo1HLjaS/7Ti3Vp2NyQxv2lZAF4PsjtqkWS7Ls31uw/qxuoDB9rMEhXeYSQTsGHF5HqBP2XAg6qLZ+BWf1VUtyJZrrxhmtZrTc7dRMSPHDCKVIfvtboBwjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781022066; c=relaxed/simple; bh=lQ8BFwcFk8id7QJFlCkkLdasgiBT72F7/3dSTYcy1Lg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YapGPJ8oi5ZgV0QPIFFkf/WHVVcdil4Iff/9rIKmC/NeBEnpgoaowmAbtP7h5LETLQzppJLc4zgJonoIhL4Zd8HjRbrvcc69bJNVxZAPu468Gmu1uqhFzMnIVKBTa8sBBv0vlORvQCRXeSGnhN6AHmbiniHE/P87f9Ng34evqis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SCPNUZBb; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SCPNUZBb" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-36bcbd7821fso2459305a91.2 for ; Tue, 09 Jun 2026 09:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781022064; x=1781626864; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W/o6xoNweapTrriRmAST3RoLSBcjrFwLozoiHNOF/xU=; b=SCPNUZBbKCLX+5O5Jr6QXfiNYax9XDW0gJJ+zZSkqw+dsGRlHlAdbHeB8GCcNcO6b4 ABAj1frLkoV5jC4BvL4lpj78B3h4+PeGuFMRITic7IewBpuHpi9cUu1DpI1flDiMGwWr OPEMHHyVYssk/cmLTPRVcSxX2E+pTHrf/vsevj4OWnJzTob8F4ElXdWmrSDPpKB8dDRL ZdOxyU139wEmj7I883vHo9hn/Jge1JgCopmDbMnl8ZhFy0YZntwRKTu/xlckxyqCM/jY 2NBWGlYqSaTCDzXKNP5Y/0UOEHbpPRFBJaF4hu88mUCx/lbfXFBNGMTNwINvrqkKLnpH FxWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781022064; x=1781626864; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W/o6xoNweapTrriRmAST3RoLSBcjrFwLozoiHNOF/xU=; b=m+TUKcD5zuLL+Egb62/R3fv+sWvkI6yCuDhMeJPSSwnpgDDUZ0/sEVDahTgYs1qlz3 +0J7fLWPhpMTCymeYbBzeFxiYlRPX7QM93kzI0EnMHjRdpg12KCpWdRps/7jCay/9KH4 9QJwHMPWOw6mioAYl0cM+2J4HVjxEx3rBbKCvQesjUT4Mc3GZ76ZZMLu8Njg4OdLoyiO G3heDOJ/tjwsKnVXe12o1oc0McHyAB/mn2pn26h6+rGj1/fh3neKVuakq258kwVCeWqW dyd3ia4Z6Gb95gD7KV2cZDo1wTprCtqUx76oOox+qiTHxEPb0IP6FCldv/xKVncFPz/5 nn9g== X-Forwarded-Encrypted: i=1; AFNElJ820ICQixXlo0t9SEqFJCU/aueIetvoU4aGvxrgS846TRNdsfrapC1Wn5U0oFq5yQogU1ZwPISTmO1l0WM=@vger.kernel.org X-Gm-Message-State: AOJu0YxJtvRW5gbhA6Q+LU2Cc26FZJ/FrOUTiBFPu+jR4T2jXBQ7upwQ YcWNkZXLskYYs0FnwQaiOa3nQ4NrgPMYlQmzHd72o0YqPDowqbm8s7ez X-Gm-Gg: Acq92OE1qhobbv7dY46GII267/GF41mPAS3PEKK3Ofl3CIbRJ15xDaMLboTcLpEn7Dl wCIiwGVCnIx0QA5+DHr2ehwq/GHf+orpiQeqYOlUyKdfmjyAfx/sGPyZxHGuKLij6gF3R6Ujrz4 kFL8qA6khb6m6VQGctSRb2UxEFMfyv8oe1POZdxlPr/wqKUdop/dAUQ9mIehX1KKbWOAYOEEbCJ M62GSRlXlA9IOXvAUxg+936t7oil8bTplZH7rdGM57em7NH86IIXxDC80Id+IOVS8PAL89Pgd7R IFno8xm55/QNVV/NcPMY3BMrchW9ZC6IGVUTHPXaWR+5XNvS5QlM3zbpqkvhWSVOvui3oVh7u72 by3YTFIMi+SwPWpmpfQxp8+bapvet5wzwqKdfjvdYrkvO/FNB77TCU2a52agL8byp8eCw3Q5m/F mv3fiPAg+XHL6ANcs7/y5ud2wC9u0DjPpOmPkvt6PDEEjs7lZ7Gk1ag+osk3xUW2tm X-Received: by 2002:a17:90b:57c4:b0:369:a9e8:dbf5 with SMTP id 98e67ed59e1d1-370ee643748mr22119245a91.3.1781022064062; Tue, 09 Jun 2026 09:21:04 -0700 (PDT) Received: from haichao.tail057a43.ts.net ([2001:da8:e000:1206:37c9:44fa:729b:6aaa]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f6bf830b2sm18366170a91.4.2026.06.09.09.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 09:21:03 -0700 (PDT) From: Ruoyu Wang To: Lucas De Marchi , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , David Airlie , Simona Vetter , Matthew Brost , Matthew Auld Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ruoyu Wang Subject: [PATCH] drm/xe: keep process name fallback for diagnostics Date: Wed, 10 Jun 2026 00:20:57 +0800 Message-ID: <20260609162057.5-1-ruoyuw560@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit xe_file_open() stores task->comm in xef->process_name with kstrdup(), but this diagnostic string is optional and the file open continues if the allocation fails. The timeout and devcoredump paths initialize process_name to the safe "no process" fallback, then overwrite it whenever q->vm->xef exists. If the kstrdup() failed, the fallback is replaced with NULL and the NULL pointer is passed to string handling in diagnostic paths. Keep the fallback process name unless xef->process_name was actually allocated. Still report the stored pid when the xe file is available. Fixes: 8af13c3fc125 ("drm/xe: Store process name and pid in xe file") Signed-off-by: Ruoyu Wang --- drivers/gpu/drm/xe/xe_devcoredump.c | 3 ++- drivers/gpu/drm/xe/xe_guc_submit.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c index 11e60d6..fbe1fba 100644 --- a/drivers/gpu/drm/xe/xe_devcoredump.c +++ b/drivers/gpu/drm/xe/xe_devcoredump.c @@ -343,7 +343,8 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump, ss->boot_time = ktime_get_boottime(); if (q->vm && q->vm->xef) { - process_name = q->vm->xef->process_name; + if (q->vm->xef->process_name) + process_name = q->vm->xef->process_name; ss->pid = q->vm->xef->pid; } diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 2ac87ff..0892400 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1189,7 +1189,8 @@ trigger_reset: } if (q->vm && q->vm->xef) { - process_name = q->vm->xef->process_name; + if (q->vm->xef->process_name) + process_name = q->vm->xef->process_name; pid = q->vm->xef->pid; } -- 2.51.0