[PATCH] clk: fixed_rate: Avoid calling dev_read_*() if CONFIG_OF_PLATDATA=y
Simon Glass
sjg at chromium.org
Sat Nov 22 15:31:36 CET 2025
Hi Tom,
On Fri, 21 Nov 2025 at 12:27, Tom Rini <trini at konsulko.com> wrote:
>
> On Fri, Nov 21, 2025 at 12:09:31PM -0700, Simon Glass wrote:
> > Hi Marek,
> >
> > On Fri, 21 Nov 2025 at 10:53, Marek Vasut <marek.vasut at mailbox.org> wrote:
> > >
> > > On 11/21/25 6:35 PM, Simon Glass wrote:
> > >
> > > Hello Simon,
> > >
> > > >> To be made to clk_fixed_rate_ofdata_to_plat_(...) in
> > > >> drivers/clk/clk_fixed_rate.c as it does not currently call
> > > >> dev_has_ofnode(dev).
> > > >
> > > > Ah OK. So the call stack is something like:
> > > >
> > > > dev_read_u32_default()
> > > > dev_ofnode() - returns ofnode_null
> > > > ofnode_read_u32_default()
> > > > ofnode_read_u32_index
> > > > fdt_getprop(NULL, -1, ...) // guess
> > > >
> > > > And I see that I put assert() in some of the ofnode_read..() functions
> > > > because I don't have tests for passing an invalid ofnode.
> > > >
> > > > So perhaps fdt_offset_ptr_() should check for NULL and return? I
> > > > haven't traced it though.
> > >
> > > In previous patch
> > >
> > > [PATCH 3/3] libfdt: Check fdt_offset_ptr() return value unconditionally
> > >
> > > that approach seems to have been rejected, and these dev_read_*() fixes
> > > were implemented as a replacement.
> >
> > I don't think it was rejected...but I think the commit message should
> > better explain the problem, e.g. using some of the info above.
> >
> > The only choice is whether to add the check unconditionally (which I
> > think is fine for now) or to add a new type of assumption.
>
> Your feedback here does not seem to match up with your feedback in the
> patch in question:
> https://lore.kernel.org/all/CAFLszTg6dF1dmJJDh8-2ZjUf6i9+ZOFvWNSxNRS_PBQ3CDNtHw@mail.gmail.com/#t
Well in my defence the cover letter and that patch didn't give me much
of a clue. No mention of OF_PLATDATA or that there is no actual FDT. I
thought Marek was saying that libfdt no longer accepted negative
offsets!
Regards,
Simon
More information about the U-Boot
mailing list