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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <trinity-8577978d-1c11-4f6d-ae11-aef37e8b78b0-1678624836722@3c-app-gmx-bap51>
Date:   Sun, 12 Mar 2023 13:40:36 +0100
From:   Frank Wunderlich <frank-w@...lic-files.de>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     Daniel Golle <daniel@...rotopia.org>,
        Vladimir Oltean <vladimir.oltean@....com>,
        netdev@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Heiner Kallweit <hkallweit1@...il.com>,
        Lorenzo Bianconi <lorenzo@...nel.org>,
        Mark Lee <Mark-MC.Lee@...iatek.com>,
        John Crispin <john@...ozen.org>, Felix Fietkau <nbd@....name>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        DENG Qingfang <dqfext@...il.com>,
        Landen Chao <Landen.Chao@...iatek.com>,
        Sean Wang <sean.wang@...iatek.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        Vladimir Oltean <olteanv@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Jianhui Zhao <zhaojh329@...il.com>,
        Bjørn Mork <bjorn@...k.no>,
        Alexander Couzens <lynxis@...0.eu>
Subject: Aw: Re: Re: [PATCH net-next v12 08/18] net: ethernet: mtk_eth_soc:
 fix 1000Base-X and 2500Base-X modes

> Gesendet: Samstag, 11. März 2023 um 21:30 Uhr
> Von: "Russell King (Oracle)" <linux@...linux.org.uk>

> On Sat, Mar 11, 2023 at 09:21:47PM +0100, Frank Wunderlich wrote:
> > Am 11. März 2023 21:00:20 MEZ schrieb "Russell King (Oracle)" <linux@...linux.org.uk>:
> > >On Sat, Mar 11, 2023 at 01:05:37PM +0100, Frank Wunderlich wrote:
> > 
> > >> i got the 2.5G copper sfps, and tried them...they work well with the v12 (including this patch), but not in v13... 
> > 
> > >> how can we add a quirk to support this?
> > >
> > >Why does it need a quirk?
> > 
> > To disable the inband-mode for this 2.5g copper
> > sfp. But have not found a way to set a flag which i
> > can grab in phylink.
> 
> We could make sfp_parse_support() set Autoneg, Pause, and Asym_Pause
> in "modes" at the top of that function, and then use the SFP modes
> quirk to clear the Autoneg bit for this SFP. Would that work for you?

i already tried this (without moving the autoneg/pause to sfp_parse_support):

static void sfp_quirk_disable_autoneg(const struct sfp_eeprom_id *id,
				unsigned long *modes,
				unsigned long *interfaces)
{
	linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, modes);
}

quirk was executed, but no change (no link on 2g5 sfp).

i guess you mean moving code handling the dt-property for inband-mode in phylink_parse_mode (phylink.c) to the sfp-function (drivers/net/phy/sfp-bus.c)

as a first test i tried to disable autoneg for the inband-setting

@@ -840,11 +842,18 @@ static int phylink_parse_mode(struct phylink *pl, struct fwnode_handle *fwnode)
 
                linkmode_zero(pl->supported);
                phylink_set(pl->supported, MII);
-               phylink_set(pl->supported, Autoneg);
+               //phylink_set(pl->supported, Autoneg);
                phylink_set(pl->supported, Asym_Pause);
                phylink_set(pl->supported, Pause);
                pl->link_config.an_enabled = true;
-               pl->cfg_link_an_mode = MLO_AN_INBAND;
+               //pl->cfg_link_an_mode = MLO_AN_INBAND;
+
+               //how to access sfp->inband_disable?
+               printk(KERN_ALERT "DEBUG: Passed %s:%d %d==%d (inband)??",__FUNCTION__,__LINE__, pl->cfg_link_an_mode, MLO_AN_INBAND);
+               //pl->cfg_link_an_mode = MLO_AN_PHY;
+               pl->link_config.an_enabled = false;
+               //phylink_clear(pl->supported, Autoneg);
+               printk(KERN_ALERT "DEBUG: Passed %s:%d %d==%d (inband)?? (forced phy-mode)",__FUNCTION__,__LINE__, pl->cfg_link_an_mode, MLO_AN_INBAND);
 
                switch (pl->link_config.interface) {
                case PHY_INTERFACE_MODE_SGMII:
@@ -947,7 +956,7 @@ static int phylink_parse_mode(struct phylink *pl, struct fwnode_handle *fwnode)
                }
 
                /* Check if MAC/PCS also supports Autoneg. */
-               pl->link_config.an_enabled = phylink_test(pl->supported, Autoneg);
+               //pl->link_config.an_enabled = phylink_test(pl->supported, Autoneg);
        }
 
        return 0;

but it seems this is not enough (or i miss something) and i get error when i try to set mac up

root@...-r3:~# ip link set eth1 up
[   30.044144] mtk_soc_eth 15100000.ethernet eth1: mtk_open: could not attach PHY: -19
RTNETLINK answers: No such device

regards Frank

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ