Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240202

Re: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy

From Neil Armstrong <narmstrong@baylibre.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy
Date 2015-10-06 09:30 +0200
Message-ID <qguRc-7Jr-23@gated-at.bofh.it> (permalink)
References <qfvZ0-4oI-11@gated-at.bofh.it> <qfBBo-43g-5@gated-at.bofh.it>
Organization Baylibre

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 3/5] net: dsa: complete dsa_switch_destroy Neil Armstrong <narmstrong@baylibre.com> - 2015-10-03 16:30 +0200
  Re: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy Florian Fainelli <f.fainelli@gmail.com> - 2015-10-03 22:30 +0200
    Re: [PATCH v2 3/5] net: dsa: complete dsa_switch_destroy Neil Armstrong <narmstrong@baylibre.com> - 2015-10-06 09:30 +0200

csiph-web