Re: [PATCH net-next,v2] net: mana: Support HW link state events

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

 



On Tue, 14 Oct 2025 14:26:49 -0700 Haiyang Zhang wrote:
> From: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> 
> Handle the HW link state events received from HW channel, and
> set the proper link state, also stop/wake queues accordingly.

Why do you have to stop / start the queues? I think it's unusual.
Let the packets get dropped, sending out potentially old packets
when link comes back is not going to make anyone happier.

> +static void mana_link_state_handle(struct work_struct *w)
> +{
> +	struct mana_port_context *apc;
> +	struct mana_context *ac;
> +	struct net_device *ndev;
> +	bool link_up;
> +	int i;
> +
> +	ac = container_of(w, struct mana_context, link_change_work);
> +
> +	if (ac->mana_removing)
> +		return;
> +
> +	rtnl_lock();
> +

> @@ -3500,6 +3556,10 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
>  	int err;
>  	int i;
>  
> +	ac->mana_removing = true;
> +
> +	cancel_work_sync(&ac->link_change_work);

Looks racy, the work needs @ac to check the ->mana_removing but
mana_remove() frees @ac. Just use disable_work_sync() please.
-- 
pw-bot: cr




[Index of Archives]     [Linux Kernel Discussion]     [TCP Instrumentation]     [Netfilter]     [Berkeley Packet Filter]     [Ethernet Bridging]     [Linux Wireless Networking]     [Openconnect]     [Linux WPAN Networking]     [Linux Host AP]     [Linux WPAN Networking]     [Linux Bluetooth Networking]     [Linux ATH6KL Networking]     [Linux Networking Users]     [XDP Newbies]     [Linux Coverity]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Squid]
  Powered by Linux