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: <334b52a6-30e8-0869-6ffb-52e9955235ff@maxlinear.com>
Date:   Fri, 18 Jun 2021 09:17:20 +0000
From:   Liang Xu <lxu@...linear.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     Florian Fainelli <f.fainelli@...il.com>,
        "hkallweit1@...il.com" <hkallweit1@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "vee.khee.wong@...ux.intel.com" <vee.khee.wong@...ux.intel.com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        Hauke Mehrtens <hmehrtens@...linear.com>,
        Thomas Mohren <tmohren@...linear.com>
Subject: Re: [PATCH v3] net: phy: add Maxlinear GPY115/21x/24x driver

On 7/6/2021 12:06 pm, Liang Xu wrote:
> On 5/6/2021 10:51 pm, Andrew Lunn wrote:
>> This email was sent from outside of MaxLinear.
>>
>>
>>>>>> This does not access vendor specific registers, should not this be part
>>>>>> of the standard genphy_read_abilities() or moved to a helper?
>>>>>>
>>>>> genphy_read_abilities does not cover 2.5G.
>>>>>
>>>>> genphy_c45_pma_read_abilities checks C45 ids and this check fail if
>>>>> is_c45 is not set.
>>>> You appear to of ignored my comment about this. Please add the helper
>>>> to the core as i suggested, and then use
>>>> genphy_c45_pma_read_abilities().
>>>>
>>>>            Andrew
>>>>
>>> I'm new to upstream and do not know the process to change code in core.
>> Pretty much the same way you change code in a driver. Submit a path!
>>
>> Please put it into a separate patch, so making a patch series. Please
>> add some kernel doc style documentation, describing what the function
>> does. Look at other functions in phy_device.c for examples.
>>
>> Anybody can change core code. It just gets looked at closer, and need
>> to be generic.
>>
>>      Andrew
>>
> Thank you. I will create 2 patches for the core modification and driver
> separately
>
> in next update.
>
Hi Andrew,


I need your advice regarding to our recent test in loopback.

My current implementation uses "genphy_loopback" to enable/disable 
loopback mode.

And it has intermittent issue (traffic not loopbacked) during the test 
with net-next.

There are difference in the implementation in net-next and Linux v5.12.

Net-next:

int genphy_loopback(struct phy_device *phydev, bool enable)
{
     if (enable) {
         u16 val, ctl = BMCR_LOOPBACK;
         int ret;

         if (phydev->speed == SPEED_1000)
             ctl |= BMCR_SPEED1000;
         else if (phydev->speed == SPEED_100)
             ctl |= BMCR_SPEED100;

         if (phydev->duplex == DUPLEX_FULL)
             ctl |= BMCR_FULLDPLX;

         phy_modify(phydev, MII_BMCR, ~0, ctl);

         ret = phy_read_poll_timeout(phydev, MII_BMSR, val,
                         val & BMSR_LSTATUS,
                     5000, 500000, true);
         if (ret)
             return ret;
     } else {
         phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0);

         phy_config_aneg(phydev);
     }

     return 0;
}

v5.12.11:

int genphy_loopback(struct phy_device *phydev, bool enable)
{
     return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK,
               enable ? BMCR_LOOPBACK : 0);
}


Not sure whether anyone else reported similar issue.

Should I use phy_modify to set the LOOPBACK bit only in my driver 
implementation as force speed with loopback enable does not work in our 
device?


Thanks & Regards,

Xu Liang


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ