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: <20241217191337.717be46a@kernel.org>
Date: Tue, 17 Dec 2024 19:13:37 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Divya Koppera <divya.koppera@...rochip.com>
Cc: <andrew@...n.ch>, <arun.ramadoss@...rochip.com>,
 <UNGLinuxDriver@...rochip.com>, <hkallweit1@...il.com>,
 <linux@...linux.org.uk>, <davem@...emloft.net>, <edumazet@...gle.com>,
 <pabeni@...hat.com>, <netdev@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <richardcochran@...il.com>,
 <vadim.fedorenko@...ux.dev>
Subject: Re: [PATCH net-next v7 5/5] net: phy: microchip_t1 : Add
 initialization of ptp for lan887x

On Fri, 13 Dec 2024 17:44:03 +0530 Divya Koppera wrote:
>  static int lan887x_phy_init(struct phy_device *phydev)
>  {
> +	struct lan887x_priv *priv = phydev->priv;
>  	int ret;
>  
> +	if (!priv->init_done && phy_interrupt_is_valid(phydev)) {
> +		priv->clock = mchp_rds_ptp_probe(phydev, MDIO_MMD_VEND1,
> +						 MCHP_RDS_PTP_LTC_BASE_ADDR,
> +						 MCHP_RDS_PTP_PORT_BASE_ADDR);
> +		if (IS_ERR(priv->clock))
> +			return PTR_ERR(priv->clock);
> +
> +		priv->init_done = true;
> +	}

If this only has to happen once, why not call mchp_rds_ptp_probe() from
lan887x_probe() ? If there is some inherent reason the function needs 
to be protected from multiple calls maybe it's better to let
mchp_rds_ptp_probe() handle that case ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ