Subject: Re: [PATCH net v1 1/4] octeon_ep: fix race conditions in ndo_get_stats64

From: Jakub Kicinski <[email-masked]>
Date: Tue, 3 Dec 2024 18:23:03 -0800

On Mon, 2 Dec 2024 23:21:27 -0800 Shinas Rasheed wrote:
> +	clear_bit(OCTEP_DEV_STATE_OPEN, &oct->state);
> +	/* Make sure device state open is cleared so that no more
> +	 * stats fetch can happen intermittently
> +	 */
> +	smp_mb__after_atomic();
> +	while (octep_drv_busy(oct))
> +		msleep(20);

This is a poor re-implementation of a lock.
We have more lock types in Linux than I care to count now.
Please just use the right one. Hint, it's probably a spin lock or
RCU+synchronize_net() on close.
-- 
pw-bot: cr