Re: [PATCH] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
From: Kyle Switch
Date: Wed Jul 15 2026 - 07:59:01 EST
On 7/15/26 05:43, Andrew Lunn wrote:
> On Tue, Jul 14, 2026 at 07:12:03PM +0800, Kyle Switch wrote:
>> Add a driver for motorcomm yt8824 quad 2.5G ethernet phy, supports
>> 2.5G/1000M/100M/10M speed.
>
> Please take a read of:
>
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
>
> and set the Subject line correctly.
>
>> +#define REG_MII_MMD_CTRL 0x0D
>> +#define REG_MII_MMD_DATA 0x0E
>
> include/uapi/linux/mii.h
>
> #define MII_MMD_CTRL 0x0d /* MMD Access Control Register */
> #define MII_MMD_DATA 0x0e /* MMD Access Data Register */
>
> Please don't repeat something which already exists. But i also wounder
> why you need these.
>
>> +static int ytphy_write_mmd(struct phy_device *phydev,
>> + u16 device, u16 reg,
>> + u16 value)
>> +{
>> + int ret;
>> +
>> + ret = __phy_write(phydev, REG_MII_MMD_CTRL, device);
>> + if (ret)
>> + return ret;
>> + ret = __phy_write(phydev, REG_MII_MMD_DATA, reg);
>> + if (ret)
>> + return ret;
>> + ret = __phy_write(phydev, REG_MII_MMD_CTRL, device | 0x4000);
>> + if (ret)
>> + return ret;
>> + ret = __phy_write(phydev, REG_MII_MMD_DATA, value);
>> +
>> + return ret;
>> +}
>
> Why are you reinventing these functions when they already exist?
Ans: Sorry, I didn't notice the existing interface before. next patch, i will remove
the duplicate functional interfaces include REG_MII_MMD_CTRL, REG_MII_MMD_DATA, and
ytphy_mmd_write api.
>> +
>> /**
>> * ytphy_get_wol() - report whether wake-on-lan is enabled
>> * @phydev: a pointer to a &struct phy_device
>> @@ -3059,99 +3187,1620 @@ static int yt8821_resume(struct phy_device *phydev)
>> return yt8821_modify_utp_fiber_bmcr(phydev, BMCR_PDOWN, 0);
>> }
>>
>> -static struct phy_driver motorcomm_phy_drvs[] = {
>> - {
>> - PHY_ID_MATCH_EXACT(PHY_ID_YT8511),
>> - .name = "YT8511 Gigabit Ethernet",
>> - .config_init = yt8511_config_init,
>> - .suspend = genphy_suspend,
>> - .resume = genphy_resume,
>> - .read_page = yt8511_read_page,
>> - .write_page = yt8511_write_page,
>> - },
>> - {
>> - PHY_ID_MATCH_EXACT(PHY_ID_YT8521),
>> - .name = "YT8521 Gigabit Ethernet",
>> - .get_features = yt8521_get_features,
>> - .probe = yt8521_probe,
>
> Why are these all stoppering? diff would not remove them unless
> something is changing.
>
Ans: after double check, no existing code logic has been modified. I guess the possible reason
is that git diff employs the Diff Algorithm, a "context minimization" strategy adopted to
represent changes in the most compact manner. It consolidates modifications into a single block.
> Andrew
>
> ---
> pw-bot: cr