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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73333d85a63eeb984077df8e27b8c75e6270efed.camel@mediatek.com>
Date: Fri, 14 Feb 2025 13:13:14 +0000
From: SkyLake Huang (黃啟澤)
	<SkyLake.Huang@...iatek.com>
To: "daniel@...rotopia.org" <daniel@...rotopia.org>
CC: "andrew@...n.ch" <andrew@...n.ch>, "dqfext@...il.com" <dqfext@...il.com>,
	Steven Liu (劉人豪) <steven.liu@...iatek.com>,
	"davem@...emloft.net" <davem@...emloft.net>, AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"edumazet@...gle.com" <edumazet@...gle.com>, "linux@...linux.org.uk"
	<linux@...linux.org.uk>, "hkallweit1@...il.com" <hkallweit1@...il.com>,
	"horms@...nel.org" <horms@...nel.org>, "kuba@...nel.org" <kuba@...nel.org>,
	"pabeni@...hat.com" <pabeni@...hat.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>
Subject: Re: [PATCH net-next 3/3] net: phy: mediatek: add driver for built-in
 2.5G ethernet PHY on MT7988

On Thu, 2025-01-16 at 01:58 +0000, Daniel Golle wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Hi Sky,
> 
> On Thu, Jan 16, 2025 at 09:21:58AM +0800, Sky Huang wrote:
> > From: Sky Huang <skylake.huang@...iatek.com>
> > 
> > Add support for internal 2.5Gphy on MT7988. This driver will load
> > necessary firmware and add appropriate time delay to make sure
> > that firmware works stably. Also, certain control registers will
> > be set to fix link-up issues.
> > 
> > Signed-off-by: Sky Huang <skylake.huang@...iatek.com>
> > ---
> >  MAINTAINERS                          |   1 +
> >  drivers/net/phy/mediatek/Kconfig     |  11 +
> >  drivers/net/phy/mediatek/Makefile    |   1 +
> >  drivers/net/phy/mediatek/mtk-2p5ge.c | 343
> > +++++++++++++++++++++++++++
> >  4 files changed, 356 insertions(+)
> >  create mode 100644 drivers/net/phy/mediatek/mtk-2p5ge.c
> > 
> > [...]
> > +static int mt798x_2p5ge_phy_probe(struct phy_device *phydev)
> > +{
> > +     struct mtk_i2p5ge_phy_priv *priv;
> > +
> > +     priv = devm_kzalloc(&phydev->mdio.dev,
> > +                         sizeof(struct mtk_i2p5ge_phy_priv),
> > GFP_KERNEL);
> > +     if (!priv)
> > +             return -ENOMEM;
> > +
> > +     switch (phydev->drv->phy_id) {
> > +     case MTK_2P5GPHY_ID_MT7988:
> > +             /* The original hardware only sets MDIO_DEVS_PMAPMD
> > */
> > +             phydev->c45_ids.mmds_present |= MDIO_DEVS_PCS |
> > +                                             MDIO_DEVS_AN |
> > +                                             MDIO_DEVS_VEND1 |
> > +                                             MDIO_DEVS_VEND2;
> > +             break;
> > +     default:
> > +             return -EINVAL;
> > +     }
> > +
> > +     priv->fw_loaded = false;
> > +     phydev->priv = priv;
> > +
> > +     mtk_phy_leds_state_init(phydev);
> 
> Calling mtk_phy_leds_state_init() can't work without also defining
> led_hw_control_get() for that driver.
> 
> This is what mtk_phy_leds_state_init() does:
>         for (i = 0; i < 2; ++i)
>                 phydev->drv->led_hw_control_get(phydev, i, NULL);
> 
> The driver lacking led_hw_control_get() method (see below) will make
> this a call to a NULL function pointer.
> 
> Imho it's fine to add the driver without support for the LEDs for now
> and add LED support later on. But in that case you also shouldn't
> call
> mtk_phy_leds_state_init().

Hi Danial,
  Thanks. I missed this. I'll remove mtk_phy_leds_state_init()
temporarily and submit it with LED support later.

BRs,
Sky

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ