Re: [PATCH v3 3/7] rust: property: Introduce PropertyGuard

Rob Herring
2025-04-28T21:10:35Z

On Mon, Apr 28, 2025 at 01:25:03PM -0700, John Hubbard wrote:
> On 4/28/25 1:18 PM, Rob Herring wrote:
> > On Sun, Apr 27, 2025 at 03:12:18PM -0700, John Hubbard wrote:
> >> On 4/26/25 2:50 PM, Remo Senekowitsch wrote:
> >>> 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:
> >> ...
> >> The idea is that the lower level you are in the software stack, the
> >> more rare printing should be.
> >
> > If that's a kernel style/requirement, I've never heard that. About the
> > only coding style in this area I'm aware of don't print messages on
> > kmalloc failure because the core does. It's the same concept here.
> >
> > When practically every caller is printing a message, it should go in the
>
> If *every* caller, without exception, today and tomorrow, including
> callers that expect failure--if all of those require printing a message,
> then yes, it's time to print from the lower level routine.

We do know for 2 reasons. The first is we document with schema whether a
property is required or not. That is a contract between the firmware and
the OS. Changing what's required breaks that contract. Second, the
caller indicates whether the property is required or not. We already do
this with subsystems that are indirectly accessing properties (e.g.
clk_get() and clk_get_optional()).

But see my other reply. We are perhaps arguing about the symptoms rather
than what is the root cause for having prints in the first place.

Rob