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] [day] [month] [year] [list]
Message-ID: <MWHPR11MB16936F7BBE2130CA9821B8FAEF1B9@MWHPR11MB1693.namprd11.prod.outlook.com>
Date:   Tue, 6 Dec 2022 16:48:11 +0000
From:   <Jerry.Ray@...rochip.com>
To:     <linux@...linux.org.uk>
CC:     <andrew@...n.ch>, <f.fainelli@...il.com>, <olteanv@...il.com>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
        <pabeni@...hat.com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next v2 2/2] dsa: lan9303: Move to PHYLINK

>> -static void lan9303_adjust_link(struct dsa_switch *ds, int port,
>> -                             struct phy_device *phydev)
>> -{
>> -     struct lan9303 *chip = ds->priv;
>> -     int ctl;
>> -
>> -     if (!phy_is_pseudo_fixed_link(phydev))
>> -             return;
>> -
>> -     ctl = lan9303_phy_read(ds, port, MII_BMCR);
>> -
>> -     ctl &= ~BMCR_ANENABLE;
>> -
>> -     if (phydev->speed == SPEED_100)
>> -             ctl |= BMCR_SPEED100;
>> -     else if (phydev->speed == SPEED_10)
>> -             ctl &= ~BMCR_SPEED100;
>> -     else
>> -             dev_err(ds->dev, "unsupported speed: %d\n", phydev->speed);
>> -
>> -     if (phydev->duplex == DUPLEX_FULL)
>> -             ctl |= BMCR_FULLDPLX;
>> -     else
>> -             ctl &= ~BMCR_FULLDPLX;
>> -
>> -     lan9303_phy_write(ds, port, MII_BMCR, ctl);
>> -
>> -     if (port == chip->phy_addr_base) {
>> -             /* Virtual Phy: Remove Turbo 200Mbit mode */
>> -             lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &ctl);
>> -
>> -             ctl &= ~LAN9303_VIRT_SPECIAL_TURBO;
>> -             regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ctl);
>> -     }
>> -}
>
>Is this functionality no longer necessary? For example, I don't see
>anywhere else in the driver that this turbo mode is disabled.
>
>I'm guessing the above code writing MII_BMCR is to force the
>configuration of integrated PHYs to be the fixed-link settings?
>How is that dealt with after the removal of the above code?
>

While it should be disabled by the HW config strap settings, I'll add
disabling Turbo Mode into the initialization sequence to keep the driver
operation consistent.

>> -
>>  static int lan9303_port_enable(struct dsa_switch *ds, int port,
>>                              struct phy_device *phy)
>>  {
>> @@ -1279,6 +1243,41 @@ static int lan9303_port_mdb_del(struct dsa_switch *ds, int port,
>>       return 0;
>>  }
>>
>> +static void lan9303_phylink_get_caps(struct dsa_switch *ds, int port,
>> +                                  struct phylink_config *config)
>> +{
>> +     struct lan9303 *chip = ds->priv;
>> +
>> +     dev_dbg(chip->dev, "%s(%d) entered.", __func__, port);
>> +
>> +     config->mac_capabilities = MAC_10 | MAC_100 | MAC_ASYM_PAUSE |
>> +                                MAC_SYM_PAUSE;
>> +
>> +     if (dsa_port_is_cpu(dsa_to_port(ds, port))) {
>> +             /* cpu port */
>> +             phy_interface_empty(config->supported_interfaces);
>
>This should not be necessary - the supported_interfaces member should
>already be zero.
>
>Thanks.
>

Yes, I agree.  I'll remove it.

Regards,
J.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ