From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 18FC533D6F0 for ; Tue, 9 Jun 2026 06:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780986422; cv=none; b=kv9XpzlUa7nsr0ah/xaVHbI8UFhfiCV69CEFMOos5Lw00ygmBtQkOiAnLfdAjS++kBPYvNubNQMrTWgpwfBuR+cqy3GQbxI3Nq5BxIcPBrlYQoBWrm1wdB8wzNyjW7oYZamw8dMdYcOn04nnvFmlPH6sUeGX8W7S9AGhrbATLSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780986422; c=relaxed/simple; bh=XWzIn0gVss55nh9DTuI6U4/KN2GlckWN/vemmHVqK4M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qt2EJnVIdRhNAmXj39sJ2uBerzhA0z1k6tJsu/sceZEKYns8JtlxiTVGRaGLNYjGKCC1ju6lBvpI5ctu9nTZoU5EpMZOI0SFN0ymd0ld6Xqk1chtcno7fzzkTWRgrQgH7zBFjZ5zee6Zsrsz90uZN504gKH5wsc3NLKTK4hsyoo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YYIJiCTk; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YYIJiCTk" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780986417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Np0x5OABf11sd/lWEcYRius1zQG4TmMrbP89pTQvYBE=; b=YYIJiCTkH8MjZ7BoGs7INCC4Vg7NTV50EYqh5qyQzaNnUUn/ixKMeAHTMaJlWsazr68AZc 9cDm4beZcV6ZDk9JRuLp/AOZC3eNoRHb5vZWf2PEag6On3FypjVNmaFjgVo30iqjkj1FaQ vdscYyTKn9RpAnTOcvy8RuzssJ18YbI= From: Kaitao Cheng To: Andy Shevchenko , Muchun Song , Philipp Reisner , Lars Ellenberg , =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= , Jens Axboe , Takashi Sakamoto , Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Christian Koenig , Huang Rui , Eddie James , Mark Brown , Maxime Coquelin , Alexandre Torgue , Laxman Dewangan , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Davidlohr Bueso , "Paul E . McKenney" , Josh Triplett , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Liam Girdwood , Jaroslav Kysela , Takashi Iwai Cc: Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Matthew Auld , Matthew Brost , Waiman Long , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, linux1394-devel@lists.sourceforge.net, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Randy Dunlap , Christian Brauner , David Howells , Luca Ceresoli , Kaitao Cheng , Kaitao Cheng Subject: [PATCH v2 04/14] drm/i915/gt: Open-code active timeline walk Date: Tue, 9 Jun 2026 14:25:16 +0800 Message-ID: <20260609062526.94907-2-kaitao.cheng@linux.dev> In-Reply-To: <20260609062526.94907-1-kaitao.cheng@linux.dev> References: <20260609061347.93688-1-kaitao.cheng@linux.dev> <20260609062526.94907-1-kaitao.cheng@linux.dev> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Kaitao Cheng A later change will make list_for_each_entry() cache the next element before entering the loop body. __intel_gt_unset_wedged() drops timelines->lock while waiting on a fence and then restarts the walk from the list head after the lock is reacquired. Keep the loop open-coded so the next timeline is selected after that restart logic has run. This preserves the existing lock-drop traversal semantics and prepares the code for the list iterator update. Signed-off-by: Kaitao Cheng --- drivers/gpu/drm/i915/gt/intel_reset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c index adff482a6c9c..fe0d87e248a7 100644 --- a/drivers/gpu/drm/i915/gt/intel_reset.c +++ b/drivers/gpu/drm/i915/gt/intel_reset.c @@ -1077,7 +1077,9 @@ static bool __intel_gt_unset_wedged(struct intel_gt *gt) * No more can be submitted until we reset the wedged bit. */ spin_lock(&timelines->lock); - list_for_each_entry(tl, &timelines->active_list, link) { + for (tl = list_first_entry(&timelines->active_list, typeof(*tl), link); + !list_entry_is_head(tl, &timelines->active_list, link); + tl = list_next_entry(tl, link)) { struct dma_fence *fence; fence = i915_active_fence_get(&tl->last_request); -- 2.43.0