From: Neil Armstrong <narmstrong@baylibre.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Guenter Roeck <linux@roeck-us.net>,
vivien.didelot@savoirfairelinux.com, Andrew Lunn <andrew@lunn.ch>,
Fabian Frederick <fabf@skynet.be>,
Pavel Nakonechny <pavel.nakonechny@skitlab.ru>,
Joe Perches <joe@perches.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
nbd@openwrt.org, sergei.shtylyov@cogentembedded.com
Subject: Re: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy
Date: Tue, 6 Oct 2015 08:23:28 +0100 [thread overview]
Message-ID: <561376F0.4080806@baylibre.com> (raw)
In-Reply-To: <561039AF.8080706@gmail.com>
On 10/03/2015 09:25 PM, Florian Fainelli wrote:
> Le 03/10/2015 07:26, Neil Armstrong a écrit :
>> When unbinding dsa, complete the dsa_switch_destroy to unregister the
>> fixed link phy then cleanly unregister and destroy the net devices.
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>
> [snip]
>
>> + port_dn = cd->port_dn[port];
>> + if (of_phy_is_fixed_link(port_dn)) {
>> + phydev = of_phy_find_device(port_dn);
>> + if (phydev) {
>> + int addr = phydev->addr;
>> + phy_device_free(phydev);
>> + of_node_put(port_dn);
>> + fixed_phy_del(addr);
>
> fixed_phy_del() removes the fixed PHY from the platform fixed MDIO bus
> list of PHYs, so we should be okay even with switch drivers which
> register a link_update callback via fixed_phy_set_link_update(), but I
> have not checked that. The sequence of call looks (phy_device_free then
> fixed_phy_del) looks sane though.
Actually I copied the exact sequence from the fixed link module, eventually this should be done in this module with a proper fixed_link_remove function.
>
> Eventually this logic might be better moved into net/dsa/slave.c such
> that it is easy to see how it balances dsa_slave_phy_setup().
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>
Thanks for the review,
Neil
prev parent reply other threads:[~2015-10-06 7:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 14:26 [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy Neil Armstrong
2015-10-03 20:25 ` Florian Fainelli
2015-10-06 7:23 ` Neil Armstrong [this message]
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=561376F0.4080806@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=fabf@skynet.be \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=pavel.nakonechny@skitlab.ru \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=vivien.didelot@savoirfairelinux.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).