All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Ioana Ciornei <ciorneiioana@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	calvin.johnson@oss.nxp.com, hkallweit1@gmail.com,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: Re: [PATCH net-next] mdio: mdiobus: setup of_node for the MDIO device
Date: Wed, 16 Jun 2021 10:40:12 +0100	[thread overview]
Message-ID: <20210616094012.GA22278@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210616082052.s56l54vycxilv5is@skbuf>

On Wed, Jun 16, 2021 at 11:20:52AM +0300, Ioana Ciornei wrote:
> On Tue, Jun 15, 2021 at 11:31:47PM +0200, Andrew Lunn wrote:
> > > The fwnode_operations declared in drivers/acpi/property.c also suggest
> > > the ACPI fwnodes are not refcounted.
> > 
> > Is this because ACPI is not dynamic, unlike DT, where you can
> > add/remove overlays at runtime?
> > 
> 
> I am really not an expert here but the git history suggests so, yes.
> 
> Without the CONFIG_OF_DYNAMIC enabled, the fwnode_handle_get() call is
> actually a no-op even in the OF case.

More accurately, of_node_get() is a no-op if CONFIG_OF_DYNAMIC is
disabled, which in turn makes fwnode_handle_get() also a no-op.

I'm wondering whether we would need two helpers to assign these, or
just a single helper that takes a fwnode and assigns both pointers.
to_of_node() returns NULL if the fwnode is not a DT node, so would
be safe to use even with ACPI.

Then there's the cleanup side when the device is released. I haven't
yet found where we release the reference to the fwnode/of_node when
we release the phy_device. I would have expected it in
phy_device_release() but that does nothing. We could only add that
when we are certain that all users who assign the firmware node to
the phy device has properly refcounted it in the DT case.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-06-16  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 15:44 [PATCH net-next] mdio: mdiobus: setup of_node for the MDIO device Ioana Ciornei
2021-06-15 16:19 ` Andrew Lunn
2021-06-15 16:49   ` Ioana Ciornei
2021-06-15 17:13 ` Russell King (Oracle)
2021-06-15 17:24   ` Ioana Ciornei
2021-06-15 18:25     ` Russell King (Oracle)
2021-06-15 18:31   ` Andrew Lunn
2021-06-15 21:09     ` Russell King (Oracle)
2021-06-15 21:21       ` Ioana Ciornei
2021-06-15 21:31         ` Andrew Lunn
2021-06-16  8:20           ` Ioana Ciornei
2021-06-16  9:40             ` Russell King (Oracle) [this message]
2021-06-16 11:01               ` Ioana Ciornei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616094012.GA22278@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=calvin.johnson@oss.nxp.com \
    --cc=ciorneiioana@gmail.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.