From: Jose Abreu <jose.abreu@synopsys.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>,
Jose Abreu <jose.abreu@synopsys.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Joao Pinto <joao.pinto@synopsys.com>
Subject: Re: [PATCH net-next 3/4] net: phy-c45: Implement reset/suspend/resume callbacks
Date: Wed, 24 Oct 2018 08:50:03 +0100 [thread overview]
Message-ID: <5e65254c-04dc-6dba-eb1c-10bafadf95c5@synopsys.com> (raw)
In-Reply-To: <20181023105828.GN30658@n2100.armlinux.org.uk>
On 23-10-2018 11:58, Russell King - ARM Linux wrote:
> On Tue, Oct 23, 2018 at 11:28:09AM +0100, Jose Abreu wrote:
>> On 23-10-2018 11:20, Russell King - ARM Linux wrote:
>>> I have no idea what you're proposing there - your patches weren't copied
>>> to me.
>> They just set / unset MDIO_CTRL1_LPOWER bit in PCS. I find that
>> without this remote end doesn't detect link is down ...
>>
>> If it's okay for Generic 10G driver I can submit only this and
>> manually reset PHY in stmmac driver so that I don't need to
>> implement custom PHY driver ...
>
>
>> BTW, I just found out currently Generic 10G Driver is broken
>> without patch 4/4 of this series [1]
>>
>> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_987570_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=zYEDSMZPTCHiPc_3B8buyu0kXnlIEYawnHWAxPrsoSU&s=MlF6I2cBSYkGxgEwNV-hXpXJIvXv_gRYXP-CazjkUSw&e=
> How is it broken - what are the symptoms?
>
> The generic 10G driver is bound not via the normal bus matching and
> phy_bus_match(), but via a manual bind in phy_attach_direct(). This
> calls the probe function, which is phy_probe(), which initialises
> the supported/advertising to the driver's features (which as you note
> are zero.)
Since 719655a14971 ("net: phy: Replace phy driver features u32
with link_mode bitmap"), phy_probe() calls
ethtool_convert_link_mode_to_legacy_u32() with phydrv->features
as argument. Since features are NULL, we will get NULL pointer
dereference.
I guess Generic 10G driver was forgotten in the conversion.
Thanks and Best Regards,
Jose Miguel Abreu
>
> However, phy_attach_direct() goes on to call phy_init_hw(), which
> calls the config_init() method. The config_init() method initialises
> the supported/advertising masks to 10GbaseT. This is (partly) what
> I refer to when I say that the generic 10G support is crippled - it
> only supports this single speed and media.
>
> So the supported/advertising masks should be forced to only 10GbaseT
> at the completion of phy_attach_direct().
>
> The "generic 10G" support doesn't do autonegotiation, configuration
> or link mode forcing. It only assumes 10GbaseT is supported, and
> only checks for the "link up" bits.
>
> It isn't like the non-10G generic PHY support due to history - it
> was added in 2014 by Andy Fleming (see 124059fd53af).
>
> BTW, your patch 1 is wrong as well (introducing phy_update_link()).
> You don't take account that a 10G phy may have alternative ways of
> reading the link (like 88x3310 does, because it has multiple
> instances of AN/PCS/PHYXS at 1k offsets.) All the gen10g_*
> functions are legacy functions for the crippled "generic" 10G
> support.
>
next prev parent reply other threads:[~2018-10-24 16:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 10:32 [PATCH net-next 0/4] net: phy: Misc improvements for Generic 10G PHY Jose Abreu
2018-10-22 10:32 ` [PATCH net-next 1/4] net: phy: Use C45 Helpers when forcing PHY Jose Abreu
2018-10-22 17:11 ` Florian Fainelli
2018-10-23 10:20 ` Jose Abreu
2018-10-22 10:32 ` [PATCH net-next 2/4] net: phy-c45: Populate autoneg_done callback Jose Abreu
2018-10-22 12:21 ` Andrew Lunn
2018-10-22 10:32 ` [PATCH net-next 3/4] net: phy-c45: Implement reset/suspend/resume callbacks Jose Abreu
2018-10-22 12:28 ` Andrew Lunn
2018-10-22 12:47 ` Jose Abreu
2018-10-22 15:48 ` Russell King - ARM Linux
2018-10-22 17:13 ` Florian Fainelli
2018-10-23 10:17 ` Jose Abreu
2018-10-23 10:20 ` Russell King - ARM Linux
2018-10-23 10:28 ` Jose Abreu
2018-10-23 10:58 ` Russell King - ARM Linux
2018-10-24 7:50 ` Jose Abreu [this message]
2018-10-24 12:03 ` Andrew Lunn
2018-10-23 12:38 ` Andrew Lunn
2018-10-22 10:32 ` [PATCH net-next 4/4] net: phy-c45: Populate missing features Jose Abreu
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=5e65254c-04dc-6dba-eb1c-10bafadf95c5@synopsys.com \
--to=jose.abreu@synopsys.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=joao.pinto@synopsys.com \
--cc=linux@armlinux.org.uk \
--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 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).