lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 4 Feb 2020 17:41:35 +0800
From:   "Chng, Jack Ping" <jack.ping.chng@...ux.intel.com>
To:     Jose.Abreu@...opsys.com
Cc:     Andrew Lunn <andrew@...n.ch>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Joao Pinto <Joao.Pinto@...opsys.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re:[RFC net-next] net: phy: Add basic support for Synopsys XPCS using
 a PHY driver

Hi Jose,
>
>> So, besides not having a DT based setup to test changes, I also don't 
>> have access to SFP bus neither SERDES ... As you suggested, I would 
>> like to integrate XPCS with PHYLINK in stmmac but I'm not entirely 
>> sure on how to implement the remaining connections as the 
>> connect_phy() callbacks will fail because the only MMD device in the 
>> bus will be XPCS. That's why I suggested the Fixed PHY approach ...
>
> Having access to the SFP or not is not that relevent to the data link.
> Generally, the SFP is not like a PHY, and doesn't take part in the
> link negotiation unless it happens to contain a copper PHY.
>
> Also, please, do not use fixed-phy support with phylink. phylink
> implements a replacement for that, where it supports fixed-links
> without needing the fixed-phy stuff. This is far more flexible
> than fixed-phy which is restricted to the capabilities of clause 22
> PHYs only.
>
> To make fixed-phy support modes beyond clause 22 PHY capabilities
> would need clause 45 register set emulation by swphy and a
> corresponding clause 45 phylib driver; clause 45 annoyingly does
> not define the 1G negotiation registers in the standard register
> set, so every PHY vendor implements that using their own vendor
> specific solution.
>
> This is why phylink implements its own solution without using
> fixed-phy (which I wish could be removed some day).
>
> I would strongly recommend supporting the XPCS natively and not
> via phylib. Consider the case:
>
> Host PC x86 -> PCI -> XGMAC -> XPCS -> SERDES 10G-BASE-R -> PHY -> RJ45
>
> You can only have one phylib PHY attached to a network device via
> connect_phy(); that is a restriction in the higher net layers. If you
> use phylib for the XPCS, how do you attach the PHY to the setup and
> configure it?
>
> Also, using a PHY via connect_phy() negates using fixed-link mode in
> phylink, the two have always been exclusive.

Currently our network SoC has something like this:
XGMAC-> XPCS -> Combo PHY -> PHY

In the xpcs driver probe(), get and calibrate the phy:

priv->phy = devm_phy_get(&pdev->dev, "phy");
if (IS_ERR(priv->phy)) {
     dev_warn(dev, "No phy\n");
     return PTR_ERR(priv->phy);
}

ret = phy_init(priv->phy);
if (ret)
     return ret;

ret = phy_power_on(priv->phy);
if (ret) {
     phy_exit(priv->phy);
     return ret;
}
ret = phy_calibrate(priv->phy);
if (ret) {
     phy_exit(priv->phy);
     return ret;
}

xpcs driver needs to handle phy or phy_device depending on the phy?

Best regards,
Chng Jack Ping

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ