From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (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 A34371FDE14; Sat, 26 Apr 2025 21:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745704248; cv=none; b=De+cmh0QaUcXmahw3Wtg8Uqu9ZbbgVpjlwocEIB7Q8QL6P4/kDtTjxebtSjPIDRVx42LjOG9Bf1g2WzHXcBbO7h7uMaF32PfO8tXDo28RWyaOpSustbIIvyB5P77frk6q06rvG+VgEW78iU927wpxu2LWB/Al8fdDDfRVoOyAqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745704248; c=relaxed/simple; bh=OOoxSyFSPyTLPl4FCcqmITLqQVrGDeYeXBwjw9sRGPc=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=hT4lNkHPsUdJH8gWtYirp3Dk+Pb1+zw3W1SO6Tp7vWAm+23mbEcHg4sJZ1xhy0+IGGWE1nr4/v0giL0bJkDripEmf4DtUm7jz/sABH/V6etK/wn5cqM+ChvbXEA9ooli+y1DaSM2ybfZGBXwP7t7WVWyZfW2SOpo+2FVMcIkWtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=buenzli.dev; spf=pass smtp.mailfrom=buenzli.dev; arc=none smtp.client-ip=80.241.56.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=buenzli.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=buenzli.dev Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4ZlNgJ5Cq4z9slv; Sat, 26 Apr 2025 23:50:36 +0200 (CEST) Precedence: bulk X-Mailing-List: devicetree@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: Sat, 26 Apr 2025 23:50:31 +0200 Message-Id: To: "Danilo Krummrich" , "Dirk Behme" Cc: "Rob Herring" , "Saravana Kannan" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Dirk Behme" , , , Subject: Re: [PATCH v3 3/7] rust: property: Introduce PropertyGuard From: "Remo Senekowitsch" References: <20250425150130.13917-1-remo@buenzli.dev> <20250425150130.13917-4-remo@buenzli.dev> <81a65d89-b3e1-4a52-b385-6c8544c76dd2@gmail.com> <39798ebd-35a8-4a67-9df4-f12a6f20ef11@gmail.com> In-Reply-To: On Sat Apr 26, 2025 at 5:02 PM CEST, Danilo Krummrich wrote: > On Sat, Apr 26, 2025 at 04:35:07PM +0200, Dirk Behme wrote: >> On 26.04.25 16:19, Danilo Krummrich wrote: >> > On Sat, Apr 26, 2025 at 01:08:39PM +0200, Remo Senekowitsch wrote: >> >> On Sat Apr 26, 2025 at 12:15 PM CEST, Danilo Krummrich wrote: >> >>> If it'd be possible to use dev_err!() instead I wouldn't object in t= his specific >> >>> case. But this code is used by drivers from probe(), hence printing = the error >> >>> without saying for which device it did occur is a bit pointless. >> >>> >> >>> Drivers can still decide to properly print the error if the returned= Result >> >>> indicates one. >> >> >> >> One alternative would be to store a reference count to the device in >> >> `FwNode`. At that point we'd be guaranteed to have a valid reference >> >> whenever we want to log something. >> >=20 >> > Yes, that would work. However, I'm not convinced that it's worth to st= ore an >> > ARef (i.e. take a device reference) in each FwNode structure *= only* to >> > be able to force an error print if a required device property isn't av= ailable. >> >=20 >> > Why do you think it is important to force this error print by having i= t in >> > PropertyGuard::required() and even take an additional device reference= for this >> > purpose, rather than leaving it to the driver when to print a message = for an >> > error condition that makes it fail to probe()? >>=20 >> To my understanding doing the error print in "core" was proposed by >> Rob [1]: > > That is fine, though it doesn't answer my question above. :) If the question is addressed to me, I don't think it is important. I don't have a particular preference either way. I'm just trying to come up with a solution that is satisfactory to everyone. We should hear from Rob if he's ok with removing the logging entirely given the limitations.