From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.241.56.152 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796134745; b=peK53pEOrfqBaM1Hjfcc9ODDPV0GXsw2fwqMq/D0ZEQvWVDC+6fZG2UZShAUTXFdFe2f DQQhxTT2R11kwpLuEwAwGoQx7H03DUIgA4ewrs3m/ru8neWgZVR/Ome9sNY5cifiYzAUc u4d8G9GApVJB4d2HblcKslUVfqShFNqLLeDowZqQ/qGzXNMBSn6V9unZqdsQpJMt6VViP Fk4vizVmhe2W09rIaNW9TG4qt8klt/poefe5O4jeB7Q9vMmM/iTbst1qERvLqenM3AwPR Z0kmcoiLvkZpclFqxYugy1/pJPu5ZZkwo3NbaR2+/qN6ylkGxTbCKdpH3DPIK9hpayA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796134745; h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Subject:From: Reply-To:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:MIME-Version:X-MBO-RS-META: X-MBO-RS-ID; bh=YcNydu4y5L4CuAKYzzJ1CYYqpnDWj1zDEhtVGf4Hm4Q=; b=QXIPqn37nxMgMkIi+nPXulb89KnhOHp2P9bzW/jHBtFjYAGzOg+VqfU2sRo/UNQt5B+U deLfSK+i6lkapqx8Xd2PV88FYYdiym2UIUTm0q6GJWf8KFhrrT7G9RfldYZQ9EnAwxBKO 7D+hCrsGCigWQcsHELMfQC+41jO4UAp40xYgXI/lYtRs+0eTxqviUE/SfQlrTJ2UiEp8/ 8OdBhfm8FacaEef4DUkI2xIWq2kBadoitvdA6SwmxzosO1NNvKXSrAjXy86xOiSw4fOsr kxjtU3NG34UXQQGaaNNy3gWY8GtrUjoaEwPgZ8Vce9ZcYWOa2AMJ00LG5zf+VBu4Fww== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=L282wCmI; arc=none smtp.remote-ip=80.241.56.152 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 555DA606A32A; Tue, 1 Dec 2026 14:19:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 555DA606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=L282wCmI Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4jf30g45tvzKsk5; Tue, 01 Dec 2026 15:18:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1796134739; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcNydu4y5L4CuAKYzzJ1CYYqpnDWj1zDEhtVGf4Hm4Q=; b=L282wCmIi3dLX4vGCM2/nnryYgtQxES5zv6zEmiN8EGrtwrCUvOAT+11J57b2aWcUAnAuj B7lr/54ikyClR/0n5mMP4HN9PveAmm3V6Aq7bAnoez1P/Az5ZYMlEsty0Whk+vYgygo4b1 GOhDGPhTNP9dy+g9Fg5seb8mhSCB9acJbmnsD4tubIuES79Y/wNW7feHrUVhfJyPQ0nbsk JGLXhJgJbVHRsnvoVCUw1YDTj0eQFsNeNQ32+MX5GOnjHWilX91KUQQbxMCxYB9jOjKDTl ouzuVkWKDNKG9GGhc1BT1Q3bQ1Km0rgWQli8KJQFPlPcNJI8s6zHlG19+eeO4g== Message-ID: <8707fa1a4a42139cf0e0e1d6b7d02ace68c824d8.camel@mailbox.org> Subject: Re: [PATCH v2 3/3] drm/amdgpu: Fix timestamp misordering From: Philipp Stanner Reply-To: phasta@kernel.org To: Christian =?ISO-8859-1?Q?K=F6nig?= , Philipp Stanner , Sumit Semwal , Alex Deucher , David Airlie , Simona Vetter , Matthew Brost , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Tvrtko Ursulin , Pierre-Eric Pelloux-Prayer , Shahyan Soltani , Ruslan Vagner , "Mario Limonciello (AMD)" , Gustavo Padovan , Chris Wilson Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, stable@vger.kernel.org Date: Tue, 01 Dec 2026 15:18:54 +0100 In-Reply-To: <64705913-aeb2-40e0-9ebd-5a22da974ce8@amd.com> References: <20261201091712.716354-2-phasta@kernel.org> <20261201091712.716354-5-phasta@kernel.org> <64705913-aeb2-40e0-9ebd-5a22da974ce8@amd.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MBO-RS-META: 11zbgd6dkzx6u1xdjxrt8sfcr1yc4pqc X-MBO-RS-ID: 07862edb557d390d8ec On Tue, 2026-12-01 at 15:10 +0100, Christian K=C3=B6nig wrote: > On 12/1/26 10:17, Philipp Stanner wrote: > >=20 [=E2=80=A6] > > =C2=A0 > > =C2=A0 /* When the fence is not even scheduled it can't have spend time= */ > > =C2=A0 s_fence =3D to_drm_sched_fence(fence); > > - if (!test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &s_fence->scheduled.flags= )) > > + if (!test_bit_acquire(DMA_FENCE_FLAG_TIMESTAMP_BIT, &s_fence->schedul= ed.flags)) >=20 > That one looks unnecessary to me because we don't really care about the t= imestamp value. You do care, you read it at the end of the function. It's just that coincidentally another memory barrier is in between which should do the ordering. I suggest we do this formally correct here. Originally btw I wrote it like that because the entire code can be made more readable with two helper variables. So this code here could then use the new dma_fence_timestamp(). But ultimately your choice, since it's your user whose bypassing the API here. P.