lkml.org 
[lkml]   [2021]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.10 64/98] net: mdio-mux: Handle -EPROBE_DEFER correctly
Hi!

> > > When registering mdiobus children, if we get an -EPROBE_DEFER, we shouldn't
> > > ignore it and continue registering the rest of the mdiobus children. This
> > > would permanently prevent the deferring child mdiobus from working instead
> > > of reattempting it in the future. So, if a child mdiobus needs to be
> > > reattempted in the future, defer the entire mdio-mux initialization.
> > >
> > > This fixes the issue where PHYs sitting under the mdio-mux aren't
> > > initialized correctly if the PHY's interrupt controller is not yet ready
> > > when the mdio-mux is being probed. Additional context in the link
> > > below.
> >
> > I don't believe this is quite right. AFAICT it leaks memory in the
> > EPROBE_DEFER case. Could someone double-check? Suggested fix is below.
>
> devm_ APIs would take care of releasing the resource (memory)
> automatically because the probe didn't succeed. So I'm not sure
> there's a leak. Does that make sense?

Yes, it does, I believe you are right.

This part of code confused me: We are going to return error there, yet
we do explicit tree, which should not be neccessary according to this
logic.


dev_err(dev, "Error: No acceptable child buses found\n");
devm_kfree(dev, pb);

Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-08-25 07:07    [W:0.100 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site