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 0E98822339; Tue, 3 Feb 2026 16:40:30 +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=1770136831; cv=none; b=oovn6wufFO/mGyqIiX7cd9Hp41MYllv7oYgYh9RWGtenV88C9bzsO8WSSXKWpB/aS7IILfCZ4ISA4ddcdFJH16jkBw6FKGaajlBDNs4hC9jhWaMgeoLr5XrNN1MteM/t+GWP0e2OXyvaK58VDlFF0DeNRO7jcb49jgCWtts/hWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770136831; c=relaxed/simple; bh=aZrOFWbYL/CIDgy9O+tBoiAZFqwv81jbqu1pKEIQ/s8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rfcPPPhu0pYXDjHr6sGLcTE0xqqM458o/nMt/2eD89iAhbWViXS39ktk9kcBPoKZ6uUbs0GrdMJ3eQu9QaW5X08tmIUsazC/BN80ds2+qZUOdQ/FOSbLC+y5hQNAW0rHDpZPo9ShEtVDjYcQUnKiA/rHK1P3+C6xphFLmdaFxmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nqgV1DFv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nqgV1DFv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4DF3C116D0; Tue, 3 Feb 2026 16:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770136830; bh=aZrOFWbYL/CIDgy9O+tBoiAZFqwv81jbqu1pKEIQ/s8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nqgV1DFvdCPf52Jr2RfRF98OglnYWvCNHNFUFRPA0vBT6Rc6KcxkDcqWxMFLNsg2l dhtBRY60gxsiJRihJhUqj2qAvVshgOSLCcV5nzSrF8HYVozyoHERceTh2FtXRbjOe1 UGdLg51T+4PDawREdFlxBc9MdhKPrVNrHco97cMQ= Date: Tue, 3 Feb 2026 17:40:27 +0100 From: Greg Kroah-Hartman To: Danilo Krummrich Cc: Matthew Maurer , Bjorn Andersson , Konrad Dybcio , Satya Durga Srinivasu Prabhala , Miguel Ojeda , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Daniel Almeida , "Rafael J. Wysocki" , David Airlie , Simona Vetter , Michal Wilczynski , Dave Ertman , Ira Weiny , Leon Romanovsky , Trilok Soni , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-pwm@vger.kernel.org Subject: Re: [PATCH v2 3/6] rust: device: Support testing devices for equality Message-ID: <2026020342-dime-sharply-3fd4@gregkh> References: <20260203-qcom-socinfo-v2-0-d6719db85637@google.com> <20260203-qcom-socinfo-v2-3-d6719db85637@google.com> <2026020338-gratitude-overplay-98b0@gregkh> Precedence: bulk X-Mailing-List: linux-pwm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Feb 03, 2026 at 05:29:16PM +0100, Danilo Krummrich wrote: > On Tue Feb 3, 2026 at 5:17 PM CET, Greg Kroah-Hartman wrote: > > And I don't see what patch in this series uses this, am I missing it? > > impl Smem { > pub(crate) fn access<'a>(&'a self, dev: &'a Device) -> Option<&'a Mmio> { > if *dev != *self.dev { > return None; > } > > // SAFETY: By our invariant, this was a subrange of what was returned by smem_aux_get, for > // self.dev, and by our above check, that auxdev is still available. > Some(unsafe { Mmio::from_raw(&self.raw) }) > } > } > > It's used to ensure that the Smem provided by the auxiliary parent can only be > accessed as long as the auxiliary parent device is bound. But how can a parent device ever bevome "unbound"? A child can always rely on its parent being present (some odd scsi devices are the one exception, that mess is hell at times...) thanks, greg k-h