* [PATCH net-next] of: mdio: honor flags passed to of_phy_connect
@ 2014-09-16 17:49 Florian Fainelli
2014-09-16 20:39 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2014-09-16 17:49 UTC (permalink / raw)
To: netdev; +Cc: davem, devicetree, Florian Fainelli
Commit f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach,
connect, connect_direct}") removed the flags argument to the PHY library
calls to: phy_{attach,connect,connect_direct}.
Most Device Tree aware drivers call of_phy_connect() with the flag
argument set to 0, but some of them might want to set a different value
there in order for the PHY driver to key a specific behavior based on
the phy_device::dev_flags value.
Allow such drivers to set custom dev_flags as part of the
of_phy_connect() call since of_phy_connect() does start the PHY state
machine, it will call into the PHY driver config_init() callback which
is usually where a specific phy_flags value is important.
Fixes: f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
David,
This is applicable to 3.9 and newer, thanks!
drivers/of/of_mdio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 401b2453da45..a85d80012993 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -224,6 +224,8 @@ struct phy_device *of_phy_connect(struct net_device *dev,
if (!phy)
return NULL;
+ phy->dev_flags = flags;
+
return phy_connect_direct(dev, phy, hndlr, iface) ? NULL : phy;
}
EXPORT_SYMBOL(of_phy_connect);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] of: mdio: honor flags passed to of_phy_connect
2014-09-16 17:49 [PATCH net-next] of: mdio: honor flags passed to of_phy_connect Florian Fainelli
@ 2014-09-16 20:39 ` David Miller
2014-09-16 20:47 ` Florian Fainelli
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2014-09-16 20:39 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, devicetree
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 16 Sep 2014 10:49:36 -0700
> Commit f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach,
> connect, connect_direct}") removed the flags argument to the PHY library
> calls to: phy_{attach,connect,connect_direct}.
>
> Most Device Tree aware drivers call of_phy_connect() with the flag
> argument set to 0, but some of them might want to set a different value
> there in order for the PHY driver to key a specific behavior based on
> the phy_device::dev_flags value.
>
> Allow such drivers to set custom dev_flags as part of the
> of_phy_connect() call since of_phy_connect() does start the PHY state
> machine, it will call into the PHY driver config_init() callback which
> is usually where a specific phy_flags value is important.
>
> Fixes: f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
I do not see anyone passing non-zero in as the flags argument.
It is difficult for me to determine the impact of this patch,
whether it should really go to 'net' and/or 'stable', etc.
if you don't tell me who this could possibly break.
It's even worse when I do all of the searching around and
cannot find a breakage case myself. :-/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] of: mdio: honor flags passed to of_phy_connect
2014-09-16 20:39 ` David Miller
@ 2014-09-16 20:47 ` Florian Fainelli
2014-09-16 20:55 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2014-09-16 20:47 UTC (permalink / raw)
To: David Miller; +Cc: netdev, devicetree
On 09/16/2014 01:39 PM, David Miller wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Tue, 16 Sep 2014 10:49:36 -0700
>
>> Commit f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach,
>> connect, connect_direct}") removed the flags argument to the PHY library
>> calls to: phy_{attach,connect,connect_direct}.
>>
>> Most Device Tree aware drivers call of_phy_connect() with the flag
>> argument set to 0, but some of them might want to set a different value
>> there in order for the PHY driver to key a specific behavior based on
>> the phy_device::dev_flags value.
>>
>> Allow such drivers to set custom dev_flags as part of the
>> of_phy_connect() call since of_phy_connect() does start the PHY state
>> machine, it will call into the PHY driver config_init() callback which
>> is usually where a specific phy_flags value is important.
>>
>> Fixes: f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>
> I do not see anyone passing non-zero in as the flags argument.
Right, I have a follow-up patch that will pass non-zero, I will just
submit everything at once so it is clear in what context and purpose
this gets used.
Thanks!
>
> It is difficult for me to determine the impact of this patch,
> whether it should really go to 'net' and/or 'stable', etc.
> if you don't tell me who this could possibly break.
>
> It's even worse when I do all of the searching around and
> cannot find a breakage case myself. :-/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] of: mdio: honor flags passed to of_phy_connect
2014-09-16 20:47 ` Florian Fainelli
@ 2014-09-16 20:55 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-09-16 20:55 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, devicetree
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 16 Sep 2014 13:47:08 -0700
> Right, I have a follow-up patch that will pass non-zero, I will just
> submit everything at once so it is clear in what context and purpose
> this gets used.
That would work a lot better, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-16 20:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-16 17:49 [PATCH net-next] of: mdio: honor flags passed to of_phy_connect Florian Fainelli
2014-09-16 20:39 ` David Miller
2014-09-16 20:47 ` Florian Fainelli
2014-09-16 20:55 ` David Miller
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).