From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 217022F39B5; Sat, 30 May 2026 14:08:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780150126; cv=none; b=rnE8sVMR69GP6w4xbDDNIWs62N6gQww5ABludzGRRq3HdGF6j+NchdVcPqoXAraZRUJsrSpFO/IeWEV2ktRB8Fvr9eOq6YdIVDZc9oJxLW/8wp7OJHBkq0ziathgNnib5defTaTXtxdw4E9J67rlZat+AWKBVrqGwTQpVGYIno0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780150126; c=relaxed/simple; bh=9h3omsab3wD/YbJIteGGZlazo155REDIL3udFpbQEu4=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=oZ4nGoHlZWmQk0j/cDS31NfwRh0T4EUYjJIjBV2hO0FRsUcu9kEjSOjyDZuyoF/OppHLEshMPhQ5O+xIocTTt7T8tftDYZuCN56xtzW1Y8bot0ZzwHgXUOAtNOnhLRl6GAFpQZdcB/4+sgJUC98hmrJOct4APRBngDPYIV6GXLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RyTrtnhj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RyTrtnhj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63BCE1F00893; Sat, 30 May 2026 14:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780150124; bh=9h3omsab3wD/YbJIteGGZlazo155REDIL3udFpbQEu4=; h=Date:Subject:Cc:To:From:References:In-Reply-To; b=RyTrtnhjoXqfk12tW+B26C0j7dyZxT24tdh7vHcLGFGPR8j4MRvPrEJk3MoJ5OwhE Ms/N6bKrTZKrjm+flKjpjDdjOKkdp/aFVAx0oaLvkwAPIuxz4L4odMYr2SWI22rrOQ /2er9ydLD2hQKwuAs2uSOCgdmccUG7wonj4xgP3N4xe5QZEGf4L4AGf1OQgrF/qi/k N8fwwFbqZDWGpYNcNbUWAOs1New611dojdb1HGAEGoUwE0jfP5DZdorcgtYH3qURbP lGqrf/L8503gPHNxSk73ilF7aUAKpnWNWJS3AnT2gFFrd9+jJJYOS4M5F1L6nL4slB ZxpB27juk2mVA== Precedence: bulk X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 30 May 2026 16:08:38 +0200 Message-Id: Subject: Re: [PATCH v8 3/5] rust: add basic serial device bus abstractions Cc: "Markus Probst via B4 Relay" , "Rob Herring" , "Greg Kroah-Hartman" , "Jiri Slaby" , "Miguel Ojeda" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Kari Argillander" , "Rafael J. Wysocki" , "Viresh Kumar" , "Boqun Feng" , "David Airlie" , "Simona Vetter" , , , , , , To: "Markus Probst" From: "Danilo Krummrich" References: <20260530-rust_serdev-v8-0-2a95f1da22a7@posteo.de> <20260530-rust_serdev-v8-3-2a95f1da22a7@posteo.de> <4638946fc49a38797b716ea173c93327eb751479.camel@posteo.de> <888dc39c52bb6ddac1a1eed7876c4573bdbef002.camel@posteo.de> In-Reply-To: <888dc39c52bb6ddac1a1eed7876c4573bdbef002.camel@posteo.de> On Sat May 30, 2026 at 4:00 PM CEST, Markus Probst wrote: > On Sat, 2026-05-30 at 15:53 +0200, Markus Probst wrote: >> On Sat, 2026-05-30 at 15:37 +0200, Markus Probst wrote: >> > If I think about it, I can't even close it inside remove_callback afte= r >> > `T::unbind`. With the driver lifetimes, the driver could store the >> > `serdev::Device` pointer in its DriverData and could still make >> > calls to the device. >> >=20 >> > Any suggestions? Now that there is no public drvdata() accessor anymore, all bus device priv= ate data accesses go through the bus abstraction. So, you could go back to your original approach and wrap the state in a bus specific bus device private data wrapper type, which would also get you rid= of the rust_private_data pointer you add to struct serdev_device.