From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D964F2D29C7; Wed, 23 Jul 2025 13:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753276976; cv=none; b=OiXzib55Y22m6q0f7bj4zHdnwilMRIOsOwGyOiKbsx0NMnXZRvWvE3amJ7B2fASSgNDYb2IIpO3t5i5X1fL+S45B9itcKBpsRjrl84Sf8lMnnwmFwUI9SjRQlVWsH+dE6YarmVa6rW55O6CsvCYZbFAiqdWLGfabZwQCx8wlZ5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753276976; c=relaxed/simple; bh=CDbI+Nsj3caOgtI2pJwYkNmOJA/uaxHrC9DvitFk4Q0=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=tTRN8Ei9tzmWA/XNmdbOegkOhIUY2IGxiPIOTW7gXSec0hympNQc+37kWaq97CAHucN3fEFONVFIyJgkqrmd/H+iBauY4GRPyJgzXvAk7Ey624DYDb0LuZ3z7+ly3uJthx4ZgJCKpvwaRS86Sy0I7MzSR6VptesAw3HVMxdOPAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RQGBF7Kt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RQGBF7Kt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFC3EC4CEE7; Wed, 23 Jul 2025 13:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753276975; bh=CDbI+Nsj3caOgtI2pJwYkNmOJA/uaxHrC9DvitFk4Q0=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=RQGBF7Kt1lvI3yc5fqBSzO1JPUgFwXu/W8GiL0k9as6EvKM0p/febse+ul/5oF+tI dwYiX9iSKcV+NRTUrF0xJPhSbst3VyULdtSVmoIIZNDc/xqwF0DZkBO/eULLCA2x59 dbzM8pciS1JYsfWOE/GkPiONaHfQVFtMqio0Zv/X3EM6KiNYkH0QIWY94FZEs7UuSQ TEalT6ENGYQigsc766rdzE90veMpRLXpgZsm5/N7dF4sBM0Ik04W8kO4cyVstIb7dt q+E+ydRtxxTsLQgBhPsvK/iVPld0s5gOxJMTXIELiNIvH/SaE4UcyjwGrK3YZITLJR d/WTb3PiNGz1g== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 23 Jul 2025 15:22:49 +0200 Message-Id: Cc: "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Georgi Djakov" , "Dmitry Baryshkov" , "Bjorn Andersson" , "Marijn Suijten" , , , , "Konrad Dybcio" Subject: Re: [PATCH DNM 2/2] interconnect: Add a test Rust consumer driver From: "Benno Lossin" To: "Daniel Almeida" , "Konrad Dybcio" X-Mailer: aerc 0.20.1 References: <20250722-topic-icc_rs-v1-0-9da731c14603@oss.qualcomm.com> <20250722-topic-icc_rs-v1-2-9da731c14603@oss.qualcomm.com> In-Reply-To: On Wed Jul 23, 2025 at 3:10 PM CEST, Daniel Almeida wrote: > On 22 Jul 2025, at 18:14, Konrad Dybcio wrote: >> +#[pin_data] >> +struct IccTestConsumerDriver { >> + #[pin] >> + path: IccPath, >> +} > > I don=E2=80=99t think this does anything useful without PhantomPinned, bu= t Benno is > the right person to chime in here. It does do something useful, there just has to be one type marked with `#[pin]` that is `!Unpin` (so for example `PhantomPinned`, `Opaque` etc.). In this case however, `IccPath` is a newtype of `*mut bindings::icc_path` which isn't `PhantomPinned`, so this doesn't ensure that the `IccTestConsumerDriver` will stay pinned after initializing. > More importantly though, why do you have #[pin] on IccPath? Another question is: why is `IccPath` not a newtype of `Opaque`? And then one can use `&IccPath`. --- Cheers, Benno