From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (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 9712636CE02 for ; Fri, 6 Feb 2026 13:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770385214; cv=none; b=VVzOqjlwDMIMODJTUT56jPnIbzvt9HvY2Yxy+LwldX4qgiezI+6IEpMpeCSv0EQf3VQbgeihbe2kyDvw4HWF8/3hSYBS00LTWeVCiojaRcW23CSFoppbXU6soeg5jPlaZt1/WWuRTTR/TwBvFDAnMEumzgpMeYzZNqXDYUAEbTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770385214; c=relaxed/simple; bh=61o1nl6q7kIs/foLMD181u6Tn4H2pEAZGBCbKjG+ZSo=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=b1g/2vAf+pG1tnK6PNu4iFiEDR8oV9r8SH67LoQN8Q3jPLXtzW5tdEpF/Fi+ddMMaD73DbIzXEVjMwsP9CU0Yp9ZZtrnLQ/Tz48g7XzJl8Ha79jNDEaRfyYcQbPR30fM3eHM3IW2/9xDugnZ0aeZ5rBnVXAmWjywZSjefz7bltQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LlXiT7k/; arc=none smtp.client-ip=209.85.128.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LlXiT7k/" Received: by mail-wm1-f68.google.com with SMTP id 5b1f17b1804b1-4801d7c72a5so6543195e9.0 for ; Fri, 06 Feb 2026 05:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770385212; x=1770990012; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GPiWcT/oJWu1HMdei+am/uID5ljtBm8TxUG5R2Ik1AI=; b=LlXiT7k/J4CrUcRkB9L8ffrwuUfufpuVMsBTmH/aB9hNwNPszpAzQH0LxfeMG17ump RvSwuOU9uODiisrJjsEzN0jvr0SRqTxyTcNHRporo/UKRnHOgperv5ohVRxGL3oKE2Dw ozqhztAH+yGtcSMHtDlgSOK6qoKrusd59nLmRvYRcYeX7WyYCxmYJbfd1/dazFjcqJG0 WzlqJbOKJs8kYQQ5INh3RACHzeoaFxk8KbRye+Wk9Nt9ceHcx/SbxT8kPq68HseFU0t1 L5fB3OKmdApuWcxzu+pPrwWOJTEVMTbY9FEVKsfXNYXPiI5dPioTzQOiZv9wWwE8fyzS BW6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770385212; x=1770990012; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GPiWcT/oJWu1HMdei+am/uID5ljtBm8TxUG5R2Ik1AI=; b=sImhmPOr9gBuszxiVZYrtmorx1863DKF3lsHhmHCL7wqHHceKlm38y84LIA75Q08nl ZNB2/cWIYcab39VKeKg09zBNDk2g48XHvFWiBh7VnlGJqoi02S47RIxNdXyFl9fMDvst 1XKqbho6jp6YT7AyC06M3Ox+P5fVY1sOylxK7a3IyDzU5UNZRld0/ipi1QIUvy47//VX +SWic59lhVlkOko8o3TzmC7TyHvLxAwdUsJyb6PGJz0yUlQHT4C4GjkFfq7+zoHv80DS E+1hdSpaePdDZXT1Jt6rjKuF29nxp57rDmQs+VXDLntGpfVpU/u1JWC5XmLog3MK5urw oa0w== X-Forwarded-Encrypted: i=1; AJvYcCUJxJTgoq2nLlsHXKYwdgoM2XxGSpFl4ZXozBcc+wKAEBOrHR9ZUU4+gAhZMmUSKbMVx52sIgGA3bifpoo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx843gajXQwjYC6/ZtsFgpeB1Q+jkmyng7cyx9ZIQ1rJpfgL6RB CIRfceOhCPv/oCs77aY+cLisCQ45V7vh7R61M5YwLo+UqbJzdlC/qMblDO5sTgxcJjTWjxSItWK UiJBM X-Gm-Gg: AZuq6aK04ELZSdNQGxi19emhPpya1XsPzISFp9OnD59NWCGd1TkWys/nUK2MwC3xgpx ZB6Mdp6zyIxOL8L0Vsbr5pqiFKBFuMcaR1zwqsVO66MR3IJoZGbjHrJeG1cRDJ2VP+1cmR3dWYJ xzX93u2mlQr/4ADwq5UiKML4E0dhBWJKiJjhsyRgmRNpuFGh9r+G/PyTCAJqC9bXKkHFdn54Aai us0JYYgqNYsfgZ50F6jDtxK1RJBPYnrVAUz4Xi0vaLQopFyWMJmKUbmdBRQlPhhGjxPUNpUrd4+ Sde1nqZ3eS0KzNT1Uc7etZbMsn2p8l7ufBQnHwdCQy7nLYc8NX2cgrRKdOU8LhqTnyapvRJq7tK df5wqETiS7HE/7HJwI9nHN+78fvBp5/DcEqm3IWgQmgeknXtISIISxGr7RYECcBS/1b1V0VNnJM Nx+RbnNshtEIIqUP48oObrLYYxwDM= X-Received: by 2002:a05:600c:1f16:b0:47a:814c:eea1 with SMTP id 5b1f17b1804b1-48320227d98mr41961805e9.35.1770385211873; Fri, 06 Feb 2026 05:40:11 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48317d345c2sm171490355e9.6.2026.02.06.05.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 05:40:11 -0800 (PST) Date: Fri, 6 Feb 2026 16:40:08 +0300 From: Dan Carpenter To: Matthew Brost Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel Subject: [bug report] drm/xe: Avoid toggling schedule state to check LRC timestamp in TDR Message-ID: 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=us-ascii Content-Disposition: inline In-Reply-To: [ Smatch checking is paused while we raise funding. #SadFace https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ] Hello Matthew Brost, Commit bb63e7257e63 ("drm/xe: Avoid toggling schedule state to check LRC timestamp in TDR") from Jan 9, 2026 (linux-next), leads to the following Smatch static checker warning: drivers/gpu/drm/xe/xe_lrc.c:2450 xe_lrc_timestamp() error: uninitialized symbol 'new_ts'. drivers/gpu/drm/xe/xe_lrc.c 2421 u64 xe_lrc_timestamp(struct xe_lrc *lrc) 2422 { 2423 u64 lrc_ts, reg_ts, new_ts; 2424 u32 engine_id; 2425 2426 lrc_ts = xe_lrc_ctx_timestamp(lrc); 2427 /* CTX_TIMESTAMP mmio read is invalid on VF, so return the LRC value */ 2428 if (IS_SRIOV_VF(lrc_to_xe(lrc))) { 2429 new_ts = lrc_ts; 2430 goto done; 2431 } 2432 2433 if (lrc_ts == CONTEXT_ACTIVE) { 2434 engine_id = xe_lrc_engine_id(lrc); 2435 if (!get_ctx_timestamp(lrc, engine_id, ®_ts)) 2436 new_ts = reg_ts; Imagine lrc_ts is active but get_ctx_timestamp() returns -1. 2437 2438 /* read lrc again to ensure context is still active */ 2439 lrc_ts = xe_lrc_ctx_timestamp(lrc); 2440 } 2441 2442 /* 2443 * If context switched out, just use the lrc_ts. Note that this needs to 2444 * be a separate if condition. 2445 */ 2446 if (lrc_ts != CONTEXT_ACTIVE) 2447 new_ts = lrc_ts; 2448 2449 done: --> 2450 return new_ts; Then new_ts could be uninitialized. 2451 } regards, dan carpenter