From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-106111.protonmail.ch (mail-106111.protonmail.ch [79.135.106.111]) (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 C1D603BED63; Tue, 16 Jun 2026 14:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781621493; cv=none; b=XBv8Gd7aqgL0j3ptEA6CpCbPojrC/6fPcc0ajrw2b8PgQAiOHK+nk8Ywd7Ov5IS8HAfOua2CxSJbDl3IlH8UxkZzvDSIYszUxFn1VLvLQ0DzX0oKNV5bPVWI0pIOe0oVhjq9Eip+8+/BB8bqHz2EoX4NAlLaDXWFFA98up4nKoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781621493; c=relaxed/simple; bh=8lg0lMM++bEYHjTp0b5ME3AVk0YuMGGw60/KhELAHHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=isCRMQZ6qAEQDJlsPL54NGtRg0Gzb4yOfKeSyBl1d6usxuorSgwoadiUcIOHfo1o5G3Re61/APekULTU5KVCC/25uI6DlD9ngL1/1F7nuQuVd7aNY7h62RqLvZd0r7AsLH5ZnQQ+YWxzjYwGEX+CRj36Bdw0x9mBQBm8xBKwzMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=onurozkan.dev; spf=pass smtp.mailfrom=onurozkan.dev; dkim=pass (2048-bit key) header.d=onurozkan.dev header.i=@onurozkan.dev header.b=frlJVMVp; arc=none smtp.client-ip=79.135.106.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=onurozkan.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=onurozkan.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=onurozkan.dev header.i=@onurozkan.dev header.b="frlJVMVp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onurozkan.dev; s=protonmail; t=1781621480; x=1781880680; bh=8lg0lMM++bEYHjTp0b5ME3AVk0YuMGGw60/KhELAHHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=frlJVMVpec64vFDqx5fdB8XDPtgKB/tWL7HRxgIspC73pZxexP3/M6050v9LV+EBR 5eU27vNdh69Jajt1fmYlyjG84fyrFsk0Gm7ZwrahvHwnuv1CtNkWd3EzOw9EECf/oV 1f1LdftmcQxuBLZlGi+kMPfJ6hW1CkEF6lvNjKF5ivzHfukwBIB1QPns1GmJAMatjz hbXFPCA/0Nh1XVHUTEiCGmPJE0blabPn7rWYC4yPekp4CtWK6UNrC4IGvPWhphzQVV P68Zg0VJ9i0SkCm1ec/2B89kk1K9RwlSGc2ENeJz30CxDj2cr15Qnc5MBtyp6+racn TFN9SXPp7E7BQ== X-Pm-Submission-Id: 4gfqgP6Gpyz1DFGT From: =?UTF-8?q?Onur=20=C3=96zkan?= To: Philipp Stanner Cc: Philipp Stanner , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Daniel Almeida , Greg Kroah-Hartman , Igor Korotin , Lorenzo Stoakes , Alexandre Courbot , FUJITA Tomonori , Krishna Ketan Rai , Shankari Anand , manos@pitsidianak.is, Boris Brezillon , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, rcu@vger.kernel.org Subject: Re: [PATCH v2 5/6] rust: Add dma_fence abstractions Date: Tue, 16 Jun 2026 17:51:11 +0300 Message-ID: <20260616145112.14201-1-work@onurozkan.dev> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: <20260616082819.2943886-2-phasta@kernel.org> <20260616082819.2943886-7-phasta@kernel.org> <20260616124755.460550-1-work@onurozkan.dev> Precedence: bulk X-Mailing-List: rust-for-linux@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, 16 Jun 2026 16:38:51 +0200=0D Philipp Stanner wrote:=0D =0D > On Tue, 2026-06-16 at 15:47 +0300, Onur =C3=96zkan wrote:=0D > > On Tue, 16 Jun 2026 10:28:17 +0200=0D > > > +=0D > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // DriverFenceData is rep= r(C) and a Fence is its first member.=0D > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 let fence_data_ptr =3D fe= nce_ptr as *mut DriverFenceData;=0D > > =0D > > Either the field ordering on the type or this code is wrong because the= first=0D > > member of DriverFenceData is `rcu_head`.=0D > =0D > Yeah, that's a bug introduced in this revision. Thx for pointing it=0D > out. Already fixed it downstream.=0D > =0D > I'm just wondering why my test did not blow up.=0D > =0D > > > =0D > > > +}=0D > > =0D > > I am unsure whether it is safe to cast the pointer in Fence::from_raw w= ithout=0D > > Fence being #[repr(transparent)] as the layout compatibility is not gua= ranteed=0D > > explicitly.=0D > =0D > Shouldn't #[repr(C)] do that trick, too? Do you need both?=0D > =0D > Who can answer that?=0D > =0D > =0D > P.=0D =0D You shouldn't use both and I think it wouldn't compile anyway. repr(C) only= =0D makes sense when the type have multiple fields.=0D =0D Thanks,=0D Onur=0D