Re: [PATCH v1] net: phy: Add support for PHY-specific link polling interval and randomization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Oleksij,

On 12.06.24 16:09, Oleksij Rempel wrote:
>  static int eth_carrier_check(struct eth_device *edev, bool may_wait)
>  {
> +	uint64_t timeout;
> +
>  	if (!IS_ENABLED(CONFIG_PHYLIB))
>  		return 0;
>  
>  	if (!edev->phydev)
>  		return 0;
>  
> +	if (edev->phydev->polling_interval)
> +		timeout = edev->phydev->polling_interval;
> +	else
> +		timeout = 5 * SECOND;

IMO, you should initialize edev->phydev->polling_interval in phy_device_create(),
so phydev->polling_interval always has a valid value.

Cheers,
Ahmad


> +
>  	if (!edev->last_link_check ||
> -	    is_timeout(edev->last_link_check, 5 * SECOND))
> +	    is_timeout(edev->last_link_check, timeout))
>  		eth_carrier_poll_once(edev);
>  
>  	if (may_wait && !edev->phydev->link) {

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux